Skip to Content
0
Former Member
Mar 31, 2008 at 08:11 AM

to create a new file in application server and transfer data to ti

12 Views

i am doing the following where i have to create a new file in application server and transfer data to tht file from an internal table.but its saying file cant be opened.the path i am giving to parameter p_prefil is /tmp/prachi.txt.

wats the prob..can anyone help.

DATA:L_WA_FINAL TYPE TY_FINAL,

l_wa_string type string.

OPEN DATASET P_PREFIL FOR OUTPUT IN text mode encoding default.

if sy-subrc <> 0.

write: ' file cannot be opened'.

stop.

endif.

LOOP AT P_I_FINAL INTO L_WA_FINAL.

move l_wa_final to l_wa_string.

TRANSFER l_wa_string TO P_PREFIL.

if sy-subrc <> 0.

write: 'file can not be written'.

stop.

endif.

clear l_wa_final.

ENDLOOP.

CLOSE DATASET P_PREFIL.

if sy-subrc <> 0.

write: ' file cannot be closed'.

stop.

endif.