2008 Apr 09 12:15 AM
hye all,
i have a field symbol which has the name of my data base table.<f_table>
1.Now i want an internal table which is again a field symbol with structure of the database table <f_table>.
2. I want to update the contents of data base table with the name <f_table>.
Please help me.
Thanks.
imran
2008 Apr 09 6:44 AM
Hi,
FIELD-SYMBOLS:
<gt_table> TYPE STANDARD TABLE.
gr_structdescr ?= cl_abap_structdescr=>describe_by_name( <f_table ).
gr_tabledescr ?= cl_abap_tabledescr=>create( gr_structdest ).
CREATE DATA gr_dref TYPE HANDLE gr_tabledescr.
ASSIGN gr_dref-> TO <gt_table>.*
Reply back..
With Rgds,
S.Barani
2008 Apr 09 12:23 AM
How about this:
DATA:
gr_structdescr TYPE REF TO cl_abap_structdescr,
gr_tabldesct TYPE REF TO cl_abap_tabledescr,
gr_dref TYPE REF TO data.
FIELD-SYMBOLS:
<gt_table> TYPE STANDARD TABLE.
gr_structdescr ?= cl_abap_structdescr=>describe_by_name( <f_table ).
gr_tabledescr ?= cl_abap_tabledescr=>create( gr_structdest ).
CREATE DATA gr_dref TYPE HANDLE gr_tabledescr.
ASSIGN gr_dref->* TO <gt_table>.
* now field-symbol <GT_TABLE> points to an internal standard
* table with the same structure as the DDIC table specified in
* <F_TABLE>
2008 Apr 09 1:40 AM
All the columns are not getting copied, into the output field symbol.
Any better solution to over come this.
2008 Apr 09 6:38 AM
Please quote the code that is executed to fill the internal table! I don´t think this issues reason is the dynamically creation of the internal table...
2008 Apr 09 6:44 AM
Hi,
FIELD-SYMBOLS:
<gt_table> TYPE STANDARD TABLE.
gr_structdescr ?= cl_abap_structdescr=>describe_by_name( <f_table ).
gr_tabledescr ?= cl_abap_tabledescr=>create( gr_structdest ).
CREATE DATA gr_dref TYPE HANDLE gr_tabledescr.
ASSIGN gr_dref-> TO <gt_table>.*
Reply back..
With Rgds,
S.Barani
2008 Apr 09 7:49 AM
@S BHARANIDARAN:
ATTENTION:
the code quoted by you only creates and initializes the internal table, it does not fill the internal table!