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

Problem while reading the file from Unix

Former Member
0 Likes
738

HI

I am facing the problem while reading the file,

I am using open dataset statement for input in legacy binary/text mode.

a fm *get_filename used to read the file from unix system. but it is filled with

  1. and other non alphabetic characters.

please help me ......

HI

I am facing the problem while reading the file,

I am using open dataset statement for input in legacy binary/text mode.

a fm *get_filename used to read the file from unix system. but it is filled with

  1. and other non alphabetic characters.

please help me ......

6 REPLIES 6
Read only

Former Member
0 Likes
709

Are you reading the file from Application Server or Presentation Server.

In the former case, you should be using OPEN DATASET and READ DATASET statements.

In the latter case, you should use the FM WS_UPLOAD option.

Rgds

Meera

Read only

0 Likes
709

I am reading the file from application server, and using the open dataset stmt in legacy binary/text mode.

but still it is not working.

With this I am able to see in sap working directory the file but it is full of

like this,

á################>###þÿ##################*###########,#######þÿÿÿ####)

any additions to the open dataset sttmt if reading from unix file?

please help me./....

Read only

0 Likes
709

Hi Alekhya

Please check the characteristics of the source system from where you have received the file. Accordingly you need to change the OPEN Dataset Stmt with these additions:

2a. ... IN BINARY MODE

2b. ... IN TEXT MODE [ENCODING (DEFAULT|UTF-8|NON-UNICODE)]

2c. ... IN LEGACY BINARY MODE [(BIG|LITTLE) ENDIAN] [CODE PAGE cp]

2d. ... IN LEGACY TEXT MODE [(BIG|LITTLE) ENDIAN] [CODE PAGE cp]

Also, if possible please view the data existing in the file via transaction AL11. It might give some clues as well.

Kind Regards

Eswar

Read only

0 Likes
709

Eswar,

I am using open dataset stmt ...legacy binary mode, (it contains numeric characters also). and I analysed file in AL11 , it contains the charcters # and other characters.

while reading the file it coming in the same characters to my file.

that is the problem. Something need to do while reading the file itself from unix.

please help me if you know...

Read only

0 Likes
709

Hi Alekhya

Please check with the concerned persons on the characteristics of the source system of the file from which you have received the same. As far as i know, the data sent is not recognizable by your SAP system.

Check for the following w.r.t the source system:

1. The format in which the source system downloads the data: ASCII or BINARY...

2. If the source system sends in UTF-8 format...

3. The codepage in which the data is downloaded. Also please make sure that in your system you have the same code page to be able to recognize the data.

Hope this helps.

Kind Regards

Eswar

Read only

0 Likes
709

The open dataset statement ,with unix linefeed in which scenarios we can use this?