I am updating value of my created SHARED MEMORY via JOB. I am deleting/freeing the SHARED MEMORY during initialization but seems like it is not deleting what's on the SHARED MEMORY because I still able to IMPORT data from the SHARED MEMORY during the first iteration of the loop below.
I have already tried researching and found some facts about shared memory like, share memory can be accessed by multiple users and sessions. I also suspected the different application server and also thought of username changing during background run which may affect the 'delete'--but still do not answer my issue because I cannot observe behavior during debug.
"Program 1: Run via job
DELETE FROM SHARED MEMORY vari(tl) ID 'MY' && sy-uname.
DO 3 TIMES.
SUBMIT program 2 WITH xxx VIA JOB AND RETURN.
ENDDO.
"Program 2: Run via Job
START-OF-SELECTION.
IF sy-calld EQ 'X'.
IMPORT var TO var FROM SHARED MEMORY vari(tl) ID 'MY' && sy-uname.
ENDIF.
IF var IS INITIAL.
SELECT fld1, fld2, fld3
FROM table
INTO TABLE var
WHERE cond EQ value.
IF sy-called EQ 'X'.
EXPORT var FROM var TO SHARED MEMORY vari(tl) ID 'MY' && sy-uname.
lt_var = var.
ENDIF.
ENDIF.
IF lt_var IS INITIAL.
"Raise error.
ELSE.
"Further processing...
ENDIF.
In my 'program 2' above, I am expecting that 'var' IMPORTED from SHARED MEMORY will not have value when it passes the first iteration of my loop since I initialized it in 'program 1'.
I am expecting SHARED MEMORY to have data on it after the first iteration.
Are there any locking considerations during delete from shared memory or do multiple servers affect the delete. Please advise. Thank you so much.