cancel
Showing results for 
Search instead for 
Did you mean: 

Right Justification on Content Conversion

Former Member
0 Kudos

Hi Guys,

I've created a receiver communication channel with content conversion to convert from the XML to a flat fixed length file. Unfortunately all the fields written to the file are left justified.

Eg writing the value "123" to a field that's ten characters long gets

123.......

Rather than

.......123

All that is in the content conversion section at the moment is the Record Set structure and the field lengths for each of the different record types.

Any ideas on how to force it to right justify the fields?

Many thanks,

John

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi John,

I have done testing on my machine regarding formatting and everything works fine.

First of all you can use NameA.fieldContentFormatting = nothing in both sender & receiver FCC without any issue. Secondly if I am not guessing wrong then you are looking your Paylod in SXMB_MONI, if yes then you will NEVER see a content with any formatting.

For example if your content is like ......Sarvesh (6 space in the begining)

Then it will always look like <NAME>Sarvesh</NAME> and not like this

<NAME>      Sarvesh</NAME>

Check your data in either XI server directory using AL11 (if you are saving it there) or check at receiver side.

I hope this solves your problem as well as doubt.

Regards,

Sarvesh

Former Member
0 Kudos

Hi Sarvesh,

Not looking at the result in SXMB_MONI, but in the exported flat file.

If for example I have defined a detail.fixedFieldLengths in the content conversion as

10,10,10

and I pass in

<TransactionAmount>090000</TransactionAmount>

<PostProcessDate>001300</PostProcessDate>

<PostSummaryDate>008061</PostSummaryDate>

The result in the file is

090000____001300____008061____

Instead of

____090000____001300____008061

Using an underscore for a space.

John

Former Member
0 Kudos

Update:

I've put .fieldContentFormatting =nothing in the Content Conversion section of the Receiver Communication Channel.

No change.

John

Former Member
0 Kudos

Hi John,

As already explained you must pass

<TransactionAmount>____090000</TransactionAmount>

<PostProcessDate>____001300</PostProcessDate>

<PostSummaryDate>____008061</PostSummaryDate>

instead of

<TransactionAmount>090000</TransactionAmount>

<PostProcessDate>001300</PostProcessDate>

<PostSummaryDate>008061</PostSummaryDate>

You need to handle the right justification in Mapping not in FCC. FCC just allocates the specififed length for the field always starting from position 1 to end position.

Former Member
0 Kudos

Hi,

Now here is the point. You are using fixedFieldLengths and when you use fixedLength it will always start from zeroth position. This is not a formatting issue..

The result "090000____001300____008061____" you are getting is 100% correct.

Regards,

Sarvesh

Former Member
0 Kudos

If you want the expected result then as correctly said by Jaishankar, handle it in mapping, may be you will require an UDF for it coz your content is variable.

Regards,

Sarvesh

Former Member
0 Kudos

That's what I was afraid of, I assumed it would be fairly standard when converting from XML to Flat to cater for justification adjustments.

Normally when working with XML spacing would be removed as it's unnecessary.

A royal pain in the neck to have to handle it in the mapping. Very primative.

Thanks for the help guys,

John

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Although it is not available in sap help document, but have you tried with

NameA.fieldContentFormatting = nothing

in your receiver adapter FCC. Are you getting some kind of error in RWB when you use the above parameter.

Regards,

Sarvesh

Edited by: Sarvesh Singh on Nov 19, 2008 5:53 PM

Former Member
0 Kudos

Hi Guys,

Thanks for your replies. Setting the .fieldContentFormatting value to nothing is for content conversion on Sender communication channels when converting from flat file to XML, or am I wrong?

I'm converting on the receiver and converting from the XML to a fixed length flat file so I want a line to look like

" 123 123 123"

Instead of

"123 123 123 "

John

Former Member
0 Kudos

yes john you are rite it's for file sender adapter.

Former Member
0 Kudos

If the initiall blank spaces of the field are getting trimmed on target data

u can use NameA.fieldContentFormatting

pls chk this link

http://help.sap.com/saphelp_erp2005/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm

Regards,

Syed

Former Member
0 Kudos

hi ,

Try NameA.fieldContentFormatting and specify "nothing" for omission of spaces getting trimmed.

or try.1. NameA.beginSeparator ´0x20´ (ascii code for space)

2.NameA.beginSeparator' '0x09' (ascii code for horizontal tab)

Edited by: ROBIN C on Nov 19, 2008 5:15 PM