2007 Feb 16 7:29 AM
Hi Experts,
I wrote the following code to test the value of header line.
TABLES: sflight.
DATA: itab LIKE STANDARD TABLE OF sflight WITH HEADER LINE.
SELECT * FROM sflight UP TO 10 ROWS.
APPEND sflight to itab.
ENDSELECT.
WRITE:/ itab-carrid, itab-connid, itab-price
1. o/p i got was the initial default values.
My question is that->
will this display the last record appended to the itab or not???
Could anyone please clear my doubt ??
Regards
Sudhansu
2007 Feb 16 7:48 AM
hi
if you want the last record in header line use this :
TABLES: sflight.
DATA: itab LIKE STANDARD TABLE OF sflight WITH HEADER LINE.
SELECT * FROM sflight into itab UP TO 10 ROWS.
APPEND itab.
ENDSELECT.
WRITE:/ itab-carrid, itab-connid, itab-price.
rgds
Deepak
hi sudhansu
it will not display the last record appened. because you you are using the workarea
sflight seprately (you are not using header line).
rgds
Deepak.
2007 Feb 16 7:34 AM
Hi,
Fill the Internal table first, and if you want to print the last record of the internal table follow this one ..
<b>DESCRIBE TABLE ITAB LINES LIN .</b>
<b>Read table ITAB index LIN.</b>
then the Header will contain the last record of the internal table
Regards
Sudheer
2007 Feb 16 7:40 AM
hi sudhansu
it will not display the last record appened. because you you are using the workarea
sflight seprately (you are not using header line).
rgds
Deepak.
2007 Feb 16 7:40 AM
do this way..
Make use of describe statement ..
describe table itab lines v_lines.
read table itab index v_lines.Regards,
santosh
2007 Feb 16 7:42 AM
Hi
Loop at your itab and inside there write the code
TABLES: sflight.
DATA: itab LIKE STANDARD TABLE OF sflight WITH HEADER LINE.
SELECT * FROM sflight UP TO 10 ROWS.
APPEND sflight to itab.
ENDSELECT.
<b>loop at itab.
WRITE:/ itab-carrid, itab-connid, itab-price
endloop.</b>
regards
Shiva
2007 Feb 16 7:42 AM
It will display the first 10 rows
report ychatest.
tables: sflight.
data: itab like standard table of sflight with header line.
select * from sflight up to 10 rows.
append sflight to itab.
endselect.
loop at itab.
write : / itab-carrid.
endloop.
OUTPUT
AA
AA
AA
AA
AA
AA
AA
AA
AA
AA
2007 Feb 16 7:46 AM
Hi,
The query would not display the last appended record .It will display only the values in the Header of the internal table which are the initial values.
Regards,
Sowmya.
2007 Feb 16 7:48 AM
hi
if you want the last record in header line use this :
TABLES: sflight.
DATA: itab LIKE STANDARD TABLE OF sflight WITH HEADER LINE.
SELECT * FROM sflight into itab UP TO 10 ROWS.
APPEND itab.
ENDSELECT.
WRITE:/ itab-carrid, itab-connid, itab-price.
rgds
Deepak
2007 Feb 16 9:19 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |