cancel
Showing results for 
Search instead for 
Did you mean: 

HRMD_A07 Idoc to MDM using PI

sriram_devarapalli
Participant
0 Kudos

Hi Team,

We had a scenario where the HR Idoc (HRMD_A07) data is getting integrated to MDM 7.1 using PI 7.1

For example 1 Pernr is having Multiple status like Active, InActive , retire etc.., so we are getting Infotype 000 & 001 multiple times.

So how do we need to Map to target where target has only 1 structure.

Source Structure

<EPLOGI>

<E1P1TYP>

<IT0000>

<PERNR>

<BEGDA>

<ENDDA>

....

</IT0000>

<IT0001>

<PERNR>

<BEGDA>

<ENDDA>

<BUKRS>

<PERSG>

....

</IT0001>

<IT0002>

<PERNR>

<BEGDA>

<ENDDA>

<ENAME>

<ANRED>

.....

</IT002>

<IT1000> </IT1000>

</EPLOGI>

Target Structure to MDM

<Record>

<EmpNo>

<Status>

<Last_Name>

<First_Name>

.....

</Record>

Here when we execute 2 perner's (10004300, 10004435) IDOC is getting created we are getting source structure as follows

<EPLOGI>

<E1P1TYP>

<IT0000>

<PERNR>10004435</PERNR>

<BEGDA>

<ENDDA>

<STAT2>3</STAT2>

....

</IT0000>

<IT0001>

<PERNR>10004435</PERNR>

<BEGDA>

<ENDDA>

<BUKRS>1030</BUKRS>

<PERSG>10</PERSG>

....

</IT0001>

<IT0002>

<PERNR>

<BEGDA>

<ENDDA>

<ENAME>xxx</ENAME>

<ANRED>1</ANRED>

.....

</IT002>

<IT1000> </IT1000>

</EPLOGI>

<EPLOGI>

<E1P1TYP>

<IT0000>

<PERNR>10004300</PERNR>

<BEGDA>

<ENDDA>

<STAT2>2</STAT2>

....

</IT0000>

<IT0000>

<PERNR>10004300 </PERNR>

<BEGDA>

<ENDDA>

<STAT2>3</STAT2>

....

</IT0000>

<IT0001>

<PERNR>10004300 </PERNR>

<BEGDA>

<ENDDA>

<BUKRS>1030</BUKRS>

<PERSG>10</PERSG>

....

</IT0001>

<IT0001>

<PERNR>10004300 </PERNR>

<BEGDA>

<ENDDA>

<BUKRS>1030</BUKRS>

<PERSG>12</PERSG>

....

</IT0001>

<IT0002>

<PERNR>

<BEGDA>

<ENDDA>

<ENAME>yyy</ENAME>

<ANRED>2</ANRED>

.....

</IT002>

<IT1000> </IT1000>

</EPLOGI>

The Output target Structure should be as follows...

<Record>

<EmpNo>10004435</EmpNo>

<Status>3</Status>

<Last_Name>xxx</Last_Name>

<First_Name>

.....

</Record>

<Record>

<EmpNo>10004300</EmpNo>

<Status>2</Status>

<Last_Name>yyy</Last_Name>

<First_Name>

.....

</Record>

<Record>

<EmpNo>10004300</EmpNo>

<Status>3</Status>

<Last_Name>yyy</Last_Name>

<First_Name>

.....

</Record>

I had done an message Mapping as follows.

IT0001 ==> Record

PERNR ==> Empno

STAT2 ==> Status

ENAME ==> Last_Name

.....

As per the mapping I m getting Output Structure as follows

<Record>

<EmpNo>10004435</EmpNo>

<Status>3</Status>

<Last_Name>xxx</Last_Name>

<First_Name>

.....

</Record>

<Record>

<EmpNo>10004300</EmpNo>

<Status>2</Status>

<Last_Name>yyy</Last_Name>

<First_Name>

.....

</Record>

<Record>

<EmpNo>10004300</EmpNo>

<Status>3</Status>

<Last_Name>

<First_Name>

.....

</Record>

There are some values missing in target for the Record <EmpNo>10004300</EmpNo> since the Infotype IT0002 is not repeated. Some Infotypes are not getting repeated, so the values are not getting mapped to target like Last_Name, First_Name etc...

