2009 Apr 16 10:33 AM
Hi,
I would like to export the field-symbol <fs_table> in a class method.
Unfortunatly I got OBJECTS_TABLES_NOT_COMPATIBLE dump while storing the field-symbol to the exporting variable.
DATA lt_table TYPE REF TO data.
FIELD-SYMBOLS <fs_table> TYPE STANDARD TABLE.
.....
* create dynamic table
CREATE DATA lt_table TYPE STANDARD TABLE OF (iv_structure_name).
ASSIGN lt_table->* TO <fs_table>.
....// fill <fs_table>
et_data_table = <fs_table>. The exporting parameter et_data_table is of type STANDARD TABLE but this can be changed.
How can I make it work?
Thanks in advance,
Best Regards Clemens
2009 Apr 16 10:47 AM
Hi,
Use TYPE REF TO Data for the exporting parameter. And assign lt_table to it.
And in the calling program you can assign that into a field-symbol.
Regards,
Sesh
Hi,
I would like to export the field-symbol <fs_table> in a class method.
Unfortunatly I got OBJECTS_TABLES_NOT_COMPATIBLE dump while storing the field-symbol to the exporting variable.
DATA lt_table TYPE REF TO data.
FIELD-SYMBOLS <fs_table> TYPE STANDARD TABLE.
.....
* create dynamic table
CREATE DATA lt_table TYPE STANDARD TABLE OF (iv_structure_name).
ASSIGN lt_table->* TO <fs_table>.
....// fill <fs_table>
et_data_table = <fs_table>. The exporting parameter et_data_table is of type STANDARD TABLE but this can be changed.
How can I make it work?
Thanks in advance,
Best Regards Clemens
2009 Apr 16 10:47 AM
Hi,
Use TYPE REF TO Data for the exporting parameter. And assign lt_table to it.
And in the calling program you can assign that into a field-symbol.
Regards,
Sesh
2009 Apr 16 10:50 AM
2009 Apr 16 10:52 AM
Hi,
Sorry I got your problem wrong.
Use TYPE REF TO Data for the exporting parameter. And assign lt_table to it.
Assuming et_data_table is TYPE REF TO DATA.
et_data_table = lt_table.
Then you can dereference it and copy in to the field-symbol in the calling program.
Regards,
Sesh
2009 Apr 16 10:57 AM
Hi Sesh,
And assign lt_table to it.
How can I assign lt_table to et_data_table(because this isn't a field-symbol)?
Regards, Clemens
2009 Apr 16 11:01 AM
Hi,
By assign I mean using the = not the ASSIGN keyword.
Since your lt_table is TYPE REF TO DATA and if you declare your exporting parameter as TYPE REF TO DATA then you can use = to assign the reference of lt_table to your exporting parameter.
As I have put in the code,
et_table_data = lt_table.
Regards,
Sesh
2009 Apr 16 12:17 PM
2009 Apr 16 10:50 AM
Hi,
If ur using a variable 'et_data_table' as an exporting parameter in a class method then u can do the same by putting the field symbol instead of 'et_data_table' .But it should be of the same type as dat of
'et_data_table' .It ll work.
Regards,
ajit.
2009 Apr 16 11:00 AM
Hi Ajit,
I tried it, put its not possible to create method parameters that are field-symbols. Or do I understand you wrong.?
Regards, Clemens