Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Delete a .csv file from desktop system

Former Member
0 Likes
1,557

Hi All,

My requirement is to read the .csv file from the desktop system having the shared folder and delete the file after read successfully.

Here I can read the .csv file from the location using the function RFC_REMOTE_FILE and updated the content into internal table.

But I cant delete the file from the presentation server ( Desktop system).

Can anyone tell me how to delete the .csv file from the desktop system on different location.

Note:

I followed this link to read file:

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2&override...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,435

.

Hi All,

My requirement is to read the .csv file from the desktop system having the shared folder and delete the file after read successfully.

Here I can read the .csv file from the location using the function RFC_REMOTE_FILE and updated the content into internal table.

But I cant delete the file from the presentation server ( Desktop system).

Can anyone tell me how to delete the .csv file from the desktop system on different location.

Note:

I followed this link to read file:

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2&override...

8 REPLIES 8
Read only

Former Member
0 Likes
1,435

I haven't tried it, but have a look at method FILE_DELETE of class CL_GUI_FRONTEND_SERVICES.

Rob

Read only

0 Likes
1,435

Hi Rob,

Thanks for your quick response.

But my requirement is to delete the file from remote desktop system in background mode.

Read only

0 Likes
1,435

As far as I know, the link you provided is the only way to do that.

Rob

Read only

0 Likes
1,435

Hi Rob,

Thanks. I solved this problem myself.

The solution to delete the file from remote system is

concatenate 'DEL' i_filename i_dirname into v_bkfile separated by space .

call function 'RFC_REMOTE_EXEC'
  destination  c_dest
  exporting
    command               = v_bkfile
  exceptions
    system_failure        = 1  MESSAGE v_ermsg
    communication_failure = 2  MESSAGE v_ermsg.

Read only

former_member226519
Active Contributor
0 Likes
1,435

look at function group SFES, e.g. fm GUI_EXEC

Read only

Former Member
0 Likes
1,436

.

Read only

0 Likes
1,435

Hi All,

I am also having the same requirement.

By using RFC_REMOTE_EXEC i can delete the file from bin directory of 'rfcsdk' folder on remote system.

But I have to delete the file from the folder where i want like E:\TEST\test.csv also.

Here i cant delete from the above location can anyone tell me how to solve this issue.

Read only

0 Likes
1,435

Hi db,

I am also faced that problem.

1. Check the connection

2. Check the path you specified

3. Check, is file on location or not

Check all the above possibilities and

In code, provide the correct directory name with file name and extension.

Success!

Hope It will work.