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

How to determine main program name?

Former Member
0 Likes
1,290

Hello Forums,

I am working on a customer exit that is called by a function module and I would like to have a condition in my include that states

if program_name = SAPLV56K .

          • do logic in here.

Endif.

is it possible to determine the program name?

thanks

4 REPLIES 4
Read only

Former Member
0 Likes
935

would sy-repid do the trick?

Read only

0 Likes
935

May be u need to use SY-CPROG instead of REPID

a®

Read only

Former Member
0 Likes
935

Hi,

Do following step,

1 declare global Variable of type sy-repid. eg data g_repid like sy-repid.

2 assign program name to variable at Initialization stmt.

INITIALIZATION

g_repid = sy-repid.

3 Use this variable.

other wise use sy-cprog.

Difference between sy-repid and sy-cprog

Sy-repid --- It contains the name of current program.

Sy-cprog---Contains the name of calling program.

Thanks & Regards,

ShreeMohan

Read only

Former Member
0 Likes
935

apart from all the above correct answers, if u want to see it, u can find it in debugging mode or WHERE USED LIST

thanq