Delete file in Appln server

Hi all,
Iam using following FM to retrive files in Aplln server.
OCS_GET_FILE_INFO.
Now my requirement if the length of file is 0 then i should delete the file.And Iam also submitting these files to another program for batchinput.
Kndly help me.
My code :
CALL FUNCTION 'OCS_GET_FILE_INFO'
       EXPORTING
            dir_name                  = p_path
            file_name                 = gv_filter
       TABLES
            dir_list                  = gt_files
       EXCEPTIONS
            no_authority              = 1
            activity_unknown          = 2
            not_a_directory           = 3
            no_media_in_drive         = 4
            too_many_errors           = 5
            too_many_files            = 6
            bracket_error_in_filename = 7
            no_such_parameter         = 8
            OTHERS                    = 9.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ELSE.
    SORT gt_files BY name.
    REFRESH gr_name.
    CLEAR   gr_name.
    gr_name-sign   = 'I'.
    gr_name-option = 'CP'.
    gr_name-low    = p_file.
    APPEND  gr_name.
    LOOP AT gt_files WHERE type <> 'directory file'
                       AND name in  gr_name.                     
      IF p_withp = 'X'.
        CONCATENATE p_path gt_files-name INTO gv_file.
      ELSE.
        gv_file = gt_files-name.
      ENDIF.
      REFRESH gt_params.
      CLEAR   gt_params.
      gt_params-selname = p_sfile.
      gt_params-kind    = 'P'.
      gt_params-low     = gv_file.
      APPEND gt_params.
      IF NOT p_spath IS INITIAL.
        CLEAR   gt_params.
        gt_params-selname = p_spath.
        gt_params-kind    = 'P'.
        gt_params-low     = p_path.
        APPEND gt_params.
      ENDIF.
      IF p_repid = 'Y_WM_EINLAGERN_PRODUKTION'.
        SUBMIT (p_repid) USING SELECTION-SET p_varid
                          WITH p_filn = p_path
                          WITH p_fil1 = gv_file
                    AND RETURN.
      ELSE.
        SUBMIT (p_repid) USING SELECTION-SET p_varid
                          WITH SELECTION-TABLE gt_params
                    AND RETURN.
      ENDIF.
    ENDLOOP.
In gt_files i have all the files.
  ENDIF.

hi,
Thanks for spending ur time.
anyway i solved with the following code.
Thanks anyway.
LOOP AT gt_files WHERE type <> 'directory file'
                     AND   len EQ 0.
      CONCATENATE p_path gt_files-name INTO test.
      CONDENSE test NO-GAPS.
      OPEN DATASET test.
      IF sy-subrc EQ 0.
        DELETE DATASET test.
        IF sy-subrc EQ 0.
          MESSAGE i000(0) WITH 'file deleted'.
        ENDIF.
      ENDIF.
    ENDLOOP.

