07-12-2007 12:44 PM
Hi All,
I have to copy standard transaction and i want to avoid copy all standard objects, my goal is just copy objects that are necessary but there is some standard function modules that are requesting for sy-tcode as i told you my transaction is 'Z' one. Then i would like to know if there is a way to change the sy-tcode value in runtime because i would like it contains standard transaction in stead of my 'Z' transaction.
Thank you in advance!
07-12-2007 12:46 PM
Hi,
This is not possible.
There is no effect even if you assign some thing to SY-TCODE.
No use of SY-TCODE = 'ZTCODE'.
This will not overwrite the value of SY-TCODE.
Regards,
Sesh
07-12-2007 12:54 PM
Hi..
Just use SY-TCDE field of table SYST..
In PBO just write a case statement on SY-TCODE..
Nd u can easily change the YCODE at runtime..
If any doubt do let me know..
I will send u the code..
Reward points if useful..
Thanks
Arun
07-12-2007 12:55 PM
07-12-2007 1:13 PM
If you have to pass sy-tcode to that transaction, then declare a new variable as follows
my_tcode like sy-tcode.
my_tcode = 'SE11'.
" or whatever u want to put in it
pass my_tcode to your program instead of sy-tcode
07-12-2007 2:35 PM
I am copying transaction LM02 to ZLM02 this calls function modules from fuction group LMOB, y want to avoid copy function group LMOB then i want to set the sy-tcode with 'ZLM02' before call any function module from this group to avoid copy the function group and change the code of this.
I have found the reserved function
DATA xxxx LIKE SY-TCODE.
CALL 'GET_PARAM_TCOD' ID 'PTCOD' FIELD xxxx.
that return the real SY-TCODE
I think that could be there is one for set SY-TCODE.
Then my issue is still without a solution.
Thanks,
Thanks
07-12-2007 2:42 PM
Hi
U can't change the value of SY-TCODE in runtime, the system'll replace again the current transaction if you try to change it.
If the std checks SY-TCODE you need to copy and change the includes of function group LMOB.
Max