2010 Nov 02 3:40 PM
Hi SDNites,
I am using export and import to transfer tables between programs. Now I wanted to schedule 2 instances of the same pgm in background.
Can you please tell me in this case will there be overlapping of the same ABAP memory used or not. My call on this is that yes this will happen. If this is the case then what would be the resolution for the same i.e. how can I share data between two programs and also can schedule the 2 instances without any problem.
Regards,
Abhi
Edited by: Thomas Zloch on Nov 2, 2010 5:22 PM - somewhat misleading subject corrected
Hi SDNites,
I am using export and import to transfer tables between programs. Now I wanted to schedule 2 instances of the same pgm in background.
Can you please tell me in this case will there be overlapping of the same ABAP memory used or not. My call on this is that yes this will happen. If this is the case then what would be the resolution for the same i.e. how can I share data between two programs and also can schedule the 2 instances without any problem.
Regards,
Abhi
Edited by: Thomas Zloch on Nov 2, 2010 5:22 PM - somewhat misleading subject corrected
2010 Nov 02 3:52 PM
Hi Abhishek,
Yes you are correct there will be overlap of the Memory may be it is ok in Development but not in all the system. In this kind of scenario please save the data in 2 different Memory ID'S (Locations).
Please create the memory id dynamically like 2 different instances then 2 diiferent memory ID's like (JOBNAME)
Make the Jobname to PROGRAM_1 (1ST instance) PROGRAM_2 (2ND instance).
Your statement should be
EXPORT ITAB TO MEMORY ID JOBNAME.
EXPORT ITAB TO MEMORY ID JOBNAME.
And the Program using the SY-BATCH value and FM "GET_JOB_RUNTIME_INFO" get the jobname and use the IMPORT Statement using the MEMORY ID as your jobname and make sure that you will free this MEMORY ID.
IF NOT sy-batch IS INITIAL.
*--Function Module to get the Runtime Job details
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
IMPORTING
jobcount = v_jobcount
jobname = v_jobname
EXCEPTIONS
no_runtime_info = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
IMPORT ITAB FROM MEMORY ID V_JOBNAME.
FREE MEMORY ID V_JOBNAME.
ENDIF.
Let me know if you need anything else on this.
Regards,
Srinivas
2010 Nov 02 3:59 PM
Hi..
You can use instead a CALL FUNCTION 'ZFUNC_CUSTOM' WITH DESTINATION 'NONE' .. Pay attention to "Update Module" option in the attributes. This should be "Start Delayed" if you are calling in the background process.
Hope to be useful...
2010 Nov 02 4:03 PM
Hi
Abap memory works on session level, so if you schedule your program twice, those jobs will run in two different session, that means they can't see the same ABAP memory
Max
2010 Nov 02 4:19 PM
Hi Abishek,
There will be no overlapping as export and import memories scope is limited to the session lever only.
Hope this answer your query.
Regards
Bikas
2010 Nov 02 4:28 PM
Use Shared Memory.
link:[EXPORT TO MEMORY/DATABASE/SHARED BUFFER|http://help.sap.com/saphelp_45b/helpdata/en/34/8e73a36df74873e10000009b38f9b8/frameset.htm]
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |