10-02-2008 6:03 AM
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
10-02-2008 6:37 AM
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.
10-02-2008 6:10 AM
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'.
10-02-2008 6:38 AM
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
10-02-2008 6:37 AM
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.
10-02-2008 6:57 AM
Thanks Ronny,
I've modified your code a little bit into my style and it works well.
Thanks again.