RecordsetsPerMessage in MessageTransformBean
Hi,
I tried using xml.recordsetsPerMessage = 1 in MessageTransformBean and in RWB i see an error like
java.lang.Exception: ERROR in structure conversion plain->xml configuration: message split not allowed here'
Has anyone tried using message split in MTB?
In my scenario XI is receiving a cp930 encoded file so I am using a custom module to add a LineFeed and also to convert the above file to UTF8. After that I am using MTB to convert the file to an XML file. Here my requirement is to send one recordset per message in XI. Please tell me if anyone faced a requirement to split messages in MTB. Any suggestions on this will be appreciated.
Regards,
Sudheer.
Dear all,
I am also using the module MessageTransformBean for txt to XML conversion.
It works well for xml.recordsetsPerMessage = * all records are available in one single PI message.
But it fails for xml.recordsetsPerMessage = 1 when tryint to get one single PI message per recordset.
The error message
Attempt to process file failed with com.sap.aii.af.sdk.xi.adapter.trans.TransformException: Error converting Message: 'java.lang.Exception: ERROR in structure conversion plain->xml configuration: message split not allowed here'; nested exception caused by: java.lang.Exception: ERROR in structure conversion plain->xml configuration: message split not allowed here
any solution for this error?
Best regards
Jochen
Similar Messages
-
Is it possible RecordSetsPerMessage with MessageTransformBean
Hi Experts,
I need to pick up large zip files from source directory and send it to CRM, I am using message transform bean for FCC in sender file adapter because source is zip file, I know normal FCC got record sets per message parameter, is it possible to do with message transform bean also, if not what is the solution to split the file into small chunks??
Thanks for the response.Leopard can read and write to a NTFS drive? Correct? Or just read?
Out of the box, just read.
I can format the drive with the option Mac OS Extended (Journaled) with Disk Utility so my Mac can read and write to it and after that a PC can also read those files?
No. That suggestion was put there in case you couldn't format the drive to NTFS because you didn't have access to a PC. Mac OS X can't create NTFS drives.
(48382) -
MessageTransformBean - SimplePlain2XML - Multiple records on a single line
Hi,
I am trying to convert multiple record from a single line to multipe rows in an XML message with the MessageTransformBean.
If the record look like this it's working:
RECORD1textETC
RECORD2textETC
But the incoming message are all on a single line:
RECORD1textETCRECORD2textETC
Is there a way to add a linefeed to my incoming message after X characters, or to tell the adapter to split by length instead of spliting on the end of line?
Thanks,
MartinI had to code a custom Module Adapter to do it.
Here's the main part of the module adapter EOLConvertBean...
Message msg = (Message) inputModuleData.getPrincipalData();
XMLPayload xmlpayload = msg.getDocument();
byte[] content = xmlpayload.getContent();
byte crlf = 0x0A; // end of line char
int current = 0; // current bytes read
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int lines = content.length / recordLen; // record len = insert EOL after X recordLen
// TODO change for do while for 1x line record
for (int i = 0; i <= lines; i++) {
baos.write(content, current, recordLen);
baos.write(crlf);
current += recordLen;
xmlpayload.setContent(baos.toByteArray());
inputModuleData.setPrincipalData(msg);
Edited by: Martin Lavoie Rousseau on Oct 6, 2010 9:08 PM -
MessageTransformBean in sender JMS Adapter flat file to xml conversion
Hi All,
The scenario is MQ (Flat File ) --->PI -
>Idoc
The flat file structure is
112233
AABBCC
The expected XML Structure after using MessageTransformBean in the sender JMS adapter is
<Record>
<Row>
<f1>11</f1>
<f2>22</f2>
<f3>33</f3>
</Row>
<Row>
<f1>AA</f1>
<f2>BB</f2>
<f3>CC</f3>
</Row>
</Record>
But I am getting 2 SEPARATE xml messages each with only one Row in it like the following
1st XML:
<Record>
<Row>
<f1>11</f1>
<f2>22</f2>
<f3>33</f3>
</Row>
</Record>
2nd XML:
<Record>
<Row>
<f1>AA</f1>
<f2>BB</f2>
<f3>CC</f3>
</Row>
</Record>
I would like to have one xml message with all rows in it.It seems the MessageTransformBean is not recognizing the end of line in the flat file.Do i need to use endSeparator explicitly.
I followed the "How to use Content Conversion in JMS Adapter " and configured the adapter,still no luck..
Any Help greatly Appreciated
Thanks,
CHi Chirag,
The parameter name sequence changes alphabetically by itself when I save and activate it eventhough I enter as it is in the document.How to stop changing this sequence or put it the order as required in the Module Processor.
Currently my sequence is
Transform.Class
Transform.ContentType
xml.conversionType
xml.documentName
xml.documentNamespace
xml.fieldFixedLengths
xml.fieldNames
xml.processFieldNames
xml.structureTitle
Let me know how to change the sequence ,if that is the issue.
Thanks,
C -
PI 7.31 SP14: use of MessageTransformBean Complex conversion w/o KEY values
In a mail sender channel I need to pick up a csv file with 2 (different) header lines and a number of data lines. the structure is like this:
header1
header2
line
line
line
There are no Key values in the file that I can use and no fixed lengths either.
How do I convert this csv file to an xml file in PI? I imagine using the MessageTransformBean in the mail sender channel but I face trouble because of the lack of Key values I can use.
I tried the following but it is screaming for KeyValues and similar stuff.can you also post 28,000 more lines? I'm sure this will be helpful....
-
Mail adapter and MessageTransformBean module configuration issue
Hi All,
I am trying to use module configuration in Receiver Mail adapter. Below is my configuration. (We are using SAP PI 7.11)
Parameter/General tab:
Message Protocol : XIPAYLOAD
Use Mail package option is selected.
Content Encoding = none
Module tab:
Processing Sequnce:
AF_Modules/MessageTransformBean : XSLT
sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean : mail
Module Configuration:
XSLT Transform.Class com.sap.aii.af.sdk.xi.adapter.XSLTConversion
XSLT Conversion.XSLTFileName /tmp/GL_POST_RESPONSE_EMAIL.xsl
XSL works outside of PI . However, when i test with a message, I am seeing following errors in Runtime workbench:
Please let me know what could be wrong in the above configuration
23.03.2011 15:24:39 Information MP: processing local module localejbs/AF_Modules/MessageTransformBean
23.03.2011 15:24:39 Information Transform: using Transform.Class: com.sap.aii.af.sdk.xi.adapter.XSLTConversion
23.03.2011 15:24:39 Error Transform: Transformer Conversion1.0.0610 Error initializing XSLT Mode:; caused by javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
23.03.2011 15:24:39 Information Transform: transforming the payload ...
23.03.2011 15:24:39 Error Transform: failed to execute the transformation: com.sap.aii.af.sdk.xi.adapter.trans.TransformException: Error converting Message; nested exception caused by: java.lang.NullPointerException: while trying to invoke the method javax.xml.transform.Templates.newTransformer() of an object loaded from local variable templates
23.03.2011 15:24:39 Error MP: exception caught with cause com.sap.aii.af.sdk.xi.adapter.trans.TransformException: Error converting Message; nested exception caused by: java.lang.NullPointerException: while trying to invoke the method javax.xml.transform.Templates.newTransformer() of an object loaded from local variable 'templates'
23.03.2011 15:24:39 Error Adapter Framework caught exception: Error converting Message
23.03.2011 15:24:39 Error Delivering the message to the application using connection Mail_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.af.sdk.xi.adapter.trans.TransformException: Error converting Message; nested exception caused by: java.lang.NullPointerException: while trying to invoke the method javax.xml.transform.Templates.newTransformer() of an object loaded from local variable 'templates'.Hi All,
Issue has been resolved. There was some minor issue in the XSL. The XSL Stylus studio was not reporting this as an error. However PI's XSL engine was reporting that error. This error message was not showing up in runtime workbench. However, when i looked at the default trace, there were few more errors. After fixing the XSL, I am able to received the email
Thanks
-Pradeep -
Content Conversion module in JMS Adapter - MessageTransformBean
Hi All,
We are using Content Conversion module using MessageTransformBean in JMS adapter to read a flat file from MQ Queue.It works fine and the file is getting picked and successfully converted into a xml structure in XI.
The flat file is multiple line file with each line as one xml record.But the xml structure after conversion has only one record in it.So we end up getting multiple messages each with one record instead of ONE xml structure with multiple records in it.
Could I know why I am not getting multiple records in one xml structure as expected.
Do I need to change xml.structureTitle as MyTitle,* or should I put something endSeparator like we do in File Content Conversion.
Any Help appreciated.
Thanks,
V
Edited by: CollinsV on Aug 9, 2010 6:28 AM
Edited by: CollinsV on Aug 9, 2010 6:36 AM
Edited by: CollinsV on Aug 9, 2010 6:38 AM
Edited by: CollinsV on Aug 9, 2010 6:39 AM
Edited by: CollinsV on Aug 9, 2010 6:56 AMThanks Shabarish .I did follow the same document , but the xml is not converted as multiple records in it .we are getting only one xml message for each record in the file .
The xml structure we are getting :
<ns:MyDocument xmlns:ns="http://xi.com/test">
<MyTitle>
<field-name1>111</field-name1>
<field-name2>222</field-name2>
<field-name3>333</field-name3>
</MyTitle>
</ns:MyDocument>
We need onle one xml message instead as below.
<ns:MyDocument xmlns:ns="http://xi.com/test">
<MyTitle>
<field-name1>AAA</field-name1>
<field-name2>BBB</field-name2>
<field-name3>CCC</field-name3>
</MyTitle>
<MyTitle>
<field-name1>111</field-name1>
<field-name2>222</field-name2>
<field-name3>333</field-name3>
</MyTitle>
</ns:MyDocument>
Any Help ...
Thanks
V -
Content conversion Vs Module (MessageTransformBean) - help?
Hi All,
Scenario- File Sender, reading file (header,data,*,trailer)
when should we use standard content conversion, Module (MessageTransformBean) ?
I need to generate complex XML structure from flat-file records.
Source (using some key value to identify header/data/trailer)
header
data-record
data-record
trailer
Target (nested structe - not sure how to do nested part using content conversion)
<message_mt>
<record>
<header>
<key>
<info>
<key1/>
<key2/>
</info>
</header>
<partner>
<parvw/>
<par1/>
</partner>
<line-ite>
.. details ..
</line-item>
</record>
<message_mt>
I looked at all the logs related to this, how-to docs as well, no where mentioned how to create nested structures, most of them are flat structure
Can anyone advise me how to do this and when should i use content coversion, module and why?
Appreciate any help.
Thanks
Message was edited by: kumar p
Message was edited by: kumar pThe content conversion in file adapter and module 'MessageTransformBean' are similar. Therefore you use the module in file adapter only, when you want to write an adapter module which works on the plain text structure before the conversion. Mostly you use the 'MessageTransformBean' in other adapters like JMS- or Mail adapter, where no content conversion is possible by default.
The content conversion is not able to create a nested structure. You have to create a flat structure first, then create a nested structure with mapping.
Regards
Stefan -
"MessageTransformBean" usage problem
Hi Friends,
I had a requirement where i will be getting a zip file with .txt file in side it.I'm using PayloadzipBean to unzip at first this works fine but when i use "MessageTransformBean" after unzipping my file is not getting picked up? Question is any configuration should be done before usage of MessageTransformBean ? And if any config needed wat should be done and where?
Regards,
VKGHi,
please check these links and make sure the order of your modules is correct:
MessageTransformBean, Migrating Dispatcher Classes
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/57/0b2c4142aef623e10000000a155106/frameset.htm
Module Processor
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/cd/5af7c0c994e24fb0d0088443513de2/content.htm
Extending the Module Chain in the Module Processor
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/a4/f13341771b4c0de10000000a1550b0/content.htm
Edited by: Kai Lerch-Baier on Apr 7, 2009 8:54 AM
Edited by: Kai Lerch-Baier on Apr 7, 2009 8:56 AM -
Adapter modules: messageTransformBean : error in recordset validation
Hi all,
I am using adapter modules in PI. I have written my own module that checks for a valid key field name on each line of an incoming file, then the messageTransformBean module is called. I took this approach because 'standard' file content conversion ignores lines that don't begin with a valid key field name, and I need to be able to error in this situation.
My module is working just fine, but the messageTransformBean one is not. I'm using the 'structPlain2XML' conversion type, and have two line types (apart from the header and trailer) so the xml.recordsetStructure parameter is Header , 1 , Detail, * , MeterRegisterDetail , * , Trailer, 1 along with the appropriate key field definitions etc. The recordsetSequence is set to variable.
The problem is that files like this:
Header
Detail
MeterRegisterDetail
Detail
MeterRegisterDetail
Trailer
fail for some reason ! It seems to be the repeating Detail that is the problem. The error message in the audit log is:
'Error converting Message: 'java.lang.Exception: ERROR consistency check in recordset structure validation (line no. 4: missing structure(s) before type 'Detail''
A similar setup with say Header,1,Detail, *, Trailer,1 as the resordsetStructure is fine with repeating Details, and if I put in a Trailer record before the second Detail it goes in fine as well !
Any ideas ? I'm pulling my hair out with this one !
Cheers,
NickThanks for the reply, but that's only the case if you don't set a variable record set sequence. I've found the problem though - looking through some old XI documentation it seems the naming convention is not quite the same as standard content conversion, the parameter should be xml.recordsetStructure = var, not recordsetSequence = variable !!!
Anyway, fixed now, so I'm happy. Thanks again. -
Mail Adapter - PayloadSwapBean - MessageTransformBean - German umlauts
Hi there,
I'm receiving mails with an attachment (.csv / .txt) that I want to process to get IDocs. Everything works fine but the conversion of German umlauts. I tried to apply several charsets (i.e. iso-8859-1, iso-8859-2, utf-8) in the contentType parameter without success. The result in my payload after swapping and transforming is a message without umlauts. All these characters have been replaced by the same 'character' that looks like a quadrangle. Therefore even the earliest possible mapping comes too late to convert this character back into umlauts, because I don't know anymore the original ones.
When I process the same attachment with a <u>file</u> <u>adapter</u> in the same manner (until getting an IDoc) there are no problems with umlauts, the payload looks fine!
I even checked the note 881308 (although it's said to be for the mail receiver) but it's already in the system (XI 3.0, SP 14)
Anyone an idea to solve my problem?
Regards,
RalphHi Ralph,
now I got the solution:
Allpy the MessageTransformBean twice.
First you set the code page for the mail attachment, how it comes to the system.
Then you do the conversion and set the code page how the target xml should be.
Make two entries in Module configuration:
localejbs/AF_Modules/MessageTransformBean - contenttype
localejbs/AF_Modules/MessageTransformBean - tranform
as paramters you set:
contentType - Transform.ContentType - text/plain; charset=iso-8859-1
transform - Transform.ContentType - text/xml; charset=UTF-8
transform - Transform.Class - com.sap.aii.messaging.adapter.Conversion
and so on.
The problem is that outlook does not provide the content type for the attachment, so the MailTransformBean assumes UTF-8, but the attachment has iso-8859-1, so you have to set this before the conversion.
I have tested this with XI 3.0 SP17 with note 960501 included.
Regards
Stefan -
MessageTransformBean bean Question Receiver Mail Adapter
localejbs/AF_Modules/MessageTransformBean Local EnterpriseBean transform1
localejbs/AF_Modules/MessageTransformBean Local EnterpriseBean transform2
sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local EnterpriseBean mail
Module Config:
transform1 Transform.ContentDisposition attachment;filename="sample.csv"
transform1 Transform.ContentType text/plain; name="sample.csv"
transform2 Transform.ContentDescription file1
transform2 Transform.ContentDisposition inline
Email body is coming fine but the attachment Name not getting changed to "sample.csv"
What am I doing Wrong. Experts any advice please ?.Hi,
have a look into this thread where similar issue is discussed
Re: Mail adapter- Attachment file name of scheme ddmm
If the requirement is just to have the dynamic name for your email attachment, it can be done using mail package. check this wiki
http://wiki.sdn.sap.com/wiki/display/SI/DynamicEmailAttachmentnameforReceivedMails
we have to choose the options 'use mail package' and 'keep attachments' in the receiver email adapter.
regards,
francis -
Can we use MessageTransformBean in between XML -- XML scenario !!
Hi Claver Heads,
Small thing in XML to XML transformation. Can we use MessageTransformBean? The reason why I am asking, In my scenario, XML to ABAP proxy, messages are splitting (1:n) everything is working fine. But in splitting messages, first Messages is getting all nodes etc., from split second message on words, Couple of nodes are missing(not coming at all)?
Any solutions for this please?
Thanks
Regards
SanHi hetal,
Yeah you are 100% correct. This must be context issue. But I don't know how to fix this. The target message is quite big hierarchy, like ProductActivityNotification>ProductActivity>Item>SalesTimeSeries>Item>ValidPeriod>Startdate etc.,
Source XML is getting DTM segment, which is in Header -- comes one time, more than 100 line items to this message. This 100 line items has to go with this date into Startdate etc.,
At present I am getting only one time this into Startdate. Please any clue in this!!
Many Thanks in advance
Kind Regards
San -
JMS Content Conversion wtih MessageTransformBean
Hi
I'm doing a content conversion in a MQSeries Receiver Channel using the MessageTransformBean. The adpater logs say that the bean has been processed and that the message has been transformed successfully. However, when I look on the queue and in the adapter message content I still see the original xml message. Any one have an idea what the problem could be? We are on XI 7.0 SP11
Thanks
TimTim,
you can use MessageTransformBean module in file adapter.
Just add the module in the module tab.
Regards,
Henrique. -
XML to CSV using AF_Modules/MessageTransformBean in AF
hi All,
I am trying to convert an XML file to CSV using AF_Modules/MessageTransformBean module key XML2Plain in the Communication channel.
http://help.sap.com/saphelp_nw04/Helpdata/EN/24/4cad3baabd4737bab64d0201bc0c6c/content.htm
My Structure looks like
<resultset> -- 1
<row> -- 0 .. *
<line>ABC</line> -- 1
</row>
</resultset>
Length of line is not fixed.
XML2Plain Transform.Class com.sap.aii.messaging.adapter.Conversion
XML2Plain Transform.ContentType text/plain;charset=utf-8
XML2Plain xml.conversionType SimpleXML2Plain
XML2Plain xml.addHeaderLine 0
Now what should be value of endSeparator or field separator if length is not fixed?
If sample input is:
<resultset>
<row>
<line>ABC</line>
</row>
<row>
<line>sapnetweaver</line>
</row>
</resultset>
Output should be:
ABC
sapnetweaver
Please help!
Thanks,
MayankHi,
As mentioned output want is CSV then need to define the separator as comma...for field and end separator as newline..
thats it...
HTH
Rajesh
Maybe you are looking for
-
I have an iPAD2 and an iPAD mini and tried to upgrade to IOS 7.0.6 but both froze and I had to restore to factory setting (backup also did not work!). I was able to get most of my purchased books and apps from iTUNES (through my computer) but lost al
-
I cannot hear any sound on my laptop DV6 1030 us even though all my icons show that l should
So, today just cannot hear a sound on it, all the icons are just as previous, they show l should, but no! I put the headphones in the sockets, nothing, when l put them in the mic socket, there l can hear just the noise that i insert something there.
-
I have typos in my podcast description. Updating the RSS does not correct this. How can I get iTunes to re-read my RSS???
-
Essbase App disappering in Shared Services v 11.1.2.2
We are having an issue where Apps mysteriously disappear from Shared services - it has happened 3 times now. One day they are there and the next day they are not. I have tried to register them in EAS but I receive an error message: Error: 1051432: Fa
-
Where is the stamps folder on the mac for Acrobat Pro Xl?
About a month ago I downloaded dynamic stamps for received and paid and "installed" them on a team-mates mac running OS X. It was straight forward. I did some forum searches and it gave me instructions to copy the .PDF file with stamps containing ja