07-12-2007 12:12 PM
Hi.
what is the use of sy-cprog and sy-dynnr.
what is the diff b/w them.
07-12-2007 12:18 PM
Sy-cprog : it is little bit tricky
always it will give main program name,where as sy-repid will give current program name.
example :
main program zxyz.
sy-cprog
sy-repid,in this both will give you same name like zxyz.
example2.
main program zxyz.
you have include zabc.
you have written the code in include
sy-cprog.
sy-repid.
in this case sy-cprog will return zxyz.
in this case sy-repid will return zabc.
sy-dynnr - it will give current screen number
Thanks
Seshu
07-12-2007 12:14 PM
hi,
sy-cprog will give the current program name
whereas sy-dynnr will give the current screen number.
07-12-2007 12:14 PM
sy-cprog gives the current program name
sy-dynnr gives the current screen number
07-12-2007 12:15 PM
Hi,
sy-dynnr - to get current screen
sy-cprog - to get main program
I have one example - suppose you are program cursor at include program and you need to get main program for other purpose then use sy-cprog ( if you use sy-repid - it will have include program)
sy-dynnr - we use in module pool program to pass current screen number to function module to get other requirement,
Thanks,
Reward If Helpful.
07-12-2007 12:16 PM
hi..
<b>SY-CPROG</b> is he name of the current program OR the name of the calling program within a procedure (perform externaly, call function)
<b>SY-DYNNR</b> will give the current screen number
<b>Reward</b> <b>points if useful</b>
Regards
ashu
07-12-2007 12:16 PM
Hi,
<b>cprog</b> shall give you the name of the program which is calling the current control.
<b>dynnr</b> shall return the screen number that is being used in the current program.
<b>reward points if this helps,</b>
Kiran
07-12-2007 12:17 PM
<u>SY-DYNNR</u>
ABAP program, number of current screen
<u>SY-CPROG</u>
ABAP program, caller in external procedures
SY-DYNNR IS USED TO FOR SCREEN NUMBERS
SY-CPROG IS USED FIND OUT THE PROGRAM NAME
REWARD IF USEFULL
REGARDS
NARESH
07-12-2007 12:18 PM
Sy-cprog : it is little bit tricky
always it will give main program name,where as sy-repid will give current program name.
example :
main program zxyz.
sy-cprog
sy-repid,in this both will give you same name like zxyz.
example2.
main program zxyz.
you have include zabc.
you have written the code in include
sy-cprog.
sy-repid.
in this case sy-cprog will return zxyz.
in this case sy-repid will return zabc.
sy-dynnr - it will give current screen number
Thanks
Seshu
07-12-2007 12:19 PM
CPROG is of CHAR 40 used in ABAP Program for <b>External procedure call</b>
DYNNR is of CHAR 4 used in ABAP Program for <b>Number of current screen</b>
Regards,
Pavan
07-12-2007 12:26 PM
Hi,
SY-CPROG
The name of the calling program in an external routine, otherwise the name of the current program.
SY-DYNNR
Number of the current screen. During selection screen processing, SY-DYNNR contains the screen number of the current selection screen. During list processing, it contains the number of the container screen. During subscreen processing, SY-DYNNR contains the number of the subscreen. This also applies to tabstrip controls.
Regards,
Bhaskar