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: 

handling check box in a report...

Former Member
0 Kudos

hi,

I display a report with say the sales order numbers with a checkbox before that as follows:

WRITE:/ l_cbox AS CHECKBOX,

(11) l_vbeln

In the output , I get many sales orders and user can click many checkboxes and select the needed sales orders. After that he selects on my custom icon on the toolbar and an operation takes place. In that functionality i need to check which checkboxes the user selected and i want to store those sales order numbers in an internal table for further processing. How to write that code ?

thks

1 REPLY 1

naimesh_patel
Active Contributor
0 Kudos

You need to use the "READ LINE.." Syntax in your user command.

Check help on the READ LINE and see this code:


DATA: date TYPE d, 
      flag(1) TYPE c, 
      wa(10) TYPE c. 

START-OF-SELECTION. 
  date = sy-datum. 
  DO 10 TIMES. 
    date = date + sy-index. 
    WRITE: / flag AS CHECKBOX, (10) date. 
  ENDDO. 

AT LINE-SELECTION. 
  DO. 
    READ LINE sy-index FIELD VALUE flag 
                                   date INTO wa. 
    IF sy-subrc <> 0. 
      EXIT. 
    ELSEIF flag = 'X'. 
      WRITE / wa. 
    ENDIF. 
  ENDDO. 

Regards,

Naimesh Patel