Similar Messages

  • 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.

  • Delete file on application server (Froms9iAS)

    How can I delete file on application server (Froms9iAS) from client machine (file such as *.txt,*dbf). I try use old win_api_utility (from Forms6i) but it doesn't work.

    Check out Webutil.
    More on it in the Forms page.

  • Deleting file from application server

    can any one tell me how to delete file from application server?

    Hi,
      Use statement
      delete dataset 'tmpfile.txt'.
    \tmp\file.txt is the file path on application server which you want to delete.
    Regards
    Sailaja.

  • T-code for delete file from application server

    Hi all!
    Please, has any t-code for delete file from application server? For upload exist CG3Z, for download has CG3Y. And for delete? Has anyone?
    I need to delete file from application server in QA system and i don't want to create a program for this because i will need to transport a request from DEV to QA.

    I don't have contact with basis team.
    The FM EPS_DELETE_FILE support directory name with max 60 char. My dir. has more than that. I need a transaction for this.
    Anybody know if this transaction exist?

  • How to delete file from Window server

    Hi
    Can anybody tell me that Is there any function module for deleting file from presentation server like C directory.
    Quick suggestion will highly be appreciated!!!!!!!

    Try this:
    CALL METHOD cl_gui_frontend_services=>file_delete
      EXPORTING
        filename             =
      changing
        rc                   =
    EXCEPTIONS
       FILE_DELETE_FAILED   = 1
       CNTL_ERROR           = 2
       ERROR_NO_GUI         = 3
       FILE_NOT_FOUND       = 4
       ACCESS_DENIED        = 5
       UNKNOWN_ERROR        = 6
       NOT_SUPPORTED_BY_GUI = 7
       WRONG_PARAMETER      = 8
       others               = 9
    this is pretty gud approach .
    Message was edited by:
            Nishant Rustagi

  • HOw to delete files from remote server?

    Hi,
    I want to delete files from a directory on remote server.
    I use the following command to delete on current server:
    find $srcdir -mtime +90 -name "COR*.txt" -exec rm -f {} \;
    Now, how can I delete files from remote server ?
    Thanks!
    Yogini

    Some possible options:
    1. There exists SSH implementation for Windows.
    2. You can make a workaround. You can setup share for specific/wanted directory.
    Then you can mount it on Linux machine and execute command localy and delete files "localy" in mounted directory.
    3. You can setup FTP server on Windows machine and do that remotely via FTP commands.

  • How to delete file on ftp server

    hello,how to delete file on ftp server?thank you!

    I was trying to hint to the fact that you gave no where near enough information.
    Have you already written anything? Such as software that will connect to an FTP server?
    Are you using a 3rd party package?
    Are you doing it by hand, using sockets?

  • 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>');

  • Delete file from app server

    hi, i am running a background job in bw and for that created a file on the application server.now how do i delete that file.to create the file i just gave the name in the bw and the file got created.i am not able to find how to delete it.
    or
    rather than deleting the file how can we delete the data it is containing.please do let me know

    hi,
    but using DELETE DATASET u can remove file for app server.
    If u want to delete the data alone then give the same name without data it will overwrite.
    U can check it in AL11.
    regards
    md zubair sha
    U can also use the function module - EPS_DELETE_FILE
    Message was edited by:
            md zubair sha

  • Delete file from application server

    Hi,
       Can any one tell me how to delete a file from application server?
    Thanks,
    Rahul.

    Basic question, please search for available information.
    Thread locked.
    Thomas

  • Delete files from APPLICATION SERVER?

    Hi All,
    I am creating the files in application server with folder name as
    /interface/freeway/ and filename as PO concatenating with sy-datum and sy-uzeit.
    Ex file name now is /interface/freeway/PO20081201064120.csv
    Now my req is i need to delete files which has beeen created less than 30 days.
    regards,
    Sachin.

    hi,,,,,,
    REPORT ZDELETE.
    * Delete a file on the application server.
    PARAMETERS: P_DIR LIKE RLGRAP-FILENAME
    DEFAULT '/usr/sap/trans/',
    P_FILE1 LIKE RLGRAP-FILENAME.
    DATA: P_FILE(128).
    DATA: W_ANS.
    START-OF-SELECTION.
    CONCATENATE P_DIR P_FILE1 INTO P_FILE.
    * check file exists
    OPEN DATASET P_FILE FOR INPUT.
    IF SY-SUBRC NE 0.
    MESSAGE E899(BD) WITH P_FILE 'does not exist'.
    EXIT.
    ELSE.
    CALL FUNCTION 'POPUP_CONTINUE_YES_NO'
    EXPORTING
    DEFAULTOPTION = 'N'
    TEXTLINE1 = P_DIR
    TEXTLINE2 = P_FILE1
    TITEL = 'ARE YOU SURE YOU WANT TO DELETE'
    * START_COLUMN = 25
    * START_ROW = 6
    IMPORTING
    ANSWER = W_ANS
    EXCEPTIONS
    OTHERS = 1.
    ENDIF.
    CLOSE DATASET P_FILE.
    CHECK W_ANS = 'J'.
    * delete
    DELETE DATASET P_FILE.
    IF SY-SUBRC NE 0.
    MESSAGE E899(BD) WITH 'Invalid file name' P_FILE.
    ELSE.
    CLOSE DATASET P_FILE.
    MESSAGE I899(BD) WITH P_DIR P_FILE1 'DELETED'.
    ENDIF.

  • How to delete files from application server posted in last 30 days

    I have some files in application server posted through ABAP program with the below format
    \.\.\.abcd_20110209_111209.csv   (with  date and time). I need to delete those files which was posted in last 30 days through another program. Could you plaese help me to achieve the requirement?

    There are many ways you can delete/archive files in application servers.
    1. Depending on the application server, usually administrators setup delete/archive programs. For e.g. if the application server is a UNIX, then the unix admin will write a script to delete/move older files. - this is the most common approach I've seen.
    If you have to achieve this through ABAP then,
    1. You can get the script from the server admin and then use that script to create an external system command through SM69/49 and use the function module SXPG_COMMAND_EXECUTE to execute it.
    2. You can also look at FM EPS_DELETE_FILE and see if it fits the bill for you.
    There are many other possibilities too and each one has its own pros/cons. So you'll have to choose the right one for your requirement.

  • Urzent: Delete files in FTP server using FTP receiver adapter

    Hi Experts,
    We are doing 2 asyncronous scenarios. frst scenario should delete existing file and place the request file. Second scenario should pick(delete) response file and delete request file it placed also.
    Scenario 1 : File(NFS) to FTP  (Asynchronous)
    Scenario 2: FTP to NFS  (Asynchronous)
    Scenario 1: (Receiver FTP Adapter )
    step-1: PI has to delete all existing files in FTP server
    step-2: PI has to place Request file in FTP
    Scenario-2: ( Sender FTP Adapter)
    step-1: PI has to Delete request file i FTP server
    Step-2: PI has to pick and delete response file in FTP server
    Doubts:
    How can we do above steps in PI
    Thanks,
    Murali

    Hi Krish - For scenario -1 You have to make use of the OS commands to delete the files on FTP server before placing the request file.
              -> write some script which wil connect to the FTP server and delete the files.
              -> call that script from the file adapter "using execute OS commands" option
    For scenario -2 :
    pick both the files(request and response) and set the processing mode to delete..
    during the receiver determination, process only request files(based on filename/content)

  • Open dataset deleting file in application server

    Hi All,
    Im reading a text file from application server .However the below statement is failing(sy-subrc = 8)
    and deleting my file
    OPEN DATASET gv_file FOR INPUT IN TEXT MODE ENCODING UTF-8.
    Please let me know what is causing the issue.
    REgards,
    Faiz

    That seems very unlikely, you should try to get more information:
    * Try the messages statement:
    DATA mess TYPE string.
    OPEN DATASET `` FOR INPUT IN BINARY MODE MESSAGE mess.
    IF sy-subrc = 8.
      MESSAGE mess TYPE 'I'.
    ENDIF.

Maybe you are looking for

  • Multiple clusters on single node

    Hello,           If I want to share server resources between 2 customers, but I want them both to have their own independent cluster, how is this accomplished? Can I have one cluster that runs off one interface/network, and the other cluster of anoth

  • Exchange 2013 mail flow problem

    Hello! We have problem, could not send mails via Exchange 2013 server. Symptoms: -no messages in message queue -if sending mail  to this domain, the message seems sent at Sender. -if sending mail from this domain, the messages are in the mailboxes' D

  • Importing mbx files to mac mail

    I've been a MAC user for a 5-6 years.  However, I still have some old email files from when I used Outlook or Outlook express on a PC.  I believe they are .mbx files with the name that my mail folders had on my pc (e.g. family.mbx...friends.mbx).  I

  • IBook to eMac

    My iBook of course has AirPort from which I get the internet from but my eMac doesn't and needs to be updated is there a way I can channel AirPort the signal through my iBook to my eMac?

  • How to group values in a column in ALV Grid

    Hi ,     i have got a report layout like below.       1   4       1   5       1   6       2   7       2   8       2   8 now i want to group the 1st column like below      1  4         5         6      2  7         8         8   How can i get this in