2007 Feb 16 10:56 AM
hi all,
i m new to function module. can any one tell me wat will be the associated type of the itab in the import of my function module. and my itab has fields from different table.
can any one send give me the link for creating a function module.
thnx
Message was edited by:
neha gupta
2007 Feb 16 10:59 AM
hi,
first of all create a strucutre in se11. this structure is similar to your internal table then declare the importing/exporting parameter with that structure type
thanks
2007 Feb 16 10:59 AM
Hi Neha,
Incase you want a function module interface table with fields from different DB tables, then create a structure in a type pool from SE11 and include the type pool in the main program (TOP include) of your function group.
Then you can use the structure as a TYPE decleration in your function module.
However if your function module is RFC enabled, then it is not possible to use type pool structures and you must create a structure in SE11 data dictionary level.
Regards,
Aditya
2007 Feb 16 11:00 AM
Hello,
Then U need to create a structure for the purpose in DDIC the associate this to the FM internal table.
Vasanth
2007 Feb 16 11:21 AM
Hi Neha,
Here's a link for creating a function module.
http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/801ee8454211d189710000e8322d00/frameset.htm
I hope it helps.
Best Regards,
Vibha
<b>*Please mark all the helpful answers</b>
2007 Feb 16 11:41 AM
Hi,
if you do not want to do the DDIC work and you remain inside your system (no RFC), you can use a reference variable of TYPE REF.
Calling program:
data:
l_ref type ref to data.
get reference of itab into l_ref.
call function 'ZXY'
exporting
REF = l_ref
* ...
*
In the function:
field-symbols:
<itab> type table.
assign REF->* to <itab>.
*...
For the sake of transparency, it is definitely better to create a structure and a table type with the stzructure as line type in data dictionary. But if you want flexibility, the passing of reference variables is a good method.
Regards,
Clemens