2007 May 29 9:05 AM
Hi people,
I have an ALV display which has a check box for each record. This is the first ALV Display. Based on User interaction a second ALV list is called
There is an option for Select All and Deselect all on the first display, which i have defined on the Application Bar. So based on the User Command here is what I do :-
WHEN '&SELECT_ALL'.
LOOP AT it_output.
it_output-check = 'X'.
MODIFY it_output TRANSPORTING check.
ENDLOOP.
PERFORM SET_PARAMS.
PERFORM DISPLAY_REPORT.
WHEN '&DESELECT_ALL'.
LOOP AT it_output.
it_output-check = ''.
MODIFY it_output TRANSPORTING check.
ENDLOOP.
PERFORM SET_PARAMS.
PERFORM DISPLAY_REPORT.
However, after select all/deselect all, the problem is that I have to call the display again to show the checkboxes correctly. Because of that when I use the Back button the previous ALV display is called i.e. if I do select all or deselect all 2 3 times and proceed to the next display, when I want to go back I have to go back many times(as many times I did Select All/Deselect All) to reach the first display.
Is there a way to update the Check Boxes without having to call the ALV display again ??
Please help.
P.S. : The check boxes and select all / deselect all buttons are user defined so the standard ALV options do not work
Thanks in advance,
Archana.
2007 May 29 9:14 AM
i guess you are writing the code for the buttons in USER_COMMAD subroutine
Try the one in bold
FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
P_SELFLD TYPE SLIS_SELFIELD.
WHEN '&SELECT_ALL'.
LOOP AT it_output.
it_output-check = 'X'.
MODIFY it_output TRANSPORTING check.
ENDLOOP.
PERFORM SET_PARAMS.
PERFORM DISPLAY_REPORT.
WHEN '&DESELECT_ALL'.
LOOP AT it_output.
it_output-check = ''.
MODIFY it_output TRANSPORTING check.
ENDLOOP.
PERFORM SET_PARAMS.
PERFORM DISPLAY_REPORT.
<b>P_SELFLD-REFRESH = 'X'.</b>
ENDFORM.
2007 May 29 9:11 AM
WHEN '&SELECT_ALL'.
LOOP AT it_output.
it_output-check = 'X'.
MODIFY it_output TRANSPORTING check.
ENDLOOP.
PERFORM SET_PARAMS.
PERFORM DISPLAY_REPORT.
WHEN '&DESELECT_ALL'.
LOOP AT it_output.
it_output-check = ''. <b>give one space gap in between like(' ') otherwise u can go for word space</b>
MODIFY it_output TRANSPORTING check.
ENDLOOP.
PERFORM SET_PARAMS.
PERFORM DISPLAY_REPORT.
<u><b>Please dont forget to award points if useful.</b></u>
Sudheer
2007 May 29 9:14 AM
i guess you are writing the code for the buttons in USER_COMMAD subroutine
Try the one in bold
FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
P_SELFLD TYPE SLIS_SELFIELD.
WHEN '&SELECT_ALL'.
LOOP AT it_output.
it_output-check = 'X'.
MODIFY it_output TRANSPORTING check.
ENDLOOP.
PERFORM SET_PARAMS.
PERFORM DISPLAY_REPORT.
WHEN '&DESELECT_ALL'.
LOOP AT it_output.
it_output-check = ''.
MODIFY it_output TRANSPORTING check.
ENDLOOP.
PERFORM SET_PARAMS.
PERFORM DISPLAY_REPORT.
<b>P_SELFLD-REFRESH = 'X'.</b>
ENDFORM.
2007 May 29 2:37 PM
2007 May 29 2:39 PM