Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Content Conversion: One row with one header and multiple item structures. Possible?

Dear all,

I have a input that looks like this:

HeaderKeySomeHeaderInformationItemKeySomeItemInformationItemKeySomeItemInformation...

Here's the actual input

TEHGMESS0026000000288S0001TEI2____026200006112410400000000           18010000000000                                                      00126000000000126000120600000000002000000000                                    000WESTMONOBERTBE2014052309422408120003 000000000000000000000000000000JTEI2____026200006112410400000000           19010000000000                                                      00126000000000126000120600000000002000000000                                    000WESTMONOBERTBE2014052309422408120003 000000000000000000000000000000J

HeaderKey = TEHGMESS

ItemKey = TEI2____

Is it possible to process this via MessageTransformBean (my actual scenario is JMS to IDoc)? I already tried but I only succeeded when having new lines in my input to separate between Header and (multiple) Items.

So when the input and my configuration looks like below it works, but when I only have a single row input it doesn't work, even when specifying xml.recordHeader.endSeparator = '0' / xml.recordItem.endSeparator = '0'. I even tried xml.endSeparator = '0' but no luck.

Input that works

TEHGMESS0026000000288S0001

TEI2____026200006112410400000000           18010000000000                                                      00126000000000126000120600000000002000000000                                    000WESTMONOBERTBE2014052309422408120003 000000000000000000000000000000J

TEI2____026200006112410400000000           19010000000000                                                      00126000000000126000120600000000002000000000                                    000WESTMONOBERTBE2014052309422408120003 000000000000000000000000000000J

Matching configuration that works for input which structures are delimited by new line.

ParamenternameParametervalue
Transform.Classcom.sap.aii.messaging.adapter.Conversion
Transform.ContentTypetext/xml;charset=utf-8
xml.conversionTypeStructPlain2XML
xml.documentNameMT_TEI2Split
xml.documentNamespacehttp://hansgrohe.com/pi/MQ/TEI2/10
xml.keyFieldNameSATZARTKey
xml.keyFieldTypeCaseSensitiveString
xml.processFieldNamesfromConfiguration
xml.recordHeader.fieldFixedLengths8,4,9,1,4
xml.recordHeader.fieldNamesSATZARTKey,SATZLENHG,NUTZLEN,MESSAE,MESSNR
xml.recordHeader.keyFieldValueTEHGMESS
xml.recordItem.fieldFixedLengths8,4,2,10,8,19,3,3,2,10,6,2,10,6,2,10,6,6,6,6,6,11,9,2,10,6,2,10,6,3,4,3,7,14,8,1,31
xml.recordItem.fieldNamesSATZARTKey,SATZLEN,BUCHART,TRNR,ANDGNR,MITEM,TEIVARI,BSTSTATU,REFTYP,ORNO,POS,REFTYP1,ORNO1,POS1,CHATYP,CHARGE,CHAPOS,ABBVONL,ABBNACH,ZUBVONL,ZUBNACH,I2MENG,I2BUNR,REFTYPN,ORNON,POSN,REFTYP1N,ORNO1N,POS1N,BSTSTATN,ABUSERAB,ABUSERFN,ABUSERNA,I2TIME,I2LIDNR,I2FMCODE,FILLER
xml.recordItem.keyFieldValueTEI2____
xml.recordsetNamerecords
xml.recordsetStructurerecordHeader,1,recordItem,*

Any clues on this? Is it even possible to have multiple structures in one row? Many thanks in advance

Jens

Tags:
replied

SAP came back to me with this answer:

First, I would like to point the documentation for Message Transform

Bean (MTB) in 7.4:

http://help.sap.com/saphelp_nw74/helpdata/en/57/0b2c4142aef623e10000000a155106/content.htm?frameset=/en/57/0b2c4142aef623e10000000a155106/frameset.htm&current_toc=/en/45/0ea2de423c2d6be10000000a11466f/plain.htm&node_id=18

As it is written at the beginning of this document, MTB is used to

call classes written for the Plain Adapter Engine. So you may find

additional documentation about the parameters for convertion in the

documentation of the Plain Adapter Engine

(http://help.sap.com/saphelp_nw74/helpdata/en/0d/00453c91f37151e10000000a11402f/content.htm?frameset=/en/1b/d5ef3b1ad56d4fe10000000a114084/frameset.htm&current_toc=/en/75/246b3de666930fe10000000a114084/plain.htm&node_id=11).There it is written that the structures by default are

arranged line-by-line. The endSeparator just adds additional character

string as a separator after the last column in a row.

I hope that this answers your question. MTB expects the data to be

structured line by line.

You may add a custom module, which transforms the message in the

expected format.

If you have a look at the second link there's even a more precise wording that multiple structures within one line are not supported:

  • xml.NameA.endSeparator

Even if no specification is made here, a line break must follow since substructures are always expected as a line of the document.

Bottom line is that it's not supported by now and verfied by me with PI 7.4 SP5

Many thanks to Ambrish, Amit and Hareesh for the valuable input. Will probably try to work things out for now following Ambrish's / Hareesh's suggestion as this seems easier to implement. Amit's proposal with a dedicated module however would probably be the more polished solution.

Cheers

Jens

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question