on 06-04-2012 11:09 AM
Hi,
I'm just a beginner in PI. And I really need help from the experts with my problem.
Scenario:
An RFC will send data to PI and will be send to 3rd party program.
What i did was:
1. Create Data type to handle mapping from RFC (DTObj1)
2. Create Data type to handle first convert fields from DTObj1 to a field in DTObj2 to an XML format. the 3rd party required this format:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:MT_ExecuteProcess xmlns:ns1="http://abc.com/poc">
<name1>/SAPTest/LoopBack</name1>
<action1>Start</action1>
<auth>
<user1>xxx</user1>
<password1>xxx</password1>
</auth>
<params>
<param1 name1="Message"><![CDATA[<Message>
<MessageHeader Originator="SAPPrototype" OriginatorRef="12345678" OriginatorVer="1" Consumer="SAPPrototype" ConsumerRef="12345678" Provider="TfSPrototype" ProviderRef="A123456" Notify="0" MsgType="ACK" />
<AckDetail Qualifier="000">
<Fields>
<Field Name="T_MESSAGE_TIME " ValueType="8" Id="58">
<Value>300412154607</Value>
</Field>
</Fields>
</AckDetail>
</Message>]]></param1>
</params>
<options/>
</ns1:MT_ExecuteProcess>
Fields in Blue are fields in my DTObj1. Fields in RED are fields i have in my DTObj2. I need to transform fields from DTObj1 to name1 in XML format before i can send. Can any body help me with this? it will be a big help.
Thanks!
Jun
Hi to All,
Here's the details of my requirement.
an RFC (Solution Manager) will send an alert (in fields format as design in PI using data type). and the i need to add additional step before i can send to another 3rd party destination, and the step is to join all the fields and come up with a field tag in CDATA format... sample XML below:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:MT_ExecuteProcess xmlns:ns1="http://abc.com/poc">
<name1>/SAPTest/LoopBack</name1>
<action1>Start</action1>
<auth>
<user1>xxx</user1>
<password1>xxx</password1>
</auth>
<params>
<param1 name1="Message"><![CDATA[<Message>
<MessageHeader Originator="SAPPrototype" OriginatorRef="12345678" OriginatorVer="1" Consumer="SAPPrototype" ConsumerRef="12345678" Provider="TfSPrototype" ProviderRef="A123456" Notify="0" MsgType="ACK" />
<AckDetail Qualifier="000">
<Fields>
<Field Name="T_MESSAGE_TIME " ValueType="8" Id="58">
<Value>300412154607</Value>
</Field>
</Fields>
</AckDetail>
</Message>]]></param1>
</params>
<options/>
</ns1:MT_ExecuteProcess>
items in blue are fields from one of the data type i have in PI (7.1). I need help how to transform fields to this CDATA format.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
This will help u..plz have a look:
Thanks
Amit Srivastava
Hi Anupam,
yeah i guess i have no choice but to go with java mapping direction. now if i go java mapping, i need the following info:
1. i am using 7.1 PI, do i need java api or jar file? if yes where can i download the file?
2. is it possible (if not much ) to ask for sample java code i can use as reference to do the java mapping?
3. sample procedure (simple) on how to do the mapping when java code is imported to PI?
thanks a lot
Hi Jun,
There are lot of blogs in java mapping which you can search in SCN. Now here I am answering your questions
1.
. i am using 7.1 PI, do i need java api or jar file? if yes where can i download the file?
ans) The jar file is present in your PI server . the name of the jar file is com.sap.xpi.ib.mapping.lib.jar.
The directory is shown in this article http://wiki.sdn.sap.com/wiki/display/XI/Where+to+get+the+libraries+for+XI+development
2.) to provide the sample java code forum would require exact input xml to the mapping . From yours posts can I assume
input to mapping is
<?xml version="1.0" encoding="UTF-8"?>
<ns1:MT_ExecuteProcess xmlns:ns1="http://abc.com/poc">
<name1>/SAPTest/LoopBack</name1>
<action1>Start</action1>
<auth>
<user1>xxx</user1>
<password1>xxx</password1>
</auth>
<params>
<param1 name1="Message"><![CDATA[<Message>
<MessageHeader Originator="SAPPrototype" OriginatorRef="12345678" OriginatorVer="1" Consumer="SAPPrototype" ConsumerRef="12345678" Provider="TfSPrototype" ProviderRef="A123456" Notify="0" MsgType="ACK" />
<AckDetail Qualifier="000">
<Fields>
<Field Name="T_MESSAGE_TIME " ValueType="8" Id="58">
<Value>300412154607</Value>
</Field>
</Fields>
</AckDetail>
</Message>]]></param1>
</params>
<options/>
</ns1:MT_ExecuteProcess>
The output is an xml
<Message>
<MessageHeader Originator="SAPPrototype" OriginatorRef="12345678" OriginatorVer="1" Consumer="SAPPrototype" ConsumerRef="12345678" Provider="TfSPrototype" ProviderRef="A123456" Notify="0" MsgType="ACK" />
<AckDetail Qualifier="000">
<Fields>
<Field Name="T_MESSAGE_TIME " ValueType="8" Id="58">
<Value>300412154607</Value>
</Field>
</Fields>
</AckDetail>
</Message>
I hope you want to send this output to target.
So you need to confirm this.
3.) You have to first import the code under operation mapping. Uisng test tab test it with input xml to check whether you are getting correct output. Exact steps for importing java mapping code is shown here http://wiki.sdn.sap.com/wiki/x/BQj2D for PI 7.0, steps are same for PI 7.1 also.
Regards
Anupam
Hi Anupam,
question.. I was able to parse a CDATA (from RFC) using my own UDF... upon testing it on the PI-ESR and PI-ID i was able to parse the correct value. but when i generated the ABAP proxy for the inbound, now i'm getting an error.
<SAP:Code area="ABAP">DYNAMIC_CALL_ILLEGAL_METHOD</SAP:Code>
is this means i need to activate something on the PI? note i just use a simple java code in UDF...hope you ca help me on this..
thanks!
Yes doing UDF for this case is not so easy task. Please go ahead with java or xslt mapping. I would recommend to use java mapping. If you need to know more about java mapping, Please go through these links to understand how to be handled. Plus also provide us more details.
http://help.sap.com/javadocs/pi/pi711/index.html
http://wiki.sdn.sap.com/wiki/display/XI/Using+PI+7.1+API+for+Java+mapping
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jun,
To create a CDATA, check daniel graversen's blog http://scn.sap.com/people/daniel.graversen/blog/2011/09/22/create-cdata-elements-with-xsl-in-sap-pi
(Also, don't forget to "like" or rate (or both) the blog in case you find it useful.)
To extract CDATA:
http://stackoverflow.com/questions/3708055/extract-cdata-using-xslt
Regards.
Hi Jun,
The XML you posted is the input xml i guess. We need exact input XML and the exact output you need. I beleive you need a java or XSLT mapping to resolve this issue.
regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jun,
Java mapping has capabilies to extract data from CDATA section and convert it into XML.
You need to provide following things for java mapping
1. version of PI you are working in.
2. Complete XML input to the mapping.
3. Exact output XML you need to send.
XML format you have to provide PI cannot create its own format.
Regards
Anupam
Hi Jun,
I think writing a simple User-Defined Function that will get the required values from param1 CDATA section is the simplest solution to your problem. Then you just map:
param1 -> UDF -> target
Regards,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use file adapter that can convert data in XML format. or use Soap Adapter it will also convert data into xml format
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
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.