‎2006 Dec 27 12:35 PM
Hi all,
We are using the FM AUTHORITY_CHECK_DATASET before the command OPEN Dataset to transfer a file to the application server.
The sy-subrc for the FM comes out to be 0, but the sy-subrc for the open dataset command = 8 (on Checking in the debug mode).
The code snippet is as follows
v_path1 = v_bkpf.
CALL FUNCTION 'AUTHORITY_CHECK_DATASET'
EXPORTING
program = 'ZZRFFI058_GL_ACCOUNT_MAPPING'
activity = 'WRITE'
filename = v_path1
EXCEPTIONS
no_authority = 1
activity_unknown = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE e195(zzfn) WITH
'No authorisation to write file on application server'
v_path1.
WRITE:/ 'File:', v_path1, ' not created'.
STOP.
ENDIF.
OPEN DATASET v_bkpf FOR OUTPUT. "DEL ACC012
TRANSFER i_bkpf_w TO v_bkpf LENGTH v_len.
So we have a dump at the TRANSFER command.
Not sure how the FM is successful and OPEN DATASET fails
Pls post your ideas.
Thanks ,
Stock.
‎2006 Dec 27 12:41 PM
Hi,
Comment your open dataset ans paste this code and tell me what is the error msg ur getting.
DATA: msg(100).
OPEN DATASET v_bkpf FOR OUTPUT MESSAGE msg
IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc <> 0.
WRITE / msg.
STOP.
else.
TRANSFER i_bkpf_w TO v_bkpf LENGTH v_len.
close dataset v_bkpf.
ENDIF.
Regds,
Senthil
Message was edited by:
senthil kumar
‎2006 Dec 27 12:54 PM
Hi Senthil,
I get a permission denied error (DATASET_CANT_OPEN).
But before the open dataset I am using the FM werein the error should have been captured, but surprisingly its not !!
Any ideas ?
Thanks,
Hari.
‎2006 Dec 27 1:08 PM
‎2006 Dec 27 12:49 PM
hi please make sure that the strcuture which ur passing into the application server is entirely in character format
for example:
<b>
data: begin of itab occurs 0,
field1 like mara-matnr,
field2 like mara-menge,
end of itab.
loop at itab.
transfer itab to app_file.
endloop.
</b>
This will for a dump as the structure isnt in character format. all the fields should be of types C, N, D, T, STRING
<b>
in this case declare another itab with character fields of same field length
begin of itab1.
field1(18),
field2(17),
end of itab1.
loop at itab.
itab1-field1 = itab-field1.
itab1-field2 = itab-field2.
transfer itab1 to app_file
endloop.
award points if found helpful</b>