Class to Get File List from Application Server

Hi all
I've to obtain the file list of a directory from application server, I can use a FM too but It's possible the lenght of file name is upper then 40 characters so I can't use FM EPS_GET_DIRECTORY_LISTING.
Thanks
Edited by: Aristoteles92 on Apr 20, 2010 3:27 PM

Try using the function  RZL_READ_DIR_LOCAL.  Here is an example program using this function.
data: begin of itab occurs 0,
      rec(1000) type c,
      end of itab.
data: wa(1000) type c.
data: p_file type localfile.
data: ifile type table of  salfldir with header line.
parameters: p_path type salfile-longname
                    default '/usr/sap/TST/DVEBMGS01/data/'.
call function 'RZL_READ_DIR_LOCAL'
     exporting
          name           = p_path
     tables
          file_tbl       = ifile
     exceptions
          argument_error = 1
          not_found      = 2
          others         = 3.
loop at ifile.
  format hotspot on.
  write:/ ifile-name.
  hide ifile-name.
  format hotspot off.
endloop.
at line-selection.
  concatenate p_path ifile-name into p_file.
  clear itab.  refresh itab.
  open dataset p_file for input in text mode.
  if sy-subrc = 0.
    do.
      read dataset p_file into wa.
      if sy-subrc <> 0.
        exit.
      endif.
      itab-rec = wa.
      append itab.
    enddo.
  endif.
  close dataset p_file.
  loop at itab.
    write:/ itab.
  endloop.
Regards,
Rich Heilman

