on 2003 Oct 15 6:48 PM
Hello everybody,
i have a problem!!
I think that i can not find the solution because i am so bad in developing code!
I need to create an internal table in a dynamic way.
Now i will explain my real problem !!
I developing a bsp page, i need to extract some HR data from r/3 via RFC i have a function "HR_READ_INFOTYPE" that returns me all the information in a char line without a structure (no problem), i extract from dd03l table the structure of the relative infotype (note: i can extract more data from different infotype) when i come back to the Web AS system i need to create at runtime the n internal table with the exact structure for each infotypes that i have extracted . So is tit possible to create dynamicly an internal table having the structure in another internal table?!?
Thanks a lot !!!!
massimo
Hi,
you can construct a new internal table with a given line type with the following syntax:
DATA dref TYPE REF TO data.
CREATE DATA dref { {TYPE tabkind OF {type|(name)}}
| {LIKE tabkind OF dobj} }
[WITH key]
[INITIAL SIZE n].
The dynamic creation of new structures will be available with Release 6.40.
Example for creating an internal table with a given structure:
PARAMETERS: dbtab(10) TYPE c,
rows TYPE i DEFAULT 100.
DATA dref TYPE REF TO data.
FIELD-SYMBOLS: .
ELSE.
EXIT.
ENDIF.
ENDDO.
ULINE.
ENDLOOP.
CATCH cx_sy_create_data_error.
WRITE 'Wrong Database!'.
ENDTRY.
Regards
Horst
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
73 | |
10 | |
9 | |
8 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.