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: 

Deleting memory ID with cl_abap_expimp_utilities=>mem_delete

Former Member
0 Kudos

Hi,


any idea why the memory data is still available even after the memory ID - that contains this data - was deleted?

Next, is there any way to find whether the memory ID was really deleted successfully? There is neither return code nor an exception risen in the method signature, so that we can only assume, in fact, that it was really deleted.

Only if I replace the 'memory ID'-specific deletion (method mem_delete) with the method for deletion of the whole ABAP memory ( cl_abap_expimp_utilities=>mem_delete_all( ).) then it works fine, but this is not desired as there can still be some other data to be used further in the program. This seems to me like a bug in method mem_delete. Am I missing something? Any idea?


Thank you

Michal


DATA:

  lv_exp       TYPE c LENGTH 1 VALUE 'A',

  lv_imp       TYPE c LENGTH 1,

  lv_directory TYPE tab_cdir,

  lv_id        TYPE char5 VALUE 'MY_ID'.

EXPORT p1 = lv_exp TO MEMORY ID lv_id.

* The data 'A' correctly exported

IMPORT p1 = lv_imp FROM MEMORY ID lv_id.

* The data 'A' correctly imported

cl_abap_expimp_utilities=>mem_delete(

  EXPORTING

    id          = lv_id ).

* cl_abap_expimp_utilities=>mem_delete_all( ). "This does the job, but it's far too powerful

CLEAR lv_imp.

IMPORT p1 = lv_imp FROM MEMORY ID lv_id.

* The data 'A' correctly imported - again! Should not the area 'MY_ID' be deleted already?

1 ACCEPTED SOLUTION

former_member197425
Active Participant
0 Kudos

Hi Michal,

Have you tried FREE MEMORY ID 'id name' statement for clearing memory ids ?..

Thanks,

Nandi

2 REPLIES 2

former_member197425
Active Participant
0 Kudos

Hi Michal,

Have you tried FREE MEMORY ID 'id name' statement for clearing memory ids ?..

Thanks,

Nandi

0 Kudos

Hi Nandi,

yes, I tried - and it works as expected. Then I simply think we should consider the method cl_abap_expimp_utilities=>mem_delete(...) not working properly.

Thanks

Michal