03-05-2007 6:42 PM
what is the purpose of sy-repid during alv.
why we are assigning sy-repid to a variable and using that variable in the FM
instead of directly assigning sy-repid in the FM
03-05-2007 6:44 PM
Hi,
We use sy-repid to get the actual program name. We can save this value in a field and pass this field to ALV function modules to inform from which program its been called.
If we pass sy-repid directly, this system variable will take the value of the ALV function module frame program immediately when inside the function - no information about the calling program's name arrives.
For ALV it should be
DATA:
lv_repid TYPE sy-repid,
...
lv_repid = sy-repid.
...
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = lv_repid
...
Regards,
Ferry Lianto
03-05-2007 6:44 PM
To recognize the current program you are working on. You can pass it directly in the FM. Don't know exactly which assignment to the variable you are talking about. Post the code.
03-05-2007 6:44 PM
Hi,
We use sy-repid to get the actual program name. We can save this value in a field and pass this field to ALV function modules to inform from which program its been called.
If we pass sy-repid directly, this system variable will take the value of the ALV function module frame program immediately when inside the function - no information about the calling program's name arrives.
For ALV it should be
DATA:
lv_repid TYPE sy-repid,
...
lv_repid = sy-repid.
...
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = lv_repid
...
Regards,
Ferry Lianto
03-05-2007 6:44 PM
Hi Sripathi,
<b>SY-REPID:</b> Name of current ABAP program. With externally called procedures this is the name of the procedures main program.
If SY-REPID was transferred to an external procedure as an actual parameter before Release 6.10, the formal parameter was not given the name of the caller, but the name of the procedures main program. SY-REID had to be transferred to an auxiliary variable before the call or you had to use SY-PROG.
As of Release 6.10, SY-REPID is a separate constant that is no longer part of the structure SYST or SY. It can be transferred to external procedures directly.
Thanks,
Vinay
03-05-2007 6:47 PM
If you are referring to the i_callback_program parameter of the ALV, there is no need to pass it ot variable, you can as well use i_callback_program = sy-repid. It could have passed via the variable just have an option to pass a diff program name to i_callback_program.
~Suresh