EXPORT/IMPORT  to MEMORY

Hi,
I want to know if a parameter ID  of "export/import to memory" instruction is available in two differents session with different user's login?
tks
Carlos

The use of the shared buffer may be of some interest to you.
<b>From F1 help</b>
<i>EXPORT obj1 ... objn TO SHARED BUFFER dbtab(ar) ID key.
Additions:
1. ... = f (for each field you want to export)
2. ... FROM f (for each field you want to export)
3. ... CLIENT g (before ID key)
4. ... FROM wa (as last addition or after dbtab(ar))
In an ABAP Objects context, a more severe syntax check is performed that in other ABAP areas. See Implicit field names not allowed in clusters and Table work areas not allowed.
Effect
Stores a data cluster in the cross-transaction application buffer.The specified objects obj1 ... objn (fields, structures, or tables) are stored as a single cluster in the buffer.
The specified table dbtab must have a standard structure.
The buffer area for the table dbtab is divided into various logically-related areas (ar, two-character ID).
You can export a collection of data objects (data cluster) to an area of the buffer under a key of your own choosing (key field).
You can import individual data objects from this collection using the IMPORT statement (as long as the data has not been deleted from the buffer).
Notes
In classes, you must always specify explicit names for the data objects. Addition 1 or addition 2 is therefore obligatory.
In classes, you must always specify the work area explicitly. Addition 4 is therefore obligatory.
The table dbtab that you specify after SHARED BUFFER must be declared under TABLES (except in addition 4).
You cannot export the header line of an internal table. If you specify the name of an internal table with a header line, the system always exports the actual table data.
You cannot export data, object, and interface references.
Please consult Data Area and Modularization Unit Organization documentation as well.
Example
Exporting two fields and an internal table to the buffer with structure INDX:
TABLES INDX.
TYPES: BEGIN OF ITAB3_TYPE,
          CONT(4),
       END OF ITAB3_TYPE.
DATA: INDXKEY LIKE INDX-SRTFD VALUE 'KEYVALUE',
      F1(4), F2 TYPE P,
      ITAB3 TYPE STANDARD TABLE OF ITAB3_TYPE WITH
                 NON-UNIQUE DEFAULT KEY INITIAL SIZE 2,
      WA_INDX TYPE INDX.
Fill data fields before CLUSTR
before the actual export
INDX-AEDAT = SY-DATUM.
INDX-USERA = SY-UNAME.
Export data.
EXPORT F1    FROM F1
       F2    FROM F2
       ITAB3 FROM ITAB3
       TO SHARED BUFFER INDX(ST) FROM WA_INDX ID INDXKEY.
Addition 1
... = f (for each object you want to export)
Effect
Exports the contents of the field f and stores them under the specified name.
Addition 2
... FROM f (for each field you want to export)
Effect
Exports the contents of field f and stores them under the specified name.
Addition 3
... CLIENT g (before ID key)
Effect
The data objects are stored in client g (as long as the import/export table dbtab is client-specific).
Addition 4
... FROM wa (as last addition or after dbtab(ar))
Effect
Use this addition if you want to store user data fields in the application buffer. Instead of the table work area, the system uses the specified work area wa. The specified work area must have the same structure as the table dbtab.
Example
DATA WA LIKE INDX.
DATA F1.
WA-AEDAT = SY-DATUM.
WA-USERA = SY-UNAME.
WA-PGMID = SY-REPID.
EXPORT F1 = F1 TO SHARED BUFFER INDX(AR)
               CLIENT '001' ID 'TEST'
               FROM WA.
Note
Catchable runtime error
EXPORT_BUFFER_NO_MEMORY: The EXPORT data cluster is too big for the application buffer. This error should not occur often, since the buffer uses a procedure similar to the LRU(Least Recently Used) procedure to monitor the buffer contents. However, if the error does occur, you can increase the profile parameter rsdb/obj/buffersize (see Profile Parameter Attributes), which may help.</i>
Regards,
Rich Heilman

