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: 

Storing the output of a function module into a custom table

Former Member
0 Kudos
754

Hi Gurus,

Is it possible to store the output of a function module into a custom table.How can this be done?Is it complex?

4 REPLIES 4

Former Member
0 Kudos
182

hi,

After u execute the FM and get values in the internal table ITAB_RESULT. Create a custom table having structure same as ITAB_RESULT call it ZRESULT.


data :wa type ITAB_RESULT.
call FM and get result it ITAB_RESULT

loop at itab_result.
move-corresponding itab_result to wa.
insert wa to ZRESULT.
endloop.

Regards,

Mansi.

Former Member
0 Kudos
182

Define your table with the same structure that the table in the function parameter TABLES

Former Member
0 Kudos
182

Hi It is not complex. Create one internal table with the same structure of your ztable. Pass it in Changing or Table parameters of your FM. Fill it up inside your FM. Once the call returns from FM, use insert or update statement to pass the data from internal table to ztable. Then call commit work so that database commit occurs.

Former Member
0 Kudos
182

Thanks