Using a checkbox in a report

In a report you can use a checkbox to select one ore more records.

* Define field for the checkbox 
data markfield(1) type c value space.
* Define filed for counting line numbers
data lineno type i.


* Writing the report with a checkbox  
  write: /      markfield as checkbox,   
                i_ejitabel-zzbukrs,      
                i_ejitabel-zzsaknr.      

* Reading the lines and cehcking if the line has been checked

lineno = 0.
do.
*       Counting the line numbers
        lineno = lineno + 1.

*                Read the value of markfield
        read line lineno field value markfield.

*                Test for end of report
        if sy-subrc ne 0. exit. endif.

*       If the value of the checkbox is X ( The checkbox is checked) the read
*       the rest of the fields of the report line into the internal table itab.
        if markfield = 'X'.
                  read current line field value i_ejitabel-zzbukrs into itab   

                        i_ejitabel-zzsaknr into itab.  
        endif.


enddo.
Converted from CHM to HTML with chm2web Standard 2.7 (unicode)