Listing files of directory on application server

hi all,
I want to download a list of files from the application server.
I tried the functions:
- SUBST_GET_FILE_LIST
- EPS_GET_DIRECTORY_LISTING
- RZL_READ_DIR_LOCAL
but the result gives me the name of my file truncated.
My filename is much longer than the functions give me.
Is there any other function, or can i bypass this problem in a way.
Thanks in advance.
Merijn.

Hello,
This is a common problem with this FMs. Even SAP acknowledges this:
In EPS_GET_DIRECTORY_LISTING you have this:
data: begin of file,
        dirname(75) type c, " name of directory. (possibly truncated.)
        name(75)    type c, " name of entry. (possibly truncated.)
      end of file.
The FM uses a Kernel Call 'C_DIR_READ_NEXT' to get the list of the files in the directory. The file name is returned in the field file-name.
call 'C_DIR_READ_NEXT'
          id 'TYPE'   field file-type
          id 'NAME'   field file-name
          id 'LEN'    field file-len
          id 'OWNER'  field file-owner
          id 'MTIME'  field file-mtime
          id 'MODE'   field file-mode
          id 'ERRNO'  field file-errno
          id 'ERRMSG' field file-errmsg.
The program RSWATCH0(trxn: AL11) also uses the Kernel call but the structure file is different.
DIrectory name can be 1024 character long & file name is 260 character long
data: begin of file,
        dirname(1024)    type c,  " name of directory. (possibly
                                       " truncated.)
        name(260)        type c, " name of entry. (possibly
                                       " truncated.)
        type(10)    type c,            " type of entry.
        len(8)      type p,            " length in bytes.
        owner(8)    type c,            " owner of the entry.
        mtime(6)    type p, " last modification date, seconds since 1970
        mode(9)     type c, " like "rwx-r-x--x": protection mode.
        useable(1)  type c,
        subrc(4)    type c,
        errno(3)    type c,
        errmsg(40)  type c,
        mod_date    type d,
        mod_time(8) type c,            " hh:mm:ss
        seen(1)     type c,
        changed(1)  type c,
      end of file.
So one workaorund would be to copy EPS_GET_DIRECTORY_LISTING to some custom FM & change the length of the structure file to suit your requirement
BR,
Suhas
PS: Use of Kernel Call is for internal use only & is highly not recommended by SAP.

