2009 Jan 22 10:02 AM
Hi All,
I am running two programs in background from program1
Eq: Program1 --> Calls 2 programs
Program1_01.(First Program)
Program2_01(Second Program).
Programs1 schedules Program1_01 and Program1_02 in background. These two programs are interdependent.
Program1_01 extracts data, evaluates and sets the Flag. This Flag is exported to SAP Memory using
Set parameter id 'p_id_flag' field Flag.
Program1_02 checks for Program1_01 is completed in background. If complted gets the Flag value from SAP Memory using "Get paramter id 'p_id_flag' field Flag.
When i checked this is not happning. When saw Flag in Program1_01 is set as Flag = 'X'.
When I came and checked in Program1_02 after Get Parameter statement Falg value is SPACE.
Cn hlp on this?
Hi All,
I am running two programs in background from program1
Eq: Program1 --> Calls 2 programs
Program1_01.(First Program)
Program2_01(Second Program).
Programs1 schedules Program1_01 and Program1_02 in background. These two programs are interdependent.
Program1_01 extracts data, evaluates and sets the Flag. This Flag is exported to SAP Memory using
Set parameter id 'p_id_flag' field Flag.
Program1_02 checks for Program1_01 is completed in background. If complted gets the Flag value from SAP Memory using "Get paramter id 'p_id_flag' field Flag.
When i checked this is not happning. When saw Flag in Program1_01 is set as Flag = 'X'.
When I came and checked in Program1_02 after Get Parameter statement Falg value is SPACE.
Cn hlp on this?
2009 Jan 22 10:08 AM
Hi,
Set parameter id 'p_id_flag' field Flag.
Check if the parameter id 'P_ID_FLAG' is defined the data element.
Use export and import otherwise.
regards,
Advait
2009 Jan 22 10:21 AM
parameter id 'P_FLAG_ID' is my own id.
How to check the id in data element level.
2009 Jan 22 10:23 AM
Hi,
you can get memory id of corresponding data element
from DD04L table.
2009 Jan 22 1:41 PM
parameter id 'P_FLAG_ID' is my own id.
You mean you have just defined it in the program? Then this will not work. GET/SET parameters should be defined in the data element only.
As I said earlier, use Export and Import instead.
regards,
Advait
2009 Jan 22 10:09 AM
and there is absolute certainty that nothing resets the flag in between ?
To ensure could you SET some standard parameter ID and check the results in your second program..
2009 Jan 22 10:48 AM
2009 Jan 22 10:54 AM
2009 Jan 22 11:16 AM
could please tell me y is it required to create in TPARA
This is copied from SAP help
In a program, only those SPA/GPA parameters can be read for which there is a name in the table TPARA. The extended program check reports an error, if it can be statically determined that an ID specified in pid is not in the table TPARA.
But I checked, even without creating parameter id in TPARA table SET/ GET statement works...
I think its good practice to create a parameter id and then use it.
coming to your problem....
I suppose you are creating two different job for each program. Try with single job with multiple steps in it. With multiple steps (program) in single job your SET/GET will work.
2009 Jan 22 11:19 AM
HI Praveen,
Parameter IDs have to be declared and defined in TPARA..only then can u use them..
If it has been used in your program then someone must have already done it..
however cross check and confirm it.
Also ensure that in SET & GET stmnts parameter id 'p_...'is mentioned in CAPS..
2009 Jan 22 11:36 AM
2009 Jan 22 11:40 AM
Goto trsansction SM30, enter TPARA and press maintain.. ignore the information message... on next screen put the PID name and press enter.. then follow few more screens ..
2009 Jan 22 12:09 PM
How to free the memory set using Set/Get statement.
I have used
Free Memory id 'P_FLAG_ID'.
2009 Jan 22 12:13 PM
Hi,
The problem simply lies in fact that pid was provided in lowercase.
Use:
SET PARAMETER ID 'P_ID_FLAG' FIELD flag.
...
GET PARAMETER ID 'P_ID_FLAG' FIELD flag.
It works fine then.
Note!
Though SAP claims it is mandatory to create pid in TPARA table, in fact this is not required. Each time SET PARAMETER is executed, system checks if data object P_ID_FLAG was defined in SAP memory. If not it will automatically create it for us. But be carefull here. If there is such data object, its value will be overwritten.
As for your last question, your statement (FREE MEMORY ....) is ok.
Regards
Marcin
Edited by: Marcin Pciak on Jan 22, 2009 1:14 PM
2009 Jan 22 12:14 PM
to clear th memory value i use SET command with blank value
CLEAR LV_FELD.
SET PARAMETER ID 'ZXXX' FIELD LV_FELD .
2009 Jan 22 12:15 PM
2009 Jan 22 2:14 PM
Hi,
I have created YFLG memory id in TPARA.
But still i am not get the values in Program2_01.
2009 Jan 22 2:48 PM
Hi,
Pardon my comments about the creation of memory ID. I always thought that the memory ID should be crated. But it seems that is not the case.
This code is working fine even without creating the memory id.
DATA flag TYPE c VALUE 'X'.
SET PARAMETER ID 'YFLG' FIELD flag.
CLEAR flag.
GET PARAMETER ID 'YFLG' FIELD flag.
WRITE flag.
So what you can do is to check if the memory id is getting set at all.
Set a break point on the statement SET PARAMETER of your program. once the break-point is reached, press F5, then in the menu GOTO>System Area>SAP Memory.
Area : SMEM and see the value of memory id 'YFLG'
regards,
Advait
2009 Jan 22 12:34 PM
HI Praveen,
Are you refreshing the memory before doing your validations and changing the value of flag?
If not then you have to refresh it by using
FREE MEMORY ID 'p_id_flag' .
Otherwise it will not refresh value and you will get the last stored value by GET statement.
Try using it, I had also experienced this type of problem which was resolved by refreshing the memory.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |