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

GUI_DELETE_FILE

Former Member
0 Likes
844

Hi,

I am using the FM GUI_DELETE_FILE for deleteing a file on Presentation Server. Although the FM successfully deletes a file, still it throws an Error always, i.e sy-subrc is never zero.

Can someone help me with the problem?

Thanks,

Sachin.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
772

Hi,

Check your sy-subrc value and handel the exception explicitly.

regards,

Anirban

6 REPLIES 6
Read only

Former Member
0 Likes
773

Hi,

Check your sy-subrc value and handel the exception explicitly.

regards,

Anirban

Read only

0 Likes
772

Please use class CL_GUI_FRONTEND_SERVICES=>FILE_DELETE

as GUI_DELETE_FILE is obsolate

Read only

0 Likes
772

Hi Anirban,

I have already handled the exception explicitly. The sy-subrc is always 1 and though the program continues to execute properly, I am unable to find any explanation for why sy-subrc is 1.

Regards,

Sachin.

Read only

0 Likes
772

Hi,

did it using CL_GUI_FRONTEND_SERVICES=>FILE_DELETE and it is working fine.

Thanks.

Read only

0 Likes
772

Hi,

Before Delete the file check whether file is Exit or not.

Like Below Code

data : existing type c.

call method cl_gui_frontend_services=>file_exist

exporting

file = filename

receiving

result = existing.

if existing is not initial.

Call function 'GUI_DELETE_FILE'.

endif.

If file is not there in yur system 'GUI_DELETE_FILE' not

excute.

Now this not go to DUMP.

Thanks,

Durai.V

Read only

Former Member
0 Likes
772

Check the value of sy-subrc and compare this value with that of the exception value. This way you should be able to know what the error is exactly.

Accordingly take the appropriate action.

Hope this helps!!!

Regards,

Lalit