Skip to Content
0
Former Member
Jun 11, 2009 at 07:41 AM

Unable to delete a file on application server

1525 Views

Hello Experts,

I have gone through couple of post and sample nothing worked that's the reason Iam posting a query here.

Please help me with your valuable suggestions.

I am reading a file from the application server running a BDC program to update my ztable all works fine.

now i wanted to move this file to another folder thats too working perfectly but now when i try deleting the older one it is not getting deleted.

I have closed the dataset and checked the authorization that is not a concern but still it is not getting deleted.

I have pasted the code below.

For READ and CLOSE dataset it returns subrc as 0 but after delete it returns 4.

data : mess type string.

OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT message mess.
IF SY-SUBRC = 0.
DO.
    READ DATASET ld_file INTO wa_string.
    if sy-subrc eq 0.
        append wa_string to it_string.
        clear wa_string.
    else.
        exit.
    endif.
  enddo.

  close dataset ld_file.
  delete dataset ld_file.
else.
WRITE 'Unable to open source file to move the content'.
endif.

Regards,

Ranjith N