Skip to Content
avatar image
Former Member

Is it possible to set a variable in a program from outside before calling

Suppose I have a program as follows

******************************************

Report Program1.

data: prog1data(10) type c.

start-of-selection.

perform Prog1Form.

form Prog1Form.

write: prog1data.

endform.

******************************************

Now if I have another program which calls the Prog1Form from outside, is there some way I can set value of variable prog1data from my second program before I call Prog1Form routine e.g

*******************************************

Report Program2.

start-of-selection.

->>>>Somehow set the variable prog1data in Program1 ?

perform PROG1FORM in PROGRAM1.

***********************************************

Will give points for the right answer. Thanks for reading.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Aug 16, 2007 at 11:04 PM

    HI,

    use Export statment in calling program and import statment in the called program.

    Calling program

    export variable to memory id 'VAR'.

    Called Program

    import variable from memory id 'VAR'

    Thanks

    Mahesh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 16, 2007 at 10:58 PM

    Try using Export to memory and Import from memory.

    -Kriss

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 16, 2007 at 11:12 PM

    Sorry I forgot to mention the Program1 in reality is SAP program so I cant change the code there. My apologies.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      No it is not possible. If they are the selection screen parameters in First program then you use SUBMIT... but this is not the case here.

      Regards,

      Atish