Application Development 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: 

case stmt for buttons on the user command

Former Member
0 Kudos

Hi All,

I created 3 buttons SELECT ALL, DESELECT ALL and BLOCKREMOVE on the application toll bar using normal reporting. Can you please help me to write the case stmt for these buttons on the user command.

SELALL - All the check boxes before each line of output should be selected.

DESALL - All the check boxes before each line of output should be deselected.

REMOVE - selected deliveries with delivery block has to remove the delivery block.

Please Help me.

Thanks

Veni.

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Assuming that CHECK is the field in your internal table which holds the value of the checkbox, you can do the following.


case sy-ucomm.
   when 'SELALL'.
 

  loop at itab.
    itab-check = 'X'.
    modify itab.
  endloop.

   when 'DESALL'.
 

  loop at itab.
    itab-check = space.
    modify itab.
  endloop.

   when 'REMOVE'.
 

endcase.

Regards,

Rich Heilman

3 REPLIES 3

Former Member
0 Kudos

Hi,

CASE SY-UCOMM.

WHEN 'SELECTALL'.

....

WHEN 'DSELECTALL'.

.....

WHEN 'BLOCKREMOVE'.

ENDCASE.

Thanks,

Naren

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Assuming that CHECK is the field in your internal table which holds the value of the checkbox, you can do the following.


case sy-ucomm.
   when 'SELALL'.
 

  loop at itab.
    itab-check = 'X'.
    modify itab.
  endloop.

   when 'DESALL'.
 

  loop at itab.
    itab-check = space.
    modify itab.
  endloop.

   when 'REMOVE'.
 

endcase.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi,

Try..Assuming checkbox is the field name for checkbox..

CASE SY-UCOMM.

WHEN 'SELECTALL'.

ITAB-CHECKBOX = 'X'.

MODIFY ITAB WHERE CHECKBOX IS INITIAL

TRANSPORTING CHECKBOX.

.

WHEN 'DSELECTALL'.

ITAB-CHECKBOX = ' '.

MODIFY ITAB WHERE CHECKBOX = 'X'

TRANSPORTING CHECKBOX.

WHEN 'BLOCKREMOVE'.

..

ENDCASE.

Thanks,

Naren