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 File

Former Member
0 Likes
840

How to delete a file from presentation server afeter use in BDC

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
763

hi

it is very easy.

Afte processin the BDC write this code

delete dataset p_file

if sy-subrc eq 0.

message s000(8i) with text-004 P_FILE text-005.

else.

message s000(8i) with text-004 P_FILE text-006.

endif.

Regards

Shiva

6 REPLIES 6
Read only

Former Member
0 Likes
763

Hi Sourav,

Use method CL_GUI_FRONTEND_SERVICES->FILE_DELETE

Regards,

Atish

Read only

Former Member
0 Likes
763

Hi

Use the static method CL_GUI_FRONTEND_SERVICES->FILE_DELETE

or

You can use function "GUI_DELETE_FILE".

Reward if usefull

Read only

Former Member
0 Likes
764

hi

it is very easy.

Afte processin the BDC write this code

delete dataset p_file

if sy-subrc eq 0.

message s000(8i) with text-004 P_FILE text-005.

else.

message s000(8i) with text-004 P_FILE text-006.

endif.

Regards

Shiva

Read only

Former Member
0 Likes
763

Hi,

use the class method FILE_DELETE in the class CL_GUI_FRONTEND_SERVICES to delete a file from the presentation server..

DATA: rc TYPE i.

CALL METHOD cl_gui_frontend_services=>file_delete

EXPORTING

filename = 'C:\TEST_FILE.TXT'

CHANGING

rc = rc

EXCEPTIONS

file_delete_failed = 1

cntl_error = 2

error_no_gui = 3

file_not_found = 4

access_denied = 5

unknown_error = 6

OTHERS = 7

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

WRITE: / sy-subrc.

Read only

Former Member
0 Likes
763

Hi ,

For presentation server use the function GUI_DELETE_FILE

&

for application server use delete dataset file_name.

Thanks

Lalit

Read only

Former Member
0 Likes
763

Try to use Long Path Tool, it really can help you with that. It will really help you to solve your problem.