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: 

Issue with freeing Memory ID

Former Member
0 Kudos

Hello All ,

I am facing a serious issue with deleting the memory id .They are giving me tough time

I am using the below syntax to export the internal tables to ABAP memory using statement ,

Export gt_trade to gt_trade from shared buffer indx(pt) id 'ZIMT' .

I am importing the above data and deleting the memory id with the below two statements .

free memory id 'ZIMT'.

delete from memory id 'ZIMT'.

Both of them are not working .

This non clearing of data is creating problems for me .Any one has solution to this problem??

Thanks ,

Nugur.

7 REPLIES 7

karol_seman
Active Participant
0 Kudos

it should work but if you are still facing problems, then use again EXPORT command with value space and it is overwritten


EXPORT space TO MEMORY ID <id>.

You can also try to use command


FREE MEMORY.

Regards,

Karol

awin_prabhu
Active Contributor
0 Kudos

Hi Hemanth,

After importing, try to free memory using following statement,

DELETE FROM SHARED BUFFER indx(pt) ID 'ZIMT'.

Thanks,

Former Member
0 Kudos

Hi,

Try using

DELETE FROM SHARED MEMORY indx(pt) ID 'ZIMT' or

DELETE FROM SHARED BUFFER indx(pt) ID 'ZIMT'.

former_member387317
Active Contributor
0 Kudos

Hi Hemanth,

Ary you checking SY-SUBRC value after executing DELETE ??

sy-subrc Meaning

0 The specified data cluster was found and deleted.

4 The specified data cluster was not found.

Try using {SHARED BUFFER dbtab(ar) [CLIENT cl] ID id} }. option with DELETE

Refer ABAP Keyword help for it...

Syntax

DELETE FROM { {MEMORY ID id} 
            | {DATABASE      dbtab(ar) [CLIENT cl] ID id} 
            | {SHARED MEMORY dbtab(ar) [CLIENT cl] ID id} 
            | {SHARED BUFFER dbtab(ar) [CLIENT cl] ID id} }.

Effect

This statement deletes a data cluster that was stored in the ABAP memory, in a database table, or in an application buffer of the application server by the statement EXPORT. The data cluster is identified by its ID id and, except in the case of the ABAP memory, by the name of a database table dbtab, a range ar, and an optional client cl. The same rules apply to dbtab, ar, cl, and id as apply when accessing the appropriate repository with the IMPORT statement.

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

ilesh Nandaniya

Former Member
0 Kudos

hi Hemanth,

Check this code, it worked for me

Exporting to INDX tablle.

data: indxkey like indx-srtfd value 'KEYBANFN'.

types: begin of ty_export,

banfn type eban-banfn,

idnlf type eban-idnlf,

end of ty_export.

data :lt_banfn type table of ty_export,

wa_banfn type ty_export.

clear wa_banfn.

wa_banfn-banfn = gv_preq_no.

wa_banfn-idnlf = gv_huid.

append wa_banfn to lt_banfn.

clear wa_banfn.

export lt_banfn to

database indx(st) id indxkey.

if sy-subrc ne 0.

  • do nothing

endif.

refresh lt_banfn.

endif.

Now in another program,.

types: begin of ty_export,

banfn type eban-banfn,

idnlf type eban-idnlf,

end of ty_export.

data :lt_banfn type table of ty_export,

wa_banfn type ty_export,

indxkey type indx-srtfd value 'KEYBANFN'.

clear lt_banfn[].

import lt_banfn from database indx(st) id indxkey.

clear : wa_eban,wa_banfn.

loop at gt_eban into wa_eban.

read table lt_banfn into wa_banfn with key banfn = wa_eban-banfn.

if sy-subrc eq 0.

gv_huid = wa_banfn-idnlf.

endif.

clear : wa_eban,wa_banfn.

endloop.

DELETE

delete from database indx(st) id indxkey.

reagads

Mohinder Singh Chauhan

Former Member
0 Kudos

Hello All ,

Yeah ,SAP FAN ,JK and ilesh ...all of you are right ..

Its workng for me now .

Many thnks .

Nugur .

Former Member
0 Kudos

Hi Hemanth Kumar


If you export to buffer you also need to delete from buffer

You're example:

Export gt_trade to gt_trade from shared buffer indx(pt) id 'ZIMT' .

delete from memory id 'ZIMT'.

Should be:

Export gt_trade to gt_trade from shared buffer indx(pt) id 'ZIMT' .

delete from shared buffer indx(pt) id 'ZIMT'.

Regs Dennis