Application Development and Automation 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: 
Read only

Alv report

Former Member
0 Likes
454

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
433

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.

3 REPLIES 3
Read only

Former Member
0 Likes
434

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.

Read only

Former Member
0 Likes
433

Khadeer,

If checkbox = 'X'

call function.

endif.

Amit.

Read only

Former Member
0 Likes
433

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