Pipe delimited file on application server.

Hi , i m creating a text file on application server, i have written below code and file is getting created correctly.  however, i want to create pipe delimited file.  is there any method for this?
DATA : lv_line(173).
  DATA : l_wa_itab_length(4) TYPE c VALUE '173'.
  IF NOT p_tab[] IS INITIAL.
    SORT p_tab.
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE.
    IF sy-subrc NE 0.
      MESSAGE 'Error on output file read' TYPE 'E'.
    ELSE.
      LOOP AT p_tab.
        lv_line = p_tab.
        TRANSFER lv_line TO p_file LENGTH l_wa_itab_length.
        CLEAR p_tab.
        CLEAR lv_line.
      ENDLOOP.
      CLOSE DATASET p_file.
    ENDIF.
  ENDIF.
  REFRESH p_tab.

i m pasting below my entire code.
REPORT  zmigration_data_download.
FIELD-SYMBOLS: <fs_table> TYPE STANDARD TABLE.
DATA: d_table_ref TYPE REF TO data.
DATA: d_rfc_db_opt TYPE rfc_db_opt.
DATA: it_opt LIKE rfc_db_opt OCCURS 0 WITH HEADER LINE.
DATA: d_file  TYPE string.
PARAMETERS:     p_tab   TYPE dd02l-tabname OBLIGATORY.
PARAMETERS:     p_file  LIKE rlgrap-filename OBLIGATORY DEFAULT '/usr/sap/tmp/test.txt'.
SELECT-OPTIONS: s_opt   FOR  d_rfc_db_opt NO INTERVALS.
START-OF-SELECTION.
  REFRESH it_opt.
  LOOP AT s_opt WHERE sign = 'I' OR option = 'EQ'.
    it_opt-text = s_opt-low.
    APPEND it_opt.
  ENDLOOP.
  CREATE DATA d_table_ref TYPE TABLE OF (p_tab).
  UNASSIGN <fs_table>.
  ASSIGN d_table_ref->* TO <fs_table>.
  IF <fs_table> IS ASSIGNED.
    CLEAR <fs_table>.
    SELECT * FROM (p_tab) INTO TABLE <fs_table>
    WHERE (it_opt).
    IF sy-subrc EQ 0.
      PERFORM download_file TABLES <fs_table> USING p_file.
      MESSAGE i398(00) WITH 'Upload from SAP Successfull'.
    ENDIF.
  ENDIF.
*&      Form  download_file
      text
     -->P_<FS_TABLE>  text
     -->P_P_FILE  text
FORM download_file TABLES p_tab USING p_file.
  DATA : lv_line(173).
  DATA : l_wa_itab_length(4) TYPE c VALUE '173'.
  IF NOT p_tab[] IS INITIAL.
    SORT p_tab.
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING NON-UNICODE.
    IF sy-subrc NE 0.
      MESSAGE 'Error on output file read' TYPE 'E'.
    ELSE.
      LOOP AT p_tab.
        lv_line = p_tab.
        TRANSFER lv_line TO p_file LENGTH l_wa_itab_length.
        CLEAR p_tab.
        CLEAR lv_line.
      ENDLOOP.
      CLOSE DATASET p_file.
    ENDIF.
  ENDIF.
  REFRESH p_tab.
ENDFORM.                               " download_file

