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

checkbox in classical list display..

former_member206377
Active Contributor
0 Likes
1,087

i have a requirement where in i have to display 4 different lines starting with a checkbox in a classical List display. (not in selection screen)

How can i do this. AT runtime i have to check which check box is checked..

Thanks,

Vasuki

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,062

HI,

try this logic.

data: begin of t_itab occurs 0,

col1 type char1,

col2 type char10,

col3 type char10,

end of t_itab.

t_itab-col2 = 'AA'.

t_itab-col3 = 'AAA'.

append t_itab.

t_itab-col2 = 'BB'.

t_itab-col3 = 'BBB'.

append t_itab.

t_itab-col2 = 'CC'.

t_itab-col3 = 'CCC'.

append t_itab.

t_itab-col2 = 'DD'.

t_itab-col3 = 'DDD'.

append t_itab.

loop at t_itab.

write 😕 t_itab-col1 AS CHECKBOX,

3(10) t_itab-col2,

15(10) t_itab-col3.

endloop.

i have a requirement where in i have to display 4 different lines starting with a checkbox in a classical List display. (not in selection screen)

How can i do this. AT runtime i have to check which check box is checked..

Thanks,

Vasuki

8 REPLIES 8
Read only

Former Member
0 Likes
1,062

Hi,

Write variable as check box. You can create a field in the internal table in the output table and use the write as checkbox to write it as checkbox.

Regards,

Himanshu V

Read only

Former Member
0 Likes
1,063

HI,

try this logic.

data: begin of t_itab occurs 0,

col1 type char1,

col2 type char10,

col3 type char10,

end of t_itab.

t_itab-col2 = 'AA'.

t_itab-col3 = 'AAA'.

append t_itab.

t_itab-col2 = 'BB'.

t_itab-col3 = 'BBB'.

append t_itab.

t_itab-col2 = 'CC'.

t_itab-col3 = 'CCC'.

append t_itab.

t_itab-col2 = 'DD'.

t_itab-col3 = 'DDD'.

append t_itab.

loop at t_itab.

write 😕 t_itab-col1 AS CHECKBOX,

3(10) t_itab-col2,

15(10) t_itab-col3.

endloop.

Read only

0 Likes
1,062

Hi Bhavana and Himanshu,

I used the keyword ' as checkbox' in the write statement but if i do that only the check box appears, not the text which should appear after it..?

" write / wa_data-wa_choice-l_choice1 as checkbox."

Thanks,

Vasuki

Read only

0 Likes
1,062

Hi,

Try like


write / wa_data-wa_choice-l_choice1 as checkbox, 'CHECKBOX'.

Regards,

Himanshu V

Read only

Former Member
0 Likes
1,062

Hi,

For checkboxes in ALV you can refer program,

BCALV_EDIT_05

Or you can try in the field catalog itself there is one parameter of checkbox

and give its value as 'X' and then you can catch it in user command:

wa_fieldcatalog-checkbox = 'X'.

Hope it helps

Regards

Mansi

Read only

Former Member
0 Likes
1,062

first create a char 1 field in your types declaration

TYPES : BEGIN OF T_AUFK,

SEL TYPE CHAR1,

then in your field catalog give the following

LS_FCAT-FIELDNAME = 'SEL'

LS_FCAT-COLTEXT = 'SEL'

LS_FCAT-SELTEXT = 'SEL'

LS_FCAT-CHECKBOX = 'X'.

LS_FCAT-EDIT = 'X'.

APPEND LS_FCAT TO LT_FCAT.

Hope this will work

Read only

0 Likes
1,062

Hi Anil,

I need checkbox in classical List ,not in ALV..

Can u pls let me know how it can be doen in classical list display.

Read only

Former Member
0 Likes
1,062

sorry for the mistake

you can use like

DATA : LV_C TYPE CHAR1.

WRITE : / LV_C AS CHECKBOX , 'CheckBox'.

like this you can do

Hope this will work. If you want any clarification let me know