2007 Jun 14 12:51 PM
Hi All,
i have to read line from output list for further processing. each reacod has one check box at start of the record all the records which are checked in the list report have to be processed further.
can anyone help how i read all the data from the list report for durther processing.
I tried wirh READ LINE SY-INDEX VALUE INTO ITAB-CHECK.
but problem here is its taking only the check box not taking other fields of that particular record.
Please help if anyone has idea.
Lokesh.
Hi All,
i have to read line from output list for further processing. each reacod has one check box at start of the record all the records which are checked in the list report have to be processed further.
can anyone help how i read all the data from the list report for durther processing.
I tried wirh READ LINE SY-INDEX VALUE INTO ITAB-CHECK.
but problem here is its taking only the check box not taking other fields of that particular record.
Please help if anyone has idea.
Lokesh.
2007 Jun 14 12:56 PM
Hi,
Check this code
report demo_list_read_line no standard page heading.
tables: sflight.
data: box(1) type c, lines type i, free type i.
start-of-selection.
set pf-status 'CHECK'.
get sflight.
write: box as checkbox, sflight-fldate.
hide: sflight-fldate, sflight-carrid, sflight-connid,
sflight-seatsmax, sflight-seatsocc.
end-of-selection.
lines = sy-linno - 1.
top-of-page.
write: 'List of flight dates'.
uline.
top-of-page during line-selection.
write: 'Date:', sflight-fldate.
uline.
at user-command.
case sy-ucomm.
when 'READ'.
box = space.
set pf-status 'CHECK' excluding 'READ'.
do lines times.
read line sy-index field value box.
if box = 'X'.
free = sflight-seatsmax - sflight-seatsocc.
if free > 0.
new-page.
write: 'Company:', sflight-carrid,
'Connection: ',sflight-connid,
/ 'Number of free seats:', free.
endif.
endif.
enddo.
endcase.
aRs
2007 Jun 14 12:59 PM
Hi Lokesh ,
Use the addition LINE VALUE INTO wa for the READ statement.
So the statement would look line this
READ LINE SY-INDEX LINE VALUE INTO ITAB.
A sample code is given below
-
Data : begin of it_1 occurs 0 ,
matnr type matnr ,
werks type werks_d,
End of it_1.
do 10 times.
it_1-matnr ='arun'.
it_1-werks = 'test'.
write it_1.
enddo.
clear it_1.
read line 3 line value into it_1.
-
Hope this helps.
Regards
Arun
Assign points if helpful
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |