Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

any example to import and export itab to function module

Former Member
0 Likes
855

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
763

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

5 REPLIES 5
Read only

former_member194669
Active Contributor
0 Likes
763

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®

Read only

0 Likes
763

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.?

Read only

0 Likes
763

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®

Read only

Former Member
0 Likes
764

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

Read only

0 Likes
763

If do you want multuple entries whether this work ? putting structure as TYPE in IMPORT & EXPORT parameter?

a®