on 11-19-2008 11:14 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.