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

case stmt for buttons on the user command

Former Member
0 Likes
567

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
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
543

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

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.

3 REPLIES 3
Read only

Former Member
0 Likes
543

Hi,

CASE SY-UCOMM.

WHEN 'SELECTALL'.

....

WHEN 'DSELECTALL'.

.....

WHEN 'BLOCKREMOVE'.

ENDCASE.

Thanks,

Naren

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
544

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

Read only

Former Member
0 Likes
543

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