Application Development and Automation 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: 
Read only

function module which is being called by many other function Module

Former Member
0 Likes
1,174

Hello All,

I have 1 function module which is being called by many other function Module .

I need to see which function modules call in runtime with my function module .

e.g

I have FM1,FM2 and FM3.

FM1 is being called by FM2 and/or FM3 .

So,dynamically I need to create a kind of trace that from which function module FM1 is called .

Hope I m clear to post my issue .

Looking for positive reply .

Bockya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,121

What is the exact requirement ?

- Kalpana

11 REPLIES 11
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,121

You need to do this programmatically?

Regards,

RIch Heilman

Read only

Former Member
0 Likes
1,122

What is the exact requirement ?

- Kalpana

Read only

0 Likes
1,121

yes ,

i need to insert in the database table .

so that we can see the FM1 called by FM1 and or FM2 .

dynamically .

Bockya

Read only

0 Likes
1,121
First read the FM and find includes.

*-Get includes
  SELECT INCLUDE APPENDING TABLE IT_REP_INCL
         FROM D010INC
         WHERE MASTER = P_REPID.
*-Delete unecessary includes
  DELETE IT_REP_INCL WHERE REPID = 'DB__SSEL'.
  DELETE IT_REP_INCL WHERE REPID CS '%_'.
  DELETE IT_REP_INCL WHERE REPID CA '<' AND
                           REPID CA '>'.
  DELETE IT_REP_INCL WHERE REPID = 'DB__SSEL'.

and then LOOP that FUNCTION MODULE INCLUDE TABLE...
and FIND ANY FUNCTION MODULES used in the Includes USING condition <b>IT_REP_INCL-REPID(5) = 'SAPLZ'</b>
INCLUDES start with 'SAPLZ' will be the programs in include..
and search for FM's and try to accumulate all the FM's to table....
Read only

0 Likes
1,121

I m really confued ,

please give me a simple solution

Bockua

Read only

0 Likes
1,121

yeah i understood your problem...

1---> First Find functionmodule's main program

--->read the includes in it and accumulate the

function modules in it

add to itab

Go to Step1

-->till you end up with all includes...

Read only

0 Likes
1,121

I guess u have understodo the requirement yaar .

i would like to know which program is calling the perticular function module .

the way we use sy-cprog ,we get the caller program name the same i need to know which FM calls the perticular FM

Hope this is finr now

bockya

Read only

0 Likes
1,121

Yeah the same way we did, but we are using to find the

tables which are getting updated in programs,FMs

so the same way we did, but if you see that you will be confused...

regards

vijay

Read only

Former Member
0 Likes
1,121

hi , try the following code in your FM1.

  
  DATA: TMP(30)  TYPE  C.
  GET PARAMETER ID 'LIB' FIELD TMP.

TMP will store the Function name which call FM1.

hope it will be helpful

thanks

Read only

0 Likes
1,121

hi thanks

but is is given the called function module

but i wann caller function module name

Praff

Read only

0 Likes
1,121

Hi Praful,

Still you have some problems with that...

regards

vijay