Import/Export Statement

Hi,
I want to import 2 internal tables (Declared with Header Line) and 1 variable from the memory. These 2 internal tables are exported separately at different points using separate Export Statements. I am not sure, why my Import statement is not working correct. Can you please give me the correct syntax?
Thanks in advance
Kannan.

Hi,
This code is from which program you want to export to the ABAP memory:          
   export ist_resb to memory id 'ZPPC0122_FD'.
             where ist_resb is the internal table name &
                   ZPPC0122_FD is the include name of my program ZPPC0122.
This code is from which program you want to import from the ABAP memory
        import *ist_resb *= ist_resb from memory id 'ZPPC0122_FD'.
              where  ist_resb This internal table is the importing program internal table.
                    ist_resb This internal table is the exporting program internal table.
But remember in both the program you have defined the same internal table with same structure
Refer this link-
IMPORT:
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3bde358411d1829f0000e829fbfe/content.htm
http://abaplovers.blogspot.com/2008/04/passing-data-from-one-abap-program-to.html
http://help.sap.com/saphelp_45b/helpdata/en/34/8e73a36df74873e10000009b38f9b8/content.htm
Check this
EXPORT an internal table  and  IMPORT an internal table in another program
Hope it will help you.
Regards,
Sujit

Similar Messages

  • Import/Export statement  not working..

    Hi all,
       I want to export some data from BADI & Import it back in user exit.
    I wrote following line of code in BADI
           export P1 FROM xstr to memory id 'ZABHI'.
    & following line of code in User Exit
          import P1 to xstr FROM memory id 'ZABHI'.
    After export sy-subrc becomes 0 hence export statement is working fine but when aftr import xstr remains blank.(sy-subrc = 4)
    I tried to execute same code in single ztest abap program & it works fine there.
    Thanks in advance.

    hi abhijeet,
    you are most welcome....
    to delete, use
    ** deletes the data to save wastage of memory
    delete from database indx(xy)
      client sy-mandt
      id 'ZABHI'.
    you need to delete it coz, its available to all programs in the R/3
    server via the ID and you don't want anybody to view the data u are
    sending into memory.
    the statement that u used earlier was program specific and hence
    not accessible to the user exit.
    Regards,
    Samson Rodrigues.

  • Help on import & export statement in moni table

    hi,
    thanks poornanand mandalika , serdar simsekler for providing help on moni table.
    now here is same more research on cluster data
    1. can we convert the import and export statement to simple select statement to extract data from moni table, thing is that i want to write report which extract data from moni as how import and export does?
    2. we have different cluster id such as DD,HK,... etc can you tell what this id means and how data store in cluster table.
    thanks,
    john

    Hello John,
    Here are the answers:
    1. No. You cannot use a simple SELECT statement on a cluster database. I mean, you will not get anything meaningful out of doing so (though it is syntactically possible).
    2. The two-character ID that you are talking about is a way of segregating the related information in a (any)
    cluster table. You would have to specify that, because it is a mandatory part of the syntax for the IMPORT statement.
    Coming to understanding the way data is stored, when the data was entered into the cluster table, it would have been done through an EXPORT statement. You will need to find out where that EXPORT statement was issued, and use the similar structure for the data recepients in the IMPORT statement.
    In a way, you can say that a cluster table can store data of any format(line-type) unlike an ordinary database table which has a particular structure , as defined in the data-dictionary (SE11). And this data is actually stored in the LRAW field of the table in a compressed format.
    For more information on MONI and Cluster tables, please search the forum for these keywords. there have been quite a lot of discussions in the past on these topics.
    Regards,
    Anand Mandalika.

  • Import/export statements

    hi all
    how to use inport and export statements in reports ?
    thanks & regards
    brahma

    <b>Import</b>
    TYPES: BEGIN OF OBJ_LINE,
            CLUSTERNAME(30),
            PROGRAMNAME(10),
          END OF OBJ_LINE,
          BEGIN OF B_LINE,
            FIELD_1    TYPE I,
            FIELD_2(1) TYPE N,
          END OF B_LINE.
    DATA: OBJ_TAB TYPE STANDARD TABLE OF OBJ_LINE,
          OBJ_WA  TYPE OBJ_LINE,
          B_PROG  TYPE STANDARD TABLE OF B_LINE,
          B_WA    TYPE B_LINE,
          A(10),
          C_PROG LIKE SYST.
    MOVE:  'A'    TO OBJ_WA-CLUSTERNAME.
    APPEND OBJ_WA TO OBJ_TAB. CLEAR OBJ_WA.
    MOVE:  'B'      TO OBJ_WA-CLUSTERNAME,
           'B_PROG' TO OBJ_WA-PROGRAMNAME.
    APPEND OBJ_WA TO OBJ_TAB. CLEAR OBJ_WA.
    MOVE:  'C'      TO OBJ_WA-CLUSTERNAME,
           'C_PROG' TO OBJ_WA-PROGRAMNAME.
    APPEND OBJ_WA TO OBJ_TAB. CLEAR OBJ_WA.
    <b>IMPORT (OBJ_TAB) FROM MEMORY ID 'ABCD'.</b>
    <b>export</b>
    TYPES: BEGIN OF OBJ_LINE,
             CLUSTERNAME(30),
             PROGRAMNAME(10),
           END OF OBJ_LINE.
    DATA: OBJ_TAB TYPE STANDARD TABLE OF OBJ_LINE,
          OBJ_WA  TYPE OBJ_LINE.
    TYPES: BEGIN OF B_LINE,
             FIELD_1    TYPE I,
             FIELD_2(1) TYPE N,
           END OF B_LINE.
    DATA: B_PROG TYPE STANDARD TABLE OF B_LINE.
    DATA: A(10),
          C_PROG LIKE SYST.
    MOVE:  'A'      TO OBJ_WA-CLUSTERNAME.
    APPEND OBJ_WA TO OBJ_TAB. CLEAR OBJ_WA.
    MOVE:  'B'      TO OBJ_WA-CLUSTERNAME,
           'B_PROG' TO OBJ_WA-PROGRAMNAME.
    APPEND OBJ_WA TO OBJ_TAB. CLEAR OBJ_WA.
    MOVE:  'C'      TO OBJ_WA-CLUSTERNAME,
           'C_PROG' TO OBJ_WA-PROGRAMNAME.
    APPEND OBJ_WA TO OBJ_TAB. CLEAR OBJ_WA.
    <b>EXPORT (OBJ_TAB) TO MEMORY ID 'ABCD'.</b>

  • IMPORT/EXPORT statement in Background Mode

    Hey dudes,
    I am facing a problem in my coding. I am dealing with coding in several events in IS-U, transaction FPY1.
    However, it's not so important ya. Now I am written some code on IMPORT and EXPORT some parameters between 2 program code. It's work very fine only in 'DEBUG MODE', but when it's running not debug mode (Is BACKGROUND MODE), coz it's massive run program.
    I suspect it's because of the background job. Does background job using ABAP Memory? IMPORT/EXPORT is only for dialog work process, not background work process?? I have a lot of question mark on my head now..
    Hope anyone facing dis issue before can help.
    Cheers,
    Isaac.

    Are you trying to pass data via EXPORT/IMPORT between two programs that are both running in background, or from an online session to a background process?... i.e. what are the two lots of program code that you are wanting to pass parameters between? 
    It would be fine for a background program to "export" data to a memory ID, then for the same batch program to submit another program that does the "import" from the same memory ID... but this method won't work for an online user doing an "export" and a batch job doing an "import" -> for this to work, you would need to persist the parameters so that the batch job can retrieve them.
    If you can explain the scenario a bit more, will try to offer more help...
    Jonathan

  • Use of IMPORT/EXPORT in methods

    Hi,
    Is it possible to use IMPORT/EXPORT statements in the methods which are part of BADI's.
    Thanks
    Rajavardhana reddy

    HI,
    Import
    TYPES: BEGIN OF OBJ_LINE,
            CLUSTERNAME(30),
            PROGRAMNAME(10),
          END OF OBJ_LINE,
          BEGIN OF B_LINE,
            FIELD_1    TYPE I,
            FIELD_2(1) TYPE N,
          END OF B_LINE.
    DATA: OBJ_TAB TYPE STANDARD TABLE OF OBJ_LINE,
          OBJ_WA  TYPE OBJ_LINE,
          B_PROG  TYPE STANDARD TABLE OF B_LINE,
          B_WA    TYPE B_LINE,
          A(10),
          C_PROG LIKE SYST.
    MOVE:  'A'    TO OBJ_WA-CLUSTERNAME.
    APPEND OBJ_WA TO OBJ_TAB. CLEAR OBJ_WA.
    MOVE:  'B'      TO OBJ_WA-CLUSTERNAME,
           'B_PROG' TO OBJ_WA-PROGRAMNAME.
    APPEND OBJ_WA TO OBJ_TAB. CLEAR OBJ_WA.
    MOVE:  'C'      TO OBJ_WA-CLUSTERNAME,
           'C_PROG' TO OBJ_WA-PROGRAMNAME.
    APPEND OBJ_WA TO OBJ_TAB. CLEAR OBJ_WA.
    IMPORT (OBJ_TAB) FROM MEMORY ID 'ABCD'.
    export
    TYPES: BEGIN OF OBJ_LINE,
             CLUSTERNAME(30),
             PROGRAMNAME(10),
           END OF OBJ_LINE.
    DATA: OBJ_TAB TYPE STANDARD TABLE OF OBJ_LINE,
          OBJ_WA  TYPE OBJ_LINE.
    TYPES: BEGIN OF B_LINE,
             FIELD_1    TYPE I,
             FIELD_2(1) TYPE N,
           END OF B_LINE.
    DATA: B_PROG TYPE STANDARD TABLE OF B_LINE.
    DATA: A(10),
          C_PROG LIKE SYST.
    MOVE:  'A'      TO OBJ_WA-CLUSTERNAME.
    APPEND OBJ_WA TO OBJ_TAB. CLEAR OBJ_WA.
    MOVE:  'B'      TO OBJ_WA-CLUSTERNAME,
           'B_PROG' TO OBJ_WA-PROGRAMNAME.
    APPEND OBJ_WA TO OBJ_TAB. CLEAR OBJ_WA.
    MOVE:  'C'      TO OBJ_WA-CLUSTERNAME,
           'C_PROG' TO OBJ_WA-PROGRAMNAME.
    APPEND OBJ_WA TO OBJ_TAB. CLEAR OBJ_WA.
    EXPORT (OBJ_TAB) TO MEMORY ID 'ABCD'.
    Regards,
    Laxmi.

  • Import/Export in Background submission

    Hi experts.,
    I am passing two internal tables to another program using Submit statement via Job. Then i am importing those two tables in another program. However i think the tables are not populated. What could be the reason for this. Also how can you debug the background job submission?
    Thanks.
    Warm regards,
    Harshad.

    Hi
    For tables , in your import export statement , just see have you used [ ] , if not the please use this.
    If does not work then as well , then see to use EXPORT TO datbase as follows
    EXPORT obj1 ... objn TO DATABASE dbtab(ar) ID key.
    Refer this link
    http://help.sap.com/saphelp_45b/helpdata/en/34/8e73a36df74873e10000009b38f9b8/content.htm
    b> after executing your program (first get the job name in debugging mode) , go to sp01 ,  check tyhe checkbox against your job name ,  just write JDBG (transaction code area) and press enter , it will take you in debudding your job. First it will execute some sap standard program , just get it done and then it will jump top your code.
    Hope it is helpful.
    Regards,
    Uma

  • IMPORT/EXPORT problem.

    Hi,
    I am using a import export statement in my program.
    REPORT  ZKATEST.
    data : w_test type c value '1'.
    data : w_test1 type c.
    export w_test to memory id 'ZKAPIL'.
    import w_test1 from memory id 'ZKAPIL'.
    write : w_test1.
    Here the value gets exported to memory, but while importing its not getting populated (w_test1 is blank).
    Please suggest the solution.
    Thanks
    Kapil

    Hi kapil,
    1.  This kind of problems happen
        because the variable name,
        for export
        and import are different.
    2.  While exporting,
        Under memory id ZKAPIL,
        Value of W_TEST is stored with the name W_TEST.
    3. From the syntax,
        <b>import w_test1 from memory id 'ZKAPIL'</b>
       while importing,  from memory id ZKAPIL,
        the sysetm will , by default,
        try to search the value stored under name W_TEST1.
    (But it won't be found, because the orignal value is stored
      under the name W_TEST and not W_TEST1)
    <b>4. So just modify the syntax with this, and it will work fine.</b>
    <b>import W_TEST = w_test1 from memory id 'ZKAPIL'.</b>
    regards,
    amit m.

  • How to find export statement for Import statement ?

    hi experts,
    I am having an IMPORT....from memory ID  statement in my program.
    how could i find the location of EXPORT ...to memory ID statement for the IMPORT statement.
    Pls help
    saravanan.

    Not possible if you are just trying to find it without knowing the links between your program and the other programs. You have to know all the objects that relate to the process that your program is automating and then you can probably dig into those related programs to see if there is an EXPORT statement there. But it is not as simple as double clicking on the IMPORT statement or doing a WHERE-USED on the memory ID.

  • Export/Import subpartition stats

    I hope someone can give me a workaround for this, because it's causing our reports to take longer than they should!
    Background:
    We have some sub-partitioned tables on a 10.2.0.3 database, partitioned daily on the date column, with the subpartitions based on a list of values.
    Overnight, various reports are run. Each report loads its data into the table, and then produces a file based on the data that's been loaded for that report. It is not practical (IMO) to analyze the tables after each report has loaded its data, due to other reports loading their data at the same time.
    As the amount of data loaded into the tables each night does not vary significantly, we export the stats from a previous partition and import them into the new partition as part of the partition housekeeping job (stats imported from old partition, old partition gets dropped, new partition created with same name as the old one, and stats imported). This is done using dbms_sql.export_table_stats and dbms_sql.import_table_stats.
    However, one report which currently loads 43million rows is taking 4.5 hours to run. The size of the load file increases daily, but looking at the history of the report, each relatively small increase causes the report to run a disproportional amount longer (ie. an increase of a similar amount of rows on one night can add twice as much time onto the length of the report than the increase the previous night did).
    We've just implemented some changes to improve the buffer sizes, etc, on the database, in a bid to reduce some of the waits, but this has not improved matters much - the report now runs in 4 hours.
    We know this report can run faster, because in testing, we saw the report run in 60 minutes! Subsequent investigation shows that this was after the partitions had been analyzed, whereas the slow report ran prior to the partitions being analyzed, despite the stats being there for the partition.
    I have now tested the export/import stats process and found that they do not import the stats for the subpartitions. This looks like it is a large part of why the report takes longer before the relevant partitions/subpartitions have been analyzed than it does afterwards.
    Does anyone know of anyway that I can export/import the stats at a subpartition level? (I tried putting a subpartition name in the partition parameter, but I just got an error about it being an unknown partition name.)
    Any help, ideas or workarounds on this will be gratefully received!

    *** Duplicate Post - Please Ignore ***

  • Memory Limit for "IMPORT/EXPORT from MEMORY ID" statement

    Hi All,
    Can anyone tell me whether there is any memory limit exists for "IMPORT/EXPORT from MEMORY ID" statement.
    Like may be we can transfer xx MB of data via this......or it is open, we can transfer any amount of data to ABAP memory via this.
    Regards
    Munish Garg

    1. Each user sessions have external sessions and each external sessions have internal sessions.
    2. The programs being executed in the internal sessions can access ABAP memory
    3.ABAP memory is a storage area for internal program variables like fields, structures, internal tables,,They can be passed  between internal sessions of an external session.
    4. you can transfer data through ABAp memory using IMPORT and EXPORT statements
    5. after IMPORT FROM MEMORY ID <id> , you can use sy-subrc to check the existance of the cluster ID. here sy-subrc is not used to check whether the Import was successful or not.

  • Import and export statements

    I am trying to use import and export statements in two different programs . The control from one program goes to another program with the function modules they have . I dont see the value while importing.
    export i_field1 to memory id 'bus_ind'
    import val1 to memory id 'bus_ind'
    i gave only the memory id as common name

    Please make sure that the variables used are the same name and defined exactly the same in both programs.
    export i_field1 = i_field1  to memory id 'BUS_IND'.
    import i_field1 = i_field1  to memory id 'BUS_IND'.
    Regards,
    Rich Heilman

  • Import/export table stats in 11i

    Hi, Experts:
    A table stats is old in the prod instance and i want to import the stats from a test instance (the same table). I appreciate you if you can tell me the steps.
    Thanks and regards

    Hi;
    What is Db version?EBS version?
    Why u dont run gather stat? If you insist to make import see
    imp STATISTICS             import precomputed statistics (always)
    Regard
    Helios

  • Syntax Error with EXPORT statement in ECC 6

    Hi All,
    I have one issue with EXPORT statement syntax.
    I have declared data like below:
    DATA: BEGIN OF mem_id,
              mandt LIKE sy-mandt,
              uname LIKE sy-uname,
              modno LIKE sy-modno,
            END OF mem_id.
    export the memory id
        EXPORT E_VBKOK XANZPK TEXTTAB XBOLNR TO MEMORY ID MEM_ID.
    When I am checking the syntax error i am getting like "MEM_ID" must be a character-type field (data type C, N, D or T). by "INTERFACE". by "INTERFACE". "INTERFACE". by "INTERFACE". by "INTERFACE".
    I know this statement would be like IMPORT ITAB TO JTAB FROM MEMORY ID 'table'. So I have written like below
    EXPORT E_VBKOK XANZPK TEXTTAB XBOLNR TO MEMORY ID 'MEM_ID'. But still it is throwing an error.
    Can you please let me know how can I resolve this?
    Regards,
    Jyothi CH.

    Hi Jyothi,
    data: l_var type string.
    concatenate '6' '8' into l_var separated by space.
    export l_var to memory id 'BB'.
    Here we have to declare the type(structure) for l_var not for BB
    and in another program
    data:l_var type string.
    import l_var from memory id 'BB'.
    write : l_var.

  • Export statement in user-exit??

    I have used the following export statement in a user-exit:"EXPORT xaccit TO MEMORY ID 'ZCACHEPPA'."-I have doubt that - will this statement export the contents of the table XACCIT to memory and those contents in the memory will be imported by the IMPORT statement in other user-exit.....??
    If no,then which EXPORT/IMPORT statement should be used....is there any other keyword that can be used to export the contents to the memory?

    Hi
    See the doc related to SAP Memory and ABAP memory
    SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The most frequent use of SPA/GPA parameters is to fill input fields on screens
    SAP global memory retains field value through out session.
    set parameter id 'MAT' field v_matnr.
    get parameter id 'MAT' field v_matnr.
    They are stored in table TPARA.
    ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. Data within this area remains intact during a whole sequence of program calls. To pass data
    to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse.
    ABAP memory is temporary and values are retained in same LUW.
    export itab to memory id 'TEST'.
    import itab from memory Id 'TEST'.
    Here itab should be declared of same type and length.
    http://www.sap-img.com/abap/difference-between-sap-and-abap-memory.htm
    ABAP Memmory & SAP Memmory
    http://www.sap-img.com/abap/difference-between-sap-and-abap-memory.htm
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    Reward points if useful
    Regards
    Anji

