Problem while exporting internal table to memory id using EXPORT

Hi friends,
Iam facing a following problem.
I have 4 line items in my va01 tcode.
now when i give material number and quantity and hit enter the processing for that line item starts.
iam moving that current line item to a internal table lt_vbap in userexit_check_vbap.
now for the 2nd line item also i have to move to internal table lt_vbap.
but my problem is that in internal table lt_vbap iam not getting all the line items.
every time the current line item is being processed the the previous line items are being refreshed.
from lt_vbap internal table.
how can i export internal table.
code
move vbap to lt_vbap.
append lt_vbap.
export lt_vbap to memory id 'ZXYZ'.

>
Prakash Pandey wrote:
> Hi Priyanka,
>
> The internal table lt_vbap will always be empty unless you import it from the Memory ID (in your case ZXYX).
>
> Use the code this way:
>
> IMPORT lt_vbap FROM MEMORY ID 'ZXYX'.
>
> move vbap to lt_vbap.
>
> append lt_vbap.
>
> export lt_vbap to memory id 'ZXYZ'.
>
> Regards,
> Prakash Pandey
The memory id shud be same in both cases

Similar Messages

  • Export internal table to memory.

    How can I export and import an internal table to memory?
    This:
    export messtab to memory id 'TAB'. (in program 1)
    import messtab=messtab from memory id 'TAB'. (in program 2)
    does not work.

    Even without the brackets it doesn't work.
    In program 1 I have:
        WRITE text-e21 TO messtab-message.
        messtab-type = c_tipo_error.
        APPEND messtab. CLEAR messtab.
        DELETE messtab WHERE message = space.
        EXPORT messtab[] TO MEMORY ID para.
        EXIT.
    The EXIT leads to program 2, from where I made a submit to program 1, and where I have:
    import messtab[] from memory id para.
    Where:
            DATA: para TYPE tpara-paramid VALUE 'MES',
            messtab  TYPE TABLE OF bapireturn WITH HEADER LINE.
    What's wrong?
    Thanks in advance.
    Oh, and I've checked the table in program 1 does have an entry.

  • Export internal table to memory in User Exit FM

    Hi all,
    My scenario here is to export an internal table in one user exit FM and import it back in another user exit FM.
    I was trying to use
    Export lt_table to memory id 'LABEL'.
    then
    Import lt_table from memory id 'LABEL'.
    But then i hit error in the import statement. How can I rectify this?
    Thanks. Answer will be rewarded.

    Refer to the below related threads
    Export an internal table to memory and import from memory into an internal
    http://help.sap.com/saphelp_erp2005/helpdata/en/fc/eb3bf8358411d1829f0000e829fbfe/frameset.htm
    Regards,
    Santosh

  • Problem in exporting internal table to memory

    Hi,
    I have to export two internal tables (thead and titem) from a report (RFTBCF00) to memory which i will import in my function module can anyone letme know hw it cud b done .
    Points will b assigned
    Thnx,

    You can take the help of this example:
    report  z_82235_test1                           .
    types: begin of tab1,
             a(1),
             b(1),
           end of tab1.
    types: begin of tab2,
             c(1),
             d(1),
           end of tab2.
    data: itab1 type table of tab1,
          wa1 like line of itab1,
          itab2 type table of tab2,
          wa2 like line of itab2.
    wa1-a = '1'.
    wa1-b = '2'.
    append wa1 to itab1.
    clear wa1.
    wa1-a = '3'.
    wa1-b = '4'.
    append wa1 to itab1.
    clear wa1.
    export itab1 to memory id '001'.
    export itab2 to memory id '002'.
    submit z_82235_test2 and return exporting list to memory .

  • Exporting internal table to memory variable

    I need to extract some data within a program into an internal table. Then I need to export the internal table into a memory variable
    Then in another program i need to import this memory variable into another internal table
    How to do the import export into a memory variable

    See the simple example :
    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.

  • Problem while processing internal table

    Hi ,
    I have to read 2 line item of same invoice no
    for  eg.
    IN_NO      !    MAT          !      AMT
    XYZ         !    MAT1       !     125
    XYZ         !     MAT2       !     325
    In o/p its display only 325 for both line items
    I used this statement for readiing..
    loop at i_final
    loop at i_itab1 where knumv = i_final-knumv.
           move i_itab1-kwert to i_vbtab-comm .
           clear i_itab1-kwert.
           endloop.
    endloop.
    In debuging i have determine that both first line item
    amt is coming in header line but while coming in body.
    I become the second line item amt
    Can any one help me

    You still are not MODIFYing the table if you intend to write it later
    loop at i_final
      loop at i_itab1 where knumv = i_final-knumv.
        move i_itab1-kwert to i_final-comm .
    *   clear i_itab1-kwert.  "<== No need for this at all
      endloop.
    endloop.
    Additionally, you're moving to your primary loop table.  Never going to see two for it unless you write to a 3rd table or
    replace the CLEAR with a WRITE:/ .......
    Edited by: Paul Chapman on May 14, 2008 10:35 AM

  • Save Internal table to memory - problem

    Hi everybody ,
    I need to extract one Internal table to memory , every 1st in the Month .
    Then every day I will be reading this table for my report ( in order to avoid running every day same and same database selections) .
    My originall idea wos with EXPORT TO MEMORY ID , AND IMPORT
    but it does'nt work next day ... With Export data is cept only untill tthe end of the transaction ...
    Is there any way except of storing data in one Z_ database table ???
    Thanks in advance

    Hi,
    You can use the following code to export to memory
    *data variable required for background processing
    data: wa_indx type indx.
    *EXPORT Internal Table TO MEMORY ID 'XYZ'.
    *part for background processing
      export tab = <your table> to database indx(xy) from wa_indx client
      sy-mandt id 'XYZ'.
    the following code will import from Memory and clear memory
    *data variable required for background processing
    data: wa_indx type indx.
    imports from database the list sent by the calling program
    IMPORT tab = <your table> FROM DATABASE indx(xy) TO wa_indx CLIENT sy-mandt
    ID 'XYZ'.
    deletes the data to save wastage of memory
    DELETE FROM DATABASE indx(xy)
      CLIENT sy-mandt
      ID 'XYZ'.
    Regards,
    Samson Rodrigues.

  • Exporting an internal table to memory

    Hi
      I want to call an program from another program and want the values stored in an internal table used in the called program.
    how can i export an internal table to memory id an then import it.
    Regards
    Arun

    So to be clear, for your requirement it would be:
    * Towards the end of the called program
      EXPORT it_itab TO MEMORY ID 'ZZ_MEM_ID'.
    * And then from calling program after the submit zzzz and return statement
      IMPORT it_itab FROM MEMORY ID 'ZZ_MEM_ID'.
    Hope that helps.
    Brad
    Message was edited by: Brad Williams (put back intro text)
    Message was edited by: Brad Williams

  • Exporting internal table in a oops

    hi friends,
    I have to pass internal table to a method and export that internal table.
    now when i am passing this internal table i am getting the last value of the table..
    i am enclosing code here please go through and modify me regarding this..
    REPORT  ZTEST_ABAP_PROXY.
    DATA PRXY TYPE REF TO ZCO_MI_PROXY_OUTBOUND.
    DATA: BEGIN OF I_MARA OCCURS 0,
      MATNR LIKE MARA-MATNR,
      ERNAM LIKE MARA-ERNAM,
      END OF I_MARA.
    CREATE OBJECT PRXY.
    DATA IT TYPE  ZMT_PROXY_OUTBOUND OCCURS 0 WITH HEADER LINE.
    TRY.
        SELECT MATNR ERNAM INTO TABLE I_MARA FROM MARA UP TO 10 ROWS.
        LOOP AT I_MARA.
          IT-MT_PROXY_OUTBOUND-MATNR = I_MARA-MATNR.
          IT-MT_PROXY_OUTBOUND-ERNAM = I_MARA-ERNAM.
          APPEND IT.
        ENDLOOP.
        CALL METHOD PRXY->EXECUTE_ASYNCHRONOUS
          EXPORTING
            OUTPUT = IT.
        COMMIT WORK.
      CATCH CX_AI_SYSTEM_FAULT .
        DATA FAULT TYPE REF TO CX_AI_SYSTEM_FAULT .
        CREATE OBJECT FAULT.
        WRITE :/ FAULT->ERRORTEXT.
    ENDTRY.
    i need to pass all the values of internal table to output at once..
    Thanks and Regards
    Vijay

    Hi Vijay,
    I think the problem is with the output parameter.
    Might be I'll give you the background and then explain you the problem. This may help.
    In the older release of ABAP there used to be Tables as one of the tabs where one could import/export tables to/from the FM. The problem was that it would difficult to identify what table are being imported and what are bein exported.
    So with later releases of ABAP this tab was removed and currently there are Exporting/Importing/Changing tabs. You can use changing in your case if you are passing the table to modify the same.
    Now the problem.
    As stated above the OUTPUT is a line type (means structure) while IT is a internal table with header lines. So the record in the wa of this table is only transferred to OUTPUT.
    What needs to be done.
    You need to change the type of the OUTPUT to table type. I am not sure if you know about table type.
    You can create a Table Type is se11 under Data Type.
    I hope this helps.
    Regards,
    Saurabh

  • Pass Internal Table to Memory

    Dear Experts.
    I have the following problem.
    I am using a User-Exit for Travel  that is called from a program standard with use the T.Code TRIP. The program standard use a structure that when entry in the user exit not is. I need use this structure in the user exit. (p_t_req_head).
    I had read abour SAP and ABAP Memory but from the program standar How can Pass Internal Table to Memory SAP or ABAP from the program standard to user-exit?
    When I am doing debugging in the program Standard and this call to the user exit, I use ()namestructure for example ()p_t_req_head  and I get the datas of the structure, But In the Source Code ABAP, How can do this with instructions?
    Regards

    Hi,
    You try with Import & Export Statements as follows ---
    DATA : t_itab LIKE TABLE OF spfli.
    EXPORT t_itab TO MEMORY ID 'ABCD'.
    After sending the internal table to ABAP memory you need to get that by IMPORT in the called session.
    IMPORT t_itab FROM MEMORY ID 'ABCD'.

  • Problem in Importing Internal Table

    Dear All,
    I am exporting Internal table from Program1 as follows:
    REPORT  ZEXPORT_TEST                            .
    TYPES: BEGIN OF ITAB,
          MATNR TYPE MARA-MATNR,
          MATKL TYPE MARA-MATKL,
          END OF ITAB.
    DATA:IT TYPE TABLE OF ITAB .
    SELECT MATNR MATKL FROM MARA INTO TABLE IT UP TO 10 ROWS.
    EXPORT IT TO MEMORY ID 'EAI1'.
    WRITE:/'Exported Successfully'.
    And I am Importing same internal table into  program2
    REPORT  ZIMPORT_TEST  .
    TYPES: BEGIN OF ITAB,
          MATNR TYPE MARA-MATNR,
          MATKL TYPE MARA-MATKL,
          END OF ITAB.
    DATA:IT  TYPE TABLE OF ITAB,
         IT1 TYPE TABLE OF ITAB,
         WA TYPE ITAB.
    IMPORT IT1 FROM MEMORY ID 'EAI1'.
    IT[] = IT1[].
    LOOP AT IT INTO WA.
      WRITE:/ wa-matnr,
            / WA-MATKL.
    ENDLOOP.
    WRITE:/'Imported Successfully'.
    But progam1 exporting correctly the return code is 0 but program2 is not importing sucessfully return code is 4.
    Kindly help me to import.
    Thanks in Advance.

    Hi friend,
    When u use 'Export' and 'Import' statements, it refers local sap memory.
    So u need to use SUBMIT ZIMPORT_TEST AND RETURN  statement immediately after 'Export'.
    i.e.
    Report ZEXPORT_TEST.
    EXPORT IT TO MEMORY ID 'EAI1'.   < -
    Exported to common local sap memory
    SUBMIT ZIMPORT_TEST AND RETURN . <---- Controls goes to next program, within same session.
    Report ZIMPORT_TEST.
    IMPORT IT from MEMORY ID 'EAI1'.  <----
    Imports data from common local sap memory.
    If u want to run two independent reports one exporting, another importing, then u have to use
    'SET' and 'GET' parameter concept which refers global sap memory.
    Thanks..
    Edited by: Sap Fan on Feb 27, 2009 4:56 AM
    Edited by: Sap Fan on Feb 27, 2009 4:56 AM

  • Export a table to memory ID and import it in the Workflow.

    Hi,
    For a particular requirement,
    We are triggering Workflow from the User Exit MV45AFZZ.
    Before triggering this WF, I am trying to export an internal table to a memory ID and trying to Import it back from the same memory ID into an internal table in the Workflow task. This is failing.
    Even the name of internal tables and memory IDs are similar.
    Can we do this like this? If yes please let me know how to do this.
    Thanks & Regards,
    Mallika Maktala

    Initially,
    I have populated the values of the internal table in to a Database table, immediately called Workflow, in a task tried to retrieve the data from the database table.
    But though there is some data in the table, it dint retrieve any data, as at that point the table may not be updated.
    So now I used this Import export concept.
    I think its in same session, but still not working,
    Any solution?
    Mallika Maktala

  • Export INTERNAL TABLE to shared buffer

    Hi all,
    My requirement:
    Export INTERNAL TABLE to shared buffer or SAP Memory.
    Any help will be appreciated.
    Can SET/GET parameter be adopted for internal tables?
    Thanks,
    Tabraiz

    EXPORT (OBJ_TAB) TO MEMORY ID 'ABCD'
    also refer to
    http://help.sap.com/saphelp_45b/helpdata/en/34/8e73a36df74873e10000009b38f9b8/content.htm

  • Passing Dynamic Internal Tables to Memory

    I have a bit of a conundrum right now that I can't seem to correct. I am working on adding an ALV report to an existing report program. I was able to write a simple helper program that builds a custom object that I defined that translates my raw data into two seperate dynamic tables, and then builds an ALV grid and outputs it. The reason I wrote this in a simple helper program was so that I could use SUBMIT ... EXPORTING LIST TO MEMORY from my primary report program and capture the input so I can later write it out under our company's standard ABAP list format as if I were using WRITE statements.
    The output of the report itself is working beautifully. We have included functionality to automatically take the output, produce an HTML file from it, and then FTP it directly to a webserver so our clients can get easy access to it. What I want to be able to do though is give the clients two tab-delimited files that contain the raw data that was used to build the report. We have an interface in place to do that, but I somehow need to be able to pass these two dynamic internal tables which I have field-symbols to reference back to my calling program.
    Here is what I am trying to do:
    CALL METHOD OBJ_ALV_MR_EST_REASONS->PRODUCE_ESTIMATION_REPORT
        IMPORTING
          RPT_DATA_BY_REASON   = ref_it_estreason
          RPT_DATA_BY_DISTRICT = ref_it_district.
    *   Assign the field symbols
      ASSIGN ref_it_estreason->* TO <it_estreason>.
      ASSIGN ref_it_district->* TO <it_district>.
    * Export the two internal tables to memory so they can be
    * retrieved by the calling program
      EXPORT reason = <it_estreason>[]
             district = <it_district>[]
      TO MEMORY ID 'ZCR_ESTIMATION_REASON_RPT'.
    As you can see, my method returns two references to dynamic internal tables. I have used the memory debugger to see that these tables are being correctly written to the ABAP memory.
    However, back in my parent program when I try to do the following,
    CREATE DATA ref_it_estreason TYPE REF TO DATA.
          CREATE DATA ref_it_district TYPE REF TO DATA.
          ASSIGN ref_it_estreason->* TO <it_estreason>.
          ASSIGN ref_it_district->* TO <it_district>.
          IMPORT reason = <it_estreason>
                 district = <it_district>
          FROM MEMORY ID 'ZCR_ESTIMATION_REASON_RPT'.
    I get the REFS_NOT_SUPPORTED_YET exception which says that "For the statement Export/Import ..." object references, interface references, and data references are currently not supported".
    I have tried multiple other ways of defining my field-symbols or my reference pointers but they all result in exceptions of some sort. Is there any way for me to get this data passed back? It seems like there must be a way to get the data from memory since I know it's being correctly stored there.
    Thanks in advance.

    Shortly after posting this, I had an idea which I was able to implement to actually get this to work.
    I decided that I would simply pass the FIELDCAT tables for each of my dynamic tables into the same memory ID as the tables themselves.
      EXPORT reason_fcat = it_estreason_fcat
             district_fcat = it_district_fcat
             reason = <it_estreason>[]
             district = <it_district>[]
      TO MEMORY ID 'ZCR_ESTIMATION_REASON_RPT'.
    Then, back in my calling program I execute the following code. This retrieves the FIELDCAT tables, builds two empty dynamic table type reference variables and then lets me create field-symbols to reference those components.
    *     Retrieve the fieldcat internal tables first
          IMPORT reason_fcat = it_estreason_fcat
                 district_fcat = it_district_fcat
          FROM MEMORY ID 'ZCR_ESTIMATION_REASON_RPT'.
    *     Generate an internal table type assigned to each
    *     reference variable based on the fieldcat listings we
    *     retrieve
          CALL METHOD cl_alv_table_create=>create_dynamic_table
            EXPORTING
              it_fieldcatalog = it_estreason_fcat
            IMPORTING
              ep_table        = ref_it_estreason.
          CALL METHOD cl_alv_table_create=>create_dynamic_table
            EXPORTING
              it_fieldcatalog = it_district_fcat
            IMPORTING
              ep_table        = ref_it_district.
    *     Assign the field symbols
          ASSIGN ref_it_estreason->* TO <it_estreason>.
          ASSIGN ref_it_district->* TO <it_district>.
          CREATE DATA ref_wa_estreason LIKE LINE OF <it_estreason>.
          CREATE DATA ref_wa_district LIKE LINE OF <it_district>.
          ASSIGN ref_wa_estreason->* TO <wa_estreason>.
          ASSIGN ref_wa_district->* TO <wa_district>.
    *     Finally, we can retrieve the data from memory and assign
    *     to the internal tables referenced by our field-symbols
          IMPORT reason = <it_estreason>[]
                 district = <it_district>[]
          FROM MEMORY ID 'ZCR_ESTIMATION_REASON_RPT'.
    This worked beautifully and saved me from having to do a major redesign. I don't know how helpful it would be for ABAP Objects to be passed to memory (I believe some type of serialization would need to be in order there), but for dynamically typed internal tables it worked like a dream with little overhead.

  • Import/export internal tabl

    Hi,
    This is regarding import/export internal table to 2 different prog, somehow when i execute in prog ztest_hl7, it doesnt work. Please help.
    report ztest_hl7.
    TYPES:
    BEGIN OF tab_type,
    para TYPE string,
    dobj TYPE string,
    END OF tab_type.
    DATA:
    id TYPE c LENGTH 10 VALUE 'TEXTS',
    text1 TYPE string VALUE `IKE`,
    text2 TYPE string VALUE `TINA`,
    line TYPE tab_type,
    itab TYPE STANDARD TABLE OF tab_type.
    line-para = 'P1'.
    line-dobj = 'TEXT1'.
    APPEND line TO itab.
    line-para = 'P2'.
    line-dobj = 'TEXT2'.
    APPEND line TO itab.
    EXPORT itab TO MEMORY ID id.
    submit ztest_hl6 and return.
    report ztest_hl6.
    data : id TYPE c LENGTH 10 VALUE 'TEXTS'.
    TYPES:
    BEGIN OF tab_type,
    para TYPE string,
    dobj TYPE string,
    END OF tab_type.
    DATA: itab TYPE STANDARD TABLE OF tab_type,
         wa_itab type tab_type.
    IMPORT itab FROM MEMORY ID id.
    loop at itab into wa_itab.
    write:
    wa_itab-para,
    wa_itab-dobj.
    endloop.
    Edited by: Hui Leng Yeoh on Jun 26, 2008 11:25 AM

    Hi There are few syntax errors. Comment ur code and Paste this code and check. It is working fine.
    report ztest_hl7.
    TYPES:
    BEGIN OF tab_type,
    para TYPE string,
    dobj TYPE string,
    END OF tab_type.
    DATA:
    id(10) TYPE c VALUE 'TEXTS',
    text1 TYPE string, " VALUE `IKE`,
    text2 TYPE string, " VALUE `TINA`,
    line TYPE tab_type,
    itab TYPE STANDARD TABLE OF tab_type.
    text1 = 'IKE'.
    text2 = 'TINA'.
    line-para = 'P1'.
    line-dobj = 'TEXT1'.
    APPEND line TO itab.
    line-para = 'P2'.
    line-dobj = 'TEXT2'.
    APPEND line TO itab.
    EXPORT itab TO MEMORY ID id.
    SUBMIT z7569411 AND RETURN.
    data : id(10) TYPE c VALUE 'TEXTS'.
    TYPES:
    BEGIN OF tab_type,
    para TYPE string,
    dobj TYPE string,
    END OF tab_type.
    DATA: itab TYPE STANDARD TABLE OF tab_type,
    wa_itab type tab_type.
    IMPORT itab FROM MEMORY ID id.
    loop at itab into wa_itab.
    write:
    wa_itab-para,
    wa_itab-dobj.
    endloop.
    Thanks,
    vinod.

Maybe you are looking for

  • How to reject pulses

    Hi, This is one project that I am doing for some time using sinar sensor which generates pulse with to measure the distance to object. This sensor is being controlle dby basic stamp2. My problem is that I am getting signal from the signal out put of

  • Re installed software still have error 16

    i uninstalled CS 6. Used Creative Cloud Cleaner. Reinstalled CS6. And I still get Error 16. What do I do know?

  • Adobe App Login problem

    Can't access adobe app in iPhone, a message appears saying the ID or the Password is incorrect, although I can still access my account in Adobe home page. Any help please

  • Lenova G580 - 59348965

    Please help need drivers for my laptop ,, I tried all downloads from lenova site .. its vain , please someone provide me  right drivers links ..  for Windows 7 ultimate 64 bit .. .. i have nividia geforce embadded even i dont model number tooo

  • Frequent error messages

    I am constantly getting this error in Console: com.apple.iCloudHelper: AOSKit ERROR: ((null)) Cannot refresh account bag, missing acct info (user=.DS_Store, hasPassword=0) Is this harmless or serious?? I have OS X Mavericks 10.9.4 and a MacBook Air.