Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

F4 help -- on editable alv field.

Former Member
0 Kudos

<b><i>Hi ABAPers,</i></b>

<i><b>I want to incorporate F4 help with the editable field of my ALV report.</b></i>

The editable field is type of IHPA-PARNR.

At present user is able to enter value at this field. but the requirement is to give F4 help there.

I am not using the OOPs alv.

<i><b>Please suggest me

Thanks in advance

Regards

Debjani</b></i>

1 ACCEPTED SOLUTION

MarcinPciak
Active Contributor
0 Kudos

For F4 help, you must register the fields whose F4 request will trigger the “onf4” event. For this you must prepare a table of type “LVC_T_F4” and register this table using the method “register_f4_for_fields”. While preparing table you must include a line for each field which will trigger F4 event. For each field in the structure;

- Pass the fieldname to ‘FIELDNAME’

- Set ‘REGISTER’ to make the field registered,

- Set ‘GETBEFORE’ to provide field content transport before F4 in editable mode

- Set ‘CHNGEAFTER’ to make the data changed after F4 in editable mode.

DATA: lt_f4 TYPE lvc_t_f4 WITH HEADER LINE .

.. ..

lt_f4-fieldname = 'Your field name'.

lt_f4-register = 'X' .

lt_f4-getbefore = 'X' .

APPEND lt_f4 .

CALL METHOD gr_alvgrid->register_f4_for_fields

EXPORTING

it_f4 = lt_f4[] .

  • A sample “onf4” method implementation

METHOD handle_on_f4 .

PERFORM f4_help USING e_fieldname es_row_no .

er_event_data->m_event_handled = 'X' .

ENDMETHOD .

The attribute “er_event_data->m_event_handled” is to prevent further processing of standard F4 help.

6 REPLIES 6

MarcinPciak
Active Contributor
0 Kudos

For F4 help, you must register the fields whose F4 request will trigger the “onf4” event. For this you must prepare a table of type “LVC_T_F4” and register this table using the method “register_f4_for_fields”. While preparing table you must include a line for each field which will trigger F4 event. For each field in the structure;

- Pass the fieldname to ‘FIELDNAME’

- Set ‘REGISTER’ to make the field registered,

- Set ‘GETBEFORE’ to provide field content transport before F4 in editable mode

- Set ‘CHNGEAFTER’ to make the data changed after F4 in editable mode.

DATA: lt_f4 TYPE lvc_t_f4 WITH HEADER LINE .

.. ..

lt_f4-fieldname = 'Your field name'.

lt_f4-register = 'X' .

lt_f4-getbefore = 'X' .

APPEND lt_f4 .

CALL METHOD gr_alvgrid->register_f4_for_fields

EXPORTING

it_f4 = lt_f4[] .

  • A sample “onf4” method implementation

METHOD handle_on_f4 .

PERFORM f4_help USING e_fieldname es_row_no .

er_event_data->m_event_handled = 'X' .

ENDMETHOD .

The attribute “er_event_data->m_event_handled” is to prevent further processing of standard F4 help.

0 Kudos

Hi

Try like this

X_FIELDCAT-DATATYPE = 'DATS'.
X_FIELDCAT-INTTYPE = 'D'.
X_FIELDCAT-REF_TABLE = 'LIKP'. 
X_FIELDCAT-REF_FIELD = 'LFDAT'. "of type dats.

can you check this Program..

BALVSD02

Reward alll helpfull answers

Regards

Pavan

0 Kudos

Hi Marcin,

Thanks a lot for your help.

But my problem has not been solved yet.

Can you please cleary explain me how do i code the following part of your code in my classical ALV.

b]CALL METHOD gr_alvgrid->register_f4_for_fields

EXPORTING

it_f4 = lt_f4[] .

  • A sample “onf4” method implementation

METHOD handle_on_f4 .

PERFORM f4_help USING e_fieldname es_row_no .

er_event_data->m_event_handled = 'X' .

ENDMETHOD .

The attribute “er_event_data->m_event_handled” is to prevent further processing of standard F4 help.</b>

<i><b>thanks and regards

Debjani</b></i>

0 Kudos

hi,

My problem has been solved by Praveen 's solution.

Thanks all for replyoing

Debjani

Former Member
0 Kudos

Hi,

check these standard reports

BCALV_EDIT_08 Integrate Non-Standard F4 Help

BCALV_F4 Possible entries

BCALV_GRID_EDIT_DELTA Example Report for F4 Help of the ALV Grid

BCALV_GRID_F4_HELP_APPLICATION

BCALV_GRID_F4_HELPM01

BCALV_TEST_GRID_EDIT F4 Help

BCALV_TEST_GRID_F4_HELP Example Report for F4 Help of the ALV

BCALV_TEST_GRID_EVENTS

http://help.sap.com/saphelp_erp2005/helpdata/en/f2/6cee408a63732ae10000000a155106/frameset.htm

Reward if helpful.

former_member205842
Participant
0 Kudos

HI,

        I added on custom field in SRM (RFX Leve) and assigned DDIC field for search help, my custom field getting displayed with F4 help in editable mode but my req is i want to change that F4 help into read only mode so that user can select from F4 help only. Please help me how to solve this.