cancel
Showing results for 
Search instead for 
Did you mean: 

Help regarding PI Message mapping

Former Member
0 Kudos

Hello Everyone,

Please guide me about following message mapping :

Source msg format :

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:wbsedcl.test.employeeCountTestSource" targetNamespace="urn:wbsedcl.test.employeeCountTestSource">

<xsd:element name="MT_Emp_Count_OB" type="DT_Emp_Count_OB" />

<xsd:complexType name="DT_Emp_Count_OB">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

22fd3a60cbdd11e5bca6001517f85c58

</xsd:appinfo>

</xsd:annotation>

<xsd:sequence>

<xsd:element name="Data1">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

ee3d29d0cb3111e5c6604437e6708e76

</xsd:appinfo>

</xsd:annotation>

<xsd:complexType>

<xsd:sequence>

<xsd:element name="Name1" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

ee3d29d1cb3111e589004437e6708e76

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="Address1" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

ee3d29d2cb3111e5a9fa4437e6708e76

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="Emp_Id1" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

ee3d29d3cb3111e593454437e6708e76

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="Emp_join_date1" type="xsd:date">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

ee3d29d4cb3111e583184437e6708e76

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

<xsd:element name="Data2">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

ee3d29d5cb3111e581d04437e6708e76

</xsd:appinfo>

</xsd:annotation>

<xsd:complexType>

<xsd:sequence>

<xsd:element name="Name2" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

ee3d29d6cb3111e5c44b4437e6708e76

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="Address2" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

ee3d29d7cb3111e59cf44437e6708e76

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="Emp_Id2" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

ee3d29d8cb3111e584c04437e6708e76

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="Emp_join_date2" type="xsd:date">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

ee3d29d9cb3111e598064437e6708e76

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

<xsd:element name="Data3">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

ee3d29dacb3111e58adf4437e6708e76

</xsd:appinfo>

</xsd:annotation>

<xsd:complexType>

<xsd:sequence>

<xsd:element name="Name3" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

ee3d29dbcb3111e586544437e6708e76

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="Address3" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

ee3d29dccb3111e580184437e6708e76

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="Emp_Id3" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

ee3d29ddcb3111e5c8094437e6708e76

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="Emp_join_date3" type="xsd:date">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

ee3d29decb3111e5bf2a4437e6708e76

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

Destination msg format :

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:wbsedcl.test.employeeCountTestDest" targetNamespace="urn:wbsedcl.test.employeeCountTestDest">

<xsd:element name="MT_Emp_Count_IB" type="DT_Emp_Count_IB" />

<xsd:complexType name="DT_Emp_Count_IB">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

230306c0cbdd11e5b876001517f85c58

</xsd:appinfo>

</xsd:annotation>

<xsd:sequence>

<xsd:element name="Name" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

cd127390cb3211e5c4404437e6708e76

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="Address" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

cd127391cb3211e5c3634437e6708e76

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="Emp_Id" type="xsd:string">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

cd129aa0cb3211e5bdca4437e6708e76

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="Emp_joining_date" type="xsd:date">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

cd129aa1cb3211e5b02b4437e6708e76

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

<xsd:element name="Count" type="xsd:integer">

<xsd:annotation>

<xsd:appinfo source="http://sap.com/xi/TextID">

cd129aa2cb3211e5a27c4437e6708e76

</xsd:appinfo>

</xsd:annotation>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

mapping logic :

1. At least two occurrences of same characters among  emp id1, emp id 2 and emp id 3 fields in source message, then populate name (concat), address(concat) and empid (concat), joining_date(whose joining date is earlier), count (occurrence count of common character) in target message.

2. If only one of set of data found in source message, name and address won't be populated but this single set data will be populated for other fields in target message.

regards,

Murari

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member213558
Active Participant
0 Kudos

HI.

please change the MT_Emp_Count_IB occurrence as 0 to outbound. and make a duplicate sub-tree.

place condition in MT_Emp_Count_IB accordingly.

Regards

ramesh

former_member186851
Active Contributor
0 Kudos

Murari,

So examples will be

1.If 3 names are present(X,Y and X)

Then XYZ.The same rule for addess and other fields?

2.No need to populate name.is this correct?

Former Member
0 Kudos

Hi Raghuraman,

Examples like below :

If

Source :

------------

<Data1><Murari><Kolkata><AB><15/07/2010></Data1>

<Data2><Suman><Mumbai><BC><11/07/2012></Data2>

<Data3><Raghu><Bangalore><BD><13/07/2013></Data3>


then destination :

------------------------

<MurariSumanRaghu><KolkataMumbaiBangalore><ABBCBD><15/07/2010><3>

 


here B is occurring common in three times, so count populated as 3


If

Source :

------------

