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 Deletion

Former Member
0 Likes
735

Hi Experts,

i need to delete a txt file after reading it. Im using this function module

GUI_DELETE_FILE

It deletes the file. but it rerurns FAILED exception, if any one has used that function module before could you advice me rearding this.

I would really appreciate if anyone can help to solve this issue.

Thanks in advance,

Lahiru.

Edited by: Lahiru Jayasundara on Feb 14, 2008 9:22 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
671

Just a thought. Have you tried WS_FILE_DELETE

Hope it helps.

SL

Hi Experts,

i need to delete a txt file after reading it. Im using this function module

GUI_DELETE_FILE

It deletes the file. but it rerurns FAILED exception, if any one has used that function module before could you advice me rearding this.

I would really appreciate if anyone can help to solve this issue.

Thanks in advance,

Lahiru.

Edited by: Lahiru Jayasundara on Feb 14, 2008 9:22 PM

4 REPLIES 4
Read only

Former Member
0 Likes
672

Just a thought. Have you tried WS_FILE_DELETE

Hope it helps.

SL

Read only

0 Likes
671

Hi SL,

yes. i tried that. GUI_FILE_DELETE is replacement of WS_DELETE. SAP doesnt recommand WS_ function module.

Thanks a lot for your reply.

Lahiru.

Read only

Former Member
0 Likes
671

Hi again,

I know what GUI_UPLOAD requires a *.dat file

Have you tried using GUI_DELETE_FILE and deleting a .dat ?? Does this return the same error?

Good luck!

SL

Read only

Former Member
0 Likes
671

Hello,

Do like this.

    • GUI_DELETE_FILE usually fails at first call >> try up to 3 times*


  ld_localfile = id_fname.
  DO 3 TIMES.
"    GUI_DELETE_FILE usually fails at first call >> try up to 3 times
    CALL FUNCTION 'GUI_DELETE_FILE'
      EXPORTING
        file_name = ld_localfile
      EXCEPTIONS
        OTHERS    = 1.
    IF sy-subrc = 0.
      EXIT.
    ENDIF.
  ENDDO.
  IF sy-subrc <> 0.
    MESSAGE e154(g00) WITH id_fname.
  ENDIF.

Hope this will solve ur issue.

Cheers,

Vasanth