2015 Feb 24 6:17 AM
Hi all,
I have placed a "select all" and "deselect all" button manually in a report. When i click the button it does not select all the field at first click and only in the second click the fields get selected. Can anyone help me in this regard.
WHEN 'SEL'.
itab-chkbox = 'X'.
LOOP at itab INTO wa_itab WHERE chkbox = ' '.
wa_itab-chkbox = 'X'.
MODIFY itab FROM wa_itab.
ENDLOOP.
ENDIF.
WHEN 'DESEL'.
itab-chkbox = ' '.
LOOP at itab INTO wa_itab WHERE chkbox = 'X'.
wa_itab-chkbox = ' '.
MODIFY itab FROM wa_itab.
ENDLOOP.
Regards,
Sam.
2015 Feb 24 7:43 AM
Hi Samuel,
In Reuse_ALV_GRID_DISPLAY Function module u have one parameter like i_callback_usercommand...
there you should take one Perform command like USER_COMMAND
For this implement as like the below mention code
FORM USER_COMMAND USING F_UCOMM LIKE SY-UCOMM
I_SELFIELD TYPE SLIS_SELFIELD.
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.
CASE F_UCOMM.
WHEN 'SALL'.
WA_itab-CHECK = 'X'.
MODIFY ITAB FROM WA_Itab TRANSPORTING CHECK WHERE CHECK <> 'X'.
CLEAR WA_itab.
I_SELFIELD-REFRESH = 'X'.
WHEN 'DALL'.
WA_itab-CHECK = ' '.
MODIFY ITAB FROM WA_itab TRANSPORTING CHECK WHERE CHECK = 'X'.
CLEAR WA_itab .
I_SELFIELD-REFRESH = 'X'.
ENDCASE.
Hope it will helps you,
Thanks,
vamsi.
2015 Feb 24 7:01 AM
Hi Samuel,
Where u wrote it? its should be before loop in PBO.
Can u paste Screen flow logic?
Regards
Sreekanth
2015 Feb 24 7:14 AM
2015 Feb 24 7:16 AM
MODULE %_PBO_REPORT.
MODULE %_PF_STATUS.
MODULE %_END_OF_PBO.
PROCESS AFTER INPUT.
MODULE %_BACK AT EXIT-COMMAND.
MODULE %_INIT_PAI.
FIELD !AUFNR MODULE %_AUFNR .
CHAIN.
FIELD AUFNR .
MODULE %_END_OF_SCREEN.
MODULE %_OK_CODE_1000.
ENDCHAIN.
2015 Feb 24 7:15 AM
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9000 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module USER_COMMAND_9000 input.
Case sy-ucomm.
WHEN 'SEL'.
itab-chkbox = 'X'.
WHEN 'DESEL'.
itab-chkbox = ' '.
endcase.
if itab-chkbox = 'X'.
LOOP at itab INTO wa_itab WHERE chkbox = ' '.
wa_itab-chkbox = 'X'.
MODIFY itab FROM wa_itab.
ENDLOOP.
Elseif. itab-chkbox = ' '.
LOOP at itab INTO wa_itab WHERE chkbox = 'X'.
wa_itab-chkbox = ' '.
MODIFY itab FROM wa_itab.
ENDLOOP.
endif
endmodule.
2015 Feb 24 7:24 AM
Hi Shailendra
Thanks for your reply. This is not a module pool program. But as u mentioned i have done the same changes but nothing worked.
2015 Feb 24 7:43 AM
Hi Samuel,
In Reuse_ALV_GRID_DISPLAY Function module u have one parameter like i_callback_usercommand...
there you should take one Perform command like USER_COMMAND
For this implement as like the below mention code
FORM USER_COMMAND USING F_UCOMM LIKE SY-UCOMM
I_SELFIELD TYPE SLIS_SELFIELD.
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.
CASE F_UCOMM.
WHEN 'SALL'.
WA_itab-CHECK = 'X'.
MODIFY ITAB FROM WA_Itab TRANSPORTING CHECK WHERE CHECK <> 'X'.
CLEAR WA_itab.
I_SELFIELD-REFRESH = 'X'.
WHEN 'DALL'.
WA_itab-CHECK = ' '.
MODIFY ITAB FROM WA_itab TRANSPORTING CHECK WHERE CHECK = 'X'.
CLEAR WA_itab .
I_SELFIELD-REFRESH = 'X'.
ENDCASE.
Hope it will helps you,
Thanks,
vamsi.
2015 Feb 24 8:19 AM
2015 Feb 24 8:21 AM
Vamsi thanks the problem got solved... as per your suggestion i used
I_SELFIELD-REFRESH = 'X'. and gor solved. Thanks all for your support and help.
Regards,
Sam.
2015 Feb 24 8:26 AM
Hi
See this code...
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT_LVC = GS_LAYO
IT_FIELDCAT_LVC = GT_FCAT
* IT_EVENTS = GT_EVENTS
TABLES
T_OUTTAB = ITAB[].
in the above Function Module have you used that parameter ........
I_CALLBACK_PROGRAM = SY-REPID
Check it once......
Thanks ,
vamsi.