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 program name.

Former Member
0 Likes
1,295

I have called a program A from many programs say B and C.

In the the called program B, I have to find from which program it has been called either B or C?

Is there any systenm field or way to find out?

6 REPLIES 6
Read only

ferry_lianto
Active Contributor
0 Likes
904

Hi,

Please check ABAP system field SY-CPROG.

Regards,

Ferry Lianto

Read only

0 Likes
904

No sy-CPORG gives the called program name.

Read only

0 Likes
904

Check with :

SY-CALLD

X if the program was started using CALL TRANSACTION, CALL DIALOG, or SUBMIT … [AND RETURN]. Space if the program was started using LEAVE TO TRANSACTION or using a transaction code from a screen. SY-CALLD is always space when a batch input session is being processed.

SY-CPROG

The name of the calling program in an external routine, otherwise the name of the current program.

I guess if want to have calling program then you need pass the program name expliciltly in perform routine

any way check with below link:

http://help.sap.com/saphelp_46c/helpdata/en/7b/fb96c8882811d295a90000e8353423/content.htm

To find out at runtime if a program is running as a called program, use the system variable sy-calld

Thanks

Seshu

Message was edited by:

Seshu Maramreddy

Message was edited by:

Seshu Maramreddy

Read only

0 Likes
904

Why do you use SET PARAMETER ID with program name before call program C?. And after this you can get name with GET PARAMETER ID

Read only

0 Likes
904

Why do you use SET PARAMETER ID with program name before call program C?. And after this you can get name with GET PARAMETER ID

Read only

ferry_lianto
Active Contributor
0 Likes
904

Hi,

Please check SY-REPID and SY-CALLD.

If it doesn't work then perhaps you can use EXPORT/IMPORT TO/FROM MEMORY statement.

Regards,

Ferry Lianto