Application Development 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: 

SYST

former_member329386
Participant
0 Kudos

HI ALL

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Check this link.

Regards

Aneesh.

6 REPLIES 6

Former Member
0 Kudos

Check this link.

Regards

Aneesh.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

sy-repid is the name of the current program.

sy-cprog is the name of the calling program.

Former Member
0 Kudos

Please give me reward points if it is useful

Thanks

Murali Poli

Former Member
0 Kudos

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

Former Member
0 Kudos

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