Application Development and Automation 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: 
Read only

MEMORY

Former Member
0 Likes
712

hai,

can u save internal table in sap memory from abap memory?

thank you

ASHOK KUMAR

5 REPLIES 5
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
688

Yes, you can. It is the same as any other variable.

Data: itab type table of mara.

export itab = itab to memory id 'TEST'.

import itab = itab from memory id 'TEST'.

Regards,

RIch Heilman

Read only

0 Likes
688

HAI RICH,

I THINK IT WILL SAVE INTERNAL TABLE IN ABAP MEMORY .NOT SAP MEMORY

THANK YOU

Read only

0 Likes
688

Why would you want to save an internal table in a parameter id?

Regards,

Rich Heilman

Read only

Former Member
0 Likes
688

hi,

by suing <b>SET PARAMETER ID <pid> FIELD <f>.</b> we can store internal table

in sap memoery.

This statement saves the contents of field <f> under the ID <pid> in the SAP memory. The code <pid> can be up to 20 characters long.

If the ID <pid> does not exist, double-click <pid> in the ABAP Editor to create a new parameter object.

regards,

Ashokreddy.

Read only

Former Member
0 Likes
688

See the Example program :

REPORT ZTEST_AMEM1.

tables : lfa1.

data : begin of i_lfa1 occurs 0 ,

lifnr like lfa1-lifnr,

name1 like lfa1-name1,

land1 like lfa1-land1,

end of i_lfa1.

start-of-selection.

select lifnr

name1

land1 from lfa1

into table i_lfa1 up to 100 rows.

  • Export

export i_lfa1 to memory id 'SAP'.

submit ztest_amem2 and return.

write:/ 'hello'.

&----


*& Report ZTEST_AMEM2

*&

&----


*&

*&

&----


REPORT ZTEST_AMEM2.

data : begin of j_lfa1 occurs 0,

lifnr like lfa1-lifnr,

name1 like lfa1-name1,

land1 like lfa1-land1,

end of j_lfa1.

start-of-selection.

import i_lfa1 to j_lfa1 from memory id 'SAP'.

loop at j_lfa1.

write:/ j_lfa1-lifnr,j_lfa1-name1,j_lfa1-land1.

endloop.