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: 

Hi regarding function modules

Former Member
0 Kudos

Hi All ,

Can any one tell me the procedure for passing the values of one function module to the other is there any procedure to do so..

Thanks in advance.

Mohan...

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Mohan,

Why dont u try with the concept of Abap memory and sap memeory since u are saying tht u want one function module to the other u can do tht if they r in the same session thn u can selct abap memory and if they r un the different sesion then go for sap memory

Syntax for abap memory

Check this link :

help.sap.com/saphelp_nw04/helpdata/en/fc/eb2d40358411d1829f0000e829fbfe/content.htm

- 36k

Regards,

Sana.

Reward points if found helpful..

5 REPLIES 5

former_member156446
Active Contributor
0 Kudos

there is not hardcoded rule as such till now...

if ur FM1 take 2 and give a table T1 put that T1 in a internal table and

pass it to FM2 which takes Table T1 and give you what u req..

>Award points if helpful..

Former Member
0 Kudos

Hi Mohan,

You mean to say the values present in one FM to the another FM .It is possible only if you both the FM's in a single Func group then you can declare some global variable in Func group and pass the required into them which can be accesible in both the function modules.

If they are not related FM's we have to write a program whcih calls both the Func Modules. First call the first FM with the required data to be passed to the second as Export paramters and use them as Import parameters in the next FM.

Edited by: araja reddy on Dec 28, 2007 8:20 AM

Former Member
0 Kudos

Hi Mohan,

Why dont u try with the concept of Abap memory and sap memeory since u are saying tht u want one function module to the other u can do tht if they r in the same session thn u can selct abap memory and if they r un the different sesion then go for sap memory

Syntax for abap memory

Check this link :

help.sap.com/saphelp_nw04/helpdata/en/fc/eb2d40358411d1829f0000e829fbfe/content.htm

- 36k

Regards,

Sana.

Reward points if found helpful..

0 Kudos

Hi Sana,

Can u plz send me the syntax of abap memory plz i need tht ..

Thanks,

Mohan...

Former Member
0 Kudos

Hi Mohan

I am writing one document for you,.

pls reward pts

Regards

Deepanker.

Calling Function Modules in ABAP

To call a function module, use the CALL FUNCTION statement:

CALL FUNCTION <module>

[EXPORTING f1 = a 1.... f n = a n]

[IMPORTING f1 = a 1.... f n = a n]

[CHANGING f1 = a 1.... f n = a n]

[TABLES f1 = a 1.... f n = a n]

[EXCEPTIONS e1 = r 1.... e n = r n [ERROR_MESSAGE = r E]

[OTHERS = ro]].

You can specify the name of the function module <module> either as a literal or a variable. Each interface parameter <fi> is explicitly assigned to an actual parameter <a i>. You can assign a return value <r i> to each exception <e i>. The assignment always takes the form <interface parameter> = <actual parameter>. The equals sign is not an assignment operator in this context.

• After EXPORTING, you must supply all non-optional import parameters with values appropriate to their type. You can supply values to optional import parameters if you wish.

• After IMPORTING, you can receive the export parameters from the function module by assigning them to variables of the appropriate type.

• After CHANGING or TABLES, you must supply values to all of the non-optional changing or tables parameters. When the function module has finished