cancel
Showing results for 
Search instead for 
Did you mean: 

I want to get the file in ANSI format.. Any idea?

Former Member
0 Kudos

Hi all,

I am doing a file to file bypass scenario .My client has demanded that the output file should be in ANSI format.

I checked the <b>file.encoding</b> option in sap-help but ANSI is not available can u suggest that what encoding type i must use.

I used ISO-8859-1 as well.But client rejected this file saying that ANSI characters not present in ISO-8859-1

Any one pls throw some light on this how to acheive.

Regards

Seema.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

K seemz one of your colleages has asked the same ques and both of you are looking for the same answer

Stefan gave him this reply

The CR/LF question has nothing to do with encoding.

In UNIX the end of line is marked with \n, in Windows it is marked with \r\n.

How XI treates the end-of-line depends on the system where it is installed.

There is no way to influence this. You have to change the EOL with a script.

The question is: What happens with the file after the XI has written this? Is it relevant whether the end-of-line is \r\n or not?

When you have XI installed on UNIX then I assume that cp1252 is not available is this is a Windows code page.

Ask saurab wether he figured the solution? Else gotta try some other options.

cheers

*RAJ*

Former Member
0 Kudos

Hi Rajesh,

I send the file again to client with the explanation..

Lemme see the reply from them..

I will post the same .

Anyway gave points to you.

-Seema.

stefan_grube
Active Contributor
0 Kudos

Interseting. To threads with the same issue.

I have another idea: You can use the sample adapter module ConvertCRLFfromToLF. Here you can exchange the LF with CRLF

http://help.sap.com/saphelp_nw04/helpdata/en/96/f04142099eb76be10000000a155106/frameset.htm

If you want use content conversion of the file adapter, you have to do use the StrictXml2PlainBean instead of using the standrad conversion of the file adapter.

http://help.sap.com/saphelp_nw04/helpdata/en/44/748d595dab6fb5e10000000a155369/frameset.htm

Put the StrictXml2PlainBean before the ConvertCRLFfromToLF in the module chain in the receiver channel.

Regards

Stefan

Former Member
0 Kudos

Hi Stefan,

Thanks for those links.. I have few doubts .. please suggest me.

Based on those links and as per my thinking, now i have to follow below steps in File Module .

-


Processing sequence:

-


<b>Module Name :</b> AF_Modules/StrictXml2PlainBean

<b>Type :</b> Local Enterprise Bean

<b>ModuleKey :</b> 0

<b>Module Name :</b> AF_Modules/StrictXml2PlainBean

<b>Type :</b> Local Enterprise Bean

<b>ModuleKey :</b> 1

Module Configuration :

-


<b>ModuleKey :</b> 0

<b>Parameter Name :</b> singleRecordType (Since it is Bypass scenario,i want the entire file to have endseparator as /r/n.)

<b>Parameter value: </b> What i need to mention i this field??

<b>ModuleKey :</b> 1

<b>Parameter Name :</b> Convert

<b>Parameter value:</b> No value ??

-


In the links, i found these 3 parameters stating as

Enter the parameter convert. It can have the following values:

&#9679; none - no conversion

&#9679; CRLFtoLF - conversion from Microsoft Windows CRLF to Unix LF

&#9679; No value or another value - conversion from Unix LF to Microsoft Windows CRLF

So now i want the file to be in (CRLF).SO i need to mention "No value" here??

Please suggest me stefan if iam thinking in correct way.

Regards

Seema.

stefan_grube
Active Contributor
0 Kudos

> Processing sequence:

> -


> <b>Module Name :</b> AF_Modules/StrictXml2PlainBean

> <b>Type :</b> Local Enterprise Bean

> <b>ModuleKey :</b> 0

>

> <b>Module Name :</b> AF_Modules/StrictXml2PlainBean

> <b>Type :</b> Local Enterprise Bean

> <b>ModuleKey :</b> 1

>

> Module Configuration :

> -


