Skip to Content

Problem with SET/GET Parameter id

Hi Folks,

I have two programs.

First is ztest_j which is as follows :

DATA : mem TYPE char10 VALUE 'id1'.

set parameter id 'PARA_XXX' field mem.

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

Second is ztest_j1 which is as follows :

DATA : mem TYPE char10 .

get PARAMETER ID 'PARA_XXX' FIELD mem.

WRITE : / 'mem from get ', mem.

When i execute both in sequence, I m not getting value of Parameter id in seconds program.

What is wrong ? kindly suggest.

Thanks in Advance.

Regards,

jitu188

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

9 Answers

  • avatar image
    Former Member
    May 01, 2011 at 04:41 PM

    hi,

    I think thr is no prob in ur code bcoz i copy pasted it in my system . Its working perfectly...

    Try to relogin again...

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 02, 2011 at 06:44 AM

    Hi,

    U can use following code in second program u can use the submit keyword ur probelm will solved

    REPORT ZTEXT2.

    DATA : mem TYPE char10 .

    start-of-selection.

    submit ztext1 and return.

    get PARAMETER ID 'PARA_XXX' FIELD mem.

    WRITE : / 'mem from get ', mem.

    Thanks & Regards,

    MURALI I

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Jitendra Soni

      Hi Jitu,

      Are you executing the second program immediately after the first? See if adding a time delay will work.

      Regards,

      Nikolai

  • May 02, 2011 at 08:32 AM

    Hi,

    I think you have not defined this parameter. Look into table TPARA with SE16 for parameter 'PARA_XXX

    Regards,

    Klaus

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Jitendra Soni

      HI

      No Need to maintiain paramter ID in TPARA Table.

      I have created two program with same Para ID = PARA_XXX its working fine .

      Please check following code =

      Program 1) =>

      DATA : mem TYPE char10 VALUE 'San'.

      set parameter id 'PARA_XXX' field mem.

      Press on Excute Button.

      Program 2) =>

      DATA : mem TYPE char10 .

      get PARAMETER ID 'PARA_XXX' FIELD mem.

      WRITE : / 'mem from get= ', mem.

      Press On Excute Button

      O/p => San

      Please check system settings with BASIS Team.

  • avatar image
    Former Member
    May 02, 2011 at 09:41 AM

    Hi Jitu,

    when you use set parameter id 'PARA_XXX' field mem.

    PARA_XXX should be defined. you can see the definition in TPARA table. more over you can use standard parameter id which are there for material and all just for testing purpose.

    thanks..

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 02, 2011 at 10:15 AM

    Hi Jitu,

    The same code i tried here, its working fine.

    You just try in debugging mode, whether sy-subrc = 0 or not after 'SET PARAMETER ID'.

    Thanks,

    Radhika

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 07, 2011 at 08:31 AM

    Iu2019ve had an issue like yours. Two programs communicated through SAP memory. There were undefined delays in setting parameter values, sometimes there was no change at all.

    However, when i added parameter id to table TPARA (tr. SM30), this issue disappeared.

    See whatu2019s written in SAP Help:

    u201CIn a program, SPA/GPA parameters can only be created or assigned values if a name exists for them in the table TPARA. The extended program check reports an error if it can statically determine that a name specified in pid is not contained in the database table TPARA.u201D

    Maybe it works also without TPARA, but without any warranty.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 07, 2011 at 10:39 AM

    Hello,

    SET/GET parameters can generate problems when you want pass a value from a program to another one. If an execution of the same program is running in another mode of the same user, can be conflicts.

    We recommend use IMPORT/EXPORT MEMORY. It's similar to set/get parameters but it only is save for one session. You don't need register the memory in any table.

    EXPORT name_field TO MEMORY ID 'ZXXXXX' .

    IMPORT name_field FROM MEMORY ID 'ZXXXX'.

    It is important that the name of the fields in import and export are the same.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 07, 2011 at 12:24 PM

    try using IMPORT and EXPORT as it works in SAP MEMORY where SET/GET works in program memory and every program has its own memory.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      This is big mistake and situation is reverse!

      "EXPORT/IMPORT...MEMORY ID" uses ABAP memory and supports communication between internal sessions. SET/GET PARAMETER ID uses SAP memory and supports communication between main and internal sessions.

  • Jun 09, 2011 at 01:24 PM

    It is necessary to free the memory first so try:

    free memory id: 'PARA',

    then try your SET and GET statements.

    This error can sometimes occur after upgrades.

    Add comment
    10|10000 characters needed characters exceeded