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

Write Checkbox Help Required

Former Member
0 Likes
790

Hi,

i want to display 2 check boxes on the screen. If a user checks first box then it should get value 'X' and put it in variable check1.

i am providing sample code which is not working

**************************************************************************************************

DATA: check1 TYPE c VALUE 'X',

check2 TYPE c VALUE ' '.

START-OF-SELECTION.

WRITE: / check1 AS CHECKBOX, 'Checkbox 1',

/ check2 AS CHECKBOX, 'Checkbox 2'.

AT LINE-SELECTION.

READ: LINE 1 FIELD VALUE check1,

LINE 2 FIELD VALUE check2.

**************************************************************************************************

i dont get any value if i heck either of them. Please i dont want to use SELECTION_SCREEN. I want to do it on List.

Thanks in advance to all people.

Kind Regards,

Muhammad Usman Malik

ABAP Consultant

Siemens.

usman.malik.sap@gmail.com

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
762

Hi,

What u are doing is correct buit add some codes in at line-selection.

at line-selection.

if sy-lisel(1) = 'X'. "Hope chk box is on first column.

"Chk box is selected.

endif.

This is hint, also use sy-lsind so that u can get line index.

Jogdand M B

7 REPLIES 7
Read only

Former Member
0 Likes
762

Hi..

write check1.

this is any how contains the value 'X' as u r selecting it and double clicking on it.

add this line...

<b>modify line 2 field value check2 from check1.</b>

Read only

Former Member
0 Likes
762

hi,

Check the program <b>DEMO_LIST_READ_LINE</b>

Regards

Sailaja.

Read only

former_member491305
Active Contributor
0 Likes
762

Hi,

i think value for check box 1 is in line2 and for check box 2 is in line 3.

So Please try likr this.

START-OF-SELECTION.

WRITE: / check1 AS CHECKBOX, 'Checkbox 1',

/ check2 AS CHECKBOX, 'Checkbox 2'.

AT LINE-SELECTION.

READ: LINE 2 FIELD VALUE check1,

LINE 3 FIELD VALUE check2.

Read only

0 Likes
762

Hi

The solution from Vigneswaran S is almost right.

The problem is that the line number counting starts from the header.

I think that correct code for your example could also be

READ: LINE 3 FIELD VALUE check1,

LINE 4 FIELD VALUE check2.

This code would be correct if you have 1 header line followed bu 1 underline followed by the 2 lines with checkboxes.

best regards

Thomas

PS the solution from Rammohan Nagam is absolutly nonsense.

Read only

0 Likes
762

Hi Usman,

If You are declaring the Report statement with NO STANDARD PAGE HEADING, then first line in the list would be ur check box check1.Otherwise it would be Report header.So try to find the line no and then read the value for the check box.

Read only

Former Member
0 Likes
763

Hi,

What u are doing is correct buit add some codes in at line-selection.

at line-selection.

if sy-lisel(1) = 'X'. "Hope chk box is on first column.

"Chk box is selected.

endif.

This is hint, also use sy-lsind so that u can get line index.

Jogdand M B

Read only

Former Member
0 Likes
762

Hi,

Use "NO standard page heading" addition in the REPORT statement and try again.

Regards,

Suresh

null