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

Export/Import to memory id

Former Member
0 Likes
9,239

Hi,

I have written following code in shilpment user_exit "EXIT_SAPLV56U_002"

DATA: TEST(5) type c value 'TEXT1'.

EXPORT I_XVTTK TO MEMORY ID TEST.

and i am importing I_XVTTK table in delivery user_exit "EXIT_SAPLV09A_002'.

DATA : TEST(5) TYPE c VALUE 'TEXT1'.

DATA : BEGIN OF I_XVTTK OCCURS 0.

INCLUDE STRUCTURE vttkvb.

DATA : END OF I_XVTTK.

IMPORT I_XVTTK FROM MEMORY ID TEST.

but the I_XVTTK structure is comming blank.

Can anyone tel me why this is happening....

Thanks

1 ACCEPTED SOLUTION
Read only

former_member189059
Active Contributor
2,289

Hello Shilpa,

use this to export and import tables


  data: wa_indx type indx.
  
  export tab = itab to database indx(xy) from wa_indx client
    sy-mandt
    id 'DETAILLIST'.


* to import 
  data: wa_indx type indx.
  import tab = itab from database indx(xy)
   to wa_indx client sy-mandt id 'DETAILLIST'.

* deletes the data to save wastage of memory
    delete from database indx(xy)
      client sy-mandt
      id 'DETAILLIST'.

Hi,

I have written following code in shilpment user_exit "EXIT_SAPLV56U_002"

DATA: TEST(5) type c value 'TEXT1'.

EXPORT I_XVTTK TO MEMORY ID TEST.

and i am importing I_XVTTK table in delivery user_exit "EXIT_SAPLV09A_002'.

DATA : TEST(5) TYPE c VALUE 'TEXT1'.

DATA : BEGIN OF I_XVTTK OCCURS 0.

INCLUDE STRUCTURE vttkvb.

DATA : END OF I_XVTTK.

IMPORT I_XVTTK FROM MEMORY ID TEST.

but the I_XVTTK structure is comming blank.

Can anyone tel me why this is happening....

Thanks

5 REPLIES 5
Read only

Former Member
0 Likes
2,289

Hi,

Here iam giving sample code for your reqt.please replace like this.It will work.

-


Program1----


REPORT demo_program_rep3 NO STANDARD PAGE HEADING.

DATA: number TYPE i,

itab TYPE TABLE OF i.

SET PF-STATUS 'MYBACK'.

DO 5 TIMES.

number = sy-index.

APPEND number TO itab.

WRITE / number.

ENDDO.

TOP-OF-PAGE.

WRITE 'Report 2'.

ULINE.

AT USER-COMMAND.

CASE sy-ucomm.

WHEN 'MBCK'.

EXPORT itab TO MEMORY ID 'HK'.

LEAVE.

ENDCASE.

-


Program2----


REPORT demo_programm_leave NO STANDARD PAGE HEADING.

DATA: itab TYPE TABLE OF i,

num TYPE i.

SUBMIT demo_program_rep3 AND RETURN.

IMPORT itab FROM MEMORY ID 'HK'.

LOOP AT itab INTO num.

WRITE / num.

ENDLOOP.

TOP-OF-PAGE.

WRITE 'Report 1'.

ULINE.

-


end of program 2----


Now you copy this programs with same name as i mentioned and execute demo_programm_leave Program.you will understnad clearly.

Notes::: A logical memory model illustrates how the main memory is distributed from the view of executable programs. A distinction is made here between external sessions and internal sessions .

An external session is usually linked to an R/3 window. You can create an external session by choosing System/Create session, or by entering /o in the command field. An external session is broken down further into internal sessions. Program data is only visible within an internal session. Each external session can include up to 20 internal sessions (stacks).

Every program you start runs in an internal session.

To copy a set of ABAP variables and their current values (data cluster) to the ABAP memory, use the EXPORT TO MEMORY ID statement. The (up to 32 characters) is used to identify the different data clusters.

If you repeat an EXPORT TO MEMORY ID statement to an existing data cluster, the new data overwrites the old.

To copy data from ABAP memory to the corresponding fields of an ABAP program, use the IMPORT FROM MEMORY ID statement.

Change according to your requirements...

Regds

Sivaparvathi

Please reward points if helpful....

Read only

Vijay
Active Contributor
0 Likes
2,289

Hi

have you checked that

1. what all data is getting exported or whether there was data in structure or not at the time of exporting.

2. second is the structure declaration is same in both the exits ?

moreover u can refer to my blog on sdn related to this only.

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/2007/09/12/new+news

regards

vijay

reward points if helpfull

Read only

Former Member
0 Likes
2,289

Where you have declared ur Memory id "HK'.

Read only

former_member189059
Active Contributor
2,290

Hello Shilpa,

use this to export and import tables


  data: wa_indx type indx.
  
  export tab = itab to database indx(xy) from wa_indx client
    sy-mandt
    id 'DETAILLIST'.


* to import 
  data: wa_indx type indx.
  import tab = itab from database indx(xy)
   to wa_indx client sy-mandt id 'DETAILLIST'.

* deletes the data to save wastage of memory
    delete from database indx(xy)
      client sy-mandt
      id 'DETAILLIST'.

Read only

Former Member
0 Likes
2,289

Shilpa,

--->In your code variable I_XVTTK doe not have any

value.

-


>Why you are giving value to memory id TEST

See the Ex :

IN user exit user_exit "EXIT_SAPLV56U_002"

DATA: I_XVTTK(50) value 'Exporting'.

EXPORT I_XVTTK TO MEMORY ID 'TEST'

IN user exit user_exit "EXIT_SAPLV09A_002'.

DATA: I_XVTTK(50) .

IMPORT I_XVTTK FROM MEMORY ID 'TEST'.

Change like above and check it now

Don't forget to reward if useful....