cancel
Showing results for 
Search instead for 
Did you mean: 

Delete file from PC ( Webdynpro + ABAP )

Former Member
0 Kudos

Hy everyone,

     I want to delete a file from my PC after I upload it on the application server. This sould be done from the WebUI because i need it into the Netweaver Business Client.

     Thank you!

          Adi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

can you check using class CL_GUI_FRONTEND_SERVICES method FILE_DELETE

Former Member
0 Kudos

I've checked with this class and method and still doesn't work... I also tried GUI_DELETE_FILE but with no success...

Former Member
0 Kudos

I tried the class and method give above...this is successfully deleting the file.

can you check return code..if you ahve authorization?

I have give file path something like below.

C:\AMAR\TEST.TXT

Former Member
0 Kudos

lv_file_name = 'C:\todelete.txt'.

CALL METHOD cl_gui_frontend_services=>file_delete

    EXPORTING

      filename             = lv_file_name

    CHANGING

      rc                   = exceptions

    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 how i use it for test purpose. The exception returned is not_supported_by_gui...

I think that the problem is that i run the nwbc/saplogon by a citrix server...

former_member184578
Active Contributor
0 Kudos

Hi,

You cannot use cl_gui* classes in Web Dynpro ABAP. These are only for SAPGUI, they require SAP GUI Framework.

If you are on Netweaver 7.01, you can use AcfExecute. Using this you can run the commands on the client machine.

Hope this helps u.,

Regards,

Kiran

Former Member
0 Kudos

Hi Kumar,

     Do you have some examples on how to use CL_WD_ACF_EXECUTE?

    

     Thank you!

former_member184578
Active Contributor
0 Kudos

Hi,

You can check my article here: http://scn.sap.com/docs/DOC-34524

You need to create a batch file to delete file in local machine and execute the batch file using AcfExecute. But it is static.

Regards,

Kiran

Former Member
0 Kudos

The problem is that i will obtain the name of the file dynamically, so i cannot create the batch file static...

former_member184578
Active Contributor
0 Kudos

Yes. That's what i mention. It is static. you cannot delete file dynamically. One option is creating/overwriting the  static batch file during upload with the name of file.

But again this is not possible using Web Dynpro ABAP.

Regards,

Kiran

Answers (0)