‎2007 Jun 21 2:46 PM
I have to create an internal table of certain database table type. without using field symbols.
Paramaters: Ledger like t881-rldnr.
data: itab like table of t881.
data: line like line of itab.
select single * from t881 into line where rldnr = ledger.
here comes the problem
I have to declare a table of type as follows
jtab should have the structure of value in (line-tab)
If the solution is with field symbols then can i declare an internal table of that type.
please provide some inputs.
Please help me.
Thanks in Advance.
Helpful answers would be rewarded.
‎2007 Jun 21 3:02 PM
Hello Kalpana
You have to use field symbols, there is no other way available. However, instead of defining all possible itabs you can make favour of the <b>RTTI</b>.
DATA:
ldo_data TYPE REF TO data.
FIELD-SYMBOLS:
<lt_itab> TYPE table.
UNASSIGN <lt_Itab>.
SELECT SINGLE * FROM t881 INTO line
WHERE ( rldnr = ledger ).
IF ( syst-subrc = 0 AND
line-tab IS NOT INITIAL ).
CREATE DATA ldo_data TYPE TABLE OF (line-tab).
ASSIGN ldo_data->* TO <lt_itab>.
ENDIF.
IF ( <lt_itab> IS ASSIGNED ).
... " do processing of itab contents
ENDIF.
Regards
Uwe