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: 

Determining if a checbox is checked

Former Member
0 Kudos

Hi,

if I have a report that outputs a number of lines ,

each with a checkbox next to it, and not in an internal table, as in the code below

WRITE:02 sp01r_tview_rec-checkbox as checkbox , l_rqident

LEFT-JUSTIFIED,

13 sy-vline.

FORMAT INTENSIFIED OFF COLOR COL_NORMAL.

WRITE:14 sp01r_tview_rec-rqdate,

24 sy-vline,

25 sp01r_tview_rec-rqtime_v,

30 sy-vline.

In AT USER-COMMAND, I want to determine which lines have been checked and their values, is there an easy way of doing this?

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

use this one

SET CURSOR FIELD F LINE SY-LILLI

Cheers,

Sasi

9 REPLIES 9

Former Member
0 Kudos

Hi

use this one

SET CURSOR FIELD F LINE SY-LILLI

Cheers,

Sasi

0 Kudos

sorry, GET CURSOR FIELD <field name>

0 Kudos

Here is a sample.....

report zrich_0002 no standard page heading.
 
data: imara type table of mara with header line.
 
data: check_box(1) type c,
      report_lines type i.
 
start-of-selection.
 
* Create the gui status with BACK button in standard place
* and a READ button in the application toolbar
  set pf-status 'CHECK'.
 
  select * into corresponding fields of table imara
           from mara up to 100 rows.
 
  loop at imara.
    write:/ check_box as checkbox, imara-matnr, imara-matkl.
    hide imara-matnr.
  endloop.
 
  report_lines  = sy-linno - 1.
 
top-of-page.
 
  write: 'List of materials'.
  uline.
 
top-of-page during line-selection.
 
  write:  'Material.....'.
  uline.
 
at user-command.
 
  case sy-ucomm.
    when 'READ'.
      check_box = space.
      set pf-status 'CHECK' excluding 'READ'.
      do report_lines times.
        read line sy-index field value check_box.
        if check_box = 'X'.
          write:/  'You have selected material', imara-matnr.
        endif.
      enddo.
  endcase.

Regards,

Rich Heilman

0 Kudos

Hi,

thanks for that, the only bit I did not understand was

  • Create the gui status with BACK button in standard place* and a READ button in the application toolbar set pf-status 'CHECK'.

the Gui status is fine but Read button in the application toolbar, is where I got confused,please help

Thanks

0 Kudos

In this sample program, you will have to create a button on the application toolbar with the function code as READ. This triggers the reading of the lines of the list. Double click the line SET PF-STATUS 'CHECK'. Click the dropdown next to "appliation toolbar" Enter 'READ' into the first space, then double click it. Click the green check, enter Read in the function text, click green check, assign a function code by double clicking it, enter "Read" in the icon text, click green check.

Regards,

Rich Heilman

0 Kudos

hi rich,

what hide command will do, i have seen the documentation but i am unable to understand,please explain me.

0 Kudos

You may want to open a new post, as your question is different from Sims. Thanks.

Regards,

Rich Heilman

Former Member
0 Kudos

There is a syntax called READ LINE....

Check that out.

Regards,

Subramanian V.

Message was edited by: Subramanian Venkateswaran

Former Member
0 Kudos

hi, what rich means is you can new a button on the toolbar, through adding a item in the 'Application toolbar', in the Status Maintain screen.

But I think it's another topic.