How to delete a local file in the presentation server.

Hi All,
How to delete a local file in the presentation server. As we do using 'delete dataset dsn' in application server. How can i achieve this. My requirement is after uploading file using gui_upload, i want to delete that source file. Please let me know, how can i achieve this.
Thanks in advance.
Regards,
Vishal

data: l_rc type i.
  data: f_name type string.
    move 'c:\YourFile.txt' to f_name.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_DELETE
      EXPORTING
        FILENAME             = f_name
      CHANGING
        RC                   = l_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
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

Similar Messages

  • Reading file from the presentation server in the background

    Hi,
    I am trying to read a .csv file from the presentation server into an internal table in the background. what should I do for it? In the foreground it works fine.
    I have declared a selection parameter 'p_file' that has the path of the file. It wokrs fine in the foreground and how to set it up in the background?
    Any thoughts would be helpful. Thanks in advance,
    VG

    hii
    did you achieved the required functionality , i,e, accessing presentation server file i nbackground .
    I too got the same requirement, can you explain the process.
    There is no way you can do it... The best method is to put the file on Appln server and then call it in the background mode.
    Regards,
    Vishwa.

  • "Bad data format" when reading txt file from the presentation server

    Hello,
    I have a piece of code which reads a txt file from the presentation server to an internal table like below:
    DATA : lv_filename type string.
    lv_filename = 'C:\abap\Test.txt'. "I created a folder called abap under C:\
    CALL method CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
       FILENAME              = lv_filename
    CHANGING
       DATA_TAB            = lt_tsd. " lt_tab has the exact same fields as the Test.txt's. Test.txt has only one line, tab delimited.
    When running this code, exception BAD_DATA_FORMAT is issued.
    Is it because of the file encoding or delimiter or other reason?
    Thanks,
    Yang

    Hello,
    If its tab delimited then use the has_field_seperator parameter and check
    DATA : lv_filename type string.
    lv_filename = 'C:\abap\Test.txt'. "I created a folder called abap under C:\
    CALL method CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
       FILENAME                = lv_filename
       FILETYPE                 = 'ASC'
       HAS_FIELD_SEPARATOR          = u2018Xu2019
    CHANGING
       DATA_TAB            = lt_tsd.
    Vikranth

  • How to refresh a local file in the Reporting Studio?

    Hello,
    I need to refresh a few local files in the Reporting Studio via script, but obviously command
    ActiveDocument.Sections["Sectionname"].Process()
    does not work, since it's not a query. What else could I use?
    Many thanks for any answer.

    I am confused...How is the solution not exactly what I look for ?
    You asked how to refresh imported data files via script.
    You correctly identified that the Imported file is not a Query.
    However if you look at the Object model closely you will notice properties that if you can think outside the box will allow you to treat the imported file like a query section.
    ActiveDocument.Sections["data.csv"].ProcessSequenceNum
    ActiveDocument.Sections["data.csv"].IncludeInProcessAllBy strategically setting unwanted sections not to process via
    ActiveDocument.Sections["Sectionname"].IncludeInProcessAll = falseand setting targeted section(s)...imported file(s) to process via
    ActiveDocument.Sections["Sectionname"].IncludeInProcessAll = trueThen
    ActiveDocument.ProcessAll()Your section(s) will refresh.
    If this is not a satisfactory solution then move the data files to a database or create a DSN entry and OCE to those files instead of importing them.

  • How we create a flat file on the application server

    hi,
    how we create a flat file on the application servere,this file have the header data and corresponding item data also.
    i.e. how we use the AT NEW and ATEND. statement in this file creation.
    pls send me some code related to this.
    thanks,
    vipin

    Hi Grafl,
    Chk this link
    Folder creation in AL11 using ABAP program
    try this code.This works on UNIX servers
    data: unixcom like   rlgrap-filename.
    data: begin of tabl occurs 500,       
            line(400),    
          end of tabl.
    dir = unixcom = 'mkdir mydir'. "command to create dir
    "to execute the unix command 
    call 'SYSTEM' id 'COMMAND' field unixcom
                      id 'TAB' field tabl[].
    <b>Reward Points if Useful</b>
    Regards
    Gokul

  • How do I upload only a few lines of a file from the presentation server?

    Hi there guys,
    I'd like to upload the contents of a file on my HD (presentation server) to an internal table. I know this can be achieved by using the GUI_UPLOAD function module. But what if I only want to upload a part of the file, not the whole thing? Like the first 100 bytes or 10 lines or something like that. Some files are just way too big to upload them as a whole. I tried using the OPEN DATASET statement, but that seems to work only for files on the application server. If I try to open 'C:     emp     est.txt' (for example) with OPEN DATASET, I get an error. Do I have to put the filename differently or am I totally wrong with OPEN DATASET? I'm kinda stuck here and I'd appreciate your help.
    Cheers,
    Björn.

    Hi Shashi,
    thanks for your reply. If I understand you correctly, this means I will have to wait for GUI_UPLOAD to upload the whole file and afterwards filter into another table. I don't want to upload the whole thing because it's that big, I'd like to only upload a portion of it in the first place. Can this be done?
    Cheers,
    Björn.

  • How to delete an individual file from the'Recents' list on an Android tablet? Not the original file in the documents library.

    I have a samsung note 8 tablet. I used to be able to delete files from the recents list, but don't know how to do it in the newest version.

    I don't think you can remove just one file from this list.

  • How to delete a text file in the HP cloud

    I had a text file that was created through a text (notpad type app ) on my kindle fire. I sent it to my HP printer using the Eprint app which worked great. I deleted the file from the notepad app but it still shows up in my HP cloud. How do I go about deleting it from my Eprint files ??

    Hi there, can you clarify what you mean by "How do I go about deleting it from my Eprint files ??"
    If its the notification message from within the ePrint app itself, then it is only a notification and a copy of the file does not get stored in the app.
    Best.
    If my reply helped you, feel free to click on the Kudos button (hover over the "thumbs up").
    If my reply solved your problem please click on the Accepted Solution button so other Forum users may benefit from viewing the post.
    I am an HP employee.

  • How to synchronize a local file with the remote copy.

    I have a local file (file.txt) inside the directory of my java application and also a copy in a remote machine. Every time I start the application I want to check if the remote copy has been updated and if yes, synchronize the local copy. If you have done this before, please let me know. Thank you very much!

    you could make a URL connection to that file, check it's lastModified date, and download if you need to update

  • How to upload a current file to the remote server in Dreamweaver?

    I am trying to transfer an html file from FrontPage to the server via Dreamweaver, but it absolutely refuses to upload. Help!

    Nobody can know anything. You are not providing any system information, what version of DW you use, what the remote server actually is. and since this is a DW question, ask in their forum with the proper information included.
    Mylenium

  • Help with how to read and write files to the applets server

    I am writing a form that requires some data to be written serverside(not on the host machine) and I also need to be able to read from those same files.
    Can anyone provide any help?
    I looked into signing but it seems, to me, that signing is for when you are going to be modifying files on the host...

    brianb7590 wrote:
    Would I use that to refer to the file like I would with a regular application?Nope. It's pretty complicated. You've got to set something up on the server to accept requests, get all the data and then save files somewhere and on the client side you've got to make the connection and send the data.
    Edited by: tjacobs01 on Apr 13, 2009 5:49 PM

  • How to delete latest opened file in the recent opened files list?

    Does any one know if there is any api to modify the recent opened files list under the meun File->Open Recent File?

    There is not.

  • Upload to file in the presentation server

    Hi Guyz,
    I got a report, which would download output into a .txt file using function module "download", but one field is not getting downloaded into that.
    how to check that? plz let me know..
    thanks a lot..
    venu.

    I guess its the last field in your structure you didn´t get. Right ? Then maybe you exceeded a hardcoded length of about 1000 or 1200 bytes in the FM.
    Hope that helps.

  • How do I stop Dreamweaver from updating the Test server copy of a file when I open the local file?

    The subject says it all. Every time I open a file, Dreamweaver connects to the testing server and uploads the local file to the test server.
    I want to stop this behaviour.  It's annoying!

    My testing server is IIS running on my local machine.
    The "local" copy of the file is actually on a remote share.  I have the test server copy open in Notepad++.  The two files are identical save for on extra line in the copy on the testing server.  When I open the "local" copy in Dreamweaver, it shows me that some file activity is being done, and then Notepad++ tells me the file has changed and do I want to reload it.  If I do, that extra line vanishes.
    When I check the file activity log, it shows that the file activity is complete.
    I haven't mentioned the production server because it doesn't seem to be affected, but we do have one.

  • Uploading a file to the web server

    How can i upload a file to the web server using JSP.

    hello sir,
    Could U even tell me performance which one is better.
    U have mentioned that Multipartrequest is Complex for Beginers,
    but as far as performance is concerned which is better.
    If Taglib is used is it error Free , as I do not know much abt taglib.
    have just read a little abt it , have never created my own Custome Tag.
    Could U just Guide me which is the best site where I could get know a little abt Taglib.An easy tutorial where I could read and start working on My application.
    I have been given a Deadline. So Please help me man.
    If U have the source Code for Uploading of a File Please Cut Paste it.
    I have to finish the project on time .
    Please
    With Regards
    Eklavya

Maybe you are looking for

  • No longer have permission for itunes

    Hi all, Switched on itunes today and it asked me to update which I admit I sort of did without thinking... it tried twice to update Quicktime and itunes, sat there for a while, gave me a failure notice that to be honest I don't recall, but it was vag

  • Safari not printing from hotmail

    I am running Mac OS 10.5.5 with Safari. Since hotmail has done their recent site upgrade I can no longer print my emails with Safari. The preview comes up blank and when you print it is blank. I have re - installed the latest drivers and have done al

  • Wierd characters in LDAP changelog

    Hello, We're encountering this wierd problem while running a LDAP activesync. The modifiersname attribute within some changelog entries have some sort of wierd special character in it (it seems to be a carriage return). LDP shows it as some wierd asc

  • How to get (database) connections for building an extension in 11g?

    Hi, I have built an extension for jdeveloer/sqldeveloper and I used the ConnectionManager Class to start my dockable. Having migrated from Jdev10g to 11g it looks like that the ConnectionManager class was removed, at least I'm not able to locate it a

  • "You are currently restricted from purchasing serv...

    The message "You are currently restricted from purchasing services or redeeming vouchers" keep appearing when I try to buy credit, or update my payment info. Unable to contact Customer Support, how can this be fixed?