cancel
Showing results for 
Search instead for 
Did you mean: 

JMS to RFC - Keep spaces in message

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member200962
Active Contributor
0 Kudos
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.

Former Member
0 Kudos

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