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

calling external subroutine

Former Member
0 Likes
717

Hi all,..

From Custum Function Module i am calling external subroutine which is in Standard Program. from my function module when it calls Standard Program all the Standard Structures does not have Values...

PERFORM (gv_report) IN PROGRAM SAPLV61A IF FOUND.

from the above statement it is going to standard program but the structures used in that standard program does not have values.. Please help how to pass the structure values to the standard Program with the above statement.

Regards,

Vinod

5 REPLIES 5
Read only

Abhijit74
Active Contributor
0 Likes
665

Hello Vinod,

I think it's not possible to pass the structure from your function module. Because it's not using the same memory from your custom program to the standard one. So, it's not possible to populate your structure with data.  If it is generic type or static kind of program then it should have possible.

Thanks,

Abhijit Mandal

Read only

kakshat
Product and Topic Expert
Product and Topic Expert
0 Likes
665

Hi Vinod,

Probably there are other subroutines which need to be called first in order to populate the required tables or structures. Maybe you are not calling the correct subroutine.

Why exactly do you need to call the subroutine externally? Does it encapsulate some logic that you want to re-use? What kind of logic is it? If it's something generic, you should probably look for available APIs (class methods or function modules).

Read only

Former Member
0 Likes
665

you cant do that, if the subroutine interface does not exsits.

As mentioned by Akshat, you can investigate , for any FM, or other way, to pass the structure.

Read only

paul_bakker2
Active Contributor
0 Likes
665

Hi,

Yes you can do that, but only if:

  • the subroutine is self-sufficient (ie does not rely on any global values in its parent program) and
  • you pass all the parameter values (via TABLEs, USING or CHANGING) that it needs.

Otherwise, no can do.

cheers

Paul

Read only

0 Likes
665

Hi vinod,

  Try by this way,

PERFORM gv_report USING (your strucuture name).

By this,you can pass the structure values from FM to the program.

Hope this helps you.

Regards,

Santhosh Kumar.K