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

FILE DELETE FROM FOLDER

Former Member
0 Likes
729

HI ALL,

I AM USING THIS METHD FOR DELETING THE FILE FROM THE

FOLDER BUT I DONT KNOW WHAT VALUE SHULD I PASS TO THE RC.

CALL METHOD cl_gui_frontend_services=>file_delete

EXPORTING

filename = 'E:\FOLDER1\TEST1.XLS'

changing

rc =

THANKS AND REGARDS,

SUGEET.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
676

Hi,

You should declare a local variable of TYPE I and pass it to RC. RC is nothing but a return code set by system upon successful deletion or otherwise of the file that you have specified for filename.

Some thing like the following,

DATA: lv_subrc TYPE i.

CALL METHOD cl_gui_frontend_services=>file_delete
EXPORTING
filename = 'E:FOLDER1TEST1.XLS'
changing
rc = lv_subrc.

IF lv_subrc NE 0.
****Deletion failed..

ENDIF.

Hope this helps..

Sri

Message was edited by: Srikanth Pinnamaneni

4 REPLIES 4
Read only

Former Member
0 Likes
677

Hi,

You should declare a local variable of TYPE I and pass it to RC. RC is nothing but a return code set by system upon successful deletion or otherwise of the file that you have specified for filename.

Some thing like the following,

DATA: lv_subrc TYPE i.

CALL METHOD cl_gui_frontend_services=>file_delete
EXPORTING
filename = 'E:FOLDER1TEST1.XLS'
changing
rc = lv_subrc.

IF lv_subrc NE 0.
****Deletion failed..

ENDIF.

Hope this helps..

Sri

Message was edited by: Srikanth Pinnamaneni

Read only

Former Member
0 Likes
676

Hi sugeet,

data : rc type i.

CALL METHOD cl_gui_frontend_services=>file_delete

EXPORTING

filename = 'E:\FOLDER1\TEST1.XLS'

changing

rc = rc.

regards,

amit m.

Read only

alex_m
Active Contributor
0 Likes
676

Declare a variable type i,

changing

rc = type i variable.

Alex

Read only

Former Member
0 Likes
676

but when the file is readonly ,how to delete it