Internal table to file - SE16N extract format

Hello experts,
I have a few records in my internal table and would like to throw these records into a file on my PC without displaying these records. The format of the output file should be identical to the format that we get from Export -> Localfile -> unconverted functionality in SE16N. Any thoughts / suggestions please? Thanks.

Hi Ritesh,
Upload data to application server in a specific format
CG3Z -  to upload file from presentation server to application server.
Upload a empty .txt file any path in the application server using CG3Z tcode and use this path in the program
Thanks
Naveen khan

Similar Messages

  • Internal table data download to XML format

    Hello All,
    I have devloped one OOPS ALV report in that our requirement is on "SAVE" button the data of the report has to be downloaded in given XML format.Please check the format provided in Finnish language.The word "Value" specified as value which are coming in the ALV report against fields mentioned.
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!u2014Aromi list -->
    <!-- Copyright -->
    <!-- Edited with Visual Basic 6 -->
    <!-- Versio 1.0 -->
        <Tiedot Lahettaja="Value" Yhteyshlo=" Value"    
                    Yhteystieto=" Value " Asiakasnumero="">
           <Raaka-aine Nimi="" Ryhma=" Value ">
              <Tuotemerkki Nimi=" Value " Ean=" Value "
                                  Ykspakkauskoko="1" Ykspakkaustyyppi="KPL" almistaja="Value">
                 <Toimittajatiedot Tuotekoodi="10" Sopimustuote="Y" Myyntierakoko="5"
                                    Myyntieratyyppi="ME" Myyntierahinta="3,035" Hintapvm="value"
                  />
          </Tuotemerkki>
      </Raaka-aine>
    </Tiedot>
    Could anybody help how to download the report data into above format.
    Regards,
    Sachin

    Hi Sachin,
    I see the sample XML has field values embedded as XML element attributes.ie <Raaka-aine Ryhma=" Value ">. For such specific requirements:
    1. Loop through the table and Use iXML library functions to build the complete XML, element by element. Help - http://help.sap.com/saphelp_nw04/helpdata/en/86/8280ba12d511d5991b00508b6b8b11/frameset.htm
    2. You can create an XSLT Transformation that match the specific XML format,  and use CALL TRANSFORMATION to convert internal table to that specific XML format.
    Few Standard Function modules and class CL_XML_DOCUMENT may help for generic SAP XML conversions, where XML element names will be same as internal table field names. Not, sure if these can be used to generate specific XML formats.
    Thanks,
    Varun
    Edited by: Varun VS on Oct 25, 2011 7:48 AM

  • Reading internal table into File Adapter

    Hi,
    I would like to read an internal table from RFC function (sender), and write all the rows into the file by using File Adapter. Here is the scenerio;
    RFC Adapter -> XI -> File adapter
    Internal table content, below;
    FLD1  FLD2   FLD3
    1        A        B
    2        X        Y
    I expect the result, below;
    <?xml version="1.0" encoding="UTF8" ?>
    <rfc:Z_RFC xmlns:rfc="urn:sapcom:document:sap:rfc:functions">
    <ITAB_ZSUBS001>
      <item>
       <FLD1>1</FLD1>
       <FLD2>A</FLD2>
       <FLD3>B</FLD3>
      </item>
      <item>
       <FLD1>2</FLD1>
       <FLD2>X</FLD2>
       <FLD3>Y</FLD3>
      </item>
    </ITAB_ZSUBS001>
    </rfc:Z_RFC>
    I see all the records in payload, but cannot write into file. Anybody have any suggestion? Thank you.
    Regards,
    Orkun Gedik
    Message was edited by:
            Orkun GEDIK

    Hi,
    Thank you for the feedback. From now on I am getting the error, below;
    Error> occured [1] >Thu Apr 05 09:24:21,046<   
    RfcException:
        message: Commit fault: com.sap.aii.af.rfc.afcommunication.RfcChannelMismatchException: Wrong Sender Agreement:The Sender agreement does not have channel Rfc_Fiyat_Sender configured for the functionmodule Z_RFC
        Return code: RFC_CLOSED(6)
        error group: 108
        key: RFC_ERROR_INTERNAL
    Please see the last configuration, below;
    Message mappings:
    RFC Message:
    Messages 1..1
    Message1 1..1
    Z_RFC 1..1
    ITAB_ZSUBS001 1..1
    item 0..unbounded
    TXTKOD 0..1
    TXTAD 0..1
    TXTADDR 0..1
    Message Type: Malzeme
    Messages 1..1
    Message1 1..1
    Malzeme 0..unbounded
    TXTKOD 1..1
    TXTAD 1..1
    TXTADDR 1..1
    Interface mappings:
    Source Interface: Z_RFC Occurrence 1
    Target Interface: MI_MAlzeme_In_Asyn Occurrence 0..unbounded
    I bound the items below;
    item -> Malzeme
    TXTKOD -> TXTKOD
    TXTAD -> TXTAD
    TXTADDR -> TXTADDR
    Also,I refreshed the adapter cache and full cache by using SXI_CACHE and restart the RFC adapter thorugh Visual Admin in order to solve the problem, but it couldn't be a solution for the problem. Do you have any suggestion about it?
    Regards
    Message was edited by:
            Orkun GEDIK

  • Internal table - excel file

    how to move the contents of internal table to excel file with tab delimited. the excel file should be created dynamically with preloaded header information.the naming of the excel file also should change dynamically.

    Hi,
    Use the below function module
    CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
         EXPORTING
            I_FIELD_SEPERATOR    =
            I_LINE_HEADER        =
              i_filename           = p_fname "'D:\file1.xls'
            I_APPL_KEEP          = ' '
         tables
              i_tab_sap_data       = input_rec "your internal table
       CHANGING
            I_TAB_CONVERTED_DATA =
       EXCEPTIONS
            CONVERSION_FAILED    = 1
            OTHERS               = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Comapare internal tables which are in tree format

    Hi guys,
    Consider internal table
         level | material-no.|quantity
          1 | mat-1 |              10
          2  |             mat-5  |             1
          3            |   mat-2    |           1
          3   |   mat-4  |      12
          2    |  mat-12      |  11
          3    |  mat-15      |  12
    ................................>mat1  ends here..it contains mat5 and mat 12 which in turn contain          
    .......................mat2 & 4 and mat 15 respectively.
          1    |  mat-8     |    1
          2    |  mat-6     |     3
          2    |  mat-100    |    5
    ......................................>mat 8 ends here
          1  |    mat -6    |    13
    .......................................>mat 6 ends here
      This data is in one internal table, here there are 3 main materials (1,8,6) which are in-turn made of other materials.
    material at level 1 is made of materials at level 2
      and in-turn materials at level2 are made up of materials at level3 .
    Now same material can exist at different levels ...
    What would be the efficient way to compare two such internal tables and comparisons are done wrt quantity but level  and hierarchy at which material exits matters and
    comparison shuld be done at each level .
    if both materials  are in same hierarchy in both tables but diff in quantity then they are unequal .
    if both materials are in same hierarchy  in both tables and equal  in quantity then they are equal .
    if that material exist in one but doesnot exist in other table in similar hierarchy then its rendered as
    not found.
    many thanks in advance.

    Hi Anurag,
    Thanks for the reply but the number of levels is not always 3(it completely depends on data) .I came up with one solution --what I have done is , created one more column <b>HPATH</b> in the internal table and kept hierarchy relationship ..i.e
    level| material| qty | HPATH(hierarchy path)
    1 | mat-1 | 10 | mat-1
    2 | mat-5 | 1 | mat-1 2 mat-5
    3 | mat-2 | 1 | mat-1 2 mat-5 3 mat-2
    3 | mat-4 | 12 | mat-1 2 mat-5 3 mat-4
    2 | mat-12 | 11 | mat-1 2 mat-12
    3 | mat-15 | 12 | mat-1 2 mat-12 3 mat-15
    1 | mat-8 | 1 | mat-8
    2 | mat-6 | 3 | mat-8 2 mat-6
    2 | mat-100 | 5 | mat-8 2 mat-100
    2 and 3 are the path seperates..which indicate the level..
    Thus I get key as unique for each material depending on its position in heirarchy ..
    Then I looped wrt one  table and read data form other table with HPATH as key  and compared it .
    This solved it...
    The number of levels doesnot matter in this solution...
    Thanks once again for replying to my post. I would be to  happy  to put up the code if u want..

  • Question about reading csv file into internal table

    Some one (thanks those nice guys!) in this forum have suggested me to use FM KCD_CSV_FILE_TO_INTERN_CONVERT to read csv file into internal table. However, it can be used to read a local file only.
    I would like to ask how can I read a CSV file into internal table from files in application server?
    I can't simply use SPLIT as there may be comma in the content. e.g.
    "abc","aaa,ab",10,"bbc"
    My expected output:
    abc
    aaa,ab
    10
    bbb
    Thanks again for your help.

    Hi Gundam,
    Try this code. I have made a custom parser to read the details in the record and split them accordingly. I have also tested them with your provided test cases and it work fine.
    OPEN DATASET dsn FOR input IN TEXT MODE ENCODING DEFAULT.
    DO.
    READ DATASET dsn INTO record.
      PERFORM parser USING record.
    ENDDO.
    *DATA str(32) VALUE '"abc",10,"aaa,ab","bbc"'.
    *DATA str(32) VALUE '"abc","aaa,ab",10,"bbc"'.
    *DATA str(32) VALUE '"a,bc","aaaab",10,"bbc"'.
    *DATA str(32) VALUE '"abc","aaa,ab",10,"b,bc"'.
    *DATA str(32) VALUE '"abc","aaaab",10,"bbc"'.
    FORM parser USING str.
    DATA field(12).
    DATA field1(12).
    DATA field2(12).
    DATA field3(12).
    DATA field4(12).
    DATA cnt TYPE i.
    DATA len TYPE i.
    DATA temp TYPE i.
    DATA start TYPE i.
    DATA quote TYPE i.
    DATA rec_cnt TYPE i.
    len = strlen( str ).
    cnt = 0.
    temp = 0.
    rec_cnt = 0.
    DO.
    *  Start at the beginning
      IF start EQ 0.
        "string just ENDED start new one.
        start = 1.
        quote = 0.
        CLEAR field.
      ENDIF.
      IF str+cnt(1) EQ '"'.  "Check for qoutes
        "CHECK IF quotes is already set
        IF quote = 1.
          "Already quotes set
          "Start new field
          start = 0.
          quote = 0.
          CONCATENATE field '"' INTO field.
          IF field IS NOT INITIAL.
            rec_cnt = rec_cnt + 1.
            CONDENSE field.
            IF rec_cnt EQ 1.
              field1 = field.
            ELSEIF rec_cnt EQ 2.
              field2 = field.
            ELSEIF rec_cnt EQ 3.
              field3 = field.
            ELSEIF rec_cnt EQ 4.
              field4 = field.
            ENDIF.
          ENDIF.
    *      WRITE field.
        ELSE.
          "This is the start of quotes
          quote = 1.
        ENDIF.
      ENDIF.
      IF str+cnt(1) EQ ','. "Check end of field
        IF quote EQ 0. "This is not inside quote end of field
          start = 0.
          quote = 0.
          CONDENSE field.
    *      WRITE field.
          IF field IS NOT INITIAL.
            rec_cnt = rec_cnt + 1.
            IF rec_cnt EQ 1.
              field1 = field.
            ELSEIF rec_cnt EQ 2.
              field2 = field.
            ELSEIF rec_cnt EQ 3.
              field3 = field.
            ELSEIF rec_cnt EQ 4.
              field4 = field.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
      CONCATENATE field str+cnt(1) INTO field.
      cnt = cnt + 1.
      IF cnt GE len.
        EXIT.
      ENDIF.
    ENDDO.
    WRITE: field1, field2, field3, field4.
    ENDFORM.
    Regards,
    Wenceslaus.

  • How to convert an internal table of char type to Raw (1022 char) format int

    Hi All,
    I am facing the problem while converting the character type internal table to Raw (1022 char) format internal table.
    Example :
    Source :
    Internal table - Itab_send of type char132.
    Target : ( Required )
    Internal table - itab_receive of type SDOK_SDATX .
    Note : SDOK_SDATX = Raw ( 1022 char )
    Thank  you,
    Purshoth

    Possible Solution : Move it to source character field to string and string to raw field.
    try to find FM , go in se37 and *RAW *
    RSAB_CONVERT_RAW_TO_CHAR convert raw to char.
    Edited by: Harsh Bhalla on Dec 15, 2009 10:31 PM

  • How to Convert internal table data into text output and send mail in ABAP

    Hi All,
    Good Morning.
    Taking a glance at a code that converts internal table data to an Excel file in ABAP. also checked how to send this excel to mailing list as attachment.
    But thought of doing it without excel.
    I mean, I have an internal table which contains fields of all types (character,integer,date,time). Since it is only around 4 to 5 rows in it (output),why to convert it to excel. not required!!.  Instead I  want to send this output to User's mails as Normal mail body with No attachments.
    Could anybody please suggest me a way as to how to send internal table data as a mail ( not as an excel or PDF etc).
    as of now my findings are, it is quite complex to convert internal table data to email (Text) format. but i believe if there is some way of doing it.
    Best Regards
    Dileep VT

    here's something I have used in the past where we send out information about failed precalculation settings (which are stored in internal table gt_fail)
    notice we use gt_text as "mail body"
    TRY.
    *     -------- create persistent send request ------------------------
           gv_send_request = cl_bcs=>create_persistent( ).
    *     -------- create and set document -------------------------------
    *     create text to be sent
           wa_line = text-001.
           APPEND wa_line TO gt_text.
           CLEAR wa_line.
           APPEND wa_line TO gt_text.
           LOOP AT gt_fail ASSIGNING <fs_fail>.
             MOVE <fs_fail>-retry_count TO gv_count.
             CONCATENATE text-002
                         <fs_fail>-setting_id
                         text-003
                         gv_count
                         INTO wa_line SEPARATED BY space.
             APPEND wa_line TO gt_text.
             CLEAR wa_line.
           ENDLOOP.
           APPEND wa_line TO gt_text.
           wa_line = text-007.
           APPEND wa_line TO gt_text.
    *     create actual document
           gv_document = cl_document_bcs=>create_document(
                           i_type    = 'RAW'
                           i_text    = gt_text
                           i_length  = '12'
                           i_subject = 'Failed Precalculation Settings!' ).
    *     add document to send request
           CALL METHOD gv_send_request->set_document( gv_document ).
    *     --------- set sender -------------------------------------------
           gv_sender = cl_sapuser_bcs=>create( sy-uname ).
           CALL METHOD gv_send_request->set_sender
             EXPORTING
               i_sender = gv_sender.
    *     --------- add recipient (e-mail address) -----------------------
           LOOP AT s_email INTO wa_email.
             MOVE wa_email-low TO gv_email.
             gv_recipient = cl_cam_address_bcs=>create_internet_address(
                                               gv_email ).
             CALL METHOD gv_send_request->add_recipient
               EXPORTING
                 i_recipient = gv_recipient
                 i_express   = 'X'.
           ENDLOOP.
    *     ---------- set to send immediately -----------------------------
           CALL METHOD gv_send_request->set_send_immediately( 'X' ).
    *     ---------- send document ---------------------------------------
           CALL METHOD gv_send_request->send(
             EXPORTING
               i_with_error_screen = 'X'
             RECEIVING
               result              = gv_sent_to_all ).
           IF gv_sent_to_all = 'X'.
             WRITE text-004.
           ENDIF.
           COMMIT WORK.
    *   exception handling
         CATCH cx_bcs INTO gv_bcs_exception.
           WRITE: text-005.
           WRITE: text-006, gv_bcs_exception->error_type.
           EXIT.
       ENDTRY.
    with the following declarations
    * TABLES                                                               *
    TABLES:
       adr6,
       rsr_prec_sett.
    * INTERNAL TABLES & WORK AREAS                                         *
    DATA:
       gt_fail          TYPE SORTED TABLE OF rsr_prec_sett
                             WITH UNIQUE KEY setting_id run_date,
       gt_text          TYPE bcsy_text,
       wa_fail          LIKE LINE OF gt_fail,
       wa_line(90)      TYPE c.
    FIELD-SYMBOLS:
       <fs_fail>        LIKE LINE OF gt_fail.
    * VARIABLES                                                            *
    DATA:
       gv_count(4)      TYPE n,
       gv_send_request  TYPE REF TO cl_bcs,
       gv_document      TYPE REF TO cl_document_bcs,
       gv_sender        TYPE REF TO cl_sapuser_bcs,
       gv_recipient     TYPE REF TO if_recipient_bcs,
       gv_email         TYPE adr6-smtp_addr,
       gv_bcs_exception TYPE REF TO cx_bcs,
       gv_sent_to_all   TYPE os_boolean.
    * SELECTION-SCREEN                                                     *
    SELECT-OPTIONS:
       s_email          FOR adr6-smtp_addr NO INTERVALS MODIF ID sel.
    DATA:
       wa_email         LIKE LINE OF s_email.

  • Transfer intenal table to file

    Hi abaers,
    i need to transfer the internal table data to file,,this file to create in application server.
    internal table lineitems contains 100 fields...
    i tried in the following method: but 100 fields i have to move each and evry field to t_output-data.. so it is becoming complex.
    data: begin of t_output occurs 0,
         data(800),
       end of t_output.
    loop at lineitems.
    t_output-data(4) = lineitems-COMP_CODE.
    t_output-data+4(10) = lineitems-VENDOR.
    append t_output.
    clear t_output.
    endloop.
       open dataset filename for output in text mode encoding default.
       loop at t_output.
          transfer t_output-data to filename.
         clear t_outpu-data.
       endloop.
       close dataset filename.
    endif.
    is there any other method to do direct transfer from internal table to file..

    Hi,
    I think FM: GET_COMPONENT_LIST would be very useful to u.
    i have attached the complete code and it's working absolutely fine with me.
    Code **********
    types: begin of type_item,
            f1(3),
            f2(3),
            f3(3),
            f4(3),
           end of type_item.
    types: begin of type_data,
            data(800),
           end of type_data.
    data : lineitems type table of type_item with header line,
           t_output type table of type_data with header line,
           fieldlist type table of RSTRUCINFO with header line.
    lineitems-f1 = 'a1'.
    lineitems-f2 = 'a2'.
    lineitems-f3 = 'a3'.
    lineitems-f4 = 'a4'.
    append lineitems.
    lineitems-f1 = 'b1'.
    lineitems-f2 = 'b2'.
    lineitems-f3 = 'b3'.
    lineitems-f4 = 'b4'.
    append lineitems.
    lineitems-f1 = 'c1'.
    lineitems-f2 = 'c2'.
    lineitems-f3 = 'c3'.
    lineitems-f4 = 'c4'.
    append lineitems.
    lineitems-f1 = 'd1'.
    lineitems-f2 = 'd2'.
    lineitems-f3 = 'd3'.
    lineitems-f4 = 'd4'.
    append lineitems.
    field-symbols : <fs> type any.
    CALL FUNCTION 'GET_COMPONENT_LIST'
      EXPORTING
        PROGRAM    = sy-repid
        FIELDNAME  = 'lineitems'
      TABLES
        COMPONENTS = fieldlist.
    data : fieldname like fieldlist-compname,data_line type type_data,dref
    type ref to data.
    format color 3.
    loop at lineitems REFERENCE INTO dref. .
    loop at fieldlist.
        fieldname =  fieldlist-compname .
        assign dref->(fieldname) to <fs>.
      concatenate data_line <fs> into data_line .
    endloop.
    append data_line to t_output.
    clear data_line.
    endloop.
    loop at t_output.
      write:/ t_output.
    endloop.
    Code *************
    If u still have any issues please revert back.
    Hope it'll help u.
    Regards,
    Ankur

  • What is the best way to declare field length 500 in internal table?

    Hi all,
    what is the best way to declare field length 500(constant value allways) in internal table?
    I am trying to send data from internal table to file format, and I have a field in internal table with 500 length (constant value always). So how do I can declare and append this field value to table?
    Thanks
    Murali

    Hi.  Please see the following example program, notice how I am filling the field with the constant value.
    report zrich_0001.
    *       CLASS lcl_main DEFINITION
    class lcl_main definition.
      public section.
        types: begin of ttab,
                fld1(500) type c,
               end of ttab.
        data: itab type table of ttab.
        data: xtab type ttab.
        methods: constructor,
                 write_itab.
    endclass.
    *       CLASS lcl_main IMPLEMENTATION
    class lcl_main implementation.
      method constructor.
    <b>
        xtab-fld1 =
          'This is one part of the total string which needs to be really' &
          ' long and this is a constant and we need to move it to a work' &
             ' area and then append it to the internal table which has a' &
              ' field with a length of five hundred characters'.
        append xtab to itab.</b>
      endmethod.
      method write_itab.
        loop at itab into xtab.
          write:/ xtab-fld1.
        endloop.
      endmethod.
    endclass.
    data: o_main type ref to lcl_main.
    start-of-selection.
      create object o_main.
      call method o_main->write_itab.
    Regards,
    Rich Heilman

  • Xml data to abap internal table

    I'm presently working on a interface where data in abap internal table is converted into xml format and placed in the frontend and vice versa.
    I'm through with the first part and in secodn part also I'm able to transfer the data from frontend to Document Object Model(DOM) by parsing but finally am not able to put it into an internal table.
    Please help (Urgent).
    Thanks and regards,
    S.K.Tripathy

    Hi sitakant,
    1. itab --- > xml
       xml ---> itab.
    2. This program will do both.
       (just copy paste in new program)
    3.
    REPORT abc.
    DATA
    DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
    DATA : BEGIN OF itab OCCURS 0,
    a(100) TYPE c,
    END OF itab.
    DATA: xml_out TYPE string .
    DATA : BEGIN OF upl OCCURS 0,
           f(255) TYPE c,
           END OF upl.
    DATA: xmlupl TYPE string .
    FIRST PHASE
    FIRST PHASE
    FIRST PHASE
    Fetch Data
    SELECT * FROM t001 INTO TABLE t001.
    XML
    CALL TRANSFORMATION ('ID')
    SOURCE tab = t001[]
    RESULT XML xml_out.
    Convert to TABLE
    CALL FUNCTION 'HR_EFI_CONVERT_STRING_TO_TABLE'
      EXPORTING
        i_string         = xml_out
        i_tabline_length = 100
      TABLES
        et_table         = itab.
    Download
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filetype = 'BIN'
        filename = 'd:\xx.xml'
      TABLES
        data_tab = itab.
    SECOND PHASE
    SECOND PHASE
    SECOND PHASE
    BREAK-POINT.
    REFRESH t001.
    CLEAR t001.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename = 'D:\XX.XML'
        filetype = 'BIN'
      TABLES
        data_tab = upl.
    LOOP AT upl.
      CONCATENATE xmlupl upl-f INTO xmlupl.
    ENDLOOP.
    XML
    CALL TRANSFORMATION ('ID')
    SOURCE  XML xmlupl
    RESULT tab = t001[]
    BREAK-POINT.
    regards,
    amit m.

  • Transfer of Internal table contents to ftp server

    Hi,
    I have data in one internal table, which needs to transferred to file on ftp server,
    please tell me how to create file on ftp server, how should i transfer contents of this internal table to file on ftp server.
    please help me.

    Hi,
    Please refer following code, which create a log file in Ftp server,
    Step 1 Connect to Ftp server.
    SET EXTENDED CHECK OFF.
        g_slen = STRLEN( p_pwd ).
      CALL FUNCTION 'HTTP_SCRAMBLE'
        EXPORTING
          SOURCE      = p_pwd
          sourcelen   = g_slen
          key         = g_key
        IMPORTING
          destination = p_pwd.
      CALL FUNCTION 'FTP_CONNECT'
        EXPORTING
          user            = p_user        <----- Pass User ID
          password        = p_pwd  <---- Pass Password
          host            = p_host        <---- Pass IP Address
          rfc_destination = p_dest  <----- RFC destination SAPFTP
        IMPORTING
          handle          = g_hdl
        EXCEPTIONS
          not_connected   = 1
          OTHERS          = 2.
      IF sy-subrc <> 0.
        sy-msgty = 'E'.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    *   MESSAGE SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4 TYPE 'I'.
      ENDIF.
    Step 2  Reading file from FTP
    CALL FUNCTION 'FTP_SERVER_TO_R3'
      EXPORTING
        handle               = g_hdl
        fname                = p_fname   <---- File path
    *   CHARACTER_MODE       =
    IMPORTING
       BLOB_LENGTH          = l_xml_table_size
    TABLES
       BLOB                 = l_xml_table
    *   TEXT                 =
    EXCEPTIONS
       TCPIP_ERROR          = 1
       COMMAND_ERROR        = 2
       DATA_ERROR           = 3
       OTHERS               = 4
    Step 3 Write a file
    g_docid = l_filename.
    * **Transferring the data from internal table to FTP Server.
      DESCRIBE TABLE gt_log LINES l_count.
      g_slen = l_count * 275.
    CALL FUNCTION 'FTP_R3_TO_SERVER'
      EXPORTING
        handle               = g_hdl
        fname                = g_docid     <---File name
       BLOB_LENGTH          = g_slen   <---- Length
       CHARACTER_MODE       = 'X'
    TABLES
    *   BLOB                 =
       TEXT                 = gt_log
    EXCEPTIONS
       TCPIP_ERROR          = 1
       COMMAND_ERROR        = 2
       DATA_ERROR           = 3
       OTHERS               = 4

  • Doubt In internal table using in GUI download

    Hi,
    how to get the field lable of all the fields in the internal table... when i download it to xls file... while downloading it i want to pass the field lable first and then its value.
    eg. in mara table .
    MATERIAL NO.
    p-101
    points will be rewarded for correct answer.

    hi,
    Actually i'm downloading the data from mara table to excel file i.e from mara -> internal table-> excel file.
    In this i'm gettng all the values in excel file but i don't kno what those values exactly ment for , so i want the fields lable to be passed first.
    But i don't kno how to get the field lables into the internal atble and then how to pass that value to the excel file.
    Thanks.
    Arunprasad.P

  • What is internal table? read the another questions

    What are internal tables? How do you get the number of lines in an internal table? How to use a specific number occurs statement?
    send me replay also

    hi,
    try this links....
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/content.htm
    An internal table is one of two structured data types in ABAP. It can contain any number of identically structured rows, with or without a header line.
    The header line is similar to a structure and serves as the work area of the internal table. The data type of individual rows can be either elementary or structured.
    Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by line in memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays. Since they are dynamic data objects, they save the programmer the task of dynamic memory management in his or her programs. You should use internal tables whenever you want to process a dataset with a fixed structure within a program. A particularly important use for internal tables is for storing and formatting data from a database table within a program. They are also a good way of including very complicated data structures in an ABAP program.
    Fields of Internal Tables
    SY-TABIX
    Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables. The field is either not set or is set to 0 for hashed tables.
    APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
    COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
    LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
    READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
    SEARCH <itab> FOR sets SY-TABIX to the index of the table line in which the search string is found.
    SY-TFILL
    After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TFILL contains the number of lines in the relevant internal table.
    SY-TLENG
    After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TLENG contains the length of the lines in the relevant internal table.
    SY-TOCCU
    After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TLENG contains the initial amount of memory allocated to the relevant internal table.
    i think this will solve your problem don't forget to reward points.
    regards,

  • Need information about Internal Tables

    Hi Every one!
    I Need some information about Internal tables. Pls help be above the same.
    Thanks & with Regards,
    Chandra.

    Hi..,
    <b>
    Internal tables </b>
    Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by line in memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays. Since they are dynamic data objects, they save the programmer the task of dynamic memory management in his or her programs. You should use internal tables whenever you want to process a dataset with a fixed structure within a program. A particularly important use for internal tables is for storing and formatting data from a database table within a program. They are also a good way of including very complicated data structures in an ABAP program.
    Like all elements in the ABAP type concept, internal tables can exist both as data types and as data objects A data type is the abstract description of an internal table, either in a program or centrally in the ABAP Dictionary, that you use to create a concrete data object. The data type is also an attribute of an existing data object.
    <b>Internal Tables as Data Types</b>
    Internal tables and structures are the two structured data types in ABAP. The data type of an internal table is fully specified by its line type, key, and table type.
    <b>Line type</b>
    The line type of an internal table can be any data type. The data type of an internal table is normally a structure. Each component of the structure is a column in the internal table. However, the line type may also be elementary or another internal table.
    <b>Key</b>
    The key identifies table rows. There are two kinds of key for internal tables - the standard key and a user-defined key. You can specify whether the key should be UNIQUE or NON-UNIQUE. Internal tables with a unique key cannot contain duplicate entries. The uniqueness depends on the table access method.
    If a table has a structured line type, its default key consists of all of its non-numerical columns that are not references or themselves internal tables. If a table has an elementary line type, the default key is the entire line. The default key of an internal table whose line type is an internal table, the default key is empty.
    The user-defined key can contain any columns of the internal table that are not references or themselves internal tables. Internal tables with a user-defined key are called key tables. When you define the key, the sequence of the key fields is significant. You should remember this, for example, if you intend to sort the table according to the key.
    <b>
    Table type</b>
    The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types:
    <u>Standard tables</u> have an internal linear index. From a particular size upwards, the indexes of internal tables are administered as trees. In this case, the index administration overhead increases in logarithmic and not linear relation to the number of lines. The system can access records either by using the table index or the key. The response time for key access is proportional to the number of entries in the table. The key of a standard table is always non-unique. You cannot specify a unique key. This means that standard tables can always be filled very quickly, since the system does not have to check whether there are already existing entries.
    <u>
    Sorted tables</u> are always saved sorted by the key. They also have an internal index. The system can access records either by using the table index or the key. The response time for key access is logarithmically proportional to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique or non-unique. When you define the table, you must specify whether the key is to be unique or not. Standard tables and sorted tables are known generically as index tables.
    <u>
    Hashed tables</u> have no linear index. You can only access a hashed table using its key. The response time is independent of the number of table entries, and is constant, since the system access the table entries using a hash algorithm. The key of a hashed table must be unique. When you define the table, you must specify the key as UNIQUE.
    <b>
    Generic Internal Tables</b>
    Unlike other local data types in programs, you do not have to specify the data type of an internal table fully. Instead, you can specify a generic construction, that is, the key or key and line type of an internal table data type may remain unspecified. You can use generic internal tables to specify the types of field symbols and the interface parameters of procedures . You cannot use them to declare data objects.
    <b>Internal Tables as Dynamic Data Objects</b>
    Data objects that are defined either with the data type of an internal table, or directly as an internal table, are always fully defined in respect of their line type, key and access method. However, the number of lines is not fixed. Thus internal tables are dynamic data objects, since they can contain any number of lines of a particular type. The only restriction on the number of lines an internal table may contain are the limits of your system installation. The maximum memory that can be occupied by an internal table (including its internal administration) is 2 gigabytes. A more realistic figure is up to 500 megabytes. An additional restriction for hashed tables is that they may not contain more than 2 million entries. The line types of internal tables can be any ABAP data types - elementary, structured, or internal tables. The individual lines of an internal table are called table lines or table entries. Each component of a structured line is called a column in the internal table.
    <b>
    Choosing a Table Type</b>
    The table type (and particularly the access method) that you will use depends on how the typical internal table operations will be most frequently executed.
    <b>
    Standard tables</b>
    This is the most appropriate type if you are going to address the individual table entries using the index. Index access is the quickest possible access. You should fill a standard table by appending lines (ABAP APPEND statement), and read, modify and delete entries by specifying the index (INDEX option with the relevant ABAP command). The access time for a standard table increases in a linear relationship with the number of table entries. If you need key access, standard tables are particularly useful if you can fill and process the table in separate steps. For example, you could fill the table by appending entries, and then sort it. If you use the binary search option with key access, the response time is logarithmically proportional to the number of table entries.
    <b>Sorted tables</b>
    This is the most appropriate type if you need a table which is sorted as you fill it. You fill sorted tables using the INSERT statement. Entries are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always uses a binary search. Sorted tables are particularly useful for partially sequential processing in a LOOP if you specify the beginning of the table key in the WHERE condition.
    <b>
    Hashed tables</b>
    This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index. The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for processing large amounts of data.
    regards,
    sai ramesh

