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: 

Check box display

Former Member
0 Kudos

Hi,

I have 6 checkboxes in a screen. I am getting data from an internal table and displaying it in a screen in a loop. But the check box is not in the loop. If there are only 3 rows in the internal table then only 3 checkboxes should be displayed. How is it possible?

Pls help.

Aarthi.M

7 REPLIES 7

Former Member
0 Kudos
data : v_lines type i,
       v_chk(1).

describe table itab lines v_lines.

do v_lines times.
  write : v_chk as checkbox
enddo.

or u can put v_chk in ur internal table and u can write the checkbox while looping at internal table

data:begin of itab occurs 0,
       chk(1),
       field1 like...
       ......
     end of itab.
loop at itab.
  write : itab-chk as checkbox.
  *display other fields here
endloop.

Message was edited by: Sekhar

0 Kudos

Hi Sekar,

This would work only for displaying check boxes in a loop.

former_member181962
Active Contributor
0 Kudos

If you are working with screens,

then in the PBO section,

describe table itab lines v_lines.

v_no_disp_lines = 6 - v_lines.

loop at screen.

if screen-group1 = <your group name for the check boxes>.

do v_no_disp_lines times.

screen-INVISIBLE = 1.

modify screen.

clear screen.

enddo.

endif.

endloop.

REgards,

ravi

0 Kudos

Hi Ravi,

I dont want the check boxes to be displayed in a loop.. I have 6 separate check boxes in the screen.. Only the datas from the table are in a loop. Is that possible?

0 Kudos

give the name of ur checkboxes as chk1 , chk2 ... chk3

describe table itab lines v_lines.
v_lines = 6 - v_lines.

do v_lines times.
  
<b>  concatenate chk sy-index into name1.</b>

  loop at screen.
    if screen-name = name1.
       screen-invisible = 1.
     modify screen.
    endif.
 endloop.
enddo.

0 Kudos

Small correction to Sekhar's code,

<b>Data: v_index(1) type n.</b>

describe table itab lines v_lines.

v_lines = 6 - v_lines.

do v_lines times.

<b> v_index = sy-index.</b>

<b> concatenate <i>'chk'</i> v_index into name1.</b>

loop at screen.

if screen-name = name1.

screen-invisible = 1.

modify screen.

endif.

endloop.

enddo.

Regards,

ravi

Former Member
0 Kudos

Hello Aarthi,

As I understand, U have 6 checkbox and an screen area where u display lines from the internal table. U can code in PBO for controlling the output.

Use DESCRIBE command to check the number of lines and based on that u can use

LOOP at SCREEN.

check for the checkbox name and set the screen attributes accordingly.

endloop.