‎2010 Mar 13 8:05 AM
hi all,
as the table parameter in function module is obsolete, please advise an example on how to pass in an internal table
and return back the result in an internal table as well.
for example, i have itab1 and itab2. By using table parameters i got the following code. Please advise alternative way by using import and export.
""Local Interface:
*" TABLES
*" itab1 STRUCTURE Zitab1
*" itab2 STRUCTURE Zitab2
loop at itab1 into wa_itab.
**do some logic here to assign value to itab2 and return.
wa_itab2-a = xxx .
wa_itab2-b = xxx.
append wa_itab2 to itab2.
endloop.
thank you.
‎2010 Mar 13 1:52 PM
hi,
suppose you have two structure name struc1 and struc2.
create table type zitab1 & 2 for both.
please do the following:
""Local Interface:
*" IMPORTING
*" VALUE(itab1) TYPE Zitab1
*" EXPORTING
*" VALUE(itab2) TYPE Zitab2
you can avoid to use the obsolete table parameters as well as LIKE in function module creation.
cheers
‎2010 Mar 13 8:20 AM
You need to create TABLES TYPES for your Zitab1 & Zitab2 then declare it as LIKE in the tables tab
Please check function module MMPUR_TEXT_EXP_SUBSCREEN and its tables tab MMPUR_T_TEXTLINES
a®
‎2010 Mar 13 8:24 AM
hi a®s,
that is what i'm doing now in the function module. but i feel not comfortable as the system prompt me that the like statement and table parameters are obsolete.
any example to input and output the table by using export and import parameters.?
‎2010 Mar 13 8:33 AM
What i am saying is declare your ZITAB1 & 2 as TABLES TYPE then give that in the Table Tab declaration. Please see the TABLES TYPE as MMPUR_T_TEXTLINES
declare a tables types as ZITAB1_T for ZITAB1 then put this table type ZITAB1_T then you will not get that message as obsolete
a®
‎2010 Mar 13 1:52 PM
hi,
suppose you have two structure name struc1 and struc2.
create table type zitab1 & 2 for both.
please do the following:
""Local Interface:
*" IMPORTING
*" VALUE(itab1) TYPE Zitab1
*" EXPORTING
*" VALUE(itab2) TYPE Zitab2
you can avoid to use the obsolete table parameters as well as LIKE in function module creation.
cheers
‎2010 Mar 14 5:20 AM
If do you want multuple entries whether this work ? putting structure as TYPE in IMPORT & EXPORT parameter?
a®