Check file in unix directory

Hi all,
I am dealing with checking file in certain directory path of the unix. If file can be found then has to be uploaded.
How to get list of those files in the unix and based on these information, I will do open dataset.
thanks alots.
Alia

Hi Alia,
  Check this Function module also
    call function 'SUBST_GET_FILE_LIST'
         exporting
              dirname      = p_reqdir
              filenm       = ' '
         tables
              file_list    = t_reqfile_list
         exceptions
              access_error = 1
              others       = 2.
This FM returns the list of all files in the path specified.
Regards,
Ravi

Similar Messages

  • How to create pdf files in UNIX directory from oracle reports

    I would like to know how to create pdf files in UNIX directory from oracle reports.
    Thanks,

    Please make your question more clear . Also mention the reports version.
    1) If you are runnning reports in Unix, you can give
    .... destype=file desformat=pdf desname=<filename>
    in command line
    Please refer docs below.
    2) If by your question you mean
    "My reports server is running in Windows but I want to ftp my files to Unix after creating it"
    then the answer is that you can use pluggable destination "ftp"
    .... destype=ftp desformat=pdf desname=<ftp url>
    Pluggable destinations download
    http://otn.oracle.com/products/reports/pluginxchange/index.html
    Thanks
    Ratheesh
    [    All Docs     ]
    http://otn.oracle.com/documentation/reports.html
    [     Publishing reports to web  - 10G  ]
    http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
    http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
    [   Building reports  - 10G ]
    http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
    http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
    [   Forms Reports Integration whitepaper  9i ]
    http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf

  • Unix command to create a copy of file from unix directory

    Hi guys,
    what is the Unix command to create a copy of file from unix directory?
    Thanks a lot!

    If you haven't noticed, this is a ABAP forum.
    You can go to the UNIX thread instead and post it there,
    SAP on UNIX
    You can expect answers there

  • Moving one file in unix directory path into another unix directory path

    Hi All,
    I have issue regarding moving one file in one unix directory into another unix directory.
    Actual requirement is as below:
    I have two unix directories 1. /var/opt/working 2. /var/opt/error
    Now i have a file [ FILE1 ] in [/var/opt/working] working directory.
    In code checking i found it is error file now in my abap i want to move/send this file [FILE1] to another unix directory [/var/opt/error].
    How can solve this issue in ABAP code.
    Can anybody solve this issue!
    Thanks,
    Deep.

    1. Open the 1st file using Open dataset for input /var/opt/working
    2. Get the data into internal table
    3. Open the 2nd file using Open dataset for output /var/opt/error
    4. TRANSFER the data from the internal table to 2nd file
    5. CLOSE 2nd file
    6. Close 1st file
    7. Delete 1st file using DELETE DATASET dsn.

  • Getting list of files from Unix directory inclding files frm sub-directries

    Hi All,
            I am trying to use Fm 'SUBST_GET_FILE_LIST'  and
    'RZL_READ_DIR_LOCAL' for getting a list of all files in a Unix directory including files from sub-directories.
    In the first case I am getting an Exception called 'Access Error'
    and when I use the 2nd FM, I am not getting any output.
    Is there a special way to use these FMs.
    Kindly help.
    Regds,
    Shweta

    [url http://java.sun.com/developer/JDCTechTips/2003/tt0122.html#1]READING FILES FROM JAVA ARCHIVES (JARS)

  • Information Broadcast Email File - Where is the file in Unix directory?

    Hi,
    I am using Information Broadcasting to email the BI report.   We use Unix as the application server.
    In transaction SOSV, I can get detailed information on the file (attachment) and the send status.  There is a requirement to encrypt the file in Unix server.   Does anyone know where the file resides in Unix when the report is generated from Information Broadcasting?   What's the Unix directory?
    Any information would be appreciated.
    Thank you.
    Rebecca

    I added the path of the servlet.jar to the CLASSPATH. Now my modified
    file content is as follows:
    WINDOWS 2000 Environmental variable changes:(CLASSPATH)
    C:\Program Files\PhotoDeluxe BE 1.1\AdobeConnectables;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;C:\jakarta-tomcat-4.1.12\common\lib\servlet.jar
    AUTOEXEC.BAT:
    set path=%path%;c:\onnet32
    SET PATH=C:\jdk1.3.1\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;
    SET JAVA_HOME=C:\jdk1.3.1
    SET CATALINA_HOME=C:\jakarta-tomcat-4.1.12
    SET CLASSPATH=.;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;C:\jakarta-tomcat-4.1.12\common\lib\servlet.jar
    With this I am executing the command: javac test.java. However, it is still giving lot of error messages
    All the messages are 'cannot resolve symbol' associated with the Servlet class, Servlet Request, Server Exception etc. In the very first error message it states that: 'package javax.servlet does not exist'.
    I would appreciate any help. Thanks in advance.

  • Sample code to read a text file from UNIX directory.

    I am using 9i Developer Suite, application server is 9.0.4. I want some help on how to read a flat file from UNIX environment. A sample code could be very helpful.
    In windows, i use this kind of code:-
    I declare an object & then write to a file using these sample staements:-
    file_handle text_io.file_type;
    filename := 'd:\ran\egs\uninvoiced.txt';
    file_handle:=text_io.fopen(filename,'w');
    text_io.put_line(file_handle, 'MOBILE NO '||'COUPON NO ' || 'DATE');
    I hope, my question is clear. Please help in solving the doubt.
    Regards.

    filename := 'd:\ran\egs\uninvoiced.txt';This is a Windows directory, so it won't work on Unix.
    For the rest of the code: see examples in the Forms Builder Online Help.

  • Number of files in unix directory

    Hi All,
    anyone can help me, how can I get the number of files in specific unix directory and number of files in each
    sub-directory inside that directory?
    Thank You

    Hi,
    Use the following program which will list the files on a unix system.
    Put/modify the logic for getting the file count. (play around)
    REPORT ZUNIXFILES MESSAGE-ID Z1
                      NO STANDARD PAGE HEADING
                      LINE-COUNT 65
                      LINE-SIZE  132.
    Global Variables.                                                   *
    DATA: BEGIN OF TABL OCCURS 0,
              LINE(2000),
          END OF TABL.
    DATA: PARCOM_LOC LIKE RS37A-LINE.
    DATA: SIZE(10) TYPE C,
          LINE     LIKE TABL-LINE,
          SUM(16)  TYPE C.
    DATA: FILE LIKE RS37A-LINE.
    DATA: PATH(255) TYPE C.
    Parameters.                                                       *
    SELECTION-SCREEN SKIP 2.
    PARAMETERS: PARCOM LIKE RS37A-LINE.
    *AT SELECTION-SCREEN.
    AT SELECTION-SCREEN.
      CONDENSE: PARCOM NO-GAPS.
    *TOP-OF-PAGE.
    TOP-OF-PAGE.
      PERFORM WRITE_PAGE_HEADING.
    *INITIALIZATION.
    INITIALIZATION.
      PARCOM = '/usr/sap/*'.               "Only default value
    *START-OF-SELECTION.
    START-OF-SELECTION.
      PERFORM MAKE_LOC.
      PERFORM COLLECT_DATA.
      PERFORM FILE_LIST.
    *AT LINE-SELECTION.
    AT LINE-SELECTION.
      CLEAR FILE.
      FILE = SY-LISEL+55.
      REPLACE '|' WITH SPACE INTO FILE.
      IF SY-LISEL+1(1) = 'd'.
         PATH = FILE.
         PATH+200 = '/*'.
         CONDENSE PATH NO-GAPS.
         SUBMIT ZUNIXFILES
           WITH PARCOM = PATH
           AND RETURN.
      ENDIF.
      SUBMIT ZBROWSEFILE            "Call the browse program
         WITH PARCOM = FILE
         AND RETURN.
    FORM MAKE_LOC.                                                      *
    FORM MAKE_LOC.
      CLEAR: PARCOM_LOC.
      PARCOM_LOC(7)    = 'ls -ld '.
      PARCOM_LOC+7(45) = PARCOM.
    ENDFORM.
    FORM COLLECT_DATA.                                                  *
    FORM COLLECT_DATA.
      REFRESH TABL.
      CALL 'SYSTEM' ID 'COMMAND' FIELD PARCOM_LOC
                    ID 'TAB'     FIELD TABL-SYS.
    ENDFORM.
    FORM FILE_LIST.                                                   *
    FORM FILE_LIST.
      FORMAT RESET.
      CLEAR SUM.
      LOOP AT TABL.
        CLEAR LINE.
        LINE = TABL-LINE.
        WRITE /2 LINE.
        PERFORM VERTICAL_LINES.
        SUM = SUM + SIZE.
      ENDLOOP.
      WRITE:/1(132) SY-ULINE.
    ENDFORM.
    FORM WRITE_PAGE_HEADING.                                          *
    FORM WRITE_PAGE_HEADING.
      WRITE:/1(132) SY-ULINE.
      PERFORM VERTICAL_LINES.
      FORMAT INTENSIFIED.
      WRITE: /2(131) SPACE COLOR 1.
      WRITE:  2    SY-DATUM COLOR 1.
      WRITE: 35 'File Manager' COLOR 1.
      PERFORM VERTICAL_LINES.
      WRITE:/1(132) SY-ULINE.
      PERFORM VERTICAL_LINES.
      FORMAT INTENSIFIED.
      WRITE: /2(131) SPACE  COLOR 3.
      PERFORM VERTICAL_LINES.
      FORMAT RESET.
      WRITE:/1(132) SY-ULINE.
    ENDFORM.
    FORM VERTICAL_LINES.                                              *
    FORM VERTICAL_LINES.
      PERFORM WRITE_VLINE USING ' '  1.
      PERFORM WRITE_VLINE USING ' '  132.
    ENDFORM.
    WRITE_VLINE.                                                      *
    FORM WRITE_VLINE USING MODE POS.
      IF MODE NE 'T'.
        FORMAT INTENSIFIED.
      ENDIF.
      POSITION POS.
      WRITE: SY-VLINE.
      IF MODE NE 'T'.
        FORMAT RESET.
      ENDIF.
    ENDFORM.

  • CX_SY_CONVERSION_CODEPAGE - Error when reading from file in unix directory

    Hi
    We have a custom report which reads data from a file put in the unix directory. This report has been running for good 3 years now without any code changes.
    For a few days the report is dumping with the following error
    CX_SY_CONVERSION_CODEPAGE
    Short text
        Character set conversion is not possible.
    What happened?
        When converting a text from code page '4110' to code page '4102',
        the system either
        - encountered a character which cannot be represented in one of
          the two code pages; or
        - found that this type of conversion is not supported.
    The code where the dump occurs is:
    load the file from the given path
      OPEN DATASET  p_p_lfdata FOR INPUT IN TEXT MODE ENCODING DEFAULT WITH SMART LINEFEED.
      IF sy-subrc EQ 0.
        DO.
    >>>>>>>>      READ DATASET  p_p_lfdata INTO  l_rec. " Dump occurs here
          IF sy-subrc = 0.
    I understand this error is thrown in the OPEN DATASET statements in case of non-unicode compliance, but this statement does not throw an error while the READ DATASET statement does..... Any particular reason why the READ statement is failing even though OPEN is successful???

    Hi,
    you open the according file in DEFAULT mode. I assume you do this on a Unicode system.
    Then the program assumes that the file is encoded in UTF-8 (SAP number 4110).
    Now it seems that the file contains some characters, which are not encoded in UTF-8.
    I would propose to investigate the code page, on which the file is created.
    Ideally this should be UTF-8. If this is not the case, try to change it.
    If this is not possible, then adapt the ABAP program (e.g. use Non-Unicode mode).
    Best regards,
    Nils Buerckel

  • How to check files in the directory using JSP?.

    Hi,
    How can i check the file is directory or file and readable or writable and file size and type of file(Ex. jpg, txt, doc., etc). i want to list the specific type of file in the particular directroy.. please help me..
    Regards
    CHinna

    With the File class, using the methods isFile(), isDirectory(), canRead(), canWrite(), length() and getName()
    With File.listFiles() you can get a directory listing. If you want to limit the amount of files returned, you can pass your own FileFilter to it.
    http://java.sun.com/javase/6/docs/api/java/io/File.html

  • How to write a file into UNIX!

    Hi Group!
    I am trying to write an error file into UNIX directory using 'OPEN DATASET ERRFILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT'. But unfortunately i am getting a dump as it is giving the subrc 8 and dumping with CX_SY_FILE_OPEN_MODE.
    The path looks like /sap/DE1/batch/data/SCM_YM/partfiles/HGMEH011.20071001150344
    Is there any special command or way to write the file into UNIX?
    Quick response would be of great help.
    Suresh

    The detailed error is
    The file '&FILENAME&' was not opened, or was opened in the wrong mode.
    Can you please try to create a new file that does not exist.
    then we can check whether you have authorization or not.
    OPEN DATASET to a file already opened - in the same internal mode - triggers the exception.
    THtas why you just create a file with some rough name ( may be ur name) intially and then check.
    bye sasi

  • Write Thai font in Unix Directory.

    Hello,
    Is there specific syntax to write file on the Unix directory in R/3 server in the Thai language. In Debug mode i can see the actual thai characters in the internal table, but when i view the file in Unix directory it gives all garbage characters e.g.
    ชื่à¸à¸¥à¸¹à¸à¸„้า
    บัญชีเลขที่
    รายงานบัญชีวันที่
    Can anyone help as to certain whether this is logic issue or font issue.?
    Regards,
    Mansi.

    Hi Mansi,
                  Well thats great that the document were of some help.Right now I can send you the syntax for Thai open dataset command.Hope it helps you to resolves your query.
    |OPEN DATASET dset
      FOR { INPUT | OUTPUT | APPENDING | UPDATE }
      IN { { BINARY MODE }
         | { TEXT MODE ENCODING { DEFAULT
                                | {UTF-8 [SKIPPING|WITH BYTE-ORDER
    MARK]}
                                | NON-UNICODE }
                       [WITH {NATIVE|SMART|UNIX|WINDOWS} LINEFEED]
         | { LEGACY BINARY MODE [{BIG|LITTLE} ENDIAN]
                                [CODE PAGE cp] }
         | { LEGACY TEXT MODE [{BIG|LITTLE} ENDIAN]
                              [CODE PAGE cp]
                              [WITH {NATIVE|SMART|UNIX|WINDOWS}
    LINEFEED] } }
      [AT POSITION pos]
      [TYPE attr]
      [FILTER opcom]
      [MESSAGE msg]
      [IGNORING CONVERSION ERRORS]
      [REPLACEMENT CHARACTER rc].

  • How to check whether a file is present in the UNIX directory of app. server

    Hi,
            I am creating files in the UNIX directory in the application server using :
                       CONCATENATE '/sapmnt/RD1/interfaces/client670/'
                       p_fname '.CSV' INTO w_filename.
               OPEN DATASET w_filename FOR OUTPUT IN TEXT MODE.
              LOOP AT t_output1.
                      TRANSFER t_output1 TO w_filename.
              ENDLOOP.
             CLOSE DATASET w_filename.
    I am unable to check whether a file with the same name exists or not. How to check the duplicate state of the file.

    You can use the following fm
    RZL_READ_FILE
    or
    use OPEN DATASET FOR INPUT.

  • FM to GET file listing of a UNIX directory.

    Hello everyone,
    Please can anyone provide me a function module that can return to me ALL the files found inside a UNIX directory. I have tried FM EPS_GET_DIRECTORY_LISTING but I can't seem to provide the correct parameter.

    Ryan,
    check this program,
    REPORT ZFTPSAP LINE-SIZE 132.
    DATA: BEGIN OF MTAB_DATA OCCURS 0,
    LINE(132) TYPE C,
    END OF MTAB_DATA.
    DATA: MC_PASSWORD(20) TYPE C,
    MI_KEY TYPE I VALUE 26101957,
    MI_PWD_LEN TYPE I,
    MI_HANDLE TYPE I.
    START-OF-SELECTION.
    *-- Your SAP-UNIX FTP password (case sensitive)
    MC_PASSWORD = 'password'.
    DESCRIBE FIELD MC_PASSWORD LENGTH MI_PWD_LEN.
    *-- FTP_CONNECT requires an encrypted password to work
    CALL 'AB_RFC_X_SCRAMBLE_STRING'
         ID 'SOURCE' FIELD MC_PASSWORD ID 'KEY' FIELD MI_KEY
         ID 'SCR' FIELD 'X' ID 'DESTINATION' FIELD MC_PASSWORD
         ID 'DSTLEN' FIELD MI_PWD_LEN.
    CALL FUNCTION 'FTP_CONNECT'
         EXPORTING
    *-- Your SAP-UNIX FTP user name (case sensitive)
           USER            = 'userid'
           PASSWORD        = MC_PASSWORD
    *-- Your SAP-UNIX server host name (case sensitive)
           HOST            = 'unix-host'
           RFC_DESTINATION = 'SAPFTP'
         IMPORTING
           HANDLE          = MI_HANDLE
         EXCEPTIONS
           NOT_CONNECTED   = 1
           OTHERS          = 2.
    CHECK SY-SUBRC = 0.
    CALL FUNCTION 'FTP_COMMAND'
         EXPORTING
           HANDLE = MI_HANDLE
           COMMAND = 'dir'
         TABLES
           DATA = MTAB_DATA
         EXCEPTIONS
           TCPIP_ERROR = 1
           COMMAND_ERROR = 2
           DATA_ERROR = 3
           OTHERS = 4.
    IF SY-SUBRC = 0.
      LOOP AT MTAB_DATA.
        WRITE: / MTAB_DATA.
      ENDLOOP.
    ELSE.
    do some error checking.
      WRITE: / 'Error in FTP Command'.
    ENDIF.
    CALL FUNCTION 'FTP_DISCONNECT'
         EXPORTING
           HANDLE = MI_HANDLE
         EXCEPTIONS
           OTHERS = 1.  
    DATA:
    l_pcfile LIKE sapb-sappfad, "Desktop file & path
    l_serfil LIKE sapb-sappfad. "Server File & path
    l_pcfile = 'D:\Data\temp\input.txt'.
    l_serfil = '/tmp/output.txt' .
    CALL FUNCTION 'ARCHIVFILE_CLIENT_TO_SERVER'
    EXPORTING
    path = l_pcfile
    targetpath = l_serfil
    EXCEPTIONS
    error_file = 1
    OTHERS = 2.
    Don't forget to reward if useful.....

  • Create XML file on application server (unix directory) from internal table

    Hallo everybody,
    I have got the following problem:
    I am working with <u><b>release 4.6C</b></u> and have got to create XML files from HR master data and organizational data respectively.
    This takes place in 3 steps:
    1.     Collect the data in an internal table
    2.     Convert the data to XML format using the function module 'SAP_CONVERT_TO_XML_FORMAT'
    3.     Download the data
    If I download the converted data, which are in an internal table, to the presentation server via the function module ‘WS_DOWNLOAD’ and open it with the Internet Explorer, everything is ok.
    If I download the converted data to the application server, i.e. into a unix directory via
    ‘open dataset’, ‘loop at internal table, ‘transfer working area to file’, ‘close dataset’
    and then try to open it, this is not possible, because after the last tag some unreadable characters, e.g. a square, appear that aren’t supposed to be there. That’s what my colleagues told me, for I haven’t got access to the server.
    I have no idea where these characters come from and how I can get rid of them. I guess that either I have to modify (how?) the table with the converted data before the download or I have to use another way to convert the data. For the second way I would probably have to work with an XML class or an XML interface. Unfortunately I’I am not an expert in working with classes so sample coding would have to be rather detailed.
    Here’s some more information about how I work with the conversion function module:
      call function 'SAP_CONVERT_TO_XML_FORMAT'
           exporting
                i_field_seperator    = lv_field_seperator
               i_line_header        = lv_line_header
               i_filename           = lv_xml_file
               i_appl_keep          = ' '
                i_xml_doc_name       = lv_xml_doc_name
           importing
                pe_bin_filesize      = lv_result
           tables
                i_tab_sap_data       = gt_data
           changing
                i_tab_converted_data = lt_tab_converted_data
           exceptions
                conversion_failed    = 1
                others               = 2.
    lv_field_seperator = ‘X’.
    lv_xml_doc_name = ‘Personalstammdaten Publikation’
    lv_result: type i
    gt_data: fields: PERNR, PERSG, PERSK etc.
      types:
      begin of truxs_xml_line,
        data(256) type x,
      end of truxs_xml_line.
      types:
      truxs_xml_table type table of truxs_xml_line.
    data:
    lv_tab_converted_data type truxs_xml_line,
    lt_tab_converted_data type truxs_xml_table
    open dataset lv_xml_file for output in binary mode.
    loop at lt_tab_converted_data into lv_tab_converted_data.
      transfer lv_tab_converted_data to lv_xml_file.
    endloop.
    close dataset lv_xml_file
    lv_xml_file: /usr/users/.../.../Personendaten_2004-11-02.xml
    Hope the information is detailed enough! Otherwise let me know. Thank you in advance.
    Message was edited by: Johannes Schwehm

    Hi Raja,
    tried the "TEXT" mode, but that didn't help.
    There are still characters after the last tag, that are not supposed to be there including a date that is not
    the creation date of the file.
    Thank you for your help.
    Regards
    Johannes

Maybe you are looking for

  • How to stop SQL Server 2008 R2 generating SQLDump.mdmp files constantly?

    Something went wrong with local SQL Server 2008 R2 and it constantly generates SQLDump.mdmp files. It generated 40Gb(!) of SQLDump.mdmp this morning. Server rebooted, but didn't help. Any ideas what happened with SQL Server and how to stop SQLDump.md

  • How to import the transports from the SAP Integration Kit into SAP system

    Hi expert, I read the forum "Re: Integration with SAP R/3 to realise i have not done the import of transport but i don't quite understand the statement give by "Sebastian Li". "Unpack the SAP Integration Kit zip-file. It contains a transport-folder.

  • Question on creating users and icloud

    I have noticed that my Macbook Pro will create its own user.  I immediately deleted this user since I didn't create it and thought it was taken care of.  Well, I turned on my computer again today and the user was created again, without my consent.  M

  • Dropping Tablespaces  ORA 23515 Error

    Hi I am trying to drop a tablespace DROP TABLESPACE EXAMPLE INCLUDING CONTENTS AND DATAFILES; I get ORA 23515 Error " Materialized Views and /or their indices exist in the Tablespace" How to find out which Materialized views and /or indices are to be

  • NAC agent 4.9 and WES7

    I am trying to find a support matirx for Windows client support in 4.9 I see where the newest release supports WIndows 8 and IE10. I do not see support for Windows embedded. Is this supported?