07-30-2007 9:52 AM
Dear All,
Please let me know how to read the first row of the internal table?
I used following read statement but it is not working
READ TABLE t_cdhdr INDEX 1.
07-30-2007 9:58 AM
statement is correct
1. put condition if itab is not initial.
read condition
endif.
2. or check your sy-subrc after read.
07-30-2007 9:56 AM
Hi,
The statement that you have used appears correct .
Regards
Shruthi R
07-30-2007 9:57 AM
Hi,
i think you are not reading an internal table
according to your code i think you are reading a type
which may be declared as types...
types are declared just for reference
eg
types: begin of t_cdhdr .
include strucuture cdhdr .
types: end of t_cdhdr .
types: t_it_cdhdr type standard table of t_cdhdr.
data: git_t_cdhdr type t_it_cdhdr.
data: gwa_t_cdhdr type t_cdhdr.
now have to fill the iternal table
and
read table git_t_cdhdr into gwa_t_cdhdr index 1.
reward points if helpful
thanks & regards,
venkatesh
07-30-2007 9:58 AM
statement is correct
1. put condition if itab is not initial.
read condition
endif.
2. or check your sy-subrc after read.
07-30-2007 10:01 AM
hi,
That READ statement is correct.I think ur reading an internal table without header
i.e ur referring to an type.
Please check if it is a table with out header line then declare workarea and use that workarea while reading the table.
READ table itab into wa INDEX 1.
Don't forget the REWARD (If it helps)
rgds
harris
07-30-2007 10:06 AM
You might be reading internal table w/o header line.. so u have to specify work area too..
data: wa_cdhdr like line of t_cdhdr.
READ TABLE t_cdhdr into wa_cdhdr INDEX 1.
Regards
Prax