Content conversion_Sennder Jms Adapter
Hello,
I am doing a sender file content conversion in the JMS sender adapter using the MessageTransformBean.
My source file is :-
00 QY040 AM01- NBG IABENT21 A 6257069 21 00000020001 20070301200703030002167440 429900000002167440teealm tezste A:10245980-1; 1/1; I/EE-31; 91830; ALMSTETTER,HANS 000000000 10245980-1 ALMSTETTER,HANS91830
Can anyone help me with the sender content conversion here ?
Regards,
Anirban.
Hi,
Go through this doc: <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f02d12a7-0201-0010-5780-8bfc7d12f891">How to Use the Content Conversion Module in JMS Adapter</a>
Regards,
Jakub
Similar Messages
-
Content conversion JMS adapter
Hi
I have a flat file which is read by JMS adapter. I am using content conversion in the JMS adapter.
There are 10 fields in the flat file,i want to read only 3rd and 5th fields.Is this possible?Can i specify the start end position of a flat file field in the content conversion.
looking forward to your ideas.......
Thanks
kumarOH. Well that makes a difference then.
Are the records fixed-width, or delimited? If they are fixed width, just set the last attribute as "filler" and give it the combined length of all the fields that are after the nth one you want. If it's delmited... Let me test out what happens if there are more fields in the data than are set up... I think it might throw them away, but I have to check.
amy -
Content Conversion in JMS Adapter
Hi All,
I am having a scenario JMS - XI - JDBC.
Now I have to do the content conversion in the incming records.
The sample incoming data is as follows:-
<Field1>,<Field2>, ...,<Fieldn> -->Row1
{<Field1A>,<Field2A>, ...,<FieldnA>} -->Row2
{<Field1A>,<Field2A>, ...,<FieldnA>} -->Row3
<Field1B>,<Field2B>, ...,<FieldnB> -->Row4
{<Field1C>,<Field2C>, ...,<FieldnC>} -->Row5
{<Field1C>,<Field2C>, ...,<FieldnC>} -->Row6
{<Field1C>,<Field2C>, ...,<FieldnC>} -->Row7
Now at the target, we have 3 oracle tables, in which the data from the Row1 &4 will go to Table 1, Row2&3 --> Table2 and Row5,6 &7 --> Table3.
The source data type that i m using is of the structure:-
<TC>
<GT>
<Field1>
<GS>
<Field1A>
</GS>
<Field1B>
<Field2B>
<GDS>
<Field1C>
</GDS>
</GT>
</TC>
Please help me out in the modules configuraton, how this can be handled.
Thanks in advance, hope to receive some solution at the earliest.
Rocky.Hi Rocky,
Please have a look at these threads..
JMS Adapter: Content Conversion
JMS Adapter Content Conversion
JMS Content Converrsion
Hope these help you!
cheers,
Prashanth -
Content conversion in Sender JMS adapter-document
Hi,
I am tring to read fixed length flat file from MQ-series Queue using JMS adapter.
I want to use content converstion to convert the flat file to XML.
I am not able to open the PDF link provided in SDN.
if anyone has a copy of the pdf document on JMS content conversion, could you please enmil it to me
at [email protected]
Edited by: ashok sri on May 27, 2008 5:25 PMplease go through the document
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/50061bd9-e56e-2910-3495-c5faa652b710 -
Content conversion in Sender JMS Adapter
Hi,
Scenario is file to IDoc
My source file is ' ; ' separated file coming from MQ via JMS adapter. now I need to convert this to XI.
Source DT looks like
Root
HEADER (Occurance 1)
Field 1
ISOCURCD
TRANKODE
IDENTIFIER
DATO
TIME
DETAIL(Occurance 1 to unbounded)
ISOCURCD
TRANKODE
EFFDATE
COMMDATE
DKKVAL1
USDVAL1
TRAILER(Occurance 1)
ISOCURCD
TRANKODE
TRANCOUNT
According to How to use content conversion in JMS guide from SDN i have configured the content conversion parameters in the module of JMS sender adapter.
In the processing sequence given the module name as localejbs/AF_Modules/MessageTransformBean and module Key as Plain2XML.
And in module configuration
Parameter Name Parameter Value
Transform.Class com.sap.aii.messaging.adapter.Conversion
Transform.ContentType text/xml;charset=utf-8
xml.keyFieldName TRANKODE
xml.keyFieldType CaseSensitiveString
xml.recordsetName Root
xml.documentName MT_ROOT
xml.documentNamespace http://XXX.XXX.XX/xi/XXXXX
xml.processFieldNames fromConfiguration
xml.conversionType StructPlain2XML
xml.recordsetStructure HEADER,1,DETAIL,*,TRAILER,1
xml.HEADER.fieldNames Field1,ISOCURCD,TRANKODE,IDENTIFIER,DATO,TIME
xml.HEADER.fieldSeparator ";"
xml.HEADER.keyFieldValue H
xml.fieldSeparator ";"(if i don't use this then the file is not being picked and getting an error in the CC monitoring of RWB saying xml.field separator missing.)
Similarily for Detail and Trailer records as well.
But when I run the scenario, the file is being picked up but I am not getting any payload into the inbound message.
Can you please help me where I have configured wrongly. And one more thing will this configuration help for ; separated file .
Thanks & Regards,
Kumar
Edited by: Kumar on Dec 19, 2007 11:11 AM
Edited by: Kumar on Dec 19, 2007 11:15 AMHI,
Have you gone through the below pdf i think it will help to find ur mistake.
How to use conversion modules in JMS - https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f02d12a7-0201-0010-5780-8bfc7d12f891
Thnx
Chiarg -
JMS Adapter module content conversion
Hi,
I'm developing a module for the jms adapter(sender). My requirement is to parse the XI message(text) using some XML parsing api and do some formatting, logic etc and to make the jms adapter create a xml file with the processed information. Jms File Content Conversion does not suit our requirement and thats the reason we are trying this option.
My understanding is: Access the payload in the "process" method of the local ejb, apply XML parsing using JDOM etc, make a xml which should be the output of the jms adapter. This xml will be the xml with my user defined tag elements after content conversion. Can i form this xml and assign to the inputModuleData? Will the jms adapter use this string to create the xml and send to IS? Are there any other parameters to be set or processes to be done?
Also in which sequence should I put my adapter module in communication channel.
================================================
My code snippet:
public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData)
throws ModuleException
Object obj = null; // Handler to get Principle data
Message msg = null; // Handler to get Message object
try
obj = inputModuleData.getPrincipalData();
msg = (Message)obj;
AuditMessageKey amk = new AuditMessageKey(msg.getMessageId(),AuditDirection.INBOUND);
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"sample: Inside sample Module---efore reading payload");
try
XMLPayload xmlpayload = msg.getDocument();
String messageStr = xmlpayload.getText();
String inputStr = null;
String tags[] = new String[2];
String values[] = new String[2];
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"sample: Inside sample Module---before content conversion");
String tagvalue1 = messageStr.substring(messageStr.indexOf("BEGIN+"), messageStr.indexOf("'");
String tagvalue2 = messageStr.substring(messageStr.indexOf("'"), messageStr.lastindexOf("ENDING");
tags[0] = "tag1";
tags[1] = "tag2";
values[0] = tagvalue1 ;
values[1] = tagvalue2 ;
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"sample: Inside sample Module---after content conversion");
Document xmldoc = null;
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
DOMImplementation impl = builder.getDOMImplementation();
org.w3c.dom.Element e = null;
Node n = null;
xmldoc = impl.createDocument(null, "MT940", null);
org.w3c.dom.Element root = xmldoc.getDocumentElement();
for(int i = 0; i < tags.length; i++)
e = xmldoc.createElementNS(null, tags<i>);
n = xmldoc.createTextNode(values<i>);
e.appendChild(n);
root.appendChild(e);
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"sample: Inside sample Module---before dom creation");
DOMSource domSource = new DOMSource(xmldoc);
ByteArrayOutputStream myBytes = new ByteArrayOutputStream();
Result dest = new StreamResult(myBytes);
TransformerFactory tf = TransformerFactory.newInstance();
Transformer serializer = tf.newTransformer();
serializer.setOutputProperty("indent", "yes");
serializer.transform(domSource, dest);
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"sample: Inside sample Module---before setting principal data");
byte[] docContent = myBytes.toByteArray();
if (docContent != null) {
xmlpayload.setContent(docContent);
inputModuleData.setPrincipalData(msg);
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"sample: Inside sample Module---after setting principal data");
catch(ArrayIndexOutOfBoundsException e)
e.printStackTrace();
catch(StringIndexOutOfBoundsException e)
e.printStackTrace();
catch(TransformerException e)
e.printStackTrace();
catch(Exception e)
e.printStackTrace();
catch(Exception e)
ModuleException me = new ModuleException(e);
throw me;
return inputModuleData;This is for sender channel. The doubt in adapter module is in the process block how will I get the main data being read by the jms adapter from the text file.As I am reading text file from websphere MQ, the content of the text file can be obtained thru xmlpayload.getText() or is there any other way.
obj = inputModuleData.getPrincipalData();
msg = (Message)obj;
XMLPayload xmlpayload = msg.getDocument();
String messageStr = xmlpayload.getText();
At present I am using my adapter module before call sap adapter, but before sap adapter there are two other modules(toBinary and to Xmb), so shld I place it before both or after both the modules.
Thanx in advance
Rachit -
Content conversion question for JMS adapter
Hi,
I need to put this again here.
I have the scenario R/3 IDoc -> XI -> MQ (webshpere). MQ requires plain text.
I have the IDoc ORDERS05 in multi level (nested in layers). But using the how to guid to convert the content I could go up to on level.
Based on the thread
Process Integration (PI) & SOA Middleware
It is not possible to use the conversion modules with XML2Plain key with parameter xml.conversionType value StructXML2Plain.
Please confirm if this is possible to convert a structure like below,
<ZSYSEX01>
.<IDOC BEGIN="1">
....<EDI_DC40 SEGMENT="SEGMENT0">
........<FIELD1>HEADER</FIELD1>
....</EDI_DC40>
....<E1STATS SEGMENT="SEGMENT1">
........<FIELD2>100</MANDT>
........<Z1HDSTAT SEGMENT="SEGMENT2">
...........<FIELD3>0200000716</FIELD3>
...........<Z1ITSTAT SEGMENT="SEGMENT3">
...............<FIELD4>1000</FIELD4>
...........</Z1ITSTAT>
........</Z1HDSTAT>
........<Z1HDSTAT SEGMENT="SEGMENT2">
...........<FIELD3>0200000717</FIELD3>
...........<Z1ITSTAT SEGMENT="SEGMENT3">
...............<FIELD4>1000</FIELD4>
...........</Z1ITSTAT>
...........<Z1ITSTAT SEGMENT="SEGMENT3">
...............<FIELD4>1001</FIELD4>
...........</Z1ITSTAT>
...........<Z1ITSTAT SEGMENT="SEGMENT3">
...............<FIELD4>1002</FIELD4>
...........</Z1ITSTAT>
........</Z1HDSTAT>
....</E1STATS>
.</IDOC>
</ZSYSEX01>
to plain text in JMS adapter.
Thanks!
JasonHi,
You have to use Content Converiosn in JMS Adapter Receiver side,
Module Sequence in the Receiver Channel
No. Module Name Module Key
1 localejbs/AF_Modules/MessageTransformBean XML2Plain
2 localejbs/SAP XI JMS Adapter/ConvertMessageToBinary CallJMSService
3 localejbs/SAP XI JMS Adapter/SendBinarytoXIJMSService Exit
Bases on Structure you have to configure the processing parameters,
please see the below link, it will helps you more
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f02d12a7-0201-0010-5780-8bfc7d12f891
Regrads
Chilla.. -
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 -
Complex XML to Plain in JMS adapter "Content conversion module"
Hi!
I have read the document on "How To use the content conversion module with XI3.0 J2EE JMS Adapter", and it says only SimpleXML can be converted in the receiver channel.
I had hoped for a solution at least as good as in the File/ftp adapter, where complex XML can be transformed to files.
Are there plans to include complex XML conversion in the JMS adapter?
I can not use the file adapter as I need to change the file name and destination, and that can not be done by adding own module to its single module.
Any idea how I can achieve what I want?
To only way I can find, is to create a file using the file/ftp adapter, and then pick it up again and treat all the lines as the same structure (one row = one xml field). Then output this new xml message to file, using the JMS adapter and add any modules with name and destination determination.
Appreciate any help!
Regards,
Oeystein EmhjellenHello,
Have you tried to use an XSLT mapping within the IE?
I have, at one customer site, created a XSLT message mapping which converts the XML to a fixed length ASCII file format. I than added the XSLT message mapping as a second mapping step on the interface mapping.
In this case I was able to publish a fairly complex fixed length file format to MQ Series via the JMS adapter.
/Johan -
JMS Adapter Content Conversion
Hi,
I am looking for some help on JMS Receiver content conversion, to put a delimited file on MQ series queue.
I tried the below link, but not able to access the document.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/3.0/how to use the content conversion module with the xi 3 j2ee jms adapter
If anyone has a copy of the pdf document on JMS content conversion, could you please email it to me at my id : [email protected]
Rgds
R ChandrasekharI had send the required PDF
Regards
Arpit seth -
Receiver JMS Adapter Content Conversion issue
Scenario :
R/3 -->XI -->MQ(XML2Plain)
Hi
We are using Receiver JMS Adapter to send the Message from XI to MQ.
The XML has to be converted to plain file. And Content conversion is
being done.
With the new development, the message type defined consist of 8 fields
with fixed length. The XML message goes successfully from XI to MQ
without any content conversion. But once simple content conversion is
being done for Receiver JMS adapter, even though the message is
received but its empty (without any data records). The adapter
monitoring everything seems fine and it gives the status that message
converted to binary and the message is delivered to MQ. Though on
checking the messages there is no data records.
Below is my content conversion configuration done in Module tab. Kindly
revert back what can be the problem as have done exactly the same way
as described in Content Conversion How to Guide for receiver JMS.
localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean XML2Plain
localejbs/SAP XI JMS Adapter/ConvertMessageToBinary Local Enterprise Bean convert_XI2Bin
localejbs/SAP XI JMS Adapter/SendBinarytoXIJMSService Local Enterprise Bean exit
XML2Plain Transform.Class com.sap.aii.messaging.adapter.Conversion
XML2Plain TransformContentType text/plain;charset=utf-8
XML2Plain xml.addHeaderLine 0
XML2Plain xml.addHeaderLine SimpleXML2Plain
XML2Plain xml.fieldFixedLengths 8,10,10,20,40,40,8,8
XML2Plain xml.fixedLengthTooShortHandling Cut
regards.
santosh.Hi,
check localejbs/SAP XI JMS Adapter/ConvertMessageToBinary Local Enterprise Bean convert_XI2Bin
this is not CallJMSService.
And also check the receiver Structure, if it is falt structure its ok, else
see the below link if it has the complex structure , how to handle..
See the below links
/people/alessandro.guarneri/blog/2006/01/04/jms-sender-adapter-handling-too-short-lines
/people/william.li/blog/2006/11/13/how-to-use-saps-webas-j2ees-jms-queue-in-exchange-infrastructure
content conversion
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f02d12a7-0201-0010-5780-8bfc7d12f891
Regards
Chilla.. -
JMS Adapter Content conversion using Webspear MQ
Hi All,
I have a scenario where I have to pick a flat file from WebSpear JMS Q.In turn I should convert flat structure into xml structure to parse to the RFC structure(YOTCS_I090_INV_S) and map to the traget structure.
Below is the Source structure:
Messages
->Message1
-->YOTCI_I090_INV_SYNC
--->YOTCS_I090_INV_SYNC
>item
>ZDATE
>TIME
>TZONE
>WERKS
>MATNR
>LGORT
>CHARG
>SOBKZ
>INSMK
>LIFNR
>ZMENGE
>ZMEINS
>LOT_NUMBER
>CODE_DATE
Source file look's as below:
YOTCS_I090_INV_S 4928
YOTCS_I090_INV_S 3
YOTCS_I090_INV_S 3
YOTCS_I090_INV_S 1
I am doing the file contact conversion as below in JMS Adapter:
Module Key ParameterName ParameterValue
Plain2XML Transform.Class com.sap.aii.messaging.adapter.Conversion
Plain2XML Transform.ContentType text/xml;charset=utf-8
Plain2XML xml.conversionType StructPlain2XML
Plain2XML xml.documentName YOTCI_I090_INV_SYNC
Plain2XML xml.documentNamespace urn:sap-com:document:sap:rfc:functions
Plain2XML xml.item.fieldFixedLengths 8,8,6,4,18,4,10,1,1,10,13,3,10,8
Plain2XML xml.item.fieldNames ZDATE,TIME,TZONE,WERKS,MATNR,LGORT,CHARG,SOBKZ,INSMK,LIFNR,ZMENGE,ZMEINS,LOT_NUMBER,CODE_DATE
Plain2XML xml.processFieldNames fromConfiguration
Plain2XML xml.recordsetStructure item,*
Can any one help me in configuring the Content conversion? Hope you got my issue.
Thanks in Advance.
Best Regards,
JoseJoseph,
Go thru the Below Link
http://help.sap.com/saphelp_nw04/helpdata/en/24/4cad3baabd4737bab64d0201bc0c6c/content.htm
Cheers
Agasthuri Doss -
I need this file "How to Use the Content Conversion Module in JMS Adapter"
Can someone send me this file:
"How to Use the Content Conversion Module in JMS Adapter"
I am not able to find it.
Thanks
Antonellopls refer guide
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-adapters/how%20to%20use%20the%20content%20conversion%20module%20with%20xi%203.0%20j2ee%20jms%20adapter.pdf
Regards,
Swetha. -
Receiver JMS adapter content conversion
Hi All,
Can anyone provide me guidelines on how to do content conversion for the receiver JMS adapter??
Thx
NavinHi,
Based on your structure , you need to configure the JMS CC parameters.
see the below link
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f02d12a7-0201-0010-5780-8bfc7d12f891
regards
Chilla -
File Content Conversion in JMS Adapter
Hello,
I am trying to use module parameters to convert File to XML in Sender JMS adapter. I have followed the instructions in the SAP document (3.1 Example of a Simple Conversion in a Sender Communication Channel)
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/50061bd9-e56e-2910-3495-c5faa652b710
The problem I am facing is instead of creating one xml message for all the lines in the file; it is creating one message per line. Not sure what I need to do get all the lines in to one xml message.
Please let me know if any of you have faced similar issue.
Thanks
AVThe Parameter xml.recordsetsPerMessage can only be used if it is a complex structure. I mean it needs a recordSet with Keys..etc and What I am trying to do is a simple FCC using
Transform.Class=com.sap.aii.messaging.adapter.Conversion
Transform.ContentType=text/xml;charset=utf-8
xml.conversionType=SimplePlain2XML
xml.documentName=PurchaseOrder_Root
xml.documentNamespace=http://namespace
xml.fieldFixedLengths =2,10,10,3,..
xml.fieldNames = DATA1,DATA2,DATA3....
xml.processFieldNames=fromConfiguration
xml.structureTitle=PurchaseOrder
<b>I am expecting</b>
<PurchaseOrder_Root>
<PurchaseOrder>
<DATA1> </DATA1>
<DATA2> </DATA2>
</PurchaseOrder>
<PurchaseOrder>
<DATA1> </DATA1>
<DATA2> </DATA2>
</PurchaseOrder>
</PurchaseOrder_Root>
<b>When I use the above Module Config it is giving me </b>
</PurchaseOrder_Root>
<PurchaseOrder>
<DATA1> </DATA1>
<DATA2> </DATA2>
</PurchaseOrder>
</PurchaseOrder_Root>
</PurchaseOrder_Root>
<PurchaseOrder>
<DATA1> </DATA1>
<DATA2> </DATA2>
</PurchaseOrder>
</PurchaseOrder_Root>
Maybe you are looking for
-
How to set up 2 separate Exchange accounts
Set up the principal account (I used the one with my main calendar) using the straightforward Exchange account. For the secondary Exchange acct, set up an IMAP account. Basically go to add an acct, choose the bottom generic acct option and set up an
-
i am a new mac user and tried to update my firefox but now i have multiple foxes and a half fox fix something? how do i get it all together in one and be sure i have current version on only?
-
Server Admin keeps dispaying error "The service has encountered an error."
All the services in the Server Admin function are continuously displaying the following error message: The service has encountered an error. Try to refresh the view (servername.local/servicename). (kNetworkError) I press OK and the message disappears
-
Anybody been able to find the correct settings for using a Samsung widescreen TV as an external monitor? Every combination seems to result in a stretched image on the TV. I seem to remember that this was negotiated automatically in the past but no lo
-
i have iMac with Tiger(upgraded to 10.4.11). i want to start development on iPhone.but when i am installing the iPhone SDK(http://developer.apple.com/iphone/program) it says "Mac OS X 10.5 was not found.".Can anyone tell me how can i upgrade my iMac