‎2008 Jun 19 6:11 PM
Hi Experts,
I need your help.
Just check out this piece of code.
FORM delete_files .
DATA: l_files TYPE rs37a-line,
l_cmd TYPE rs37a-line,
it_list LIKE STANDARD TABLE OF l_cmd WITH HEADER LINE.
CONCATENATE p_source '*.xls' INTO l_files.
CONCATENATE 'rm -f' l_files INTO l_cmd SEPARATED BY space.
REFRESH it_list.
CALL 'SYSTEM' ID 'COMMAND' FIELD l_cmd
ID 'TAB' FIELD it_list-sys.
IF sy-subrc = 0.
MESSAGE s018(zz).
ELSE.
MESSAGE e019(zz).
ENDIF.
ENDFORM. " DELETE_FILES
Here I am deleting all files of a directory at once ,how do I delete one file at a time .
‎2008 Jun 19 6:46 PM
Hi,
just a guess, try this
CALL 'SYSTEM' ID 'COMMAND' FIELD l_cmd
ID 'FLD' FIELD it_list-filename. <----- TAB changed to FLD
Edited by: Chandrasekhar Jagarlamudi on Jun 19, 2008 11:16 PM
‎2008 Jun 19 6:47 PM
Hi there
'*.xls' need to be replaced with the one single file name you want to delete..
CONCATENATE p_source 'file1.xls' INTO l_files.
or change the decelration
it_list LIKE STANDARD TABLE OF l_cmd WITH HEADER LINE.
to
it_list LIKE line OF l_cmd.
Edited by: Jay Sadaram on Jun 19, 2008 10:48 AM
‎2008 Jun 19 11:32 PM
Hi.
Please have a look into the [rules of engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] of all SDN forums. Threads not following the rules will be deleted. See Michael Schwandt's [blog about strict moderation|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/10047] [original link is broken] [original link is broken] [original link is broken]; for details. As these strict moderation policy is quite new I will not delete this thread but lock it.
Best regards,
Jan Stallkamp