Skip to Content
avatar image
Former Member

SAP Script - problem accessing a variable from the program

Hello Friends,

I try to access a variable in SAP Script.

For ex.

IF &Y_VAR& EQ 'X'.

When the control goes here, during debuging, it simple omits the whole condition, including else part.

It's really a strange thing. Could any one suggest what is wrong here.

Senthil

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • May 23, 2006 at 04:36 PM

    Is this variable define in the global section of the print program? Can you please post the code from the sapscript for the IF statement along with the format.

    Regards,

    Rich Heilman

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 23, 2006 at 04:39 PM

    chk if u have declared Y_VAR within a subroutine..if yes, then declare it globally...

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      As Bikash suggested might be variable not declared globally in the print program.

      You do check(syntax check) at text element level.

      Hope this helps.

      Thanks and regards,

      vamshi tallada

  • avatar image
    Former Member
    May 23, 2006 at 06:40 PM

    define the variable globally in the print program or

    use CALL FUNCTION 'SET_TEXTSYMBOL'

    EXPORTING

    NAME = NAME

    VALUE = VALUE.

    if the variable is not globally defined.

    For E.g

    PERFORM SET_TEXTSYMBOL USING 'ITEM_FT' ITEM_FT

    FORM SET_TEXTSYMBOL USING NAME VALUE.

    CALL FUNCTION 'SET_TEXTSYMBOL'

    EXPORTING

    NAME = NAME

    VALUE = VALUE.

    ENDFORM. " SET_TEXTSYMBOL

    and in the SAP Script use &ITEM_FT& variable.

    Add comment
    10|10000 characters needed characters exceeded

  • May 23, 2006 at 06:53 PM

    This looks more like an activation issue even though you are seeing the code in debugging, you may be executing the older version of it. Activate all and then start your test from the begining.

    Add comment
    10|10000 characters needed characters exceeded