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

syntax error in ECC 6

HI All,

can any one please suggest me that cant we assign any prg to sy-repid.

i have ana error for this code SY-REPID = 'PRGNAME'.

error is:the field SY-REPID cant be changed

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 12, 2007 at 08:53 AM

    Hi,

    SY-REPID is the system field and it assigned automatically by the system.

    So you can't manully assign the values to system field.

    Thanks.

    Add a comment
    10|10000 characters needed characters exceeded

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

    Hi the error is because:

    The system field SY-REPID is not part of SYST or SY. Instead, every program contains the predefined constants SY-REPID and SYST-REPID, which both contain the name of the corresponding program. Furthermore, there are two predefined types of the same name, SY-REPID and SYST-REPID.

    All system fields are addressed using SY field name and their types using SYST field name.

    Go through this link....

    http://help.sap.com/saphelp_nw2004s/helpdata/en/7b/fb96c8882811d295a90000e8353423/content.htm

    Regards

    vasu

    Add a comment
    10|10000 characters needed characters exceeded

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

    Hi.....sy-repid is a system variable and it cant be changed in the program......

    jus like u cant change sy-datum....

    Plz reward points if helpful

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 12, 2007 at 09:06 AM

    Hi,

    No you Cant do this . Actually SY_REPID already has assigned the program name once you call it in ur program. No need to assign the program name again to SY_REPID.

    If you want to pass your program name to any FM's or anywhere , you can directly pass SY_REPID there. OR you can pass SY_REPID to any variable of type SY_REPID and pass that variable where you want to pass the program name.

    May be i am not 100% correct to my statement but If anyhow i solved your problem do reward points.

    Regards,

    Rahul

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 12, 2007 at 09:18 AM

    hi,

    SY-REPID is a field of database table SYST, which is a database table developed by sap.

    it holds the name of current program under execution. we can use this variable to get current prgm name. we cant change the value of this variable.

    for eX:

    data: prgname like sy-repid.

    prgname = sy-repid. // then both prgname and sy-repid contains the name of program under execution.

    but u cant use it as IT IS A system field.

    with regards,

    Suresh Aluri.

    prgname = 'SURESH ALURI'.

    sy-repid = prgname. //

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 12, 2007 at 09:25 AM

    Hi Suresh..

    ECC 6.0 Performs certain additional checks like this which may be ignored in 4.6C

    So if you want to Assign the Value .. do like this:

    DATA: V_REPID LIKE SY-REPID.

    V_REPID = 'PRGNAME'.

    or

    V_REPID = SY-REPID

    This will not Give any error

    reward if Helpful.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi sureshrayudu,

      the question remains: Why?

      If yopu want to pass a manipulated SY-REPID to a function, it will change as soon the function is entered.

      If you need it in your program, then you can exchange all occurences of SY-REPID with a global constant declared as CONSTANTS: gc_repid typs syrepid value 'whatyoulike'.

      And is there no other way of doing it properly?

      Regards,

      Clemens

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.