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

Open data -error opening file

Former Member
0 Likes
2,234

Hi all,

When I am writing like this , I am unable to open the file.

data : lw_filename type string.

move p_file to lw_filename.

OPEN DATASET LW_FILENAME FOR OUTPUT IN TEXT MODE MESSAGE

LW_MSG ENCODING DEFAULT.

*---Error opening file

IF SY-SUBRC <> 0.

MESSAGE I998 WITH LW_MSG.

ELSE.

please help me in this.

regards,

Ajay

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
1,251

I think you haven't used the <b>lower case</b> additoin to the parameter for file. This will enable you to put the file name in the lower case.

parameters: p_file type char70 lower case.  " << LOWER CASE is required

Regards,

Naimesh Patel

7 REPLIES 7
Read only

naimesh_patel
Active Contributor
0 Likes
1,252

I think you haven't used the <b>lower case</b> additoin to the parameter for file. This will enable you to put the file name in the lower case.

parameters: p_file type char70 lower case.  " << LOWER CASE is required

Regards,

Naimesh Patel

Read only

0 Likes
1,251

hI Naimesh,

I am using the lowe case option here.

Parameters: p_file for rlgrap-filename lower case.

regards,

Ajay

Read only

0 Likes
1,251

Hi Naimesh,

Sorry.

Parameters : p_file like rlgrap-filename lowe case.

regards,

Ajay

Read only

0 Likes
1,251

Check the file path first.

Second check about your authorizatoin to open the file.

You need to have the authorization to open the file. Contact your Basis guys for that.

You can catch the Authority issue with CX_SY_FILE_AUTHORITY.

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
1,251

hai ajay i think u r writi

ng code wrong

do u want to open the data from apllication server..

first write:

open dataset x for output in texmode encoding default.

read the data.

close data set x for input encoding default.

if u not get his shortcut mail me at

abapsati@gmail.com

thanks and regards

Read only

Former Member
0 Likes
1,251

Ajay,

Sometimes you may get this error if you are not authorized to open the file. Please check with your basis people also.

Read only

Former Member
0 Likes
1,251

Hi,

the path is case sensitive, so be careful.

rgs