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

Error while opening the file

Former Member
0 Likes
1,754

Hi,

I have written below code open the text file..

OPEN DATASET filename FOR OUTPUT

IN LEGACY TEXT MODE CODE PAGE codepage MESSAGE msg

REPLACEMENT CHARACTER repl_char

IGNORING CONVERSION ERRORS

FILTER filter.

Values:

Filename: xyz.txt

codepage: 1100

repl_char = @

After executing this statement. SYSUBRC value is 8.

Would you please help me on this.

Regards,

K.Krishna Chaitanya.

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
1,358

Hi Krishna,

OPEN DATASET filename 
  FOR OUTPUT
  IN LEGACY TEXT MODE 
  CODE PAGE codepage 
  MESSAGE msg
  REPLACEMENT CHARACTER repl_char
  IGNORING CONVERSION ERRORS
  FILTER filter.

Please check the content of (string) field msg, it has the error. What is your filter ?

Regards,

Clemens

6 REPLIES 6
Read only

Former Member
0 Likes
1,358

your filename should also have application server path

Read only

Former Member
0 Likes
1,358

Hi Krishna,

Try to pass the full file path along with the file name to the OPEN DATA filename variable.

Regards,

SRinivas

Read only

dhirendra_pandit
Active Participant
0 Likes
1,358

Make Sure you are passing the full file path and the filename type should be of rlgrap-filename.

like

DATA: ck_file TYPE rlgrap-filename.

Regards

Dhirendra

Read only

Former Member
0 Likes
1,358

8 often means dataset permissions does not allow the SAP userid open/read privileges...check permissions....

Read only

Clemenss
Active Contributor
0 Likes
1,359

Hi Krishna,

OPEN DATASET filename 
  FOR OUTPUT
  IN LEGACY TEXT MODE 
  CODE PAGE codepage 
  MESSAGE msg
  REPLACEMENT CHARACTER repl_char
  IGNORING CONVERSION ERRORS
  FILTER filter.

Please check the content of (string) field msg, it has the error. What is your filter ?

Regards,

Clemens

Read only

Former Member
0 Likes
1,358

Hi,

MSG variable contains the string "perm"...

So it mean that some issues related to access/authorization.

Regards,

K.krishna Chaitanya.