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

SYST

former_member329386
Participant
0 Likes
1,121

HI ALL

WHAT IS THE DIFFERENCE B/W SY-CPROG & SY-REPID. ON WHAT CONDITIONS WE HAVE TO USE THEM ? THANKS

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,078

Check this link.

Regards

Aneesh.

6 REPLIES 6
Read only

Former Member
0 Likes
1,079

Check this link.

Regards

Aneesh.

Read only

Former Member
0 Likes
1,078

SY-CPROG gives the program name of external procedure call.

Check this thread for more details which also shows an example.

sy-repid is a system variable that stores the current program name.

Check this thread which explains this in detail -

ashish

Read only

Former Member
0 Likes
1,078

Hi,

sy-repid is the name of the current program.

sy-cprog is the name of the calling program.

Read only

Former Member
0 Likes
1,078

Please give me reward points if it is useful

Thanks

Murali Poli

Read only

Former Member
0 Likes
1,078

hi,

sy-repid is the name of the current program.

sy-cprog is the name of the calling program.

SY-CPROG - Program that called the current external

procedure

SY-REPID - Name of the current ABAP program. For externally-called procedures, it is the name of the main program of the procedure. If you pass SY-REPID as an actual parameter to an external procedure, the formal parameter does not contain the name of the caller, but that of the main program of the procedure. To avoid this, assign SY-REPID to an auxiliary variable and use that in the call, or use the system field SY-CPROG.

sy-repid is used by normally developers. sy-cprog is used for to call some external routines. once i got the program name start with ! when use sy-cprog. But both are present in syst structure

if helpful reward points,

Aruna

Read only

Former Member
0 Likes
1,078

hi,<b>

Name Type Length Use Description</b>

SYST-CPROG CHAR 40 ABAP program External procedure call.

SYST-REPID CHAR 40 ABAP program Current main program.

for more information follow this link.

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

regards,

Ashok Reddy