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-Select All

Former Member
0 Likes
798

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
755

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.

4 REPLIES 4
Read only

Former Member
0 Likes
755

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

Read only

Former Member
0 Likes
756

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.

Read only

0 Likes
755

Didn't work !!

Read only

0 Likes
755

Hey Chandrakshekhar,

Thanks it works !!!