10-07-2008 7:30 AM
Hi all,
I am writing code in a method which is not accepting into table in select query, How to pass data into internal table using select query in method. As per my knowlegde we have to write code using field-symbols. can anybody please help me.
Thanks in advance.
Ranjith
10-07-2008 7:35 AM
it is possible to do a select into table. in your case the exporting parameter may be defined normal structure. if you want to define the internal table you have to use table types to behave the parameter as Internal table.
exporting
e_flight type sflight_1ab1
select * from sflight
into table e_flight
up to 30 rows.
10-07-2008 9:05 AM
to explain a bit more
if your internal table has a structure defined in DDIC, you can look for a table type using this structure - if it does not exist you can create one
if your internal table has a structure defined locally in your program you have two possibilities:
- if you are able to create a type with TYPE TABLE OF ty_struc then you can refer to this type for your parameter
- if you are not able to add a table type, then you can use TYPE STANDARD TABLE for your parameter, and ensure that you call method with compatible parameter