Similar Messages

  • Read Tab delimited File from Application server

    Hi Experts,
    I am facing problem while reading file from Application server.
    File in Application server is stored as follows, The below file is a tab delimited file.
    ##K#U#N#N#R###T#I#T#L#E###N#A#M#E#1###N#A#M#E#2###N#A#M#E#3###N#A#M#E#4###S#O#R#T#1###S#O#R#T#2###N#A#M#E#_#C#O###S#T#R#_#S#U#P#P#L#1###S#T#R#_#S#U#P#P#L#2###S#T#R#E#E#T###H#O#U#S#E#_#N#U#M#1
    i have downloaded this file from Application server using Transaction CG3Y. the Downloaded file is a tab delimited file and i could not see "#' in the file,
    The code is as Below.
    c_split  TYPE abap_char1 VALUE cl_abap_char_utilities=>horizontal_tab.
    here i am using IGNORING CONVERSION ERRORS in order to avoid Conversion Error Short Dump.
    OPEN DATASET wa_filename-file FOR INPUT IN TEXT MODE ENCODING DEFAULT IGNORING CONVERSION ERRORS.
          IF sy-subrc = 0.
            WRITE : /,'...Processing file - ', wa_filename-file.   
           DO.
          Read the contents of file
              READ DATASET wa_filename-file INTO wa_file-data.
              IF sy-subrc = 0.
                SPLIT wa_file-data AT c_split INTO wa_adrc_2-kunnr
                                                   wa_adrc_2-title
                                                   wa_adrc_2-name1
                                                   wa_adrc_2-name2
                                                   wa_adrc_2-name3
                                                   wa_adrc_2-name4
                                                   wa_adrc_2-name_co
                                                   wa_adrc_2-city1
                                                   wa_adrc_2-city2
                                                   wa_adrc_2-regiogroup
                                                   wa_adrc_2-post_code1
                                                   wa_adrc_2-post_code2
                                                   wa_adrc_2-po_box
                                                   wa_adrc_2-po_box_loc
                                                   wa_adrc_2-transpzone
                                                   wa_adrc_2-street
                                                   wa_adrc_2-house_num1
                                                   wa_adrc_2-house_num2
                                                   wa_adrc_2-str_suppl1
                                                   wa_adrc_2-str_suppl2
                                                   wa_adrc_2-country
                                                   wa_adrc_2-langu
                                                   wa_adrc_2-region
                                                   wa_adrc_2-sort1
                                                   wa_adrc_2-sort2
                                                   wa_adrc_2-deflt_comm
                                                   wa_adrc_2-tel_number
                                                   wa_adrc_2-tel_extens
                                                   wa_adrc_2-fax_number
                                                   wa_adrc_2-fax_extens
                                                   wa_adrc_2-taxjurcode.
    WA_FILE-DATA is having below values
    ##K#U#N#N#R###T#I#T#L#E###N#A#M#E#1###N#A#M#E#2###N#A#M#E#3###N#A#M#E#4###S#O#R#T#1###S#O#R#T#2###N#A#M#E#_#C#O###S#T#R#_#S#U#P#P#L#1###S#T#R#_#S#U#P#P#L#2###S#T#R#E#E#T###H#O#U#S#E#_#N#U#M#1
    And this is split by tab delimited and moved to other variables as shown above.
    Please guide me how to read the contents without "#' from the file.
    I have tried all possible ways and unable to get solution.
    Thanks,
    Shrikanth

    Hi ,
    In ECC 6 if all the unicode patches are applied then UTF 16 will defintly work..
    More over i would suggest you to ist replace # with some other  * or , and then try to see in debugging if any further  # appears..
    and no # appears then try to split now.
    if even now the # appears after replace statement then try to find out what exactly is it... wheather it is a horizantal tab etc....
    and then again try to replace it and then split..
    Please follow the process untill all the # are replaced...
    This should work for you..
    Let me know if you further face any issue...
    Regards
    Satish Boguda

  • Reading tab delimited file from application server

    Hi All,
    I do know that we need to use Open data set to read a file from application server, but my question is when you use  read DATASET v_file into wa_final -  this wa_final is an work area and also i have mentione an internal table. so do we need to Split the record at tab into the corresponding fields. Append the records into an internal table i_input.????
    Please let me know on this....
    thanks in advance....
    Poonam....

    Hi,
    first see the file contents in application server, how the contents whether the contents seperated by any symbol or not, if the contents seperated by any symbol then you have to split the data before appending to internal table.
    check this code.
    DATA: l_data_string TYPE string.
      filename = p_file.
      OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc EQ 0.
        DO.
          READ DATASET filename INTO l_data_string.
          IF sy-subrc NE 0.
            EXIT.
          ENDIF.
          CLEAR k_input.
          SPLIT l_data_string AT '#' INTO k_input-agreement k_input-suffix k_input-status
                k_input-first_name k_input-last_name k_input-job_title k_input-tel k_input-fax k_input-email_address k_input-mob_number.
          APPEND k_input TO i_input.
        ENDDO.
      ENDIF.
    Regards,
    Venu

  • Comma delimited file in application server.

    How to extarct a comma delimited file from an internal table in to SAP application server.

    Hi Arun,
    Can you be a bit more clearer? Are you uploading the dat to the appl server or downloading?
    1) Comma separated info from itab to file server.
    loop at itab.
    concatenate itab-field1
                itab-field2
                 itab-field3
    into itab_new-data separated by ','.
    append itab_new.
    clear itab_new.
    endloop. 
    open dataset dsn for output in text mode.
    if sy-subrc = 0.
    loop at itab_new.
    transfer itab_new to dsn.
    endloop.
    endif.
    close dataset.
    2) Comma separated info from file to itab.
    open dataset dsn for input in text mode.
    if sy-subrc = 0.
    do.
    read datset dsn into itab-data.
    if sy-subrc <> 0.
    exit.
    else.
    append itab.
    clear itab.
    endif.
    enddo.
    endif.
    close dataset.
    loop at itab.
    split itab-data at ',' into  itab_new-field1
                itab_new-field2
                 itab_new-field3.
    append itab_new.
    clear itab_new.
    endloop. 
    REgards,
    Ravi

  • Uploading file to Application Server using Tcode: CG3Z

    Hi Friends,
    I am facing a weird problem when uploading a file(PIPE delimited format) to application server
    using the transaction CG3Z. The data is getting truncated at the end of each row and the file size
    doesn't match with the one i had uploaded.
    Can anyone resolve this issue.
    Thanks in advance.
    Murthy

    Hi Friends
    I wrote the custom program to upload the file on application server.
    Thanks for your time.
    Murthy

  • Need file on Application server to be pipe delimited

    Hi,
    I want the file in the application server with headings and pipe delimited... I have used
        IF NOT T_OUTPUT[] IS INITIAL.
    Transfer the changed T_INPUTFILE data to application server.
          OPEN DATASET V_FILEPATH FOR OUTPUT IN TEXT MODE ENCODING DEFAULT
                                                  MESSAGE V_MSG.
          IF SY-SUBRC <> 0.
            MESSAGE I008. " File could not be opened.
            EXIT.
          ENDIF.
    Transferring Data
          LOOP AT T_OUTPUT.
            TRANSFER T_OUTPUT TO V_FILEPATH.
          ENDLOOP.
          CLOSE DATASET V_FILEPATH.
        ENDIF.
    But this is not giving me output like below...
    RefDoc.No.
    Text
    Period
    Year
    9
    Dummy Text
    002
    2006
    How do I get a pipe delimited file on the application server ... ??

    Hi,
    Check this..
    DATA: V_STRING TYPE STRING.
    LOOP AT T_OUTPUT.
    DO.
    ASSIGN COMPONENT SY-INDEX OF STRUCTURE T_OUTPUT TO <FS>.
    IF SY-SUBRC <> 0 .EXIT .ENDIF.
    IF SY-INDEX = 1.
       V_STRING = <FS>.
    ELSE.
       CONCATENATE V_STRING '|' <FS> INTO V_STRING.
    ENDIF.
    ENDDO.
    TRANSFER V_STRING TO V_FILEPATH.
    ENDLOOP.
    Thanks,
    Naren

  • Need a pipe delimiter after every field in the file on application server

    Hi ,
    i have to transport data in internal table to a file on application server.
    I have done this successfully. But the problem is i have to put a pipe
    delimiter after every field in the file on application server.
    Could yoe plz help in  this issue.
    Thanks & Regards
    Suresh kumar D

    Hi Should,
              I think the below code should solve your problem as i also had  a similar type of requirement and this was the code i had used in my program.
      FIELD-SYMBOLS: <FS> TYPE ANY.
      DATA: L_FLINE TYPE STRING.
    Open file for output
      M_CHECK_SELSCR_FNMS O1 O.
      LOOP AT I_TARGET.
    Write records to file
        DO.
          ASSIGN COMPONENT SY-INDEX OF STRUCTURE I_TARGET TO <FS>.
          IF SY-SUBRC EQ 0.
            IF SY-INDEX EQ 1.
              MOVE <FS> TO L_FLINE.
            ELSEIF <FS> NE C_PIPE.
              CONCATENATE L_FLINE C_PIPE <FS> INTO L_FLINE.
            ELSE.
              CONCATENATE L_FLINE <FS> INTO L_FLINE.
            ENDIF.
          ELSE.
            TRANSFER L_FLINE TO W_SRVR_NM_O_O1.
            EXIT.
          ENDIF.
        ENDDO.
      ENDLOOP.
    Close file
      CLOSE DATASET W_SRVR_NM_O_O1.
      IF SY-SUBRC EQ 0.
        MESSAGE S208(00) WITH TEXT-M02.
      ENDIF.
    Regards
    Sikha

  • File from application server -Read and process and delete the file .

    Hi All,
             I writing a ZEE program which will read the file from application server(file will be in text delimat format) and moving the data to internal table and uploadind data base.The part which iam facing problem is -
    > I hve read the file from application server like below ,
    OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
    EXIT.
    ELSE.
      DO.
        CLEAR: wa_string, wa_uploadtxt.
        READ DATASET ld_file INTO wa_string.
        IF sy-subrc NE 0.
          EXIT.
        ELSE.
          SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
                                          wa_uploadtxt-name2
                                          wa_uploadtxt-age.
    Spliting part i having problem .i need to seperate each field which is seperate from tab delimite and pass it into respective fields of internal table .
    Second if another file come to the appicaltion server , wether my first file will be there ? or should i need to delete the first file after redaing how should i proceed further ?.
    Regards
    SRIRAM...
    THANKS In ADVANCE

    HI,
    1.
    OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
    EXIT.
    ELSE.
    DO.
    CLEAR: wa_string, wa_uploadtxt.
    READ DATASET ld_file INTO wa_string.
    IF sy-subrc NE 0.
    EXIT.
    ELSE.
    SPLIT wa_string AT cl_abap_char_utilities=>horizontal_tab INTO wa_uploadtxt-name1
    wa_uploadtxt-name2
    wa_uploadtxt-age.
    APPEND  wa_uploadtxt TO itab.
    ENDDO.
    CLOSE DATASET ld_file.
    ENDIF.
    2. If the another file get's generated in the application server with same file name then the data in old file get's over written with the new data. You are not required to delete the file.

  • Unable to create a file in Application Server using OPEN DATASET stattement.

    I am unable to create a file in Application Server using the following statement.
    OPEN DATASET filename FOR OUTPUT
    IN TEXT MODE ENCODING DEFAULT
    MESSAGE msg.
    The message I'm getting is "Permission Denied". I have checked authorisation using SU53 which says "The last authorization check was successful". Please help.

    You can use following code to capture the error.
    TRY.
          OPEN DATASET filename FOR OUTPUT IN BINARY MODE MESSAGE V_MSG.
          CATCH CX_ROOT
          INTO EXCEPTION.
          CALL METHOD O_EXCEPTION ->IF_MESSAGE~GET_TEXT
            RECEIVING
            RESULT = V_MSG.
          MESSAGE v_msg
          TYPE 'E'.
    ENDTRY.
    You can capture error in v_msg.
    Following are the exceptions for the same:
    Exceptions
    Catchable Exceptions
    CX_SY_FILE_OPEN
    Cause: The file is already open.
    Runtime Error: DATASET_REOPEN
      CX_SY_CODEPAGE_CONVERTER_INIT   
    Cause: The desired conversion is not supported. (Due to specification of invalid code page or of language not supported in the conversion, with SET LOCALE LANGUAGE.)
    Runtime Error: CONVT_CODEPAGE_INIT
    CX_SY_CONVERSION_CODEPAGE
    Cause: Internal error in the conversion.
    Runtime Error: CONVT_CODEPAGE
    CX_SY_FILE_AUTHORITY
    Cause: No authorization for access to file
    Runtime Error: OPEN_DATASET_NO_AUTHORITY
    Cause: Authorization for access to this file is missing in OPEN DATASET with addition FILTER.
    Runtime Error: OPEN_PIPE_NO_AUTHORITY
      CX_SY_PIPES_NOT_SUPPORTED   
    Cause: The operating system does not support pipes.
    Runtime Error: DATASET_NO_PIPE
    CX_SY_TOO_MANY_FILES
    Cause: Maximum number of open files exceeded.
    Runtime Error: DATASET_TOO_MANY_FILES   Non-Catchable Exceptions   
    Cause: An attempt was made to open a pipe that is already open.
    Runtime Error: DATASET_PIPE_POSITION
    Hope that will help you.
    Please reward if useful.

  • Problem of Delete and Overwrite XLS file on Application Server

    Hi Experts,
         I want to transfer file on application server using below code and try to delete after successfully transfer on application file to other location.
    I have problem during deleting file and overwrite file.
    DATA: G_S_FILE TYPE EPSFILNAM,
          G_S_DIR  TYPE EPSDIRNAM,
          G_T_FILE TYPE EPSFILNAM,
          G_T_DIR  TYPE EPSDIRNAM.
    DATA : DELFILE(60).
      G_S_FILE = '1400000051.XLS'.
      G_S_DIR  = '\\Dev\PO\'.
      G_T_FILE = '1400000051.XLS'.
      G_T_DIR  = '\\Dev\PO\bkup'.
      DELFILE = '\\Dev\PO\1400000051.XLS'.
      CALL METHOD CL_CTS_LANGUAGE_FILE_IO=>COPY_FILES_LOCAL
        EXPORTING
          IM_SOURCE_FILE           = G_S_FILE
          IM_SOURCE_DIRECTORY      = G_S_DIR
          IM_TARGET_FILE           = G_T_FILE
          IM_TARGET_DIRECTORY      = G_T_DIR
          IM_OVERWRITE_MODE        = 'S'
        EXCEPTIONS
          OPEN_INPUT_FILE_FAILED   = 1
          OPEN_OUTPUT_FILE_FAILED  = 2
          WRITE_BLOCK_FAILED       = 3
          READ_BLOCK_FAILED        = 4
          CLOSE_OUTPUT_FILE_FAILED = 5
          OTHERS                   = 6.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      OPEN DATASET DELFILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF SY-SUBRC = 0.
        DELETE DATASET DELFILE.
      ELSE.
        WRITE / 'File not found'.
      ENDIF.
    Thanks,
    Himanshu Patel.

    Write a Java program using Apache POI that reads in a tab delimited file and outputs an xls file (in what they call Horrible Spread Sheet Format. Create your tab delimited file and then run your Java program using appropriate OS commands.
    Jelena Perfiljeva wrote:
    In all honesty, I find it hard to believe other application can't accept any other format. It's actually seems rather unreasonable to expect an ERP system to create a file in an outdated format of a desktop software. Even Excel itself can open many formats, so this just doesn't make any sense.
    This.
    Unless you can explain exactly why the destination must be xls and no other format is acceptable, I'm going to close the thread. What is this third party tool? Why can it only read the obsolete xls file format.
    I'm going through this thread and rejecting all the responses that attempt a solution that isn't xls.
    I'm surprised that the OP thought that simply saving with an xls file extension would cause some magic to happen and produce an actual Excel file.

  • Uploading Excel File in application server

    Hi,
    I am uploading data from internal table to excel file in application server.I am using Open dataset to put in appln server.(background job).But the problem is it is not sitting in different colums,all data goes to single column.I want every field in separate columns.Please suggest to proceed.

    Hi,
    save the internal table as a desktop file and then use CG3Z transaction to put the data from desktop to application server.
    then to read the application file use the logic given below:
    DATA: wa_file_data TYPE text4096,
    lv_app_server_file TYPE string.
      lv_app_server_file = pa_afile.
    To read file from Application server
      OPEN DATASET lv_app_server_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      DO.
        READ DATASET lv_app_server_file INTO wa_file_data.
        IF sy-subrc = 0.
          APPEND wa_file_data TO gi_file_data.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE DATASET lv_app_server_file.
    DATA: lv_file_separator TYPE c.
      lv_file_separator = cl_abap_char_utilities=>horizontal_tab.
    To upload file in other formats(CSV, Tab delimited etc)
      CALL FUNCTION 'TEXT_CONVERT_TEX_TO_SAP'
        EXPORTING
          i_field_seperator    = lv_file_separator
          i_tab_raw_data       = gi_file_data
        TABLES
          i_tab_converted_data = gi_zhralcon_file
        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.
    Hope it helps.
    Regards,
    Rajesh Kumar

  • Placing the text file in application server

    Hi all,
    I am uploading the text file into application server.
    the line length is 1028 characters.But in application server i am not able to see whole line.it is showing only some data and reamaining data is not coming.
    Please let em know how can we increase the line length in application server.
    Regards,
    Shoban

    SE38 is the ABAP Editor transaction.
    Use function module ‘GUI_UPLOAD’ to create an upload the data. 
    *Use function module ‘GUI_UPLOAD’ to create an upload the data.
    Example Code >>>
    REPORT  zuploadtab                    .
    PARAMETERS: p_infile  LIKE rlgrap-filename
                            OBLIGATORY DEFAULT  '/usr/sap/'..
    *DATA: ld_file LIKE rlgrap-filename.
    DATA: gd_file type string.
    *Internal tabe to store upload data
    TYPES: BEGIN OF t_record,
        name1 LIKE pa0002-vorna,
        name2 LIKE pa0002-name2,
        age   TYPE i,
        END OF t_record.
    DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
          wa_record TYPE t_record.
    *Internal table to upload data into
    DATA: BEGIN OF it_datatab OCCURS 0,
      row(500) TYPE c,
    END OF it_datatab.
    *Text version of data table
    TYPES: BEGIN OF t_uploadtxt,
      name1(10) TYPE c,
      name2(15) TYPE c,
      age(5)  TYPE c,
    END OF t_uploadtxt.
    DATA: wa_uploadtxt TYPE t_uploadtxt.
    *String value to data in initially.
    DATA: wa_string(255) TYPE c.
    CONSTANTS: con_tab TYPE x VALUE '09'.
    *If you have Unicode check active in program attributes then you will
    *need to declare constants as follows:
    *class cl_abap_char_utilities definition load.
    *constants:
       con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB.
    *AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_INFILE.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_infile.
      CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
                def_filename     = p_infile
                mask             = ',*.txt.'
                mode             = 'O'
                title            = 'Upload File'(078)
           IMPORTING
                filename         = p_infile
           EXCEPTIONS
                inv_winsys       = 1
                no_batch         = 2
                selection_cancel = 3
                selection_error  = 4
                OTHERS           = 5.
    *START-OF-SELECTION
    START-OF-SELECTION.
      gd_file = p_infile.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = gd_file
          has_field_separator     = 'X'  "file is TAB delimited
        TABLES
          data_tab                = it_record
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
        IF sy-subrc NE 0.
          write: 'Error ', sy-subrc, 'returned from GUI_UPLOAD FM'.
          skip.
        endif.
    Alternative method, where by you split fields at each TAB after you
    have returned the data. No point unless you dont have access to
    GUI_UPLOAD but just included for information
    CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
               filename        = gd_file
               filetype        = 'ASC'
          TABLES
               data_tab        = it_datatab  "ITBL_IN_RECORD[]
          EXCEPTIONS
               file_open_error = 1
               OTHERS          = 2.
    IF sy-subrc NE 0.
    ELSE.
       LOOP AT it_datatab.
         CLEAR: wa_string, wa_uploadtxt.
         wa_string = it_datatab.
         SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
                                         wa_uploadtxt-name2
                                         wa_uploadtxt-age.
         MOVE-CORRESPONDING wa_uploadtxt TO wa_record.
         APPEND wa_record TO it_record.
       ENDLOOP.
    ENDIF.
    *END-OF-SELECTION
    END-OF-SELECTION.
    *!! Text data is now contained within the internal table IT_RECORD
    Display report data for illustration purposes
    LOOP AT it_record INTO wa_record.
      WRITE:/     sy-vline,
             (10) wa_record-name1, sy-vline,
             (10) wa_record-name2, sy-vline,
             (10) wa_record-age, sy-vline.
    ENDLOOP.
    Edited by: Nikhil Jathar on Jan 9, 2008 7:38 AM

  • How to extract a tab delimiter file on appli server in openhub destination

    Hi All,
    in my scenario i want download a file on application server in tab delimiter file where iam not able to do it.while creating  OHD iam selecting seperator feild has ';'(semicolan).tab delimiter fule format is not posible with semicolan and even i tried it with "comma" also but not getting the tab delimiter formate.please help how to get that particular format..
    thanks
    vamshi..

    Hi Dashyam,
    May help you:----
    with comma delimiter file read
    I want to download comma delimiter file on to presentation server from inte
    http://wiki.sdn.sap.com/wiki/display/ABAP/UploadaCommaDelimitedCSVfilethatcontainscommasindata+fields
    Regards,
    Suman

  • Process Chain - Delete File from Application Server

    Hi Gurus,
    Im working with Process chain, and i have a load from a flat file, so my question is :
    How can i delete that file from the application server after was loaded ?
    THANKS IN ADVANCED !!! I REALLY APRECCIATE YOUR HELP.
    Marcos

    hi,
    I have gone through the forum you have posted for deleting files from application server through process chain.
    I have similar reuirement in my project.
    Can you please provide me the solution?
    Your inputs will be highly appreciated.
    Thanks in advance.
    Regards,
    Lavanya.

  • How to delete file from application server(Unix)

    Hi All,
    Using the below code downloading a file from application server(Unix) to client machine. I want to delete the file from application server once it is downloaded to client
    We work on Forms 11.1.1.4.0 and Oracle DB 10g. Client machine are Windows 7.
    BEGIN
      IF webutil_file_transfer.AS_to_Client
      (clientFile => Name_In('global.g_file_name')
      ,serverFile => ls_AppServer_Loc)THEN
      message('Data exported Successfully');
      ELSE
       message('File download from Application Server failed');
      END IF;
    EXCEPTION
      WHEN OTHERS THEN
      message('File download failed: '||SUBSTR(sqlerrm,1,200));
      END;
    I have search for solution on OTN. Few suggested to use HOST.
    Can any one help me how to use Host() built_in to delete the file.
    Thanks,
    Maddy

    Can any one help me how to use Host() built_in to delete the file.
    Host('/bin/rm <complete file path>');

Maybe you are looking for