Skip to Content
author's profile photo Former Member
Former Member

How to delete a file from Appliction Server.

Hi Gurus,

I want to delete a file from application server . can any one tell me the FM/BAPI.

Plz Reply me ASAP.

Thanks in Advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 03, 2008 at 06:39 AM

    hi,

    use FM

    EPS_DELETE_FILE

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Here I'm using 192.168.1.100 server

      Complete path of the text files is"
      192.168.1.100\d$\usr\sap\mobileone_data\s.txt"

      how to Give FILE_NAME and

      DIR_NAME.

      could u tel me what is Correct path of this file.

  • author's profile photo Former Member
    Former Member
    Posted on Nov 03, 2008 at 06:37 AM

    Use DELETE DATASET <FILENAME>.

    DATA: w_dataset TYPE string VALUE '/usr/sap/trans/ECC60/swa'.
    DELETE DATASET w_datase.
    

    Edited by: Swastik Bharati on Nov 3, 2008 7:38 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 03, 2008 at 06:39 AM

    Hello,

    Try with this statements.

    DELETE DATASET dset

    FM

    DX_FILE_DELETE

    WS_FILE_DELETE

    First

    1) Open dataset.

    2) Read dataset

    3) DELETE DATASET dset

    4) clsoe dataset.

    ABAP Development

    Edited by: Santosh Marupally on Nov 3, 2008 7:39 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 03, 2008 at 06:41 AM

    Hi,

    Try this below open your file using RLGRAP, OPEN DATASET write the code for file path DELETE DATASET and CLOSE the dataset.

    Cheers!!

    VEnk@

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 03, 2008 at 06:42 AM

    Hi,

    REPORT ZDELETE.

    • Delete a file on the application server.

    PARAMETERS: P_path LIKE RLGRAP-FILENAME

    P_FILE1 LIKE RLGRAP-FILENAME.

    DATA: P_FILE(128).

    DATA: W_ANS.

    START-OF-SELECTION.

    CONCATENATE P_path P_FILE1 INTO P_FILE.

    ----


    • check file exists

    ----


    OPEN DATASET P_FILE FOR INPUT.

    IF SY-SUBRC NE 0.

    MESSAGE ' File does not exist' TYPE 'I'.

    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 'DELETED' TYPE 'I'.

    ENDIF.

    I hope u will get some help...

    Thanks & Regards

    Ashu Singh

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 03, 2008 at 06:44 AM

    Hi,

    Use FM: DX_FILE_DELETE

    Edited by: Neenu Jose on Nov 3, 2008 7:45 AM

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.