03-14-2011 12:16 AM
hi
i have programB which is calling the programA. Inside programA how i can get the name of the calling program i.e. programB? I have no access to prgramB code to make changes for importing and exporting so looking for any other standard way of doing it? any hints pls?
thanks
prabhu
03-14-2011 2:16 AM
03-14-2011 4:48 AM
Hello Jerry,
When a program is called using SUBMIT, the internal session of the calling program is replaced by that of the called program. So SYSTEM_CALLSTACK won't be of use!
@Nikhil: SY-CPROG will hold the name of the calling program for externally called procedures viz., CALL FUNCTION, PERFORM form IN PROGRAM program IF FOUND etc. Don't think it'll contain the value of the calling program for SUBMIT.
@OP: Can you confirm if program A is called by program B only? Or are there other programs which might be calling A?
BR,
Suhas
03-14-2011 5:19 AM
03-14-2011 5:34 AM
Hi Suhas,
it depends on the SUBMIT option "AND RETURN" whether the internal mode is replaced or not. Without it will be replaced.
Regards,
Klaus
03-14-2011 6:18 AM
>
> it depends on the SUBMIT option "AND RETURN" whether the internal mode is replaced or not. Without it will be replaced.
Hello Klaus,
My bad! But if you check the ABAP stack in the called program you won't find the reference of the calling program.
Thanks for correcting my statement.
BR,
Suhas
03-14-2011 4:41 AM
Hi
Check the system variable sy-cprog.
Best Regards,
Nikhil Patil