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

Writing internal table to application server - Issues

Former Member
0 Likes
344

Hi ,

Iam writing a internal table to a file in application server.

sample

   OPEN DATASET filepath FOR OUTPUT IN Binary Mode.

Also Iam transfering the following at times to the filepath.

'0D',      "Carriage Return

'0A',      "Line Feed

'01',      "Start of Header

'02',      "Start of Text

'03'.      "End of Text

Eq : Iam trying to write 'SAP' to application server But it is shown in AL11 as 'S#A#P' and when the file viewed in OS level it is as 'S A P'.  (space inbetween).

Where am I missing .

File is written perfectly in text mode.

But want carriage return and other items.

Suggest me solution.

Thanks and Regards,

Karthiheyan M

Hi ,

Iam writing a internal table to a file in application server.

sample

   OPEN DATASET filepath FOR OUTPUT IN Binary Mode.

Also Iam transfering the following at times to the filepath.

'0D',      "Carriage Return

'0A',      "Line Feed

'01',      "Start of Header

'02',      "Start of Text

'03'.      "End of Text

Eq : Iam trying to write 'SAP' to application server But it is shown in AL11 as 'S#A#P' and when the file viewed in OS level it is as 'S A P'.  (space inbetween).

Where am I missing .

File is written perfectly in text mode.

But want carriage return and other items.

Suggest me solution.

Thanks and Regards,

Karthiheyan M

1 REPLY 1
Read only

Former Member
0 Likes
314

Hi,

I cannot see why you are not using the text mode. E.g remember that you can still handle the CR/LF yourself In text mode as well by using the option NO END OF LINE and concatenate value like CL_ABAP_CHAR_UTILITIES=>CR_LF whenever you need.

Otherwise I think you may be able to read your file trough abap statement and output it correctly within your sap system as maybe the soft you are using at OS level could not decode your binary stream properly... What happens if you reopen your file for INPUT after it has been created (and use WRITE statements)? Is the file written correctly to the spool this way?

If no, please provide some code at least...

Cheers,

Manu.