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

How to create check boxes dynamically in selection screen

Former Member
0 Likes
2,670

Hi Experts,

I have a requirement of creating dynamic check boxes based on the number of records that are retrieved from a database table.

Can you please suggest me how to achieve it.

Regards

RP.

10 REPLIES 10
Read only

Former Member
0 Likes
1,754

Hi RP,

Please see below link, it will surely help you.

[;

Kindly set to resolve if it serves your purpose.

Regards

Abhii..

Read only

Former Member
0 Likes
1,754

Not helpful man....thanks Abhi...

Read only

Former Member
0 Likes
1,754

Hi ,

why dont you provide a pop-up to select checkboxes and corresponding selection.....will be too simple

Read only

Clemenss
Active Contributor
0 Likes
1,754

Hi RPReddy16,

where do you want the check boxes?

- List: You can create the list just the way you need it, WRITE ... AS CHECKBOX HOTSPOT ON and pocess -> interactive list events.

- Screen: Must define maximum af all possible check boxes, set invisible not wanted boxes.

Kind regards,

Clemens

Read only

venkat_o
Active Contributor
0 Likes
1,754

Hey RP, Try this way.


REPORT ztest_program .
DATA: it_data TYPE TABLE OF t001.
DATA:check    TYPE char3.
DATA:sy_index TYPE char2.
DEFINE checkbox.
  parameters:&1 as checkbox.
END-OF-DEFINITION.
CHECKbox:c01,c02,c03,c04,c05,c06,c07,c08,c09,c10,
         c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,
         c21,c22,c23,c24,c25,c26,c27,c28,c29,c30,
         c31,c32,c33,c34,c35,c36,c37,c38,c39,c40.
AT SELECTION-SCREEN OUTPUT.
  DESCRIBE TABLE it_data LINES sy-tfill.
  sy-tfill = 39. "This will be changed based on the itab records. I just hardcoded the value
  sy_index = 1.
  LOOP AT SCREEN.
    CONCATENATE 'C' sy_index INTO check.
    IF screen-name = check.
      IF sy_index GT sy-tfill.
        screen-active = '0'.
        MODIFY SCREEN.
        sy_index = sy_index + 1.
        CONTINUE.
      ENDIF.
      sy_index = sy_index + 1.
    ENDIF.
  ENDLOOP.
Thanks Venkat.O

Read only

Former Member
0 Likes
1,754

Hi ,

You can achive the same as below ,

Suppose you want 5 checkboxes , then make a counter and loop on it.

Inside this loop you decide the name of the checkbox like BOX1, BOX2...etc.

So, concatenate BOX with counter , now use this name to make a checkbox by select option.

Hope its help you.

Read only

0 Likes
1,754

Hi Harsh,

I don't understand. Can you give a few code lines?

Many thanks in advance

Clemens

Read only

0 Likes
1,754

try something like this :

suppose you require 5 checkbox.

loop 5 times :

concatenate a common name and a number like BOX and number.

now make checkbox with this name using select option.

end loop.

hope you get it

Read only

0 Likes
1,754

Harsh,

no kidding: Where is the syntax for

now make checkbox with this name using select option.

We want you to try to help not to help your mechanical frothing.

Regards,

Clemens

Read only

Former Member
0 Likes
1,754

Why don't you define a subscreen with a table control?

That way you can place all the checkboxes you want without worrying about screen area