Import & Export of Internal table

Hello All,
In my requirement I need to call the MB5B program RM07MLBD. I used the code like this.
SUBMIT rm07mlbd AND RETURN
            WITH matnr   IN  so_matnr
            WITH werks   IN  so_werks
            WITH datum   IN  so_budat.
Now from the RM07MLBD program I need the get the values of the table * g_t_totals_flat * to my zprogram.
Is it possible to import & export the Internal table from one program to other.
Regards,
Anil.

Hi,
You can export the internal table ot memory id and can access the (Import) in the called program.
Consider this small code from ABAPDOCU.
DATA text1(10) TYPE c VALUE 'Exporting'.
DATA: itab TYPE TABLE OF sbook,
      wa_itab LIKE LINE OF itab.
DO 5 TIMES.
  wa_itab-bookid = 100 + sy-index.
  APPEND wa_itab TO itab.
ENDDO.
EXPORT text1
       text2 = 'Literal'
  TO MEMORY ID 'text'.
EXPORT itab
  TO MEMORY ID 'table'.
Regards
Bikas

Similar Messages

  • 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

  • Export to internal table

    Hi experts:
        I got problems when I'm using 'export/import to internal table'.When 'import to internal table' exected, an ABAP occured, text 'Format error with IMPORT: No further container found.'
        Part of my codes is below:
        Export:
        data: gi_info type standard table of ZBPS_PASSINFO,
                   itab type standard table of ZBPS_PASSINFO,
                   gs_info type ZBPS_PASSINFO.
        loop at layout->mt_html_cell assigning <ld_cell> where row = row_id and chanm = 'ZBPS_ZNU'.
                  gs_info-num = <ld_cell>-value.
                endloop.
                loop at layout->mt_html_cell assigning <ld_cell> where row = row_id and chanm = 'ZBPS_ZNAM'.
                  v_xmmc = <ld_cell>-value.
                endloop.
                loop at layout->mt_html_cell assigning <ld_cell> where row = row_id and chanm = 'ZBPS_ZTZ'.      "
                  v_ZTZ = <ld_cell>-value.
                endloop.
                loop at layout->mt_html_cell assigning <ld_cell> where row = row_id and chanm = 'ZBPS_DEP'.      "
                  v_DEP = <ld_cell>-value.
                endloop.
                loop at layout->mt_html_cell assigning <ld_cell> where row = row_id and chanm = 'ZBPS_SHRY'.      "
                  v_SHRY = <ld_cell>-value.
                endloop.
                gs_info-xmmc = v_xmmc.
                gs_info-ZTZ = v_ZTZ.
                gs_info-DEP = v_DEP.
                gs_info-SHRY = v_SHRY.
                append gs_info to gi_info.
        EXPORT ZPASSINFO FROM gi_info TO INTERNAL TABLE itab.
        Import:
        data: GI_PASSINFO type standard table of ZBPS_PASSINFO,
          itab type standard table of ZBPS_PASSINFO,
          GS_PASSINFO type ZBPS_PASSINFO.
    import ZPASSINFO to GI_PASSINFO from INTERNAL TABLE itab.

    EXPORT - Export data
    Variants
    1. EXPORT obj1 ... objn TO MEMORY.
    2. EXPORT obj1 ... objn TO DATABASE dbtab(ar) ID key.
    3. EXPORT obj1 ... objn TO DATASET dsn(ar) ID key.
    Variant 1
    EXPORT obj1 ... objn TO MEMORY.
    Additions
    1. ... FROM g (for each field to be exported)
    2. ... ID key
    Effect
    Exports the objects obj1 ... objn (fields, structures or tables) as a data cluster to ABAP/4 memory .
    If you call a transaction, report or dialog module (with CALL TRANSACTION , SUBMIT or CALL DIALOG ), the contents of ABAP/4 memory are retained, even across several levels. The called transaction can then retrieve the data from there using IMPORT ... FROM MEMORY . Each new EXPORT ... TO MEMORY statement overwrites any old data, so no data is appended.
    If the processing leaves the deepest level of the call chain, the ABAP/4 memory is released.
    Note
    The header lines of internal tables cannot be exported, because specifying the name of an internal table with a header line always exports the actual table data.
    Addition 1
    ... FROM g (for each object to be exported)
    Effect
    Exports the contents of the data object g and stores them under the name specified before FROM .
    Addition 2
    ... ID key
    Effect
    Stores the exported data under the ID key in ABAP/4 memory . You can then use the ID to read it in again (with IMPORT ). The ID can be up to 32 characters long.
    Note
    If you store data both with and without an ID , the data stored without an ID remains separate and you can re-import it (using IMPORT without ID ).
    Note
    Runtime errors
    EXPORT_NO_CONTAINER : SAP paging exhausted
    Variant 2
    EXPORT obj1 ... objn TO DATABASE dbtab(ar) ID key.
    Additions
    1. ... FROM g (for each field to be exported)
    2. ... CLIENT h (after dbtab(ar) )
    3. ... USING form
    Effect
    Exports the objects obj1 ... objn (fields, structures or tables) as a data cluster to the database table dbtab .
    The database table dbtab must have a standardized structure .
    The database table dbtab is divided into different logically related areas ( ar , 2-character name).
    You can export collections of data objects (known as data clusters ) under a freely definable key (field key ) to an area of this database.
    IMPORT allows you to import individual data objects from this cluster.
    Notes
    The table dbtab specified after DATABASE must be declared under TABLES .
    The header lines of internal tables cannot be exported because specifying the name of an internal table with a header line always exports the actual table data.
    Example
    Export two fields and an internal table to the database table INDX :
    TABLES INDX.
    DATA: INDXKEY LIKE INDX-SRTFD VALUE 'KEYVALUE',
          F1(4), F2 TYPE P,
          BEGIN OF ITAB3 OCCURS 2,
            CONT(4),
          END OF ITAB3.
    Before the export, the data fields in
    front of CLUSTR are filled.
    INDX-AEDAT = SY-DATUM.
    INDX-USERA = SY-UNAME.
    Export der Daten.
    EXPORT F1 F2 ITAB3 TO
           DATABASE INDX(ST) ID INDXKEY.
    Addition 1
    ... FROM g (for each object to be exported)
    Effect
    Exports the contents of the field g and stores them under the specified name in the database.
    Addition 2
    ... CLIENT h (after dbtab(ar) )
    Effect
    Stores the data objects in the client h (if the import/export database table dbtab is client-specific).
    Addition 3
    ... USING form
    Effect
    Does not export the data to the database table. Instead, calls the FORM routine form for every record written to the database without this addition. This routine can take the data from the database table work area and therefore has no parameters.
    Note
    Runtime errors
    Errors in the structure of the EXPORT / IMPORT database can cause runtime errors .
    Variant 3
    EXPORT obj1 ... objn TO DATASET dsn(ar) ID key.
    Note
    This variant is not to be used at present.

  • How to export an internal table to another report while submitting ..

    Hi ,
    I have 2 reports ZR1 and ZR2 . Both contains an Internal table with same structure IT_DATA. After the output of ZR1 comes,I am submitting ZR2 at a click event. The requirement is to pass the data from IT_DATA from ZR1 to IT_DATA of ZR2 while submitting ZR2.
    Hope that the requirement is clear.
    Thanks & regards,
    Shankar

    Hi
    You have to use IMPORT/EXPORT statament
    REPORT ZREPORT1.
    DATA: ITAB LIKE .....
    EXPORT ITAB TO MEMORY ID 'ZZZ'.
    SUBMIT ZREPORT2.
    REPORT ZREPORT2.
    DATA ITAB LIKE
    INITIALIZATION.
    IMPORT ITAB FROM MEMORY ID 'ZZZ'.
    Max
    Message was edited by: max bianchi

  • IMPORT Statement Issue (Internal Table)

    Hi All,
    I am using an IMPORT statement to get all the data from other report's internal table. Now whenever this (the other report's internal table) is changed (for field addition, etc), my report throws a dump. Hence, everytime I have to add these fields in my program as well.
    Is there any way by which I can include the whole internal table of that report in my program just like
    'INCLUDE STRUCTURE VBRK'.
    Thanks in advance

    Hi, CHeck this code related to your problem..This will helpful to you...
    I have done this program earlier..I hope it will helpful to u..
    This programa calling the other program to import the data..
    Check it out...
    *" Tables declarations.................................................
    TABLES:
      spfli.
    *" Type declarations...................................................
    Type declaration of the structure to hold data from table SPFLI     *
    TYPES:
      BEGIN OF type_s_spfli,
        carrid LIKE spfli-carrid,          " Carrier Id
        connid LIKE spfli-connid,          " Connection Number
        cityfrom LIKE spfli-cityfrom,      " City from
        cityto LIKE spfli-cityto,          " City to
        airpfrom LIKE spfli-airpfrom,      " Airport from
        airpto LIKE spfli-airpto,          " Airport to
        countryfr LIKE spfli-countryfr,    " Country from
        countryto LIKE spfli-countryto,    " Country to
      END OF type_s_spfli.
    Data Declaration...................................................*
         Field String To Hold Flight Details Record from SPFLI          *
    DATA
      fs_spfli TYPE type_s_spfli.
    Data Declaration...................................................*
         Internal Table To Hold Flight Details Records from SPFLI       *
    DATA
      t_spfli LIKE STANDARD TABLE OF fs_spfli.
    TYPES:
      BEGIN OF types_s_itab,
        carrid LIKE sflight-carrid,        " Carrier id
        connid LIKE sflight-connid,        " Connection number
        fldate LIKE sflight-fldate,        " Flight date
      END OF types_s_itab.
    Data Declaration...................................................*
         Field String To Hold Flight Details Record from SFLIGHT        *
    DATA
      fs_itab TYPE types_s_itab.
    Data Declaration...................................................*
         Internal Table To Hold Flight Details Records from SFLIGHT     *
    DATA
      t_itab LIKE STANDARD TABLE OF fs_itab.
    *" Type declarations...................................................
    Type declaration of the structure to hold data from table SBOOK     *
    TYPES:
    BEGIN OF type_s_sbook,
       carrid LIKE sbook-carrid,           " Carrier Id
       connid LIKE sbook-connid,           " Connection Number
       fldate LIKE sbook-fldate,           " Flight date
       bookid LIKE sbook-bookid,           " Booking number
       loccuram LIKE sbook-loccuram,       " Local currency
       loccurkey LIKE sbook-loccurkey,
       order_date LIKE sbook-order_date,   " Booking date
    END OF type_s_sbook.
    Data Declaration...................................................*
         Field String To Hold Flight Details Record from BOOK           *
    DATA
      fs_sbook TYPE type_s_sbook.
    Data Declaration...................................................*
         Internal Table To Hold Flight Details Records from SBOOK       *
    DATA
      t_sbook LIKE STANDARD TABLE OF fs_sbook.
    DATA
      w_checkbox.                          " Checkbox
    SELECT-OPTIONS:
      s_carr FOR spfli-carrid.             " Carrier id range
                          START-OF-SELECTION EVENT                      *
    START-OF-SELECTION.
      PERFORM selectq.
                          END-OF-SELECTION EVENT                        *
    END-OF-SELECTION.
      SET PF-STATUS 'YH1314_030502'.
      PERFORM display_basic.
    AT USER-COMMAND.
      PERFORM ucomm.
    *&    Form  selectq
        This subroutine retreive data from SPFLI table
      There are no interface parameters to be passed to this subroutine.
    FORM selectq .
      SELECT carrid                        " Carrier id
             connid                        " Connection number
             cityfrom                      " City from
             cityto                        " City to
             airpfrom                      " Airport from
             airpto                        " Airport to
             countryfr                     " Country from
             countryto                     " Country to
             INTO CORRESPONDING FIELDS OF TABLE t_spfli
             FROM spfli
             WHERE carrid IN s_carr.
    ENDFORM.                               " Selectq
    *&      Form  display_basic
        This subroutine displays data from internal table
      There are no interface parameters to be passed to this subroutine.
    FORM display_basic .
      LOOP AT t_spfli INTO fs_spfli.
        WRITE:
          / w_checkbox AS CHECKBOX,
            fs_spfli-carrid,
            fs_spfli-connid,
            fs_spfli-cityfrom,
            fs_spfli-cityto,
            fs_spfli-airpfrom,
            fs_spfli-airpto,
            fs_spfli-countryfr,
            fs_spfli-countryto.
      ENDLOOP.                             " LOOP AT T-SPFLI INTO...
    ENDFORM.                               " Display_basic
    *&      Form  UCOMM
      This subroutine for at user-command event
      There are no interface parameters to be passed to this subroutine.
    FORM ucomm .
      RANGES :
        r_carr FOR spfli-carrid,
        r_conn FOR spfli-connid,
        r_carrid FOR sflight-carrid,
        r_connid FOR sflight-connid,
        r_fldate FOR sflight-fldate.
      CASE sy-ucomm.
        WHEN 'DISPLAY'.
          DATA:
            lw_lines TYPE i,
            lw_lineno TYPE i VALUE 3.
          DESCRIBE TABLE t_spfli LINES lw_lines.
          DO lw_lines TIMES.
            READ LINE lw_lineno FIELD
                 VALUE w_checkbox   INTO w_checkbox
                       fs_spfli-carrid INTO  fs_spfli-carrid
                       fs_spfli-connid INTO  fs_spfli-connid.
            IF sy-subrc = 0.
              IF w_checkbox = 'X'.
                r_carr-sign = 'I'.
                r_carr-option = 'EQ'.
                r_carr-low = fs_spfli-carrid.
                APPEND r_carr.
                r_conn-sign = 'I'.
                r_conn-option = 'EQ'.
                r_conn-low = fs_spfli-connid.
                APPEND r_conn.
              ENDIF.                       " IF W_CHECKBOX = 'X'
            ENDIF.                         " IF SY-SUBRC = 0
            ADD 1 TO lw_lineno.
          ENDDO.                           " DO LW_LINES TIMES
          SUBMIT yh1314_030502_call
            WITH s_carr IN r_carr
            WITH s_conn IN r_conn
             AND RETURN.
          IMPORT t_itab FROM MEMORY ID 'YH1314'.
          LOOP AT t_itab INTO fs_itab.
            r_carrid-sign = 'I'.
            r_carrid-option = 'EQ'.
            r_carrid-low = fs_itab-carrid.
            APPEND r_carrid.
            r_connid-sign = 'I'.
            r_connid-option = 'EQ'.
            r_connid-low = fs_itab-connid.
            APPEND r_connid.
            r_fldate-sign = 'I'.
            r_fldate-option = 'EQ'.
            r_fldate-low = fs_itab-fldate.
            APPEND r_fldate.
          ENDLOOP.                         " LOOP AT T_ITAB INTO.....
          SELECT carrid                    " Carriee Id
                 connid                    " Connection number
                 fldate                    " Flight date
                 bookid                    " Booking number
                 loccuram                  " Local Currency
                 order_date                " Booking date
             INTO CORRESPONDING FIELDS OF TABLE t_sbook
             FROM sbook
             WHERE carrid IN r_carrid AND
                   connid IN r_connid AND
                   fldate IN r_fldate.
          IF SY-SUBRC NE 0.
            MESSAGE 'NO RECORDS FOUND'(006) TYPE 'S'.
          ENDIF.                           " IF SY-SUBRC NE 0
          LOOP AT t_sbook INTO fs_sbook.
            AT FIRST.
              WRITE: /5 'Carrier Id'(001),
                     20 'Conn Id'(002),
                     35 'Flight date'(003),
                     50 'Book Id'(004),
                     65 'Local Currency'(005).
            ENDAT.                         " AT FIRST
            WRITE: /5 fs_sbook-carrid,
                   20 fs_sbook-connid,
                   35 fs_sbook-fldate,
                   50 fs_sbook-bookid,
                   65 fs_sbook-loccuram CURRENCY fs_sbook-loccurkey.
          ENDLOOP.                         " LOOP AT T_SBOOK INTO.....
      ENDCASE.                             " CASE SY-UCOMM
    ENDFORM.                               " UCOMM
    Regards
    Kiran

  • Exporting Multiple Internal table data to Single Excel file.

    Hello Expert,
      I want to export more than one internal table data from Web Dynpro Application to single Excel file but in such a way that
    each table's data to be get exported to different tabs in (Multiple sheets)  that single excel file.
    So help me in this matter.
    Thank You.
    Varun
    Moderator message: wrong forum, please post again in "Web Dynpro ABAP".
    Edited by: Thomas Zloch on Oct 29, 2010 1:39 PM

    Each table having different sheet in same CSV file .
    A CSV file is a flat file and don't have "Sheets"; you would have to Export to an Excel file, which supports several Sheets in one file.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Internal table export and import in ECC 5.0 version

    Hi friends,
    I am trying to export and import internal table from one program to other program.
    The below… export and import commands are not working when I run the program in background (using SUBMIT zxxxx via JOB name NUMBER number…..)
    EXPORT ITAB TO MEMORY id 'ZMATERIAL_CREATE'.
    IMPORT ItAB FROM MEMORY ID 'ZMATERIAL_CREATE'.
    Normally it should work. Since It’s not working I am trying with another alternative..
    i.e EXPORT (ptab) INTERNAL TABLE itab.
    My sap version is ECC 5.0….
    For your information, here I am forwarding sap help. Pls have a look and explain how to declare ptab internal table.
    +Extract from SAP help+
    In the dynamic case the parameter list is specified in an index table ptab with two columns. These columns can have any name and have to be of the type "character". In the first column of ptab, you have to specify the names of the parameters and in the second column the data objects. If the second column is initial, then the name of the parameter in the first column has to match the name of a data object. The data object is then stored under its name in the cluster. If the first column of ptab is initial, an uncatchable exception will be raised.
    Outside of classes you can also use a single-column internal table for parameter_list for the dynamic form. In doing so, all data objects are implicitly stored under their name in the data cluster.
    My internal table having around 45 columns.
    pls help me.
    Thanks in advance
    raghunath

    The export/import should work the way you are using it. Just make sure you are using same memory id and make sure its unique - meaning u are using it only for this itab purpose and not overwriting it with other values. Check itab is not initial before you export in program 1 - then import it in prog2 with same memory id...also check case, I am not sure if its case sensitive...
    Here is how you use the second variant...
    Two fields with two different identifications "P1" and "P2" with the dynamic variant of the cluster definition are written to the ABAP Memory. After execution of the statement IMPORT, the contents of the fields text1 and text2 are interchanged.
    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.
    IMPORT p1 = text2
           p2 = text1 FROM MEMORY ID id.

  • 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

  • Exporting Internal Table from Methods

    Hi Experts,
    I wanted to export an internal table from Methods and I am using below syntax and its not working.
    METHODS get_data IMPORTING value(s_matnr) type mara-matnr
                     exporting it_tab TYPE STANDARD TABLE itab.
    Please let me know what is the proper syntax.
    Thanks
    Basanagouda

    Hi,
    Define itab as a 'table type' of standard table.
    Example: TYPES: t_sflight TYPE STANDARD TABLE OF sflight.
    METHODS : get_data IMPORTING s_carrid type sel_carrid
    EXPORTING e_tab type t_sflight.
    ENDCLASS

  • Importing internal table from diffrent program

    HI experts,
    i have two ALV report zprograms . My requirements is i have to write a report in that report i want to pass input screen parameters to each report and get their final intarnal table without generating ALV. How is it possible.
    my question is i want to call any program and export values of thier screen parameter and get the final internal table as export.
    Pls Help. THanks in advace
    Ajay Kuamr

    Hello Ajay,
    In each of the report you can EXPORT the internal table contents to SAP memory & IMPORT the table contents in the third program.
    You have to use SUBMIT statements for each report & get back the internal table using IMPORT statements.
    For further details explore SDN.
    BR,
    Suhas

  • 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

  • Import from internal table

    Dear Experts,
    I need a solution for importing from an internal table.
    Two variables I_EXP01 and I_EXP02 containing an xml stream have been exported to the database using the following syntax
    and depending on the size of I_EXP01 and I_EXP02 two or more entries are created in table LTEX.
    EXPORT
             L_SAPRL
             I_EXP01
             I_EXP02
    TO    DATABASE LTEX(LT)
                           ID LS_LTEXKEY.
    But now i have a few entries of table LTEX in an internal table and they need to be imported from the internal table.
    What would be the syntax to import from internal table so that after importing I can de-serialise the data from XML to ABAP.
    Thanks & Regards,
    Ashwini

    Try this and let me know if it works:
    IMPORT
    L_SAPRL
    I_EXP01
    I_EXP02
    To
    L_SAPRL1 (same type as above)
    I_EXP011 (same type as above)
    I_EXP021 (same type as above)
    FROM DATABASE LTEX(LT)
    ID LS_LTEXKEY.
    if it is not working. try using seperate statements for each internal table and see.
    Thanks,
    Venkatesh.
    Edited by: venkatesh333 on Jul 27, 2011 6:23 AM

  • Export Internal Table to XML in Background

    Hi
    I need to export a internal table into xml file in background using open dataset. The file is getting created but i am not able to open the file using IE/XML editor . When i open the file uisng wordpad i can see some charcters at the end of file which prevents it from opening in xml editor. if i delete the characters(box like) and save the file. i am able to open the file
    When i downalod the same internal table via frontend using ws_downlod it works pefectly. no junk charcters are appended in the end. and hence files opens perfectly
    below is the extract of program
    START-OF-SELECTION.
       PERFORM get_data.
       PERFORM create_xml.
    FORM get_data.
       REFRESH accesos.
       CLEAR accesos.
       MOVE: '45050' TO accesos-socio-numero,
                     'MOISES MORENO' TO accesos-socio-nombre,
                     '0' TO accesos-socio-reposicion.
       APPEND accesos.
    ENDFORM.
    i am using the following function modules
    CALL FUNCTION 'SDIXML_DATA_TO_DOM'
            EXPORTING
                 name         = 'ACCESOS'
                 dataobject   = accesos[]
            IMPORTING
                 data_as_dom  = l_dom
    CHANGING
                 document     = m_document
            EXCEPTIONS
                 illegal_name = 1
                 OTHERS       = 2.
           CHECK NOT l_dom IS INITIAL.
    w_rc = m_document->append_child( new_child = l_dom ).
    CALL FUNCTION 'SDIXML_DOM_TO_XML'
    EXPORTING
    document      = m_document
    IMPORTING
    xml_as_string = w_string
    size          = w_size
    TABLES
    xml_as_table  = it_xml
    EXCEPTIONS
    no_document   = 1
    OTHERS        = 2.
    LOOP AT it_xml INTO xml_tab-d.
         APPEND xml_tab.
       ENDLOOP.
    The following syntax for open datset which does not work
      lv_physcial_file = '
    hdat03\test.xml'.
    OPEN DATASET lv_physcial_file IN BINARY MODE   FOR OUTPUT MESSAGE l_msg.
       LOOP AT xml_tab.
         TRANSFER xml_tab TO lv_physcial_file.
       ENDLOOP.
    The ws_download function works
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
                   BIN_FILESIZE = W_SIZE
                   FILENAME = GK_RUTA
                   FILETYPE = 'BIN'
    TABLES
                   DATA_TAB = XML_TAB
    EXCEPTIONS
                   OTHERS = 10.
    many thnaks

    Hi Chetan,
    Can you just try changing the syntax to the following, I not sure if that will help but just try and see.
    OPEN DATASET  lv_physcial_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    Regards
    Mohamed

  • Export internal table from report to web-dynpro

    Hi,
    I am trying to export an internal table from a report to my web dynpro pragram however its not working.
    Statement used in my report -
    EXPORT it_ordbk FROM it_ordbk TO MEMORY ID 'ZORDBK'.
    Statement used in my web dynpro program
    IMPORT it_ordbk to it_ordbk  FROM MEMORY ID 'ZORDBK'.
    This dynpro application is being called in HTML container on the screen.
    Kindly help.
    Cordially,
    Danish

    Hi Danish,
    do not use export or import in Webdynpro.
    try to create a class with global variables and in the report or at the place of Export fille the data .
    and next in the place of Import memory to to call the global variable in the webdynpro and fill the internal table
    go to se24> create a zclasss->  methods initialize>create a ztable same as export table and also declare in glaobal vairaible
    --> next in the webdynpro program -->call the method retrive and push the global data to internal table.
    Prabhudas

  • 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.

Maybe you are looking for

  • UTF-8 encoding trouble

    I need to use UTF8 encoding throughout a site. For that purpose, I have the following tags on JSP: <%@ page contentType="text/html; charset=UTF-8" %> <meta http-equiv="Content-Type" CONTENT="text/html; charset=UTF-8"> Next, in my weblogic.xml, I have

  • Session is set for every request

    Hi, With WL Server 6.1SP1 we have some peculiar problem. Every request is considered as a new request and a new session object is created. So the information we stored in the session is no longer available for subsequent requests. This behaviour is s

  • Append report text adds

    My data is being saved with a block at the end of the data. It appears to becoming in with a star due to using Array to Spreadsheet String VI. Not sure what to do to get rid of the block. The complete VI that is giving me trouble is attached. Attachm

  • Where can i download database server 8.1.5?

    Where can i download database server 8.1.5? All download links to 8.x looks dead.

  • "Invalid Account. Please Validate." for Curve 9360

    Facing this issue since I bought the device since last Thursday. The issue is recurring, and even the successful account setup attempt never pops up email account message box on home screen and after some time the status is same - Invalid Account. Pl