on 09-27-2010 9:21 PM
Hello.
I have a JMS to RFC scenario. I have the following Modules in my JMS Sender channel:
Number / Module Name / Module Key:
1 SAP XI JMS Adapter/ConvertJMSMessageToBinary convert_JMS2Bin
2 SAP XI JMS Adapter/ConvertBinaryToXMBMessage convert_Bin2XI
3 AF_Modules/MessageTransformBean Plain2XML
4 CallSapAdapter call_AF_MS
And the following Module Configuration:
Module Key / Parameter Name / Parameter Value:
Plain2XML Transform.Class com.sap.aii.messaging.adapter.Conversion
Plain2XML Transform.ContentType text/xml;charset=utf-8
Plain2XML xml.conversionType StructPlain2XML
Plain2XML xml.documentName MT_Envio_JMS
Plain2XML xml.documentNamespace urn:MQSERIES:ECC:SendMSG
Plain2XML xml.keyFieldName Key
Plain2XML xml.keyFieldType CaseSensitiveString
Plain2XML xml.linhas.fieldFixedLengths 1000000
Plain2XML xml.linhas.fieldNames line
Plain2XML xml.linhas.keyFieldValue PI
Plain2XML xml.processFieldNames fromConfiguration
Plain2XML xml.recordsetName recordset
Plain2XML xml.recordsetStructure lines,1000
Source plain TXT file:
10111789352 (5 spaces here) 40002105 (10 spaces here) 4001A518210101 000376296823092010 (15 spaces here) 2 KG # 10111789352 40002077 (2 spaces here) 4001A518210102 (3 spaces here) 000376296823092010 (5 spaces here) 2 KG #
Inbound Message:
<?xml version="1.0" encoding="utf-8" ?>
<ns:MT_Envio_JMS xmlns:ns="urn:MQSERIES:ECC:SendMSG">
<recordset>
<lines>
<line>10111789352 40002105 4001A518210101 000376296823092010 2 KG # 10111789352 40002077 4001A518210102 000376296823092010 2 KG #</line>
</lines>
</recordset>
</ns:MT_Envio_JMS>
I have 2 problems:
Problem N# 1) I need to keep the spaces between the text. How do I do this?
Problem N# 2) I wanted to seperate the lines by the # caracter, so my Inbound Message looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<ns:MT_Envio_JMS xmlns:ns="urn:MQSERIES:ECC:SendMSG">
<recordset>
<lines>
<line>10111789352 40002105 4001A518210101 000376296823092010 2 KG #</line>
</lines>
<lines>
<line>10111789352 40002077 4001A518210102 000376296823092010 2 KG #</line>
</lines>
</recordset>
</ns:MT_Envio_JMS>
Can anybody help?
Thanks.
At.,
Bernardo Braga
Plain2XML xml.linhas.fieldFixedLengths 1000000
Source plain TXT file:
10111789352 (5 spaces here) 40002105 (10 spaces here) 4001A518210101 000376296823092010 (15 spaces here) 2 KG # 10111789352 40002077 (2 spaces here) 4001A518210102 (3 spaces here) 000376296823092010 (5 spaces here) 2 KG #
Problem N# 2) I wanted to seperate the lines by the # caracter, so my Inbound Message looks like this:
Make use of fieldSeparator.....more information is given in this wiki:
http://wiki.sdn.sap.com/wiki/display/XI/HowTo...ContentconversionmodulewithJ2EEJMS+adapter
From the above wiki:
If your source file is a CSV file, replace each xml.XXX.fieldFixedLengths with xml.XXX.fieldSeparator.
Regards,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi.
The xml.lines.fieldSeparator solution will give me a XML like this:
<recordset>
<lines>
<line>HELLO 1</line>
<line>HELLO 2</line>
</linhas>
</recordset>
I need a XML like this:
<recordset>
<lines>
<line>HELLO 1</line>
</lines>
<lines>
<line>HELLO 2</line>
</linhas>
</recordset>
At.,
Bernardo Braga
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.