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

Adding checkbox on screen dynamically

Former Member
0 Likes
1,306

Hi all,

how can we add checkbox on to a screen dynamically. please send me some details.

thanks,

samm

5 REPLIES 5
Read only

Former Member
0 Likes
853

Hi,

are you trying to use checkbox in the Abap List?

For creating checbox, you can use

the write addition "as checkbox".

Do 5 times

WRITE:/ FLAG AS CHECKBOX INPUT OFF.

WRITE:/ FLAG_on AS CHECKBOX INPUT ON.

enddo

regards

Read only

Former Member
0 Likes
853

If its a screen that you are adding the checkbox to, you can select whether to hide/unhide your checkbox in the PBO as follows:

LOOP AT screen.

IF screen-name = 'CHK1'.

screen-invisible = 0.

screen-input = 0.

ENDIF.

ENDLOOP.

To enable the checkbox, just reverse the values to 1.

Hope this helps.

Sudha

Read only

0 Likes
853

Hi Sudha,

could you please give me some more inputs since i am not getting any check box on the screen after i used your codes in PBO.

thanks,

Samm

Read only

0 Likes
853

Hi Samm,

In the code suggesed by Sudha, just add the statement MODIFY SCREEN before the ENDLOOP and it should work.

Also if the name of your checkbox is CHK1 then:

to hide the checkbox

LOOP AT SCREEN.

IF SCREEN-NAME EQ 'CHK1'.

SCREEN-INPUT = '0'.

SCREEN-INVISIBLE = '1'.

SCREEN-ACTIVE = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

And inverse values for input/active and invisible when u want to display the checkbox.

Regards,

Aditya

Message was edited by:

Aditya Laud

Read only

Former Member
0 Likes
853

Hi Try this ..

Let Us say u have a Check box on selection screen p_cbox , if user selects this u want Check box ( for selection ) to appear in the output list ..

While Setting the layout parameters for the Output you can use :

DATA g_r_layo1 TYPE lvc_s_layo ,

FORM alv_layo1.

g_r_layo1-grid_title = 'SD Delivery Note(Printed)'.

g_r_layo1-cwidth_opt = g_c_mark.

g_r_layo1-zebra = g_c_mark.

g_r_layo1-no_rowmark = space.

  • IF ALready Printed Delivery to be printed

IF p_cbox = 'X'.

g_r_layo1-sel_mode = g_c_selmode.

ENDIF.

ENDFORM. " alv_layo

g_r_layo1-sel_mode will get u the check box ..

This works for classes ..

Thanks .