2008 Jul 15 5:51 AM
Hi..,
Iam developed a function module...
In One of the subroutine of that function module iam fetching the data from database and filling one internal table.
So after coming back from that subroutine.. My function module needs to carry that internal table.
Which parameters i hav to pass for this sub routine...?
What about data declaration part?
And in which internal table i hav to fill my entries?
Thanks,
Naveen Inuganti.
2008 Jul 15 5:58 AM
Hi Naveen,
Check these links, which have description with examples of passing internal tables in subroutines:
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db979035c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw70/helpdata/en/9f/db979035c111d1829f0000e829fbfe/content.htm
Hope this helps you.
Regards,
Chandra Sekhar
Hi..,
Iam developed a function module...
In One of the subroutine of that function module iam fetching the data from database and filling one internal table.
So after coming back from that subroutine.. My function module needs to carry that internal table.
Which parameters i hav to pass for this sub routine...?
What about data declaration part?
And in which internal table i hav to fill my entries?
Thanks,
Naveen Inuganti.
2008 Jul 15 5:54 AM
Hi,
You can declare the internal table in the main program and populate it in the subroutine. Since it is global ,it will populate data and store it.
Regards,
anirban
2008 Jul 15 5:57 AM
What is this man....
Why are you sending Just Hi???????????
At any time if u sent correct reply i will deffenately rewards you!!!
2008 Jul 15 5:59 AM
Hi Naveen,
Use Tables parameters in your function module
regards
padma
2008 Jul 15 6:14 AM
Hi Naveen,
There are two ways.
1. Declare your internal tables as Global i.e in TOP include of that FM. So no need to pass in the subroutine. U can directly populate and use it any where.
2. Declare local internal tables(In the source code of FM) and pass these in TABLES parameters. Populate these in side form. U can use after PERFORM.
eg: PERFORM populate_data TABLES i_tab1 i_tab2.
Use these tables.
FORM populate_data TABLES pi_tab1 pi_tab2.
Populate the tables with ur logic.
ENDFORM.
Thanks,
Vinod.
2008 Jul 15 5:54 AM
hi,
Pass the internal table By REference into the sub Routine. Declare it a global variable so that it can be Accessed.
Regards
Sumit Agarwal
2008 Jul 15 5:55 AM
Hi,
Tables parameter is used to pass internal tables as input and return internal tables as output.
If reqd you can have two parameters, one for input internal table and one for output internal table.
Regards,
Subramanian
2008 Jul 15 5:58 AM
Hi Naveen,
Check these links, which have description with examples of passing internal tables in subroutines:
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db979035c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw70/helpdata/en/9f/db979035c111d1829f0000e829fbfe/content.htm
Hope this helps you.
Regards,
Chandra Sekhar