Delete data from application server

Hi All.
I have created file in application by using OPEN DATA SET, I need to delete from application server after some validation ,  how to delete?
Please guide me.
Thanks in Advance.

Hi,
DATA FNAME(60) VALUE 'file'.
OPEN DATASET FNAME FOR OUTPUT.
OPEN DATASET FNAME FOR INPUT.
IF SY-SUBRC = 0.
  WRITE / 'File found'.
ELSE.
  WRITE / 'File not found'.
ENDIF.
DELETE DATASET FNAME.
OPEN DATASET FNAME FOR INPUT.
IF SY-SUBRC = 0.
  WRITE / 'File found'.
ELSE.
  WRITE / 'File not found'.
ENDIF.
The output appears as follows:
File found
File not found
Use cane Also Use Function Modue: EPS_DELETE_FILE
Regards,
Gurpreet

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.

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

  • Delete data from archive server

    Hello,
    we have following question : How do you delete data from archive server which has passed the retention time and need to be removed from archive server.
    Have you any ideas?
    Thanks,
    Stefan

    Hi Planung,
    For deletion of data SARA transaction is used. Also deletion indicator is required to set for the documents which you are not using. Use the bapi BAPI_DOCUMENT_DELETE  for deleting the documents which are set with deletion indicator.
    I hope this will resolve the query.
    Regards,
    Ravindra

  • How to upload data from application server

    Hi,
    please help me out in uploading the data from application server which is a tab delemited file into an internal table.
    Thanks
    kumar

    hi,
    Use this sample code as an example.
    table declaration
    tables: mara.
    *data declaration
    data: begin of it_lfa1 occurs 0,
    vendor like lfa1-lifnr,
    land1 like lfa1-land1,
    name1 like lfa1-name1,
    ort01 like lfa1-ort01,
    end of it_lfa1.
    selection screen
    selection-screen: begin of block b1 with frame.
    parameters: p_file type rlgrap-filename obligatory.
    selection-screen: end of block b1.
    at selection screen
    at selection-screen on value-request for p_file.
    *& start-of-selection
    start-of-selection.
    perform transfer_file using p_file.
    perform write.
    *& Form transfer_file
    text
    -->P_P_FILE text
    form transfer_file using p_p_file.
    data: l_message(30) type c.
    ***opening dataset for reading
    open dataset p_p_file for input in text mode encoding default message
    l_message.
    if sy-subrc ne 0.
    message i001(zerr2) with p_p_file.
    endif.
    *******transferring data from file to app server.
    do.
    read dataset p_p_file into it_lfa1.
    if sy-subrc = 0.
    append it_lfa1.
    clear it_lfa1.
    else.
    exit.
    endif.
    enddo.
    *******closing dataset
    close dataset p_p_file.
    endform. " transfer_file
    *& Form write
    text
    --> p1 text
    <-- p2 text
    form write .
    loop at it_lfa1.
    write:/ it_lfa1-vendor,
    it_lfa1-land1,
    it_lfa1-name1,
    it_lfa1-ort01.
    endloop.
    endform. " write
    Thanks
    Aneesh.

  • How to get data from application server

    hi experts,
    when i load data from application server(.csv file) to ODS, data all goes one column.
    in infopackage exterdata tabstrip  i have given the below values.
    escape sign is "
    data separator is ,
    separator for thousands is ,
    my sample data:
    "1010000";"A410";"03.2008";"113.5704531"
    "1010000";"A410";"04.2008";"93.1146410"
    any ideas..
    Siri

    Hi Siri,
    You should look in the T.Code :RSCUSTV1
    BW:Settings for Flat File
    Thousand separator 
    Dec. point separator 
    Field separator         
    Field delimiter 
    Then you can use the Same Characterstics while creating the Flat file & also passing the same in Info Package
    This will resolve your issue
    Regards
    Hari

  • How to bring the data from application server to presentation server

    hi,
    i have one problem,i have written the program which will open the files in the application server when we run the program in the background(sm37),the same data from application server i want to bring into presentation server in the format of (.csv),how to bring the data from application to presentation server can any body help me on this  topic.folowing is the code .
    *& Report  ZPFA_HIER_LOAD
    REPORT  ZFPA_HIER_LOAD.
    *---- Declaration of Oracle connectioN
    DATA con_name LIKE dbcon-con_name VALUE 'COMSHARE'.
    DATA: MFL1(9),MFL2(5),MFL3(9),MFL4(2),MFL5(8) TYPE c.
    DATA : mfilename type string.
    data: begin of matab1 occurs 0,
          MFL1(9) TYPE C,
          MFL2(5) TYPE C,
          MFL3(9) TYPE C,
          MFL4(2) TYPE C,
          MFL5(8) TYPE C  ,
         end of matab1 .
    data: setid(8) type c.
    data: begin of source occurs 0,
          setid(8) type c,
          end of source.
    *PARAMETERS : p_pfile LIKE filename-FILEEXTERN.
    *PARAMETERS : m_bsenty(8). " type c obligatory.
    *mfilename = P_PFILE.
    EXEC SQL.
      SET CONNECTION :con_name
    ENDEXEC.
    EXEC SQL.
      CONNECT TO :con_name
    ENDEXEC.
    EXEC SQL PERFORMING get_source.
      SELECT set_id FROM UNIT_SET INTO
      :setid
      ORDER BY SET_ID
    ENDEXEC.
    start-of-selection.
    LOOP AT SOURCE.
      REFRESH matab1. CLEAR matab1.
      EXEC SQL PERFORMING evaluate.
    SELECT TO_CHAR(MEM_ID),TRIM(TO_CHAR(MEM_PID)) FROM UNIT_TREE INTO :MFL1,
    :MFL5
    where set_id = :SOURCE-SETID ORDER BY MEM_ID
      ENDEXEC.
      if SOURCE-SETID = '80000000'.
       mfilename = '/tmp/aesorg'.
      elseif SOURCE-SETID = '80000006'.
       mfilename = '/tmp/Consolidation_Manager'.
      elseif SOURCE-SETID = '80000010'.
       mfilename = '/tmp/10org'.
      elseif SOURCE-SETID = '80000012'.
       mfilename = '/tmp/20org'.
      elseif SOURCE-SETID = '80000018'.
       mfilename = '/tmp/30org'.
      elseif SOURCE-SETID = '80000025'.
       mfilename = '/tmp/40org'.
      Endif.
      mfilename = '/usr/test.dat'.
    ************************This was i tried***********************
      open dataset mfilename for output in text mode encoding default." IN
    *TEXT MODE ENCODING DEFAULT.
    if sy-subrc <> 0.
    exit.
    endif.
    close dataset mfilename.
    CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
         FILENAME         = MFILENAME
         FILETYPE         = 'ASC'
       TABLES
         data_tab         = matab1
       EXCEPTIONS
         file_write_error = 1
         invalid_type     = 2
         no_authority     = 3
         unknown_error    = 4
         OTHERS           = 10.
    loop at matab1 .
    transfer matab1 to mfilename.
    endloop.
      clear matab1.
    ENDLOOP.
    loop at matab1 .
    transfer matab1 to mfilename.
    endloop.
    close dataset mfilename.
         MFL5 = '0'.
       CLEAR MFL5.
    FORM evaluate.
      if MFL5 = -1.
        MFL5 = ''.
      ENDIF.
      concatenate MFL1 ','   into MFL1.
      concatenate MFL1 ','   into MFL3.
      matab1-MFL1 = MFL1.
      matab1-MFL2 = 'ZBUE,'.
      matab1-MFL3 = MFL3.
      matab1-MFL4 = ' ,'.
      matab1-MFL5 = MFL5.
      append matab1 .
      CLEAR MFL1.
      CLEAR MFL2.
      CLEAR MFL3.
      CLEAR MFL4.
      CLEAR MFL5.
    ENDFORM.
                     "evaluate
    *&      Form  GET_SOURCE
          text
    FORM GET_SOURCE.
      source-setid = setid.
      append source.
      clear source.
    ENDFORM.                    "GET_SOURCE

    Hi Rammohan,
    You cannot use OPEN DATASET to transfer data from application server to presentation server.
    You can do the following :
    <b>Do 1st point in BACKGROUND</b>
    1. Read the data file from application server into an internal table using OPEN DATASET
    <b>Do 2nd point in Foreground</b>
    2. Once you get the data into an internal table, then use FM GUI_DOWNLOAD to download it on presentation server
    You cannot use the above 2 point together in Background because its not possible. Hence you need program it partially in background and partially in foreground.
    Best regards,
    Prashant

  • Download  350MB of data from Application Server to Presentation server

    i want to Download  350MB(Around 2.5Million record of Table BSEG) of data from Application Server to Presentation server..
    i have tried with the transaction CG3Y and program using open dataset,read dataset,close dataset,ws_download...but went in vain,,,ended with TIMEOUT ERROR..will OPEN DATASET 'path' FOR OUTPUT FILTER 'Compress'  be helpful
    ..please help me ..its urgent..

    you can do the FTP with Unix commands..
    initially connect to the application server  by using command
    FTP <app server ip>,then it willl ask for username and password... after successful connection you  can use the following commnads to transfer file
    lcd <destination path name>(set the dest path)
    cd <source path>(set the sorce path),
    get <filename to be transfererd>( do the transfer)....
    You can do same with ABAP code also, for this you need to use some function modules like..
    FTP_CONNECT ( to establish the connection)
    FTP_COMMAND ( to execute the commands like cd, lcd get,put)
    finally FTP_DISCONNECT to close the open connection...
    for further details refer standard program RSFTP002,RSFTP003....
       reward points if helpful...

  • Error while loading data from application server

    Hi all,
    Am facing a problem while loading data from application server.
    The error i get is ....
    *" The argument ' Rental/Lease ' cannot be interpreted as a number while assigning character to application structure*.
    'Rental/Lease' is a value for a character infoobject length 30. I checked for the sequence of fields in data source and the sequnce of values am receiving in application server and the sequence match.
    when i copy these values into a CSV onto a desktop and load,load is successful.
    Please let me know your views.
    Thanks&Regards,
    Praveen

    It looks like the system is trying to convert Rental/Lease to a number format.   Is the info object type CHAR or NUMC or ???  I would look there.
    Also, make  sure / is in RSKC.
    Brian

  • Dump while downloading data from Application Server File in 4.6 system

    Hi,
    When we are trying to upload data from Application Server to internal table using dataset statements, it is resulting in a dump. System we are using is 4.6c.
    When we faced similar kind of issue in ECC version, we have used the statement, Ignoring Conversion Errors.
    Please let me know how to handle this situation in 4.6 System.
    Thanks for your inputs.
    Regards,
    Phani

    Hi All,
    I am sorry. My question was wrong. It should be while uploading data from internal table to application server, if there are any special characters, it is going to dump.
    I will let you know the dump details and code at the earliesst.
    Sorry and Thanks again for your prompt response.
    Regards,
    Phani.

  • Delete file data from Application Server

    Hello,
    How do we delete data from the file on application Server.
    For deleting the file, we use DELETE DATASET <filename>.
    If we want to delete only the data and not the file, how to address it?
    Please let me know.

    Hi , please check the following links, maybe using the truncate dataset can be helpful.
    http://help.sap.com/saphelp_nw70/helpdata/EN/fc/eb3c7f358411d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/EN/d5/c3f58e9f3b11d2960000a0c9308b1f/frameset.htm
    Another way could be get the file name and store in a var , then delete the file and afterwards
    create a new one with the same name as stored in the var.
    Thanks,
    Walter Oliveira.

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

  • Uploading the data from Application server to Database

    Hi,
    I am trying to upload tab delimited file from application server into database.
    I have upload the file from presentation to application server by CGZ3
    and i am able to see file in app server with #s and it appers in application server as
    10140#A#E#120#abcd#
    10146#M#P#300#a.b#
    10152#M#P#200#dat123.com##
    140#A#P#300#blicksat123.com#
    10140#A#E#260#cust1at123.com##
    And my notepad records looks like
    10140     A     E     120     abcd
    10146     M     P     300     a.b
    10152     M     P     200     dat123.com     
    140     A     P     300      blicksat123.com
    10140     A     E      260     cust1at123.com
    I am using open data set and read dataset to read the file as shown below
    DATA:
        l_htab      TYPE c,                " Horizontal tab
        l_line(100) TYPE c.                " Content in the file
      l_htab = cl_abap_char_utilities=>horizontal_tab.
    Open dataset
      OPEN DATASET pp_afname FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc EQ 0.
        DO.
    Read dataset
          READ DATASET pp_afname INTO l_line.
          IF sy-subrc EQ 0.
            SPLIT l_line AT l_htab
                       INTO fs_file-carrid
                            fs_file-autoind
                            fs_file-commtype
                            fs_file-resptime
                            fs_file-smtpaddr.
            APPEND fs_file TO pt_afile.
          ELSE.
            EXIT.
          ENDIF.                           " IF SY-SUBRC EQ 0.
        ENDDO.                             " DO.
        CLOSE DATASET pp_afname.
      ELSE.
        MESSAGE 'Problem in opening the App.Server file' TYPE con_msgtyp_i.
      ENDIF.                               " IF sy-subrc EQ 0.
    Load the data to the database
      PERFORM load_data_to_database USING t_afile.
    When i am trying to upload it is taking me to dump and the errpr analysis is like
    "The program attempted to interpret the value "26 0 " as a number, but
    since the value contravenes the rules for correct number formats,
    this was not possible."
    Any suggestions on this
    Regards
    VEnk@

    Hi,
    Thats the line feed character. After reading  the application server file, use this
    data: lv_feed type c value CL_ABAP_CHAR_UTILITIES=>CR_LF.
    loop at itab.
    replace all occurrences of lv_feed in itab-field with space.
    modify itab.
    endloop.
    Vikranth

Maybe you are looking for