Maybe you are looking for

  • Problem with sfsy-formapges in smartforms

    Hello smartform experts, I am developing quite a complicated smartform right now. The design of the page looks like this. Page 1. Loop at header table.    display delivery order and sales order.    Loop at materials where delivery_order=header_delive

  • Problem CCA 8.1.2 - BEA Weblogic 10.0.1 MP1 - SQL 2005 SP2

    Hi, i need some help, i'm trying to install those configuration, but web application start in bea console i have several errors in log: ++++++++++++++++++++++++++++++++++++++++++++++ 25 Mar 2009 20:11:59,306 [[ACTIVE] ExecuteThread: '5' for queue: 'w

  • SAP B1 - Automated Bank Reconciliations

    We are currently importing the bank information through data transfer workbench and are wondering how to replace or delete the uploaded data: ie. we loaded same bank record twice.

  • Not sure how to transfer/save ALL data from old SIM card to new iPhone

    1) How can I save/keep/transfer all Messages and Notes when I put my SIM card into a new iPhone?      I have done that but only some of the Messages and Notes are there on new phone. 2)  Also/or:  are all Messages and Notes saved on my Mac whenever I

  • Como paso documentos de mi mac air a un pendrive ??

    HOLA , SOY SUPER NUEVA EN MAC. PUEDO PASAR DOCS DE MIS PENS A MI MAC , PERO NO AL REVÉS . POR QUÉ ??