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

getting error in transfering data from internal table to application layer

Former Member
0 Likes
382

data: fname(60).

fname = 'usr/sap/trans' .

OPEN DATASET FNAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

LOOP AT itab1 .

TRANSFER itab1 TO FNAME.

ENDLOOP.

CLOSE DATASET FNAME.

this is my code ,

the dump error is the file cannot be accesed , so please me in sloving me the problem

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
356

Are you sure you have access to that directory to which you are writing the file ''usr/sap'?

It sounds like, you don't have authorization.

You probably can check the value of SY-SUBRC after OPEN DATASET in the debug mode.

Regards,

Ravi

Note - Please mark all the helpful answers

2 REPLIES 2
Read only

Former Member
0 Likes
357

Are you sure you have access to that directory to which you are writing the file ''usr/sap'?

It sounds like, you don't have authorization.

You probably can check the value of SY-SUBRC after OPEN DATASET in the debug mode.

Regards,

Ravi

Note - Please mark all the helpful answers

Read only

Former Member
0 Likes
356

Hi,

Correct your code, do not forget to check sy-subrc value after 'open dataset...'

OPEN DATASET FNAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

IF SY-SUBRC EQ 0.

LOOP AT itab1 .

TRANSFER itab1 TO FNAME.

ENDLOOP.

CLOSE DATASET FNAME.

ELSE.

WRITE: 'File can not be accessed'.

ENDIF.