2007 Aug 28 6:50 PM
hi for the insert new icon on the ALV tool bar, i have to add the standard F4 help (for ex: the F4 help for the second field in RECN transaction), so that the value selected in the help should appear as the ALV row entry... Can anyone tell how to achieve this...
2007 Aug 28 8:07 PM
CLASS LCL_EVENT_RECEIVER DEFINITION.
PUBLIC SECTION.
METHODS:
HANDLE_F4_HELP
FOR EVENT ONF4 OF CL_GUI_ALV_GRID
IMPORTING E_FIELDNAME ES_ROW_NO ER_EVENT_DATA.
ENDCLASS.
CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.
METHOD HANDLE_F4_HELP.
PERFORM HANDLE_ONF4 USING E_FIELDNAME ES_ROW_NO.
ER_EVENT_DATA->M_EVENT_HANDLED = 'X'.
ENDMETHOD.
ENDCLASS.
FORM HANDLE_ONF4 USING P_E_FIELDNAME
P_ES_ROW_NO STRUCTURE LVC_S_ROID.
CASE P_E_FIELDNAME.
WHEN 'NUM_MATERIAL'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'MATNR'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = T_CUSTOM_MATNR
RETURN_TAB = RETURN_TAB
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
*Assign the value to the field...
ENDCASE.
ENDFORM. " handle_onf4
===================================
LT_F4-FIELDNAME = 'NUM_MATERIAL'.
LT_F4-REGISTER = 'X' .
LT_F4-GETBEFORE = 'X' .
LT_F4-CHNGEAFTER = 'X' .
APPEND LT_F4.
SET HANDLER EVENT_RECEIVER->HANDLE_F4_HELP FOR GRID1.
CALL METHOD GRID1->REGISTER_F4_FOR_FIELDS
EXPORTING
IT_F4 = LT_F4[].
Greetings,
Blag.