Similar Messages

  • How to read list of all files in folder on application server?

    How to read list of all files in folder on application server?

    Hi,
    First get the files in application server using the following function module.
        CALL FUNCTION 'RZL_READ_DIR_LOCAL'
          EXPORTING
            name     = loc_fdir
          TABLES
            file_tbl = int_filedir.
    Here loc_fdir contains the application server path.
    int_filedir contains all the file names in that particular path.
    Now loop at int_filedir.
    OPEN DATASET int_filedir-name FOR INPUT IN TEXT MODE ENCODING  DEFAULT MESSAGE wf_mess.
    MESSAGE wf_mess.
        IF sy-subrc = 0.
          DO.
            READ DATASET pa_sfile INTO wf_string.
            IF sy-subrc <> 0.
              EXIT.
    endif.
    close datset int_filedir-name.
    endloop.

  • Directory in application server has multiple flat files

    Hi
    How should we know that the Directory in application server has multiple flat files.
    my requirement is, daily my program runs in batch at night. So, i  have to know are there more than 1 flat file existing in the directory.
    regards
    mac

    Try this FM,
      CALL FUNCTION 'SUBST_GET_FILE_LIST'
        EXPORTING
          dirname      = ws_filepath
          filenm       = ws_fname
        TABLES
          file_list    = i_rsfillst
        EXCEPTIONS
          access_error = 1
          OTHERS       = 2.
    Pass the path and
    say ur file name starts with ALPXXXXX
    then pass
    ws_fname =  'ALP*' .
    In the table i_rsfillst you will get all the file in directory.
    Try this through a sample prorgam ,dont try through SE37, it will show ACCESS_ERROR.
    Regards,
    Message was edited by: sreejesh purapadiath
    Message was edited by: sreejesh purapadiath

  • Use XML files stored in directory of Application server as a input for XI ?

    I have a scenario that there is a xml file stored in sap application server for example /inf/ERQ/XML/XXX.xml which i want to use it as an input for XI. I know that there is an adapter in XI for getting xml file stored in normal path but in my situation it's in application server of SAP so i don't know how to do this.
    Any solution or example for this? Thank you in advance.
    Best regards

    Hi,
    We can read this file through FILE adapter with FTP protocol, before that i think need permission from basis for access.  Configure source(according to xml format) and target structure according to your requirement.  But one thing should remember in XI/PI sour/target XML formats should contain Message type name & namespace name else it can't work.
    Find below link for more information.
    Introduction to simple (File-XI-File)scenario and complete walk through for starters(Part2)

  • How to create a directory in application server

    Hi all,
    How to create a directory in application server through Progaram??
    eg:\tmp - is already existing
    I want to create \tmp\fi 
    Within \tmp\fi - i should able to store my file,,,
    Kindly help me urgent...

    Hello San,
    Either contact Basis guys at ur end for the same or u can do it dynamically via a piece of ABAP code, i hope it wll help u.
    call function 'GUI_CREATE_DIRECTORY'
         exporting
    dirname = '//<ip_address>/qfilesvr400/<host>/usr/sap/TST/SYS/Folder1'
         exceptions
              failed  = 1
              others  = 2.
    Reward If Helpful.
    Regards
    Sasidhar Reddy Matli.

  • F4 help for file path in the Application server

    Hi All,
    i want to provide the F4 help so as to enable us to give the file path in the application server (AL11). I'm in version 4.0
    Regards
    Shekhar

    Hi
    Copy paste the following code and see the result
    Here you can see 2 types of open dialogs
    1. Directory View
    2. File View
    Use any one as per your requirement.
    DATA : l_filetable TYPE filetable,
           l_rc TYPE i.
    DATA: l_folder TYPE string,
          l_file TYPE string.
    PARAMETERS: p_folder(100) TYPE c,
                p_file(100) TYPE c.
    *Provide a Dialogue box for getting a folder path
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_folder.
      CALL METHOD cl_gui_frontend_services=>directory_browse
        EXPORTING
          window_title    = 'Select Folder Path'
          initial_folder  = 'D:\'
        CHANGING
          selected_folder = l_folder.
      p_folder = l_folder.
    *Provide a Dialogue box for getting a file path
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title      = 'Select a Text File'
          initial_directory = l_folder
        CHANGING
          file_table        = l_filetable
          rc                = l_rc.
    Reward points generously
    Regards
    Akshay Chonkar
      READ TABLE l_filetable INTO p_file INDEX 1.
      CHECK sy-subrc <> 0.

  • Upload a file to portal--- BW application server.

    Dear All,
    I have requirement where some part of business does not have SAP installed. But we would like to extract data from these business too.
    So just wanted to know if we can have a scenario where user will upload the data to the portal (this is just a web portal). Can this be done?
    Secondly, if the can be done, can we extract the file from portal to application server? From application then it becomes very simple to upload to data targets in BW.
    Please help in this regard.
    Thanks,
    Sandeep

    Assign an ID (e.g. 1234) to the uploaded file. You should abstract the store
    so that it will work on the file system or in the database.
    The JSP will include an image ref to that ID, e.g.
    http://www.myco.com/myapp/imageservlet?id=1234
    The image servlet will retrieve and stream the image. It has to set content
    type etc. You should also verify that the current user has access to the
    requested image if security/privacy is an issue.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    http://www.tangosol.com/coherence.jsp
    Tangosol Coherence: Clustered Replicated Cache for Weblogic
    "newsgroups.bea.com" <[email protected]> wrote in message
    news:3daadaa5$[email protected]..
    Imp struggling to find a way of uploading an image file from the browserto
    the app server (wl 6.1), where the uploaded image will to be included as
    part of a JSP file.
    ** Note
    - this part of Managed Cluster, the uploaded directory is NFS mounted
    between the managed servers
    - we deploy using EAR's from the admin server.
    I am able to upload but, cant get the uploaded image to display as partof
    a JSP,
    Our 5.1 WL server work perfectly using a standard exploaded directory !
    I have logged this as a call at BEA, but they have not been able to offerme
    a solution yet.
    Regards
    Roland

  • Creating Directory in Application Server

    Hi Friends,
    Can anyone help me on,
    How to create directory in application server.
    Also, I need to create one file in this directory with fixed name, how do we do that?
    Also, tell me how to use transaction FILE in detail...
    I am working on CRM and there is no transaction CB3Z ...
    Kindly help.
    Good answers will be rewarded...
    Cheers!
    Pradeep

    Hi Pradeep
    Refer the Links:
    <b>Creating a directory & subdirectory on Application Server
    API for creating a directory in the application server
    Regards,
    Sree

  • How to store a JSP file in the SAP Application server ?

    Hello All,
    My reqt. is as follows :
    1. I need to store a JSP File on the SAP Application server .
    How can I do this ?
    2. I want to call the uploaded jsp file from the server and call this jsp from abap to view the result of it .
    How can I achieve this ?
    First of all is this possible ?
    Regards,
    Deepu.K

    Hello Mike,
    Thanks for ur reply.
    I've imported the JSP as a mime object into the BSP.
    Now I've created the page to show that Mime Object as an image.
    But nothing is coming as an output.
    But then,there is an option for that mime object. i.e when I right click on the mime object there is an option called " convert to BSP".
    I selected that option and it created a view in my BSP .( My BSP is a page with flow logic application )
    Now how should i make this view to be an output ?
    I guess this shud be posted in the BSP Forum ...but still taking a chance here :)-
    Regards,
    Deepu.K

  • Reading the data from excel file which is in application server.

    Hi,
    Iam trying to read the data from excel file which is in application server.
    I tried using the function module ALSM_EXCEL_TO_INTERNAL_TABLE. But it didn't work.
    I tried just reading using open data set and read data set it is giving junk characters.
    Please suggest me if you have any solution.
    Best Regards,
    Brahma Reddy

    Hi Narendra,
    Please see the below code I have written
    OPEN DATASET pa_sfile for INPUT in text mode ENCODING  DEFAULT MESSAGE wf_mess.
    CHECK sy-subrc = 0.
    DO.
    READ DATASET pa_sfile INTO wf_string.
    IF sy-subrc <> 0.
    EXIT.
    else.
    split wf_string at wl_# into wf_field1 wf_field2 wa_upload-field3
    wa_upload-field4 wa_upload-field5 wa_upload-field6 wa_upload-field7 wa_upload-field8
    wa_upload-field9 wa_upload-field10 wa_upload-field11 wa_upload-field12 wa_upload-field13
    wa_upload-field14 wa_upload-field15 wa_upload-field16 wa_upload-field17 wa_upload-field18
    wa_upload-field19 wa_upload-field20 wa_upload-field21 wa_upload-field22 wa_upload-field23
    wa_upload-field24 wa_upload-field25 wa_upload-field26 wa_upload-field27 wa_upload-field28
    wa_upload-field29 wa_upload-field30 wa_upload-field31 wa_upload-field32 wa_upload-field33
    wa_upload-field34 wa_upload-field35 wa_upload-field36 .
    wa_upload-field1 = wf_field1.
    wa_upload-field2 = wf_field2.
    append wa_upload to int_upload.
    clear wa_upload.
    ENDIF.
    ENDDO.
    CLOSE DATASET pa_sfile.
    Please note Iam using ECC5.0 and it is not allowing me to declare wl_# as x as in your code.
    Also if Iam using text mode I should use extension encoding etc.( Where as not in your case).
    Please suggest me any other way.
    Thanks for your help,
    Brahma Reddy

  • Files are stored in application server,

    Files are stored in application server, I am using Open dataset to write to a file in unix box.would like to convert my itab into tab delimted and download. Please let know
    is there any function?

    You should do a search to get the right ascii value (you can get an
    ascii chart, you can google a bit, you can visit the group's page and
    search for tab delimited... ) and replace 09 by the right value. And
    that's it.. The technique (which is what it matters) is right.
    Another tip:: you could download in two steps: first you use
    gui_download or ws_download to create a tab delimited file in your pc or
    in a network. Then you upload this file (using gui_upload or ws_upload
    into an internal table and the final step is to use open dataset -
    transfer - close dataset to write down this last itab to your app
    server.

  • Regarding the File Format on the application server

    Hi,
    I would like to know the file format (ANSI, UTF-8, UTF-16, UTF-32) of the file placed on the application server in my program. Can anyone help me with the Function Module or Class or any other way which will retrieve this information.
    Thanks
    Sarves S V K

    Hi
    You can try the standard class CL_ABAP_FILE_UTILITIES and the method
      CALL METHOD cl_abap_file_utilities=>check_utf8 
        EXPORTING 
         file_name = filename 
        IMPORTING 
         bom       = file_bom 
         encoding  = file_encoding. 
    Check the possible values returned by encoding and BOM:
    NO_BOM
    BOM_UTF8
    BOM_UTF16_BE
    BOM_UTF16_LE
    ENCODING_UTF8
    ENCODING_7BIT_ASCII
    ENCODING_OTHER

  • How i access file which stored at application server .? Is there any fm ?

    Hi,
    How i access file which stored at application server . Is there any function module which provide same funtinality.
    Regards,
    Gurprit Bhatia

    Hi ,
            U need to use datasets for reading data from application server.Do a f1 on dataset,u will get to know rest of the things.
    TRY.
        OPEN DATASET file FOR INPUT IN TEXT MODE ENCODING UTF-8.
      ENDTRY.
      IF sy-subrc = 0.
          READ DATASET file INTO <wa_data> MAXIMUM LENGTH 200.
               move the data in to internal table
        close dataset
    Edited by: A kumar on Aug 21, 2008 1:37 PM

  • How to trigger a Report when a file is placed in Application server

    Hi All,
    How to triggger a Report and get executed when a new file is placed in the application server.?
    It will be helpful if a Navigation is provided for the EVENT.
    Thanks in advance
    Chakri

    Hi,
    Check what is the frequency of the file coming to the application server.
    Schedule your program in SM36 giving data and time make it periodic . select the check box Periodic Job
    and then select the period values and give the period values as per the frequency of the file coming to app server.
    Thanks,
    Harini

  • How to move PDF file from Spool to Application Server?

    How to move PDF file from Spool to Application Server?
    Cannot use RSTXPDFT4 because that converts OTF to PDF and the file is already PDF.
    RSTXPDFT5 doesn't work. It picks the file up and assigns it a 'text' type and outputs a 1 line txt (1kb in size) on the server with the spool number in it!
    The program which outputs the file to the spool, in the first place, uses adobe forms and outputs to a printer of type PDF.

    Hi Gemini ,
    Please refer the below links.
    [http://sap.ittoolbox.com/groups/technical-functional/sap-hr/convert-a-spool-to-pdf-and-save-on-application-server-in-background-720959]
    [http://www.sapfans.com/forums/viewtopic.php?f=13&t=325628&start=15]
    Edited by: Prasath Arivazhagan on Apr 13, 2010 4:48 PM

Maybe you are looking for

  • 110W power adaptor

    I have a 110W power adaptor from a 2006 Mac mini thats not being used, I need a power adaptor for a late 2009 Mac mini, I was wondering if the 2006 power adaptor is compatible with the late 2009 Mac mini? I know the late 2009 mac mini also uses a 110

  • Fetch cross commit doens't throw ora-1555 in 10.2.0.3

    in this link, Ktye put an example of fetch across commit which will throw ora-1555. http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:546822742166 But I can't reproduce it in oracle 10.2.0.3. Anything changed for undo in 10g? I set

  • MSS Calendar View - Details of employee's request displaying 0 for hours

    In MSS Calendar view when a manager views their calendar they can select the employee's time off request and the details will dispaly below.  The details consist of the type, date and hours of the request.  It appears that for some managers they are

  • Switching Phones.. And Apps..

    Lets say my phone was damaged and I had another Verizon phone that I could use temporarily. Could I activate it online , use it, and would it change my  2 free every date or would stay the same? Also would I have to eventually switch back to my origi

  • AIBU error

    when I run AIBU, it reports the error: Acquisition value negative in  depreciation area 01, but I checked AUC, there is positive net book value 1000, My AUC has two transactions , in Nov, it settled from project system, P&L account is credited with 3