2010 Aug 17 12:57 PM
Hi experts,
I have a method X in my class Y, my method X exports a table (which is defined in dictionary) with a lot of fields. In the code part, I've an internal table wich must be the table to be exported, but when I'm trying to returned it, I've a message that say "Itab_X is not an internal table OCCURS n", how can I export that itab?
Thanks a lot,
Regards,
Rebeca
Hi experts,
I have a method X in my class Y, my method X exports a table (which is defined in dictionary) with a lot of fields. In the code part, I've an internal table wich must be the table to be exported, but when I'm trying to returned it, I've a message that say "Itab_X is not an internal table OCCURS n", how can I export that itab?
Thanks a lot,
Regards,
Rebeca
2010 Aug 17 1:07 PM
Hi,
Use export to shared buffer to export internal table,
EXPORT ITAB TO SHARED BUFFER INDX(ST) ID 'TEST1'.
To import,
IMPORT ITAB FROM SHARED BUFFER INDX(ST) ID 'TEST1'.
Regards,
Arun
2010 Aug 17 1:13 PM
The exporting is in transaction SE24, so the problem is that the data I pass, itab_one with type Dictionary tabla don't let me return all the fields....
Thanks for your answer!
I don't know, but is probably I've to define a structure of that table for using it?
Thanks a lot,
Regards,
Rebeca
2010 Aug 17 1:28 PM
If I understand you correctly, you have a method wherein you extract some data from DB table and want to return this table content to the method's caller. Is that right? If so you type your exporting parameter must be of TABLE TYPE defined either in DDIC or you in local class typing area. In the latter case you can use this type only within current class pool, so typing with DDIC type is a better choice.
So basically you should follow this logic
class lcl_test definition.
"exporting parameter typed with DDIC table type FLIGHTTAB
methods: get_db_table_data exporting et_tab type FLIGHTTAB.
endlcass.
class lcl_test implementation.
method get_dd_table_data.
select * from sflight into table ET_TAB ....
"now ET_TAB stores desired entries and can return data to its caller in form of a table
endmethod.
endclass.
"using the method
data itab_flights type flighttab.
call methods lo_test->get_db_table_data( importing et_tab = itab_flights ).
That's it. It's all about correct parameter typing.
Regards
Marcin
2010 Aug 17 1:33 PM
Solved! I have to create a type of line and then generate the table!
Thanks a lot everybody!
Regards,
Rebeca
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |