cancel
Showing results for 
Search instead for 
Did you mean: 

Check Box Reading -- Urgent

Former Member
0 Kudos

I am new user of ABAP. and currently I am requested to do a report with <b>few check box align horizontally</b> on the same line. I am able to solve that one with help of the forum. However, my problem came when I want to detect the selected check box for further processing.

It is because <b>all my check box are having the same name from an internal table</b>, as i am looping the table and display them out in the standard report.

So, i would really appreciate you guys with valuable suggestion and help. Thanks. Please reply me for any doubt upon my question.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mervyn,

Suppose your ITAB has field CHECK which you are writing as checkbox on Column 1 ( leftmost column of list ).

You can do something like this -

At USER-COMMAND .

DO .

READ LINE SY-INDEX.

IF SY-SUBRC NE 0 .

EXIT.

ENDIF.

CLEAR ITAB_CHECK.

IF SY-LISEL(1) EQ 'X'. " means chk box is selected

ITAB-CHECK = 'X'.

ENDIF.

MODIFY ITAB INDEX SY-INDEX TRANSPORTING CHECK.

ENDDO.

REPLACE SY-LISEL(1) with say SY-LISEL(N) where N is the number of column on which you output your check box.

Cheers .

( Dont forget to reward if answers were helpful . )

Former Member
0 Kudos

If you are looking for a multiple checkboxes in a single line, you can try the below code....

selection-screen begin of line.

selection-screen comment (10) text-001.

parametres ch1 type checkbox.

selection-screen comment (10) text-002.

parametres ch2 type checkbox.

selection-screen comment (10) text-003.

parametres ch3 type checkbox.

selection-screen end of line.

Dont forget to reward if answers were helpful....

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Mervyn. I am also new to ABAP and am really greatful for this site. I am trying to do what you achieved in placing some check boxes in a line on a selection screen (or other) so that the user can choose using the check boxes. How did you get that working?

Then I want to do what you were looking for in detecting which choises were made. Do you have an answer yet.

That part of my program flow is like this:

1. get all the users who are logged on

2. put all their names in an internal table

3. display the internal table with a check box next to each name for user to select names

4. detect which names were selected

Anyone with a solution please help

Thanks

Rapula

Former Member
0 Kudos

Hi,

See this link and find helpful.

http://www.sapdevelopment.co.uk/reporting/selscr/selscr_sameline.htm

PARAMETERS: p_filchk AS CHECKBOX

Kindly reward points and close the thread if ur problem got solved.

Former Member
0 Kudos

Hi

Better have seperate names for the checkboxes in ur Internal Table also. This will ease ur problem.

Former Member
0 Kudos

selection-screen begin of line.

selection-screen comment (10) text-001.

parameters ch1 as checkbox.

selection-screen comment (10) text-002.

parameters ch2 as checkbox.

selection-screen comment (10) text-003.

parameters ch3 as checkbox.

selection-screen end of line.