Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with SET/GET Parameter id

jitendra_it
Active Contributor
0 Kudos

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

16 REPLIES 16

Former Member
0 Kudos

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...

0 Kudos

hi mihir6666,

I tried after relogin, but still it is not working.

Former Member
0 Kudos

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

0 Kudos

Hi Murli,

It should also work WITHOUT submit statement since I m accessing SAP Memory.

0 Kudos

Hi Jitu,

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

Regards,

Nikolai

former_member195402
Active Contributor
0 Kudos

Hi,

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

Regards,

Klaus

0 Kudos

Hi,

I think it is not necessary to maintain Parameter id in TPARA table.

0 Kudos

Hi,

try your programs with an existing parameter id, for example BUK, and you will see that your programs are working fine!

Regards,

Klaus

0 Kudos

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.

Former Member
0 Kudos

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..

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

0 Kudos

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.

former_member201275
Active Contributor
0 Kudos

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.