> <b>ModuleKey :</b> 0

> <b>Parameter Name :</b> singleRecordType (Since it is

> Bypass scenario,i want the entire file to have

> endseparator as /r/n.)

> <b>Parameter value: </b> What i need to mention i

> this field??

Do you have a content conversion in your file adapter? Then you have to apply all relevant parameters here. If not, then you can omit this module.

> <b>ModuleKey :</b> 1

> <b>Parameter Name :</b> Convert

> <b>Parameter value:</b> No value ??

Put <b>LFtoCRLF</b> here.

Former Member
0 Kudos

Hi Stefan,

Thanks a lot .. Good Idea.

I will test this and i will let u know the result.

Regards

Seema.

Former Member
0 Kudos

Hi Stefan,

Here we need to use J2SE adapter which is a separate url where we will give configuration details like dir name ,file name etc in that url.

So i need to use XI adapter in ID in XI .

For XI adapter,the module tab is in Disabled state.

Do you have any idea where we can add those Module processing steps in J2SE adapter?

Thanks.

-Seema.

stefan_grube
Active Contributor
0 Kudos

When you use the J2SE adapter, it is not possible to work with adapter modules.

In this case you can only use the solution with a script.

Stefan

Answers (6)

Answers (6)

Former Member
0 Kudos

Seema,

What is the transport protocol you are using? If FTP, there is a simple solution. Set transfer mode = text and file type = text..FTP server will take care of the translation and line separator.

if you are not using FTP, you can explicitly specify the endSeparator characters..as your client needs \r\t...specify the endSeparator as '0x0D''0x0A'...hex symbols for CR & LF.

I used text mode and text file for sending the file to AS400 system with an FTP server....I dint have to use any encoding...i left it blank...It worked wonders for me

praveen

Former Member
0 Kudos

CHECK THESE SOME ANSWERS WERE POSTED FOR SAME QUES

When you use Microsoft Notepad and safe the file with encoding "ANSI", it means code page Windows-1252. This is a proprietary character set of Microsoft.

You should use ISO-8859-1 instead.

ANSI characters not present in ISO-8859-1

http://www.alanwood.net/demos/charsetdiffs.html#a

http://www.alanwood.net/demos/ansi.html

This link may help...

https://www.sdn.sap.com/irj/sdn?rid=/webcontent/uuid/40943d04-0b01-0010-fbae-c023e996d1b6 [original link is broken]

<b>

*REWARD POINTS IF FOUND USEFULL*</b>

Former Member
0 Kudos
Former Member
0 Kudos

Hey,

<b>JAVA RUNTIME ENVIRONMNET</b> supports ascii, iso-latin-1, utf-8, utf-16, utf-16le, utf-16be.

When the text file are being processed <b>UTF-8 </b> CODE PAGE has to be used.

Does it work ? Do post the result back.

<b>Cheers,

*RAJ*

*REWARD POINTS IF FOUND USEFULL*</b>

Former Member
0 Kudos

Hi all,

I tried with ISO-8859-1 but found that the file is in "UNIX-ANSI" format .

But they are using is "PC-ANSI" format (sorry I am not able to give you the correct ISO version).

My client gave below explanation by seeing that file:

<b>The consequence is that the carriage return is not well reconized by our import script. We use the "\r\n" separator between each line.

Does the format you use set only a \n at the end of files.</b>

Any suggestions please.

-Seema.

Shabarish_Nair
Active Contributor
0 Kudos

use UTF-8 as your encoding.

From wikipedia -

<b>UTF-8 is a superset of ASCII.</b> Since a plain ASCII string is also a valid UTF-8 string, no conversion needs to be done for existing ASCII text. Software designed for traditional extended ASCII character sets can generally be used with UTF-8 with few or no changes.

Shabarish_Nair
Active Contributor
0 Kudos

Try the encoding standards mentioned in this link - http://gedcom-parse.sourceforge.net/doc/encoding.html

In case i get more info will post it !!!!!