Application Development 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: 

Checkbox followed by itab-field

former_member300754
Participant
0 Kudos

Hi all,

Pls me on this. I want to show the data from itab which each line lead by checkbox.

O itab-field1

O itab-field2

O itab-field3

.

.

.

As above, i want user to tick the line they want then collect the selected line into itab.

in this case, please help me how to put the checkbox in front of each line. and please advise me how to modify the table after user selects the rows already.

Thanks in advance,

Peerasit

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Following code will display records with the checkboxes, you can select particular record and display it or store into another table then process further for collect.

DATA: date TYPE d,

flag(1) TYPE c,

wa(10) TYPE c.

START-OF-SELECTION.

date = sy-datum.

DO 10 TIMES.

date = date + sy-index.

WRITE: / flag AS CHECKBOX, (10) date.

ENDDO.

AT LINE-SELECTION.

DO.

READ LINE sy-index FIELD VALUE flag

date INTO wa.

IF sy-subrc <> 0.

EXIT.

ELSEIF flag = 'X'.

WRITE / wa.

ENDIF.

ENDDO.

4 REPLIES 4

Former Member
0 Kudos

Hi ,

Please let me know are you classical or ALV report .

If classical you can write : p1 as checkbox.

in the ALV in the fieldcatalog there is field checkbox ='X'.

0 Kudos

Dear Malhotra,

it's classic report.

i write p1 as checkbox but i cannot put itab-field after that.

example for sflight

O AA

O LF

.

..

...

Thanks

Former Member
0 Kudos

Hi,

Following code will display records with the checkboxes, you can select particular record and display it or store into another table then process further for collect.

DATA: date TYPE d,

flag(1) TYPE c,

wa(10) TYPE c.

START-OF-SELECTION.

date = sy-datum.

DO 10 TIMES.

date = date + sy-index.

WRITE: / flag AS CHECKBOX, (10) date.

ENDDO.

AT LINE-SELECTION.

DO.

READ LINE sy-index FIELD VALUE flag

date INTO wa.

IF sy-subrc <> 0.

EXIT.

ELSEIF flag = 'X'.

WRITE / wa.

ENDIF.

ENDDO.

0 Kudos

Thanks Ronny,

I've modified your code a little bit into my style and it works well.

Thanks again.