‎2008 Jul 02 10:08 AM
Hi,
Please have a look at the scenario. In alv display there is 'check box' as one field.If check box is checked, it should call a bapi.For this , what should I do?
By using user command , when check box is checked, should we call the reqd bapi. Is it so? Please suggest.
rgds,
Khadeer.
‎2008 Jul 02 10:15 AM
Hi,
you must specify the field of ALV FM I_CALLBACK_USER_COMMAND = 'USER_COMMAND'.
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
case r_ucomm.
when 'the function code of your button'.
call bapi.......
To find the record checked you can you the structure RS_SELFIELD.
endcase.
ENDFORM.
‎2008 Jul 02 10:15 AM
Hi,
you must specify the field of ALV FM I_CALLBACK_USER_COMMAND = 'USER_COMMAND'.
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
case r_ucomm.
when 'the function code of your button'.
call bapi.......
To find the record checked you can you the structure RS_SELFIELD.
endcase.
ENDFORM.
‎2008 Jul 02 10:19 AM
‎2008 Jul 02 10:28 AM
Check the code below:
FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM
SELFIELD TYPE SLIS_SELFIELD.
IF SELFIELD-FIELDNAME = 'CHECK'.
DATA REF1 TYPE REF TO CL_GUI_ALV_GRID.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = REF1.
CALL METHOD REF1->CHECK_CHANGED_DATA.
READ TABLE (internal table) INDEX SELFIELD-TABINDEX.
if sy-subrc eq 0.
Call BAPI
endif.
ENDFORM.
Regards
Kannaiah