but how do we solve it by using message mapping, Can we use any Java UDF or XSLT Mapping for this issue.

the problem in brief is some infotypes in source is getting multiple times and some are getting only 1 time.

Please suggest.

Thanks in Advance,

Sriram

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try using Node function "UseoneasMany" in your mapping.

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

Regards

Ramg.

Answers (1)

Answers (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

in Target structure you are not getting expected output means,you missed mapping for some fileds,no need go for XSLT,Java mapping,the requirement looks simple,try with mapping functions and UDF.

better to post your source and Target structures in code format,so that we can understrand your requirement bit easily.

Regards,

raj

sriram_devarapalli
Participant
0 Kudos

Hi Raj,

The Mapping is working fine for a single Employee details, In the above target you can see the output correct for

<Empno>10004435</Empno>

If an Employee has multiple status then we are getting multiple Values of same infotype(Segments) like 2 IT000 & IT001, but for some infotype in the same IDOC we are not getting Infotype IT002, so for that record we are not getting the values in output.

For Example if an Employee has only Active status then that Employee will have only 1 action so he will only have 1 IT000,IT001 etc.. then for that record we will get the output correct.

For this Input

<EPLOGI>

<E1P1TYP>

<IT0000>

<PERNR>10004435</PERNR>

<BEGDA>

<ENDDA>

<STAT2>3</STAT2>

....

</IT0000>

<IT0001>

<PERNR>10004435</PERNR>

<BEGDA>

<ENDDA>

<BUKRS>1030</BUKRS>

<PERSG>10</PERSG>

....

</IT0001>

<IT0002>

<PERNR>

<BEGDA>

<ENDDA>

<ENAME>xxx</ENAME>

<ANRED>1</ANRED>

.....

</IT002>

<IT1000> </IT1000>

</EPLOGI>

The Output is as follows which is correct.

<Record>

<EmpNo>10004435</EmpNo>

<Status>3</Status>

<Last_Name>xxx</Last_Name>

<First_Name>

.....

</Record>

If an Employee has status Active and Withdrawn status then he will have 2 actions and so he will have 2 IT000, IT001 segments. For this Example see the input structure

<EPLOGI>

<E1P1TYP>

<IT0000>

<PERNR>10004300</PERNR>

<BEGDA>

<ENDDA>

<STAT2>2</STAT2>

....

</IT0000>

<IT0000>

<PERNR>10004300 </PERNR>

<BEGDA>

<ENDDA>

<STAT2>3</STAT2>

....

</IT0000>

<IT0001>

<PERNR>10004300 </PERNR>

<BEGDA>

<ENDDA>

<BUKRS>1030</BUKRS>

<PERSG>10</PERSG>

....

</IT0001>

<IT0001>

<PERNR>10004300 </PERNR>

<BEGDA>

<ENDDA>

<BUKRS>1030</BUKRS>

<PERSG>12</PERSG>

....

</IT0001>

<IT0002>

<PERNR>

<BEGDA>

<ENDDA>

<ENAME>yyy</ENAME>

<ANRED>2</ANRED>

.....

</IT002>

<IT1000> </IT1000>

</EPLOGI>

See the Output of this above input

<Record>

<EmpNo>10004300</EmpNo>

<Status>2</Status>

<Last_Name>yyy</Last_Name>

<First_Name>

.....

</Record>

<Record>

<EmpNo>10004300</EmpNo>

<Status>3</Status>

</Last_Name>

</First_Name>

.....

</Record>

The First Segments are getting mapped correctly to Output. but the second segments are only not getting mapped since some values in Infotype or segment IT002 are missing, Means the Output till this record is correct

<Record>

<EmpNo>10004300</EmpNo>

<Status>2</Status>

<Last_Name>yyy</Last_Name>

<First_Name>

.....

</Record>

But the second record for the same employee is missing.

<Record>

<EmpNo>10004300</EmpNo>

<Status>3</Status>

</Last_Name>

</First_Name>

.....

</Record>

in the above output we are missing </Last_Name>,</First_Name> etc where according to business it should be

<Record>

<EmpNo>10004300</EmpNo>

<Status>3</Status>

<Last_Name>yyy</Last_Name>

<First_Name>

.....

</Record>

as per business we need to use the previous IT002 data of the same employee in previous action.

How can we get the previous action details in message mapping.

Thanks in Advance,

Sriram