Skip to Content
author's profile photo Former Member
Former Member

How can i change SY-TCODE in runtime?

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!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Posted on Jul 12, 2007 at 11:46 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 12, 2007 at 11:54 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 12, 2007 at 11:55 AM

    Hi it was SY-TCODE..

    Hope it works..

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 12, 2007 at 12: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 12, 2007 at 01: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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.