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

A reason why creating a file doesn't work

Former Member
0 Likes
627

Hello, everyone.

I have a simple code which suppose to create a file and write to it.

Even when everything seems to be OK when debugging the program the file is not created (subrc = 0).

Please do not suggest me to use FM (gui_download and so...), it's not possible (backgroung execution).

The code is:

OPEN DATASET LV_FILENAME FOR OUTPUT IN TEXT

MODE ENCODING DEFAULT.

IF SY-SUBRC EQ 0.

LOOP AT LT_DATA_TAB INTO LS_DATA_TAB.

TRANSFER LS_DATA_TAB TO LV_FILENAME.

ENDLOOP.

ENDIF.

CLOSE DATASET LV_FILENAME.

Does anyone has an idea what's the problem ? Folders Access Authorization Only ??

Thanks in advance,

Rebeka

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
605

hi,

try to use

DATA mess TYPE string.

OPEN DATASET `` FOR INPUT IN BINARY MODE MESSAGE mess.

IF sy-subrc = 8.

MESSAGE mess TYPE 'I'.

ENDIF.

the opeating system will give u the answer in mess!

bye

4 REPLIES 4
Read only

Former Member
0 Likes
605

It should be authorization problem ...

Read only

Former Member
0 Likes
605

Hi,

Check if the path is in the transaction AL11.

Try to use a path maintained in the AL11.

Regards,

Fernando

Read only

asik_shameem
Active Contributor
0 Likes
605

Hi

It must be the authorization prob.

Try to locate the file in /TMP folder and check the sy-subrc OR try to use the existing file.

LV_FILENAME = '/tmp/test.txt'.

Read only

Former Member
0 Likes
606

hi,

try to use

DATA mess TYPE string.

OPEN DATASET `` FOR INPUT IN BINARY MODE MESSAGE mess.

IF sy-subrc = 8.

MESSAGE mess TYPE 'I'.

ENDIF.

the opeating system will give u the answer in mess!

bye