‎2007 May 18 10:42 AM
‎2007 May 18 10:44 AM
hi,
pl go through
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-CPROG:
The name of the calling program in an external routine, otherwise the name of the current program.
For more information, please check this links.
http://help.sap.com/saphelp_nw2004s/helpdata/en/7b/fb96c8882811d295a90000e8353423/content.htm
http://help.sap.com/saphelp_46c/helpdata/en/7b/fb96c8882811d295a90000e8353423/content.htm
2..............
SY-REPID : It is name of the current program
SY-CPROG : Name of the calling program. It would be same as SY-REPID if it is the current program.
But for example check the below.
REPORT ZREP.
start-of-selection.
write : / sy-repid, sy-cprog.
submit zrep1 and return.
REport zrep1.
start-of-selection.
write : / sy-repid, sy-cprog.
The output would be.
zrep zrep
zrep1 zrep
pls rewad if it helpful
Thanks
Vana
‎2007 Jun 20 6:54 AM
‎2007 Sep 14 5:44 PM
I think a more appropriate example is:
*----
REPORT ZCHKSYREPID.
break-point.
start-of-selection.
write : / sy-repid, sy-cprog.
submit ZCHKSYREPID2 and return.
PERFORM r2 in program ZCHKSYREPID2.
*----
REPORT ZCHKSYREPID2.
start-of-selection.
write : / sy-repid, sy-cprog.
------ Form r2 -
form r2 .
write : / sy-repid, sy-cprog.
endform. " r2
‎2007 May 18 10:46 AM
hi,
<b>sy-repid</b> :gives Current main program.
<b>SY-CPROG</b>
The name of the calling program in an external routine, otherwise the name of the current program.
Regards
Reshma
‎2007 May 18 10:48 AM
Hi shital,
SY-CPROG (MAIN program)
The name of the current program and name of the calling program within a procedure.
SY-REPID (CURRENT program)
Name of the current ABAP program.
Kindly reward if useful.
Regards,
Sunny
‎2007 May 18 10:52 AM
Hi,
SY-REPID / SY-CPROG
SY-REPID is the Name of the current ABAP program.
SY-CPROG is he name of the current program OR the name of the calling program within a procedure (perform externaly, call function)