Skip to Content
author's profile photo Former Member
Former Member

ALV-Select All

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 29, 2007 at 08: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 29, 2007 at 08: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.