Similar Messages

  • Export / Import   to memory Id 2 . ( Unicode System)

    hi all ,
    we get unicode syntax error for the statement
       EXPORT d1200  TO MEMORY ID 2.
    Error discription is -
    2 must be a character-type field (data type C, N, D, or T) . "INTERFACE".
    We get similar error in import statement as well.
    Please refer this code ..........
    DATA:  BEGIN OF d1200,
             form    LIKE mard-matnr,
             formbez LIKE makt-maktx,
             labst(10),
             zeichnr LIKE drad-doknr,
             zeichnr1 LIKE drad-doknr,
             produktion_brutto(08) TYPE p, " (16) type c
             reparatur(08) TYPE p,
             zaehlerstand(16),
             maxprod(08) TYPE p,
             kapazitaet(06) TYPE p DECIMALS 2,
             hoehe(07),
             gewicht(07),
             netto-gesamt(07) TYPE p,
             ausschuss-gesamt(07) TYPE p,
             brutto-gesamt(07) TYPE p,
           restmenge(07) TYPE p,
    *mico20000430
    *notwendig für korrekte Anzeige in Druckliste
             restmenge(08) TYPE p,
             datenuebernahme(16),
             menge(08) TYPE p decimals 0 ,
             maxprod2(08) TYPE p decimals 0,
             umwertung(08) TYPE p decimals 0,
             ohnefa(08) TYPE p decimals 0,
             charge like mchb-charg,
             fhmnr LIKE mara-matnr,
           END   OF d1200.
    EXPORT d1200  TO MEMORY ID 2.

    Unicode systems have a problem in that you can't define stuff as type X. Structures also have to be properly "bounded".  You can also no longer rely on code such as field1+7(9) .
    You could define your structure as a STRING and delimit the fields with say a tab symbol ( use the attribute in cl_abap_utilities to get the tab char in a unicode system).
    export the string to memory.
    on the import end use the SPLIT command on the string to re-create your data elements.
    You will then have to manage the decimal arithmetic yourself.
    It's a pain - but that's largely the point of Unicode --everything is treated as TYPE C.
    Structures containing anything other than type C data are also a real problem if you want to upload / download data. Handling Binary files is a nightmare.
    There are some SAP supplied utilities  / notes / documentations on converting to a Unicode system.
    Cheers
    jimbo

  • Export- Import to Memory Query

    Hello Everyone,
    I have 2 FMs where one exports variable to memory and other FM imports the same .
    FM A:
      DATA: id    TYPE c LENGTH 10 VALUE 'SWITCH_WO',
            id1   TYPE c LENGTH 10 VALUE 'SWITCH_OP'.
      EXPORT   g_workorder from g_workorder  TO MEMORY ID  id.
      EXPORT   g_operation from g_operation  TO MEMORY ID  id1.
    FM B:
    DATA: id    TYPE c LENGTH 10 VALUE 'SWITCH_WO',
            id1   TYPE c LENGTH 10 VALUE 'SWITCH_OP'.
      IMPORT g_workorder   FROM MEMORY ID  id.
      IMPORT g_operation   FROM MEMORY ID  id1.
    When it export Sy-subrc is 0 but when i import it is 4 , where  can i check memory variable in new debugger.
    Please let me know ,
    Regards,
    Raj

    Hello,
    You can use the Import and export to Memory Id only with the programs and FM which runs in the same session, because that memory is only available in the same session of the memory. Once you have imported say a internal table/work area to some memory id and the session ends the memory is cleared by the Garbage Collector.
    In your case you are using 2 FM each running in different session, Import and Export to memory id will not work for you (as said it works in a single session). Try to use concepts of Shared Memory Object or populate a table (Custom table) and try to retrieve the same from 2nd FM.
    Hope it helps.
    Thanks,
    Jayant

  • EXPORT/IMPORT TO MEMORY ID

    Hi,
    I'm using FM EXIT_SAPLV51S_001.(USER EXIT)
    In the row :
    EXPORT sy-uzeit TO MEMORY ID 'YTIME'.
    I got sy-subrc = 4.
    Why??? What is the problem?
    Thanks
    DIANA

    Hi,
    try this in user exit.
    data: v_time type sy-uzeit.
    <b>GET TIME.</b>
    V_time = sy-uzeit.
    EXPORT v_time TO MEMORY ID 'YTIME'.
    GET TIME is must.
    Regards
    vijay

  • Export / Import  from Memory in background.

    Hi,
    I have a trouble and I dont know very well how to solve it.
    I have a Z report running in background, and this report uses a SUBMIT to call another one.
    Before the SUBMIT, there is an EXPORT to memory sentence; and the second report read this memory cluster and works with the data; but it doesnt work.
    When I execute online, there is no problem, and the 2nd report shows an ALV with data exported in 1st report, but in background, nothing is shown.
    Could you give me some help?
    A lot of thanks!

    Hello Alvaro,
    This is simple. There are two types of memories in SAP. ABAP and SAP memory. These memories have some properties. ABAP memory remains active as long as the program is in the same session. When ever there is a new session the old ABAP memory get refreshed, and a new ABAP memory comes into picture.
    In your case, before submitting the program to some other program you are exporting the value. Export will transfer the value to the ABAP memory. And after that you are submitting the program so a new session is being created and the ABAP memory is refreshed and so when you import that value you will get nothing.
    So in order to solve the matter. Find a data element whose parameter ID you can set or you can create a custom data element witha  custom parameter id and use that parameter id. Use the GET / SET parameter id to set or get the values. In that case the value is being stored at the SAP memory instead of ABAP memory.
    You can have a look the following site for the custom parameter ID creation:
    http://www.****************/Tutorials/ABAP/ParameterID/custom.htm
    Rewards points if found useful.
    Regards.
    Abhijit.

  • Export/Import from Memory

    Sometimes after I export from one program, user exit, etc., then I import in another program, user exit, etc. the field value does not show up. It is usually in two totally unrelated programs, or other, that are in different function groups, but sometimes it works? I need to capture a value in a PAI screen, that later  goes into another user exit. Has anyone had this issue with Import/Export? Is there another way I can tru to pass this parameter to the second program?
        Thank-You.

    Hi TMM,
    You have to consider that the Memory Variables from Program 1 will be released if the session is over and that's why maybe our Program 2 might not get them correctly. If that is the scenario you will need to save your data in maybe a table then use it in program 2.
    Regards,
    Gilberto Li

  • Export/Import Free Memory

    Dear all,
    is there a function or transaction or command where I can see which memorys are aktiv ?
    At the moment we are using Free Memory without ID, but so we delete them all.
    I need something that I can see a overview which memory is at the moment aktiv.
    Thanks for a tip.

    Hi,
    I think that  by  link given below  you will deffinately find the solution of your question.
    The Link is:
                     http://help.sap.com/saphelp_nw04/helpdata/en/02/96283e538111d1891b0000e8322f96/frameset.htm
    Thanks And Regards
    Sarita Singh Rathour

  • Issue with Memory ID export / import

    Hi Experts,
    We are facing strange issue during export/import from memory ID.
    We are exporting value to Memory ID from module pool program and trying to import same value in SAP workflow method.
    While importing the value from memory ID it is failing to import and gives sy-subrc =4.
    Any idea how can we do export/import in module pool program to Workflow method?
    Regards,
    Sanjana

    Hi sanjana,
    Please check the link. Here you can find some examples also.
    http://wiki.scn.sap.com/wiki/display/Snippets/Import+and+Export+to+Cluster+Databases
    P.S
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3bf8358411d1829f0000e829fbfe/content.htm
    You just need to create a key and an ID to save data into INDX table.Once its saved you can use same key and id to import .
    Again mentioning , dont forget to delete using same key and ID once you have imported else it may give error.
    Regards,
    Sandeep Katoch

  • EXPORT - IMPORT in BACKGROUND JOB

    Hello ABAP Gurus,
    There are two programs I am using.
    In 1st Program I am Exporting the Data to the ABAP Memory and then after that scheduling the second program in background from 1st Program through
    1 ) JOB_OPEN
    2 ) SUBMIT
    3 ) JOB_CLOSE
    Now I am trying to Import the data that is Exported in the second program which is scheduled in background.
    But I am not able to Import it.
    My question is that - Does EXPORT - IMPORT Statements works in such scenario when background job is scheduled.
    As it is working fine if, I only submits and does not put in the Background  JOB.
    Looking forward for the answer.
    Helpful answers will definately be awarded.
    Thanks in Advance
    Sudhanshu Garg

    Hi Sudhanshu,
    Export/import to memory uses ABAP memory which will not be accessible by the background job.
    No need of creating the structures in dictionary
    You can use the Table INDX for storing your data in the database.
    See the link below for an example.
    http://help.sap.com/saphelp_45b/helpdata/en/34/8e73a36df74873e10000009b38f9b8/content.htm

  • Issues with Export/Import using Database & Shared buffer

    Hi All,
    I have a method that calls a program via a job and I am having issues passing data between the two.
    Note that two different users process the method and program (via job) resp. This is how I am calling the second prog-
    SUBMIT ZPROGRAM
                 VIA JOB     l_jobname
                     NUMBER  l_jobcount
                     USER    i_user
                 AND RETURN.
    I need to pass data from method to  the second program and vice versa and then the method continues its processing with the data acquired from the second program.
    I have tried using Import/Export using database and also shared buffer. What I have found is that most of the times I am able to pass data from method to program. However the job takes a couple of min to execute and I think that the data is not making back to the method in time.
    I have looked at some useful forum links-
    Problem with export/import in back ground
    Re: EXPORT/IMPORT  to MEMORY
    but havent been able to find an answer yet. Any solution? Thanks in advance for your help!
    Liz

    Hi Suhas, Subhankar
    I have tested the scenario without the job previously itself and it works. Thats the reason, i am trying with the job now as my requirement is that I need to change the user while executing the second report.
    Here is an example of my import/export - I am passing the return value from the second report to the first.
    Code in second report-
    DATA: INDXKEY LIKE INDX-SRTFD VALUE 'RET1'.
    INDX-AEDAT = SY-DATUM.
    INDX-USERA = SY-UNAME.
    EXPORT RETURN1 TO SHARED BUFFER INDX(ST) ID INDXKEY.
    Code in first report -
    SUBMIT ZPROGRAM
                     VIA JOB     l_jobname
                         NUMBER  l_jobcount
                         USER    i_user
                     AND RETURN.
    Once Job close FM is executed successfully, I import the values as follows
    IMPORT RETURN1 TO RETURN1 FROM SHARED BUFFER INDX(ST) ID INDXKEY3.
    INDXKEY is having value RET1.
    However Return1 is not having any values in first report. It has some value in executed without the job
    Please note that I have tried Export/import with Database too and I am getting the same results.
    Thanks for your suggestions.
    Regards, Liz

  • Memory Limitation on EXPORT & IMPORT Internal Tables?

    Hi All,
    I have a need to export and import the internal tables to memory. I do not want to export it to any data base tables. is there a limitation on the amount of memroy that is can be used for the EXPORT & IMPORT. I will free the memory once I import it. The maximum I expect would be 13,000,000 lines.
    Thanks,
    Alex (Arthur Samson)

    You don't have limitations, but try to keep your table as small as possible.
    Otherwise, if you are familiar with the ABAP OO context, try use Shared Objects instead of IMPORT/EXPORT.
    <a href="http://help.sap.com/saphelp_erp2004/helpdata/en/13/dc853f11ed0617e10000000a114084/frameset.htm">SAP Help On Shared Objects</a>
    Hope this helps,
    Roby.

  • Import/Export code using Memory ID in BO Method

    Hi experts,
    I am having a approver name and other relevant data in my report. I don't want to write the entire code I want to bring it into my BO method by using import/export memory id. Pl. guide me what should I do ? Is it possible or not?
    Thank you,
    Saquib

    I am a bit confused that what you are trying to achieve. In any case I think you can forget any export/import memory ID related solutions - they will not work!
    The workflow (or its step/task) is executing your BO method, right? You want this method to have some data when it gets executed? Normally you would want to populate the data to the workflow (or task) container, for example with function SAP_WAPI_WRITE_CONTAINER (you just need the work item ID). Then when this data is in the container, you can use it in your method (binding required).
    Somehow I feel that you looking a difficult solution for a simple problem. If you need some relevant data in your workflow, let the workflow to find it (add a new step to the workflow, and copy/paste the relevant part of the code of your report to this step). (Or try to give the data to the workflow already when it gets started, if possible). Don't try to mix things with some separate report, unless it is completely necessary, and if it is, then writing into the container is most likely the best approach.
    Regards,
    Karri

  • Export and Import in memory Id

    Hi ,
    I have a requirement to import the 90,000 records into memory id.
    Is there any limitation for the amount of data which we are importing and exporting to the memory ID ?
    or can i Export this huge amount of data into memory ID and Import it as required.
    Kindly respond as soon as possible.
    Its very Urgent.
    Thanks & Regards,
    Poonam

    Hi Poonam,
    Export to memory option stores the data into your ABAP memory.
    So the maximum amount of data that you can store using EXPORT is dependent on how much ABAP memory your system is having.
    Hope this will help you.

  • Export/import memory ID in OO

    I tried to use the conventional way of EXPORT itab TO MEMORY ID 'itab' and
    IMPORT itab FROM MEMORY 'itab' but it is not working in object oriented environment. How to write the correct syntax in object oriented environment?
    Thanks

    Hi..
    Internal table with Header line is not Supported in ABAP OO.
    So it may be the reason why you are getting an error.
    Declare your ITAB without header line.
    Try the Same code.
    <b>reward if Helpful</b>

  • How to Export data to memory and Import data from memory?

    hi
    I have the follwoing some code of program.
    The data is not filled from memory. I have to find what is the wrong in code.
    REPORT ZIFT_TEST1..
    SELECT-OPTIONS : so_budat FOR bkpf-budat,
                     sd_saknr FOR ska1-saknr.
      EXPORT so_budat TO MEMORY ID 'ZBUDAT'.
      EXPORT sd_saknr TO MEMORY ID 'ZSAKNR'.
      SUBMIT ZIFT_TEST2 AND RETURN.
    REPORT ZIFT_TEST2..
    SELECT-OPTIONS so_budat FOR bsis-budat NO DATABASE SELECTION.
    SELECT-OPTIONS: SD_SAKNR    FOR  SKA1-SAKNR MATCHCODE OBJECT SAKO.
      import so_budat = so_budat from memory id 'ZBUDAT'.
      import sd_saknr from memory id 'ZSAKNR'.
    Regards
    Iftikhar Ali
    Islamabad.

    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.

Maybe you are looking for