Hello everyone,
We had a Test system that just been upgraded and there was programs that read file and delete from server.
İts standard SAP code!!
İ simplified it and foun found out that
delete dataset <fıle_name> doesnt work!!!
it works in all systems except this upgraded one, other systems havent been upgraded!!
Code is like this:
I looked at snotes: 18273
The auth object i check works fine but delete dataset returns subrc 4 and fails to delete!!
*&---------------------------------------------------------------------*
*& Report ZZZ_MC_ALV1
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
"\\172.20.7.93\entegrasyon$
REPORT ZZZ_SOLEN_ALV1.
TYPE-POOLS SABC.
data: gv_line type string.
data: full_name type string.
data: lv_message(100).
DATA myref TYPE REF TO CX_SY_FILE_AUTHORITY .
DATA err_text TYPE string.
"E:\USR\SAP\ENTEGRASYON\ISLENMEMIS\XX.TXT
FULL_NAME = 'e:\usr\sap\entegrasyon\islenmemis\xx.txt'.
write:sy-subrc.
break sdogan.
DATA: lv_file_name type AUTHB-FILENAME.
lv_file_name = full_name.
**Check the auth object
CALL FUNCTION 'AUTHORITY_CHECK_DATASET'
EXPORTING PROGRAM = SY-REPID
ACTIVITY = sabc_act_delete
FILENAME = lv_file_name
EXCEPTIONS NO_AUTHORITY = 1
ACTIVITY_UNKNOWN = 2.
write:sy-subrc.
open dataset full_name for input message lv_message
in text mode encoding non-unicode.
write:/ 'Open dataset:' , sy-subrc.
do.
read dataset full_name into gv_line.
if sy-subrc eq 0.
write:/ gv_line.
else.
exit.
endif.
enddo.
close dataset full_name.
write:/ 'Close dataset:' , sy-subrc.
delete dataset full_name.
write:/ 'Delete dataset:' , sy-subrc.
*form backup_file using pv_in_dir
* pv_in_backup_dir type salfile-longname
* pv_fname like gt_infiles-name.
* data str type string.
* data cmd(256) type c.
* data: lt_list(250) occurs 50 with header line.
*
* clear: lt_list, lt_list[].
* concatenate 'CACLS' ',' c_in_dir pv_fname ',/E,/P,EVERYONE:F'
* into str.
* translate str using ', '.
* cmd = str.
* call 'SYSTEM' id 'COMMAND' field cmd
* id 'TAB' field lt_list-*sys*.
*
* clear: lt_list, lt_list[],cmd,str.
* concatenate 'copy' ',' pv_in_dir pv_fname ','
* pv_in_backup_dir pv_fname into str.
*
* translate str using ', '.
* cmd = str.
* call 'SYSTEM' id 'COMMAND' field cmd
* id 'TAB' field lt_list-*sys*.
*
* check sy-subrc eq 0.
*
* " yedeği alınmış dosya silinir
* delete dataset full_name.
* if sy-subrc is initial.
* endif.
*
*endform. " backup_file