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: 

Do SET/GET parameters share between different background tasks?

Former Member
0 Kudos

Hello!

I use batch input program for data migration. There are no good messages with msgv* parameters, so I have to use GET PARAMETER ID statement for getting new object id. Everything is fine, but to improve performance I want to run several background threads simultaneously. And I'm not sure now if it is possible to share values between different background threads (of the same user). In my case it is very important (for data consistency).

Does anyone know for sure?

Any links?

Thank you in advance!

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Neither SAP Memory nor ABAP Memory will fulfill you request.

SAP memory is a memory area to which all main sessions within a SAPgui have access.

ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements.

(ref [Passing Data Between Programs|http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9df735c111d1829f0000e829fbfe/frameset.htm]) So try other [Storage Media for Data Clusters|http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb3bc4358411d1829f0000e829fbfe/content.htm] like DATABASE or SHARED MEMORY/BUFFER ([cross-transaction application buffer|http://help.sap.com/abapdocu_70/en/ABENCROSSTRANS_APP_BUFFER_GLOSRY.htm])

Of course, as you mention "background tasks", you could use [CALL FUNCTION - STARTING NEW TASK|http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_STARTING.htm] [{PERFORMING subr} {CALLING meth} ON END OF TASK |http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_STARTING.htm#&ABAP_ADDITION_2@2@] so the tasks return information to a main task central program.

Regards,

Raymond

PS: Sorry , i started inserting the links before i could see your post...

Edited by: Raymond Giuseppi on Jun 15, 2011 9:28 AM

4 REPLIES 4

Former Member
0 Kudos

Hi,

Since the SET/GET statments will use the SAP memory, i think, we cannot assure the consistancy of the data.

I think it will be better if you make use of the ABAP memory(Import/Export).

Regards

HM

matt
Active Contributor
0 Kudos

Please do not ask for links

You could use the shared memory buffer (Export to shared memory). The problem you may encounter here is that the shared buffer is application server specific.

The SAP solution for this kind of thing is to use a db table.

raymond_giuseppi
Active Contributor
0 Kudos

Neither SAP Memory nor ABAP Memory will fulfill you request.

SAP memory is a memory area to which all main sessions within a SAPgui have access.

ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements.

(ref [Passing Data Between Programs|http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9df735c111d1829f0000e829fbfe/frameset.htm]) So try other [Storage Media for Data Clusters|http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb3bc4358411d1829f0000e829fbfe/content.htm] like DATABASE or SHARED MEMORY/BUFFER ([cross-transaction application buffer|http://help.sap.com/abapdocu_70/en/ABENCROSSTRANS_APP_BUFFER_GLOSRY.htm])

Of course, as you mention "background tasks", you could use [CALL FUNCTION - STARTING NEW TASK|http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_STARTING.htm] [{PERFORMING subr} {CALLING meth} ON END OF TASK |http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_STARTING.htm#&ABAP_ADDITION_2@2@] so the tasks return information to a main task central program.

Regards,

Raymond

PS: Sorry , i started inserting the links before i could see your post...

Edited by: Raymond Giuseppi on Jun 15, 2011 9:28 AM

0 Kudos

Thank you, Raymond,

you posted a very helpful SAP help reference, where it is stated that:

SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program at the time of logon using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The most frequent use of SPA/GPA parameters is to fill input fields on screens (see below).

But background jobs are not mentioned at all. My original question was: "do they have separate SAP memory?" So I relied on it...