Application server file deletion

i am uploading data from LSMW.
I Have to delete the '.CONV ' AND '.READ' files form application server.
please send the code .
Thanks
laxmi

Hi Laxmi,
You can use the command;
delete dataset <dataset name>.
To get the list of all files with pattern *.READ, you should use the function module:
SUBST_GET_FILE_LIST
call function 'SUBST_GET_FILE_LIST'
exporting PATTERN = '*.READ'
importing
file_list = t_files.
loop at t_files.
concatenate t_files-DIRNAME t_files-NAME
into v_str separated by '/'.
delete dataset v_str.
endloop.
Regards,
Ravi
Message was edited by:
        Ravi Kanth Talagana

Similar Messages

  • Application server-file delete

    Hi All,
    Is there any options to delete for file in directory in Application server. If there ,please send me flow or logic.

    Hi,
    For deleting a file in the application server user the syntax DELETE DATASET..
    DELETE DATASET '/tmp/test.txt'.
    IF SY-SUBRC <> 0.
      WRITE: / 'Error in deleting'.
    ELSE.
      WRITE; / 'File deleted'.
    ENDIF.
    Thanks,
    Naren

  • Application Server file to internal table

    Hi,
      How can i read the application server file into the internal table??  Which FM should i use??
    Regards,
    Kit

    Hi,
    Open Dataset is used to read or write on to application server ... other than that i am not sure that there exists any way to do the same ... here is a short description for that
    FILE HANDLING IN SAP
    Introduction
    • Files on application server are sequential files.
    • Files on presentation server / workstation are local files.
    • A sequential file is also called a dataset.
    Handling of Sequential file
    Three steps are involved in sequential file handling
    • OPEN
    • PROCESS
    • CLOSE
    Here processing of file can be READING a file or WRITING on to a file.
    OPEN FILE
    Before data can be processed, a file needs to be opened.
    After processing file is closed.
    Syntax:
    OPEN DATASET <file name> FOR {OUTPUT/INPUT/APPENDING}
    IN {TEXT/BINARY} MODE
    This statement returns SY_SUBRC as 0 for successful opening of file or 8, if unsuccessful.
    OUTPUT: Opens the file for writing. If the dataset already exists, this will place the cursor at the start of the dataset, the old contents get deleted at the end of the program or when the CLOSE DATASET is encountered.
    INPUT: Opens a file for READ and places the cursor at the beginning of the file.
    FOR APPENDING: Opens the file for writing and places the cursor at the end of file. If the file does not exist, it is generated.
    BINARY MODE: The READ or TRANSFER will be character wise. Each time ‘n’’ characters are READ or transferred. The next READ or TRANSFER will start from the next character position and not on the next line.
    IN TEXT MODE: The READ or TRANSFER will start at the beginning of a new line each time. If for READ, the destination is shorter than the source, it gets truncated. If destination is longer, then it is padded with spaces.
    Defaults: If nothing is mentioned, then defaults are FOR INPUT and in BINARY MODE.
    PROCESS FILE:
    Processing a file involves READing the file or Writing on to file TRANSFER.
    TRANSFER Statement
    Syntax:
    TRANSFER <field> TO <file name>.
    <Field> can also be a field string / work area / DDIC structure.
    Each transfer statement writes a statement to the dataset. In binary mode, it writes the length of the field to the dataset. In text mode, it writes one line to the dataset.
    If the file is not already open, TRANSFER tries to OPEN file FOR OUTPUT (IN BINARY MODE) or using the last OPEN DATASET statement for this file.
    IF FILE HANDLING, TRANSFER IS THE ONLY STATEMENT WHICH DOES NOT RETURN SY-SUBRC
    READ Statement
    Syntax:
    READ DATASET <file name> INTO <field>.
    <Field> can also be a field string / work area / DDIC structure.
    Each READ will get one record from the dataset. In binary mode it reads the length of the field and in text mode it reads each line.
    CLOSE FILE:
    The program will close all sequential files, which are open at the end of the program. However, it is a good programming practice to explicitly close all the datasets that were opened.
    Syntax:
    CLOSE DATASET <file name>.
    SY-SUBRC will be set to 0 or 8 depending on whether the CLOSE is successful or not.
    DELETE FILE:
    A dataset can be deleted.
    Syntax:
    DELETE DATASET <file name>.
    SY-SUBRC will be set to 0 or 8 depending on whether the DELETE is successful or not.
    Pseudo logic for processing the sequential files:
    For reading:
    Open dataset for input in a particular mode.
    Start DO loop.
    Read dataset into a field.
    If READ is not successful.
    Exit the loop.
    Endif.
    Do relevant processing for that record.
    End the do loop.
    Close the dataset.
    For writing:
    Open dataset for output / Appending in a particular mode.
    Populate the field that is to be transferred.
    TRANSFER the filed to a dataset.
    Close the dataset.
    chk a sampel
    parameters: p_file like rlgrap-filename obligatory
    default '/usr/sap/upload.xls'.
    types: begin of t_data,
    vbeln like vbap-vbeln,
    posnr like vbap-posnr,
    matnr like vbap-matnr,
    werks like vbap-werks,
    megne like vbap-zmeng,
    end of t_data.
    data: it_data type standard table of t_data,
    wa_data type t_data.
    open dataset p_file for output in text mode encoding default.
    if sy-subrc ne 0.
    write:/ 'Unable to open file:', p_file.
    else.
    do.
    read dataset p_file into wa_data.
    if sy-subrc ne 0.
    exit.
    else.
    append wa_data to it_data.
    endif.
    enddo.
    close dataset p_file.
    endif.
    And if you want to write on the file.
    *--- open UNIX file
    open dataset unixfile for output in text mode message w_msg.
    if sy-subrc ne 0.
    write: / 'Cannot open for writing:', unixfile, w_msg.
    exit.
    endif.
    *--- write UNIX file
    loop at it_file.
    transfer it_file to unixfile.
    endloop.
    *--- close UNIX file
    close dataset unixfile.

  • Application server file path vaidation

    I have written the code for application server file path validation.
      DATA : l_fname TYPE filename-fileintern." type c.
      DATA : l_filpath TYPE filename-fileintern,
             l_filname(40) TYPE c.
    PARAMETER : p_sucfil LIKE rfpdo-rfbifile OBLIGATORY. " rlgrap-filename
    AT SELECTION-SCREEN ON p_sucfil.
    l_fname = p_sucfil.
    CALL FUNCTION 'FILE_GET_NAME'
      EXPORTING
      CLIENT                        = SY-MANDT
        logical_filename              = l_fname
       OPERATING_SYSTEM              = SY-OPSYS
      PARAMETER_1                   = ' '
      PARAMETER_2                   = ' '
      PARAMETER_3                   = ' '
      USE_PRESENTATION_SERVER       = ' '
       WITH_FILE_EXTENSION           = 'X'
      USE_BUFFER                    = ' '
      ELEMINATE_BLANKS              = 'X'
    IMPORTING
      EMERGENCY_FLAG                =
      FILE_FORMAT                   =
       FILE_NAME                     = l_filpath
    EXCEPTIONS
       FILE_NOT_FOUND                = 1
       OTHERS                        = 2
    IF sy-subrc <> 0.
      message 'Invalid file name' type 'E'.
    ENDIF.
    But always i will get Invalid file name.
    Y is it so.
    pls help me.

    Praveen,
    I have checked ur code and I found that if i give a logical file name from
    tran. FILE under folder 'Logical file name definition, cross client' then ur code works. Pl. check.
    Regards,
    Joy.
    DATA : l_fname TYPE filename-fileintern." type c.
    DATA : l_filpath TYPE filename-fileintern,
    l_filname(40) TYPE c.
    PARAMETER : p_sucfil LIKE rfpdo-rfbifile OBLIGATORY. " rlgrap-filename
    AT SELECTION-SCREEN ON p_sucfil.
      l_fname = p_sucfil.
      CALL FUNCTION 'FILE_GET_NAME'
      EXPORTING
      logical_filename = l_fname
    operating_system = sy-opsys
      with_file_extension = 'X'
      IMPORTING
      file_name = l_filpath
      EXCEPTIONS
      file_not_found = 1
      OTHERS = 2
      IF sy-subrc <> 0.
        MESSAGE 'Invalid file name' TYPE 'E'.
      ENDIF.

  • Validate  application server file

    Hi,
      I have to validate the application server file path on selection screen.
    I am using following code :
    form VALID_APP_FILEPATH   using    p_filpath TYPE FILENAME-FILEINTERN.
      data : l_fname(60).
      CALL FUNCTION 'FILE_GET_NAME'
        EXPORTING
          LOGICAL_FILENAME = p_filpath
          OPERATING_SYSTEM = SY-OPSYS
        IMPORTING
          FILE_NAME        = L_FNAME
        EXCEPTIONS
          FILE_NOT_FOUND   = 1
          OTHERS           = 2.
      IF SY-SUBRC ne 0.
          MESSAGE 'Enter the valid file path'(e01) TYPE 'E'.
      ENDIF.
    endform.                    " VALID_APP_FILEPATH
    but if i choose correct file path from F4 help also.
    It displays error message.
    Sy-subrc always equals 1.
    Help me out

    Hi,
    I have implemented the code mentioned by you and am not having any problems even when I use F4 to get the fle name.
    Pls recheck and get back if the error persists.
    Reward if found helpful.
    Warm Regards,
    R Adarsh

  • Error  while accessing the application server file

    Hello,
    When I try to load the data from CSV file to PSA , I am getting following error message
    "Error  while accessing the application server file"
    "Errors in source system"
    I gave the right file path
    I am not sure about this error message.
    Thanks,

    Hi ram,
    if you have more than one application server running in your BI system (see at transaction SM51) be aware that your infopackage will be executed on the right one. Each application server has its own file system and your job need to run on the server your file is stored on.
    Also check if the os user of the SAP system itself (<sid>adm on Unix) has rights to read that file.
    Bye
    Frank

  • Application Server File

    Hi,
    Could any one please answer my question.
    How to archive application server file?.. What is the function module used for that?.
    And my second question..
    How to scan application directory.. after scanning I must be able to know how many files the source directory contians, and the file properties
    Thank you..

    1 . use CG3Z transaction or use OPEN dATASET statement
    2 . use FM EPS_GET_dIRECTORy_LISTING

  • Application Server : File writes only 255 characters

    Hi Friends,
    I am trying to writes data to application server file .
    My line size is 1100 charqacters.
    When I use open dataset for output in text mode encoding default
    and transfer contents to file.
    I am only able to write contents upto 255 characters.
    Whatever is beyond that I do not see it in AL11.
    Is there a way to write more than 255 characters.
    I tried CG3Y to view files but it also shows only 255 characters.
    Please help.

    Hi,
    Just find the string length.
    In 4.6C version there is a limit of 1500 characters i. e. U can transfer max of 1500 characters in a single transfer. For that we applied below solution. Check this it may help u.
      l_len = strlen( p_data ).
      DO.
        IF l_len LT 1500.
          TRANSFER p_data+l_offset(l_len) TO p_file.
          MOVE 0 TO l_len.
        ELSE.
          TRANSFER p_data+l_offset(1500) TO p_file.
          SUBTRACT 1500 FROM l_len.
          ADD 1500 TO l_offset.
        ENDIF.
        CHECK l_len EQ 0.
        EXIT.
      ENDDO.
    p_data has the content to be trasfered of around 6000 characters and the length is dynamic.
    Also download the data using CG3Y with BIN to .txt file and see.
    If problem is still there then paste ur code of OPEN DATASET, TRANSFER statements.
    Try to open the file in TEXT MODE.
    eg: OPEN DATASET l_file IN TEXT MODE.
    Thanks,
    Vinod.
    Edited by: Vinod Reddy Vemuru on Jul 25, 2008 12:34 PM

  • Application server file lentgh

    Hi,
    I am trying to read an application server file using open dataset in Binary Mode..
    I want to find the file length of the file read.(number of bytes transferred as in the GUI_Download FM parameter Filelength)
    How can i achieve it.
    Appreciate ur ideas.
    Rgds.
    stck

    Hello,
    Use the FM EPS_GET_FILE_ATTRIBUTES passing the file name and the directory name and get the file_size.
    Vikranth

  • Application server file formats.

    Hi,
    I have one query regarding the application server file formats, when we are creating a file we give some extension (.txt, .dat),what is the use of different extensions.
    When we are downloading the file from appl server using CG3Y we have two options(ASC and BIN ) what is the use of these options.
    Thanks in advance.

    Hi,
    A text file is a kind of computer file that is structured as a sequence of lines.
    A .dat  file is a computer file which stores data for use by a computer application or system.
    A character encoding consists of a code that pairs a sequence of characters from a given character set (sometimes referred to as code page) with something else, such as a sequence of natural numbers, octets or electrical pulses, in order to facilitate the storage of text in computers and the transmission of text through telecommunication networks.
    ASCII and BINARY codes are used for internal representation of data.
    The major difference between ASCII and BINARY is that when ASCII mode is used then the READ DATASET stmt starts at new line each time and in case of BINARY it reads character by character ( or some characters).
    Thanks and regards.

  • Application Server file into EXCEL SHEET

    Hi ,
    i want down load the Application Server FILE into EXCEL SHEET directly..
    how to do this one.
    regards,
    venu.

    Hi Srinivas
    I tried using CG3Z to upload excel onto application server but failed to do the same,
    Any pointers regarding the same would be of great help.
    Regards
    Sukumari
    Edited by: Manjeera Chinigiri on Mar 31, 2008 3:08 PM

  • Application Server file Validity

    Hi Experts,
    I have one query. I wanted to check the validity of file in application server. The scenerio is like in my selection screen I will provide application server file name.
    I wanted to validate whether that file is existing or not. If file is not existing then I need to display an error message.
    Can anybody will suggest me how I can achieve this requirement?
    Thanks,
    Neha

    Hi Neha,
    To access the files on Application server we use DATASET operationsd like open, read, close etc.
    Now in your case use opendataset as:
      open dataset   ds_name for output in text mode encoding default.
      IF sy-subrc NE 0.
         //write your message here.
      ENDIF.
      CLOSE DATASET ds_name.
    Where ds_name = logical path name of your file, or if you want to check for just one file, hard code the path.
    Better practice is to use logical path name.
    Also declare ds_name as
    DATA: ds_name          LIKE rfpdo-rfbifile.   
    Close dataset is used in case file exists you need to close it.
    Revert back if you wantto know abt logical file name.
    Regards,
    Sana.

  • Application Server file Accessing problem

    Hi all,
        In my program  i am writing data to the application server file ( temp.txt ) in Appending mode.
    I am having 1000 records to write. In the mean time ( while temp.txt have 200 records ) i am running the same program using same application server file ( temp.txt ) same client but different user. That time writting option for both programs are successfully done.
    But in my case i have to restrict the file writing at that time only one user.
    Is there any way to lock the application server file for particular user while writting.
    Thanks in Advance,
    Florian.
    Edited by: Florian Thiruselvan on Dec 22, 2008 6:51 AM

    Hi Kishan Singh,
          You are exactly write. Its working but i got some more problem in that.
          Importing Parameter
          VOLDIR_SET    TYPE   TXW_LOCK2-VOLDIR_SET
          VOLDIR_SET     TXW_VOLSET    CHAR     10     0     Data file directory set
    But the Data file directory set length is more than 10.
    What shall i do? do you have any idea please suggest me.
    Thanks
    Florian

  • How to give the application server file path in the module pool programming

    Hi,
         Could somebody help me how to provide the application server file path in module pool programming once the logo is uploaded to sap system.
      For eg I have imported a logo name ‘owens’ into sap system by using transaction ‘se78’; now I need to call the path in the below url,
    if container2 is initial.
    CREATE OBJECT CONTAINER2
      EXPORTING
        CONTAINER_NAME              = 'PICTURE_CONTAINER2'.
    CREATE OBJECT PICTURE2
      EXPORTING
        PARENT = CONTAINER2.
    CALL METHOD PICTURE2->SET_DISPLAY_MODE
      EXPORTING
        DISPLAY_MODE = CL_GUI_PICTURE=>display_mode_fit_center
      EXCEPTIONS
        ERROR        = 1.
    CALL METHOD PICTURE2->LOAD_PICTURE_FROM_URL
      EXPORTING
        URL    = " ? "
      EXCEPTIONS
        ERROR  = 1
        Others = 2.
    endif.
    Thanks in advance
    Deepu

    hi Deepu,
    Use FM '/SAPDMC/LSM_F4_FRONTEND_FILE' for fetching the data from the application server path/presentation server path
    Regards,
    Santosh

  • Regarding Application server file path browsing

    Hi All,
    I have a issue regarding Application Server File Path browsing.
    Actually in my selection-screen i will declare a parameter as <b>Application Server File Path</b> now when i press F4 in that field it should be able to browse through <b>Application Server Path's</b>.
    Just like <b>F4_FILENAME</b> in the case of <b>Presentation Server File Path</b> Browsing.
    Can anybody solve my issue.
    Thanks in advance.
    Thanks & Regards,
    Rayeez.

    Hi Shaik,
    Just copy and paste:
    Here is the code for retrieving list of files contained within specific Application server directory(SAP).
    PARAMETER: p_fdir type pfeflnamel DEFAULT '/usr/sap/tmp'.
    data: begin of it_filedir occurs 10.
    include structure salfldir.
    data: end of it_filedir.
    START-OF-SELECTION.
    Get Current Directory Listing for OUT Dir
    call function 'RZL_READ_DIR_LOCAL'
    exporting
    name = p_fdir
    tables
    file_tbl = it_filedir.
    List of files are contained within table it_filedir
    loop at it_filedir.
    write: / it_filedir-NAME.
    endloop.
    Hope this will help you.
    Let me know incase of any concerns.
    EDIT:
    There are few FM for ur refernce :
    RZL_READ_DIR_LOCAL
    SUBST_GET_FILE_LIST Return table with file list for the given directory (pattern allowed)
    F4_DXFILENAME_TOPRECURSION Popup to select one file from the given application server directory
    TH_SERVER_LIST Returns list of application servers.
    EPS_GET_DIRECTORY_LISTING – Lists filenames from the application server .
    Cheers
    Sunny
    Rewrd points, if found helpful
    Message was edited by: Sunny

Maybe you are looking for

  • Remote App doesn't work with iPod 2nd Gen or iPhone 3G

    I have been using till recently the "Remote" app to control a Apple Express base station from an iPod 2nd Generation (and it also would work from iPhone 3G. It worked great. Today, I noticed that it is not working. I am getting a message that says th

  • Sales Order Posting

    Hi Expert, I have seen that in the pricing procedure of sales order there are some account keys for accrual are assigned to the condition types. I believe with them the system will create entries to corresponding G/L account automatically the time th

  • £99 to fix a fault

    Back in 2006 a BT Engineer installed an ADSL filter faceplate to my master socket to resolve our issues with slow connection.  It worked OK until last night when we lost the broadband connection completely. I was able to get my connection back by rem

  • Bootcamp - Catalyst Control Center - help me!

    Hello, I've tried to install catalyst control center for windows 7 bootcamp, I can't seem to find the download for the actual program, I only find the drivers for it, I did find the program once, and installed it, but then I only had 2 different tabs

  • Shopping Cart not going to Sourcing

    Shopping cart is not showing up in Sourcing.  Shopping cart is approved but in BBPD the shopping cart says "In Transfer" Sourcing relevant flag is "X" and we are using Extended Classic with SRM PPS 7.0. Any suggestions?