<Data1><Murari><Kolkata><AB><15/07/2010></Data1>

<Data2></Data2>

<Data3></Data3>


then destination :

------------------------

<AB><15/07/2010><1>


Please advise.


Regards,

Murari

former_member186851
Active Contributor
0 Kudos

Hello Murari,

Try like below name and address fields

for Date you wish to have the recent or old date?

Former Member
0 Kudos

Hello Raghu,

Couldn't get the reply/Coudn't relate the reply with example given.

First I need to count of occurrence of same character in emp ID field, based on which target message population will be decided.

Kindly advise in this regard.

Regards,

Murari

former_member186851
Active Contributor
0 Kudos

Murari,

All the values come in same node and you wish to split?

Former Member
0 Kudos

Hello Raghu,

Source message multiple data nodes are there but in target message single nodes are there.

Plz revert.

My Cell No : 9830336797

Regards,

Murari

Former Member
0 Kudos

Hello Raghu,

Kindly update. I am getting stuck on the above mapping.

regards,

Murari

former_member186851
Active Contributor
0 Kudos

Hello Murari,

Please cleary my query.

Former Member
0 Kudos

Hello Raghu,

I have a source message with data1, data2 and data3 element and each element having subelement of name,address,emp id and joining date.

The destination message structure is main element name, address, emp id, joining date and count.

The basic logic of mapping is the occurrence of same character in emp id. If same character occurs twice or more among the source data elements then destination message will be populated like concat of name in name field, concat of address in address field, joining date will be the first joining date among three, count is no of occurrence.

If only one data elements are present, then name and address will not be populated and joining date will be the same joining date and count will be 1.

Plz help.

Regards,

Murari

former_member186851
Active Contributor
0 Kudos

Try the logic I gave Muarri,

In the example instead of firstname use ur actual inputs.

Former Member
0 Kudos

Hello Raghu,

I have tried that but facing issue in mapping from name to removeContext and copyValue simultaneously.

Sametime I cannot point to two different functions from single element.

Please help

Regards,

Murari

former_member186851
Active Contributor
0 Kudos

Murari,

The same logic worked,I posted after testing.

What is the error your getting?and post the screenshot which your using.

Former Member
0 Kudos

Hello Raghu,

Please find below screenshot.

Regards,

Murari

former_member186851
Active Contributor
0 Kudos


Hello Murari,

Give the name1 as input to removecontexta as you wish to check for three names.

Former Member
0 Kudos

Hello Raghu,

The problem is from name1 I can't drag the mapping line to removeContext and copyValue simultaneously.

Please advise.

Regards

Murari

former_member186851
Active Contributor
0 Kudos


Hello Murari,

It is possible.Place the arror in the white box and just drag it

Former Member
0 Kudos

Hello Raghu,

I have first drag the arrow from name whitebox to removeContext box. then again try dragging an arrow from name to copyValue box. If try to do so, earlier arrow to removeContext box is getting disappeared.

Please advise.

regards,

Murari

former_member186851
Active Contributor
0 Kudos

Murari,

Try one more thing.

Select name 2 times, I mean drag name 2 times in to editing area and check.

Former Member
0 Kudos

I have done as per above image but getting below error while IR testing :

15:58:54 Start of test 

Cannot produce target element /ns1:MT_Emp_Count_IB/Name. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
Cannot produce target element /ns1:MT_Emp_Count_IB/Name. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd

15:58:54 End of test    
Also count is currently hardcoded as 3 but I am stuck in the population of count and other fields mentioned in destination message fields based on emp id logic mentioned earlier.
Kindly advise.
Regards,
Murari
former_member186851
Active Contributor
0 Kudos

Hello Murari,

Did you give 3 names and test whether the output node is generated?

why your harcoding 3 to count?

Count in statistic funtion will count the number of nodes present.

Former Member
0 Kudos

Hello Raghu,

Yes I have given 3 names and other details but output node not generated getting error mentioned earlier.

Plz advise.

Also how I should map the destination count parameter pls guide.

Regards,

Murari

former_member186851
Active Contributor
0 Kudos

Strange,your names are in different or same contexts?

Former Member
0 Kudos

Hello Raghu,

names are in different contexts. I have given the source structure earlier. data1,data2 and data3 are different contexts under each name, address, emp id, joining date fields are there.

Pls suggest.

Regards,

Murari

former_member186851
Active Contributor
0 Kudos

     Hello Murari,

Just tried the same logic(just used Arithmetic equals instead of Text equals)getting the required output.

Former Member
0 Kudos

Have tried same by changing arithmetic equals getting same error.

Pls suggest

Former Member
0 Kudos

try this one:

former_member186851
Active Contributor
0 Kudos

Murari.

You an see the output coming in my case,check queue values in each step and  compare.