Application Development 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: 

Function module with internal table as changing parameter

manoj_goyal2
Participant
0 Kudos

Hi Guys,

Can somebody share a simple code of FM using an internal table as CHANGING parameter.

Thanks,

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

I did not understand the problem you are facing with using an internal table as a changing parameter.

Any ways i will provide you a peice of code:

PC_TABLE type ZT_LEAVE_APPL."This is the changing parameter.

(Zt_leave_appl is a table type of structure ZLEAVE_APPL_STRUC )

This is what i have written in the source code:

data ls_leave type ZLEAVE_APPL_STRUC.

ls_leave-EMPLOYEE_ID = '2343'.

ls_leave-LEAVE_TYPE = 'A'.

append ls_leave to pc_table.

So when i execute the FM, internal table pc_table will be filled a singe row of record.

Hope this gives you an idea.

5 REPLIES 5

Former Member
0 Kudos

chaging parameter is combination import and export parameter,

define i_matnr like mara-matnr ( Changing parameter)

just write the code under source code

select single * from mara into table mara

where matnr = i_matnr.

changing parameter will work as structure and it will not work as internal table.

you see the output -

input i_matnr

output i_matnr

Former Member
0 Kudos

Hi,

I did not understand the problem you are facing with using an internal table as a changing parameter.

Any ways i will provide you a peice of code:

PC_TABLE type ZT_LEAVE_APPL."This is the changing parameter.

(Zt_leave_appl is a table type of structure ZLEAVE_APPL_STRUC )

This is what i have written in the source code:

data ls_leave type ZLEAVE_APPL_STRUC.

ls_leave-EMPLOYEE_ID = '2343'.

ls_leave-LEAVE_TYPE = 'A'.

append ls_leave to pc_table.

So when i execute the FM, internal table pc_table will be filled a singe row of record.

Hope this gives you an idea.

Former Member

Former Member
0 Kudos

Hi,

You can use internal table/structure in TABLES tab only. IMPORTING,EXPORTING,CHANGING can accomodate only one record at a time.

Hope your clear!!!

Get back if you have any doubts.

Regards,

Younus

<b>Reward Helpful Answers:-)</b>

0 Kudos

Hi,

In SE11 you can create a "Table Type" of the required structure.

use that table type as the reference type for your changing parameter.

Regards,

Guarav