Maybe you are looking for

  • How do I prevent my content from being erased when adding a new device to itunes?

    I've had my 4s for about a year now and I just got a new windows laptop. I installed itunes and signed in but i dont know how to add my phone to this itunes. I know that normally you just plug your phone into the computer and it does it automatically

  • How to Move Offline Files Cache in Windows 7?

    I'm using the offline files feature in Win7 (much better implementation, btw - kudos!) and I've run into a problem:  the CSC is using up all the drive space on C:\.  I'd like to move the CSC to D:\, however I've been unable to do so. I've seen this p

  • Float type data not coming properly in ALDSP 2.5

    Hi, we are using ALDSP 2.5. We have a SQL server data base. We have created data services based on stored procs from this data base. we have a read method with a field declared as float data type. But the DSP is not showing up the correct data. For e

  • My photo albums do not load in Internet Explorer

    Is there many compatibility issues between Explorer (IE) and iWeb? The photo albums I created in iWeb'09 do not load in IE but it worked fine in Safari and Firefox. How do I resolve this issue? Any clue would be most appreciated. Karim

  • Is it recommended to support multiple DBs and Instances on same RAC nodes

    Customer wants to install multiple databases on the same set of 3-nodes essentially making all these database 3-node rac databases on Sun fire servers. Is this a recommended approach? What are the pitfalls? Can this be done effectively without using