‎2005 Aug 23 9:25 AM
How can one pass internal table in Function table.
In my case importing & exporting an internal table. the table gets updated in the function module.
Problem is internal table is not defined like a DDIc structure. Infact its defined using various field from various tables. so when tried to put loop on internal table it says table is not defined as internal table.
In such case where to define internal table.
coding is
Import:
ITAB1
ITAB2
Export:
ETAB1
ETAB2
PLS HELP
‎2005 Aug 23 9:29 AM
Hi Anupma,
You have 2 choices:
1. Pass the tables using the TABLES parameters (both import and export).
2. Declare in the Data Dictionary table types for the internal tables ITAB1 ITAB2 ETAB1 and ETAB2; then you can pass the internal tables to the FM with reference to the table type defined in the Data Dictionary.
Regards,
John.
‎2005 Aug 23 9:32 AM
Instead of using that in import parametet, use that in tables.
Import/export parameter are only workareas and not tables.
Regds
gv
‎2005 Aug 23 9:34 AM
hi, you can transfer this kind of table with ANY TABLE.
You can reference the example like FM 'REUSE_ALV_LIST_DISPLAY' table T_OUTTAB.
Without specify the type of the table, you can transfer it into FM.
And GET REF TO to get the reference of the table, assign to a Field-Symbol.
Then you can use some way to populate the internal table, E.G. ASSIGN Field-Symbol, or RTTI technology.
There are many resources you can reference in the SDN.
Sorry for haven't too much time for list the resources for you.
Hope it will be helpful
thanks a lot
‎2005 Aug 23 9:55 AM
I am not sure whether i under stood your problem clearly but let me explain one thing.
In a FM if you want to pass any table to it or take values from a table from FM, it is declared under tab 'Tables'.
Here which ever tables you declare say.
vartab type dbstr.
it is same as define in editor as
Data vartab type dbstr occurs 0 with header line.
i hope it help you
regards
‎2005 Aug 23 11:15 AM
Hi,
I thing the problem with work area / Header line.
you do like
1. first define the structure ( now you defined as internal table
Data : begin of ISTRuc,
matnr like mara-matnr,
eindt like mara-eindt,
end of Istruc.
DATA : Itab type Istruc occurs 0 with header line.
else
you keep the same internal table and define one more work area process the data with help of work area
data : wa_a like itab.
loop at itab into wa_a.
endloop.
Cheers,
Sasi
‎2005 Aug 23 4:38 PM
Hi,
Typically 'IMPORT' and 'EXPORT' parameters of a function module are not tables, even though there are exceptions.
How are ITAB1 ITAB2 ETAB1 ETAB2 defined in your funtion module interface?
If they don't have any type reference, then how is the function module recognizing the structure and modifying it(you said 'the table gets updated in the function module.')?
When you are passing your internal table to the function module, all you are passing is the header of the internal table. Once you get your ETAB1 and ETAB2 you need to modify your internal table accordingly.
But if the function module code is what you want change, then put the ITAB1, ITAB2, ETAB1, ETAB2 in the tables parameters.
Look at GUI_UPLOAD or GUI_DOWNLOAD function modules, they use a table without structure.
Please give us more information.
Srinivas
‎2005 Aug 25 8:34 PM
‎2005 Aug 27 4:19 PM
<b>It is discouraging to see that the posts are not being closed. Please close the post if answered, and if not please let the forum know. It doesn't have to be left open like this.</b>
Thanks for your attention,
Srinivas
‎2005 Aug 28 9:59 AM
‎2005 Aug 28 10:19 AM
on to the left of the post (reply to your question) you will see three radio buttons. choose the one based on the answer. choosing solved will mark the thread as answered.
Regards
Raja
‎2005 Oct 10 4:41 PM
I have faced a similar situation in one of my earlier programs. In this case, I have used ABAP Memory option.
That is, first I have exported the internal table ITAB to memory
using EXPORT ITAB from ITAB to MEMORY ID 'ZITAB'.
& later on inside the Function Module, I have retrievied the ITAB contents by importing it. ( IMPORT ITAB to ITAB FROM MEMORY ID 'ZITAB'. )
I am sure this will solve your problem.
Thanks
Atul