Similar Messages

  • Web Matrix FTP Remote Connection Error - "Connection Error - Failure to get file list from server. An entry with the same key already exists."

    Does anyone have experience with this issue when connecting to a Linux FTP Web Server running a FTP Site?
    "Connection Error - Failure to get file list from server. An entry with the same key already exists."
    I cannot access the root directory of the ftp file server using Web Matrix 3. The site is .php based, and
    is accessible when connecting with FileZilla or Remote Connecting via FTP with Visual Studio.
    All sites have been deleted from Web Matrix, the user Application Data has been cleared and Web Matrix has been reinstalled.
    Issue Persists....
    Thanks in advance,
    Justin

    Turns out that the program leaves metadata in your app data folder that is not removed upon uninstallation of the software.
    This is incorporated to communicate with a file that uploaded into the ftp directory when publishing pages.

  • Java does not get file list from shared folder in another server.

    Hi,
    I'm using java 1.4.2.16,
    Command below does not get file list.
    import java.io.;*..
    File file = new File("\\\\10.242.22.28\\SapMII");
    File[] files = file.listFiles();
    SapMII folder is Everyone full Control permission.
    How can i solve this problem?
    Thanks.

    Could you please post replies in a more helpful way? Just informing me that it was an NPE doesn't really tell me anything. Post the stacktrace (Exception#printStackTrace()). And the listFile() methods API has this to say:
    Returns null if this abstract pathname does not denote a directory, or if an I/O error occurs.I'm able to run this sample code easily:
    import java.io.File;
    public class TestFileList {
         public static void main(String[] args) {
              File file = new File("\\\\10.40.55.33\\shared");
              File [] files = file.listFiles();
              for(File currentFile: files )
                   System.out.println(currentFile.getName());
    }

  • File download from application server to presentation server

    Hi,
         We have requirment to upload a file to application server in .dbf format and then download it to presentation server.  while downloading the file to presentation server some of the fields  getting junk values.  we are downloading file to excel sheet.  some of the fields values are Russian texts.  Those fields only getting junk values, all other fields are getting correct values.
    Please advice.
    Regards,
    chandra.

    hi
    sample code below should help you......
    <u>Download to presentation server</u>
    This program can be used to download files from Application server to presentaion server.
    1)Maximum length of each field is considered to be 40 characters.
    2)Maximum length of the field can be changed by specifying the length in selection screen parameter
    3)First line of the Application server file should contain the description of each field.
    4)Each field should be delimited by #.
    *& Report ZDOWNLOADFILE *
    REPORT ZDOWNLOADFILE
    MESSAGE-ID B1 .
    INCLUDES *
    INCLUDE ZDOWNLOADFILE_TOP.
    INCLUDE ZDOWNLOADFILE_FORM.
    EVENT-AT SELECTION-SCREEN *
    AT SELECTION-SCREEN ON pa_appl.
    PERFORM check_file_exists USING pa_appl.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_appl.
    PERFORM f4_dxfilename USING pa_appl.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_pres.
    PERFORM f4_filename USING pa_pres.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_del.
    PERFORM f4_dxfilename USING pa_del.
    EVENT INITIALIZATION *
    INITIALIZATION.
    PERFORM initialization.
    EVENT START-OF-SELECTION *
    START-OF-SELECTION.
    PERFORM determine_fields. "Determine number of columns
    PERFORM build_itab. "Create internal table based on number
    "of columns
    PERFORM build_header. "To prepare header for the file
    PERFORM download_data. "Download data to presentation server
    PERFORM delete_files. "Delete files from application server
    *& Include ZDOWNLOADFILE_TOP *
    TYPES: BEGIN OF ty_header,
    text(100) TYPE c,
    END OF ty_header.
    DATA: c_fnh_mask type dxfields-filemask value '.',
    search_dir type dxfields-longpath value '/sapglobal/users'.
    CLASS cl_abap_char_utilities DEFINITION LOAD.
    Internal tables *
    DATA: gt_header TYPE STANDARD TABLE OF ty_header,
    gt_fieldcat TYPE lvc_t_fcat.
    Work areas *
    DATA: gs_header TYPE ty_header,
    gs_fieldcat TYPE lvc_s_fcat.
    DATA: wa_filename TYPE string.
    DATA: wa_count(2) TYPE N,
    wa_start(3) TYPE N,
    wa_end(3) TYPE N,
    wa_len(3) TYPE N.
    DATA: wa_data(12000) TYPE c,
    wa_off TYPE I,
    itab_appl TYPE REF TO DATA,
    itab_line TYPE REF TO DATA,
    col(2) TYPE c.
    DATA: wa_field(30) TYPE c.
    DATA: lv_index TYPE sy-tabix.
    DATA: gs_adrp type adrp,
    gs_usr02 type usr02,
    gs_usr21 type usr21,
    gs_char50(50).
    CONSTANTS: co_slash(1) value '/'.
    FIELD-SYMBOLS: <itab> TYPE STANDARD TABLE,
    <wa>,
    <fs_line>,
    <wa_line>.
    SELECTION SCREEN *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE text-f01.
    PARAMETERS: pa_appl LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE text-f02.
    PARAMETERS: pa_pres LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B2.
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE text-f03.
    PARAMETERS: pa_del LIKE rlgrap-filename .
    PARAMETERS: pa_deld AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK B3.
    SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE text-f04.
    PARAMETERS: pa_len(3) TYPE c.
    SELECTION-SCREEN END OF BLOCK B4.
    *& Include ZDOWNLOADFILE_FORM *
    *& Form f4_dxfilename
    text
    -->P_pa_appl text
    form f4_dxfilename using p_file.
    DATA: wa_file LIKE dxfields-longpath.
    CLEAR: wa_file.
    call function 'F4_DXFILENAME_TOPRECURSION'
    exporting
    i_location_flag = 'A'
    i_server = ' '
    i_path = search_dir
    filemask = c_fnh_mask
    fileoperation = 'R'
    importing
    o_path = wa_file
    exceptions
    rfc_error = 1
    error_with_gui = 2
    others = 3
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    else.
    p_file = wa_file.
    endif.
    endform. " f4_dxfilename
    *& Form f4_filename
    text
    -->P_pa_pres text
    form f4_filename using p_data.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    PROGRAM_NAME = SYST-CPROG
    DYNPRO_NUMBER = SYST-DYNNR
    IMPORTING
    FILE_NAME = p_data
    endform. " f4_filename
    *& Form check_file_exists
    text
    -->P_pa_appl text
    form check_file_exists using p_file.
    DATA: wa_file LIKE rlgrap-filename.
    wa_file = p_file.
    OPEN DATASET wa_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc = 8.
    MESSAGE E714
    WITH text-m01 p_file text-m02.
    ELSE.
    CLOSE DATASET p_file.
    ENDIF.
    endform. " check_file_exists
    *& Form build_header
    text
    --> p1 text
    <-- p2 text
    form build_header .
    *Select user details
    clear gs_usr21-persnumber.
    select single persnumber
    into (gs_usr21-persnumber)
    from usr21
    where bname = sy-uname.
    concatenate sy-uname
    co_slash
    gs_adrp-name_text(36)
    co_slash
    into gs_char50.
    condense gs_char50.
    clear gs_usr02-class.
    select single class
    into (gs_usr02-class)
    from usr02
    where bname = sy-uname.
    concatenate gs_char50
    gs_usr02-class
    into gs_char50.
    condense gs_char50.
    Write report technical name
    write 'Name: ' TO gs_header+0(10).
    gs_header+11(*) = sy-repid.
    APPEND gs_header TO gt_header.
    CLEAR: gs_header.
    Write user data
    write 'User: ' TO gs_header+0(10).
    gs_header+11(*) = gs_char50.
    CONCATENATE gs_header gs_char50 INTO
    gs_header SEPARATED BY SPACE.
    APPEND gs_header TO gt_header.
    CLEAR: gs_header.
    Write System data
    write 'System: ' TO gs_header+0(10).
    write: sy-sysid to gs_header+11(3).
    write: co_slash to gs_header+14(1).
    write: sy-mandt to gs_header+15(3).
    APPEND gs_header TO gt_header.
    CLEAR: gs_header.
    Write System date and time
    write 'System: ' TO gs_header+0(10).
    write sy-datum to gs_header+11(10).
    write sy-uzeit to gs_header+22(8).
    APPEND gs_header TO gt_header.
    CLEAR: gs_header.
    Write Local date and time
    write 'Local: ' TO gs_header+0(10).
    write sy-datlo to gs_header+11(10).
    write sy-timlo to gs_header+22(8).
    APPEND gs_header TO gt_header.
    CLEAR: gs_header.
    APPEND gs_header TO gt_header.
    endform. " build_header
    *& Form determine_fields
    text
    --> p1 text
    <-- p2 text
    form determine_fields .
    DATA: wa_data(600) TYPE c.
    CLEAR: wa_count,wa_start,wa_end,wa_data.
    wa_start = 0.
    wa_end = 1.
    OPEN DATASET pa_appl FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    READ DATASET pa_appl INTO wa_data.
    wa_len = STRLEN( wa_data ).
    DO wa_len TIMES.
    IF wa_data+wa_start(wa_end) EQ
    cl_abap_char_utilities=>horizontal_tab.
    wa_count = wa_count + 1.
    ENDIF.
    wa_start = wa_start + 1.
    ENDDO.
    CLOSE DATASET pa_appl.
    wa_count = wa_count + 1.
    endform. " determine_fields
    *& Form build_itab
    text
    --> p1 text
    <-- p2 text
    form build_itab .
    DATA: wa_len(4) TYPE c.
    CLEAR: wa_len.
    IF pa_len IS INITIAL.
    wa_len = 40.
    ELSE.
    wa_len = pa_len.
    ENDIF.
    col = 1.
    DO wa_count TIMES.
    CONCATENATE 'FIELD' col INTO wa_field.
    gs_fieldcat-fieldname = wa_field.
    gs_fieldcat-outputlen = wa_len.
    gs_fieldcat-datatype = 'CHAR'.
    gs_fieldcat-col_pos = col.
    col = col + 1.
    APPEND gs_fieldcat TO gt_fieldcat.
    CLEAR: wa_field.
    ENDDO.
    *Create the internal table dynamically based on the file structure,
    *this table will be used to download data through GUI_DOWNLOAD fm
    CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
    it_fieldcatalog = gt_fieldcat
    IMPORTING
    EP_TABLE = itab_appl
    *Assign the pointer to the field symbol
    ASSIGN itab_appl->* TO <itab>.
    CREATE DATA itab_line LIKE LINE OF <itab>.
    *Create a work area for the dynamic internal table
    ASSIGN itab_line->* TO <wa_line>.
    col = 1.
    OPEN DATASET pa_appl FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    DO.
    READ DATASET pa_appl INTO wa_data.
    IF sy-subrc <> 0.
    CLOSE DATASET pa_appl.
    RETURN.
    ELSE.
    wa_start = 0.
    lv_index = 1.
    DO wa_count TIMES.
    ASSIGN COMPONENT lv_index OF STRUCTURE <wa_line> TO <fs_line>.
    FIND cl_abap_char_utilities=>horizontal_tab
    IN wa_data+wa_start(*) MATCH OFFSET wa_off.
    IF sy-subrc = 0.
    IF wa_off NE 0.
    <fs_line> = wa_data+wa_start(wa_off).
    ENDIF.
    wa_start = wa_start + wa_off + 1.
    lv_index = lv_index + 1.
    ELSE.
    <fs_line> = wa_data+wa_start(*).
    ENDIF.
    ENDDO.
    APPEND <wa_line> TO <itab>.
    CLEAR: <wa_line>,<fs_line>.
    ENDIF.
    ENDDO.
    endform. " build_itab
    *& Form download_data
    text
    --> p1 text
    <-- p2 text
    form download_data .
    clear: wa_filename.
    wa_filename = pa_pres.
    call function 'GUI_DOWNLOAD'
    exporting
    filename = wa_filename
    filetype = 'DAT'
    tables
    data_tab = gt_header
    exceptions
    access_denied = 15
    call function 'GUI_DOWNLOAD'
    exporting
    filename = wa_filename
    filetype = 'DAT'
    append = 'X'
    tables
    data_tab = <itab>
    exceptions
    access_denied = 15
    endform. " download_data
    *& Form initialization
    text
    --> p1 text
    <-- p2 text
    form initialization .
    REFRESH: gt_header,gt_fieldcat,gt_header.
    endform. " initialization
    *& Form delete_files
    text
    --> p1 text
    <-- p2 text
    form delete_files .
    IF pa_deld EQ 'X'.
    DELETE DATASET pa_appl.
    ENDIF.
    IF pa_del IS NOT INITIAL.
    DELETE DATASET pa_del.
    ENDIF.
    endform. " delete_files
    <b>reward points if helpful.</b>
    thanks
    vijay

  • Get file list from URL/web directory

    Hey guys,
    I have created a script for After Effects that can download multiple images from URLs that are given in an array. Now ideally what I want, is to get all the filenames of the files in a certain browsable web directory to be put in an array.
    Unfortunately, I can't seem to figure out how to do this. Does someone have the knowledge here to help me out?
    Thanks in advance,
    Jorge

    This is more difficult to do than it seems. Since the files are on a remote web server, you need to find some way to get the server to divulge its local file structure, which is not something most servers will do. The absolute best way is to have control over the web server and run some server-side code (PHP, node.js, whatever) to generate the file list on the server side and then fetch it with your client/extension/script. Other than that it's almost impossible to get a 3rd party server to divulge its file structure as far as I know, mainly for security reasons. So the #1 question is: do you have control over the server/website that you're trying to fetch from or not?

  • Split tab delimited file coming from application server.

    Hi,
    i have received a tab delimited file from the application server.it contains # instead of tab at the application server.
    i want to know how to split it.
    i tried decalring constant as:
    c_tab type x value'09'.
    but it gives an error saying only c,n,d and t types are allowed.
    please gelp.
    Thanks,
    Anand.

    Hi,
    Do like this
    *--Local Variables
      DATA : l_file TYPE string,
             l_line TYPE string.
    *--Clear
      CLEAR : l_file.
      l_file = p_ipfile.
    *--Read the data from application server file.
      OPEN DATASET l_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc NE 0.
    *--Error in opening file
        MESSAGE i368(00) WITH text-005.
      ENDIF.
    *--Get all the records from the specified location.
      DO.
        READ DATASET l_file INTO l_line.
        IF sy-subrc NE 0.
          EXIT.
        ELSE.
          SPLIT l_line AT cl_abap_char_utilities=>horizontal_tab
                          INTO st_ipfile-vbeln
                               st_ipfile-posnr
                               st_ipfile-edatu
                               st_ipfile-wmeng.
          APPEND st_ipfile TO it_ipfile.
        ENDIF.
      ENDDO.
    *--Close dataset
      CLOSE DATASET l_file.
    Regards,
    Prashant

  • Delete file data from Application Server

    Hello,
    How do we delete data from the file on application Server.
    For deleting the file, we use DELETE DATASET <filename>.
    If we want to delete only the data and not the file, how to address it?
    Please let me know.

    Hi , please check the following links, maybe using the truncate dataset can be helpful.
    http://help.sap.com/saphelp_nw70/helpdata/EN/fc/eb3c7f358411d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/EN/d5/c3f58e9f3b11d2960000a0c9308b1f/frameset.htm
    Another way could be get the file name and store in a var , then delete the file and afterwards
    create a new one with the same name as stored in the var.
    Thanks,
    Walter Oliveira.

  • Get file list from directory(t.code: AL11).

    Hi Frnds,
    i need to get the list of file for particular directory from t.code AL11,
    is there any Function Module to display the list of File from  the directory in executable program,
    i have directory like '/home/im3/hrintf/processed/..... ' and now i need to get the list of file from that directory,
    the list is available in t.code AL11( standard program :RSWATCH0 ).
    pls suggest me with relevant FM or relevant logic.
    Thank you.
    Regards
    Ramesh M

    Hi 
       use this code i have checked its working fine
    Data:
          w_itab type table of  EPSFILI,
          w_dirnam type  EPSF-EPSDIRNAM.
          w_dirnam = 'C:\usr\sap\E6S\DVEBMGS00\work'.
    CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
      EXPORTING
        dir_name                     = w_dirnam
    *   FILE_MASK                    = ' '
    * IMPORTING
    *   DIR_NAME                     =
    *   FILE_COUNTER                 =
    *   ERROR_COUNTER                =
      tables
        dir_list                     = w_itab
    * EXCEPTIONS
    *   INVALID_EPS_SUBDIR           = 1
    *   SAPGPARAM_FAILED             = 2
    *   BUILD_DIRECTORY_FAILED       = 3
    *   NO_AUTHORIZATION             = 4
    *   READ_DIRECTORY_FAILED        = 5
    *   TOO_MANY_READ_ERRORS         = 6
    *   EMPTY_DIRECTORY_LIST         = 7
    *   OTHERS                       = 8
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    write: 'test'.
    Thanks
    Viquar Iqbal

  • Logic to fetch the file name from Application Server

    Hi Friends
    I have a requirement that : By giving the Directory name (eg:/tmp),I have to get the all file names stored under that Directory name.
    Can anyone please provide me the logic / function modules related to this requirement.
    Points are assured for useful answers.
    Regards,
    Sree

    Hi,
    use these:
    function module "EPS_GET_DIRECTORY_LISTING"
    FM RZL_DIR_READ instead. its easy and effective to use.
    Or
    FILE_GET_NAME_USING_PATH,
    EPS_GET_DIRECTORY_LISTING
    /SAPDMC/LSM_F4_FRONTEND_FILE
    OPEN DATASET <Path / filename> FOR INPUT IN TEXT MODE...
    if sy-subrc eq 8, then the file does not exist on the application server.
    Reward Points if found helpfull..
    Cheers,
    Chandra Sekhar.

  • Excel File downloaded from application server is also opening in notepad

    Hi Friends,
    While downlaoding an excel file from the application server,we are able to open in notepad also.But this does not conatin the excel properties and hence happening.File should only oopen with excel and no other file type
    Can any open help on this
        ld_file =  '/usr/sap/trans/abap/HR_DATA.xls'.
        OPEN DATASET ld_file FOR OUTPUT in text mode ENCODING DEFAULT .
        IF sy-subrc = 0.
          LOOP AT int_final.
            CLEAR wa_string.
            CONCATENATE int_final-employee_sno int_final-employee_code INTO wa_string SEPARATED BY con_tab.
            CONCATENATE wa_string int_final-first_name         INTO wa_string SEPARATED BY con_tab.
    please help...
    Edited by: Neliea on Oct 29, 2009 1:11 PM

    Hi,
    Please refer to these links.
    [url]Re: Internal table to excel download?;url]
    [url]Re: Transfer from Internal Table to EXCEL file...;url]
    Regards,
    Aditya

  • Get File List From webserver!

    hello !
    I want to get the list of files residing in webserver.Actually these files r image files and i want to show thumbnails of these images to the user for selection. Please Help..

    Unless the webserver is poorly secured and allows directory browsing you're not going to get it.

  • Download file from application server to internal table in background

    hi all,
    i want to download a file from appliaction server into my internal table but in background.
    i had tryed CG3Z and CG3Y t-code but screen that is coming is asking for the parameters, and i want that screen should not appear and file should be saved in the predefined path by me.
    if there any way to do so,
    Points will be rewarded as per the Aswers.
    thaks in advance.

    Hi Sudeep,
       Use this code to get file data from application server.
    REPORT  ZE0232_BDC_APPLSERVER.
    DATA: FILE_PATH TYPE STRING.
    FILE_PATH = 'c:\bdc_mat.prn'.
    DATA: BEGIN OF ITAB OCCURS 0,
                END OF ITAB.
    OPEN DATASET FILE_PATH FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF SY-SUBRC = 0.
    DO.
    READ DATASET FILE_PATH INTO ITAB.
    IF ITAB-RESNO NE SPACE.
       APPEND ITAB.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    ENDIF.
    CLOSE DATASET FILE_PATH.
    LOOP AT ITAB.
    WRITE:/ ITAB.
    ENDLOOP.
    FILE PATH IS  application server path.
    IF USEFULL REWARD

  • Reading File from Application Server using Read Dataset

    Hi,
    i am trying to read excel file from Application Server and has multiple records in that based on structure below. but when i execute its giving me error message.here is the code, can sumone suggest me on this please ??
    FORM f_data_upload .
      DATA:
         l_filename TYPE string,   "file name
         l_wa_string TYPE string.  "file record
        l_filename = p_inp_as. "File path from Application Server
        OPEN DATASET l_filename FOR INPUT IN TEXT MODE ENCODING DEFAULT.
        DO.
          IF sy-subrc <> 0.
            EXIT.
          ENDIF.
    Read the data from the file in Application server.
          READ DATASET l_filename INTO l_wa_string.
          IF sy-subrc = 0.
            SPLIT l_wa_string AT cl_abap_char_utilities=>horizontal_tab
                  INTO w_data-tcode
                       w_data-matnr
                       w_data-mtart
                       w_data-werks
                       w_data-vkorg
                       w_data-vtweg
                       w_data-lgort
                       w_data-meins
                       w_data-maktx
                       w_data-spart
                       w_data-kosch
                       w_data-mstae
                       w_data-brgew
                       w_data-ntgew
                       w_data-groes
                       w_data-matkl
                       w_data-prdha
                       w_data-mstde
                       w_data-mtpos_mara
                       w_data-gewei
                       w_data-spart
                       w_data-mstav
                       w_data-mstdv
                       w_data-dwerk
                       w_data-taxkm
                       w_data-versg
                       w_data-kondm
                       w_data-ktgrm
                       w_data-mtpos
                       w_data-mtvfp
                       w_data-tragr
                       w_data-ladgr
                       w_data-herkl
                       w_data-ekgrp
                       w_data-webaz
                       w_data-dismm
                       w_data-beskz
                       w_data-prctr
                       w_data-bklas
                       w_data-bwtty
                       w_data-vprsv
                       w_data-verpr
                   IN CHARACTER MODE.
            APPEND w_data TO i_data.
            CLEAR w_data.
           ENDIF.
        ENDDO.
        CLOSE DATASET l_filename.
    Error Message while executing
    What happened?
        At the conversion of a text from codepage '4110' to codepage '4102':
        - a character was found that cannot be displayed in one of the two
        codepages;
        - or it was detected that this conversion is not supported
        The running ABAP program 'ZHDI_LOMM_VEHI_MAT_MASS_CREATE' had to be terminated
         as the conversion
        would have produced incorrect data.
        The number of characters that could not be displayed (and therefore not
        be converted), is 449. If this number is 0, the second error case, as
        mentioned above, has occurred.
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_CONVERSION_CODEPAGE', was not
         caught in
        procedure "F_DATA_UPLOAD" "(FORM)", nor was it propagated by a RAISING clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        Characters are always displayed in only a certain codepage. Many
        codepages only define a limited set of characters. If a text from a
        codepage should be converted into another codepage, and if this text
        contains characters that are not defined in one of the two codepages, a
        conversion error occurs.
        Moreover, a conversion error can occur if one of the needed codepages
        '4110' or '4102' is not known to the system.
        If the conversion error occurred at read or write of  screen, the file
        name was '/usr/sap/interfaces/conversion/pioneer/ddm/data/test_data1.xls'.
         (further information about the file: "X 549
         24064rw-rw----200812232135082008122307293120081223072931")
    Please help me
    Thank You

    Woah ... perfect guru
    but data looks like all junk characters ? its filling with special characters, hashes # and other characters but not with Excel data.. any idea ??
    Temesh
    Edited by: New2Sap Abap on Dec 24, 2008 6:42 AM

  • Dynamic selection of file in infopackage from application server

    Hi,
    We have a infopackage in Process chain which runs daily. In the infopackage 'EXTRACTION' tab , input file is from application server. The file we get daily is not unique.
    As an example file name is not like 'UNIQUE.CSV' . It varies daily and carries a date and time stamp like UNIQUE_DATE_TIME.CSV
    I think we can have a routine to handle this. can someone help me with the routine/code?
    Thank you all.

    Hi,
    1. Create Two Floders in AL11 i.e. in Apllication Server. Eg Name it F1 and F2.
    2. First dump the .csv files into Folder F1 using some Programs or Manualy (Name xyz.csv).
    3. Then load the data using InfoPackage (here IN infoPackage, Extraction Tab you need to select Adapter = Load Text File from Application Server and then give the correct path from Folder F1), through PC.
    4. At the end of the load, attach a simple Program to Move the xyz.csv file from Folder F1 to Folder F2.
    5. So next day the file will come to Folder F1 and the it will loaded to Cube/DSO and at the end it will move to Folder F2.
    Else you can use simple one or two lines of UNIX/WINDOWS (depends on your OS) script to move the file from Folder F1 to Folder F2 , once you load is over.
    While moving the file from Folder F1 to Folder F2 you can append the date at the end of the file and then move to Folder F2, it is use full for future reference.
    See Blogs and Article, similar logic...
    https://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
    How to transfer the Data from SAP-System to Non-SAP system without additional Cost/License
    /people/surendrakumarreddy.koduru/blog/2009/03/11/how-to-transfer-the-data-from-sap-system-to-non-sap-system-without-additional-costlicense
    To Check the Files/Reports in Application Server and Trigger Mail Alerts.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/4096bf2d-bcea-2b10-4ab4-e0683830d9b2&overridelayout=true
    1. Create Three Floders in AL11 i.e. in Apllication Server. Eg Name it F1, F2 and F3.
    2. First dump the .csv files into F1. (Name xyz.csv).
    3. Then using UNIX/WINDOWS (depends on your OS) script , first check the file is there are not in F1, if yes then rename the file with date and time or date and transfer the files from F1 to F2 i.e xyz06032010.csv.
    4. Then Create a small ABAP program to check the file in F2, if it is there then Trigger the Event, and using that event you execute teh PC.
    5. Then using UNIX/WINDOWS (depends on your OS) script , transfer the files from F2 to F3 i.e xyz06032010.csv.
    6. Next day morning F1 and F2 are empty and F3 is having the backup files.
    So use this method, I used the similar logic and it is working fine.
    Timinings are importent i.e what time you need to dump the fule in F1 and what time you need to run UNIX/WINDOWS (depends on your OS) script , transfer the files from F1 to F2 and what time UNIX/WINDOWS (depends on your OS) script , transfer the files from F2 to F3.
    Thanks
    Reddy

  • 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