Skip to Content
0

MAPPING ERROR

Nov 16, 2017 at 09:24 AM

61

avatar image
Former Member

I HAVE A SCENARIO LIKE THIS

Source –

<Mapping_Task>

<Company Name>A</Company Name>

<Company Domain>SAPECC</Company Domain>

<Start_Year>2006</Start_Year>

<End_Year>2016</End_Year>

</Mapping_Task>

<Mapping_Task>

<Company Name>B</Company Name>

<Company Domain>SAPMM</Company Domain>

<Start_Year>2008</Start_Year>

<End_Year>2012</End_Year>

</Mapping_Task>

<Mapping_Task>

<Company Name>C</Company Name>

<Company Domain>DOTNET</Company Domain>

<Start_Year>2010</Start_Year>

<End_Year>2015</End_Year>

</Mapping_Task>

<Mapping_Task>

<Company Name>D</Company Name>

<Company Domain>JAVA</Company Domain>

<Start_Year>2002</Start_Year>

<End_Year>2016</End_Year>

</Mapping_Task>

<Mapping_Task>

<Company Name>E</Company Name>

<Company Domain>C++</Company Domain>

<Start_Year>2002</Start_Year>

<End_Year>2010</End_Year>

</Mapping_Task>

<Mapping_Task>

<Company Name>F</Company Name>

<Company Domain>SAPFICO</Company Domain>

<Start_Year>2012</Start_Year>

<End_Year>2016</End_Year>

</Mapping_Task>

Target –

<Mapping_Task>

<SAP_Companies>3</SAP_Companies>

<Non_SAP_Companies>3</Non_SAP_Companies>

<Total_No_Of_Years_SAP>18</Total_No_Of_Years_SAP>

<Total_No_Of_Years_Non_SAP>27</Total_No_Of_Years_Non_SAP>
</Mapping_Task>

I HAVE SCREEN SHOTS

according to my scenario O/p should be <Mapping_Task>

<SAP_Companies>3</SAP_Companies>

<Non_SAP_Companies>3</Non_SAP_Companies>

<Total_No_Of_Years_SAP>18</Total_No_Of_Years_SAP>

<Total_No_Of_Years_Non_SAP>27</Total_No_Of_Years_Non_SAP>

</Mapping_Task>.

But in my O/P it crest two node how to do that without creating the new node

screenshot-379.png (151.3 kB)
screenshot-380.png (154.6 kB)
screenshot-381.png (133.2 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Sanjali Salian Nov 16, 2017 at 10:49 AM
0

Hi,

Your mapping conditions dictate that either SAP_Companies or Non_SAP_Companies should be mapped but both are mandatory fields in the target structure hence the error.

You could use a UDF to get the expected result, so to count all SAP_Companies,

int count = 0;
for(int i = 0; i<nameList.length; i++){
	if( nameList[i].equals("SAP"))
	count++;
}
result.addValue(count);

similarly create for Non_SAP_Companies, update according to your requirement.

Regards,

Sanjali


function.png (23.0 kB)
mapping.png (5.6 kB)
Share
10 |10000 characters needed characters left characters exceeded
Iñaki Vila Nov 16, 2017 at 10:31 AM
0

Hi Manohar,

It has no sense that the node NonSAPCompanies has cardinality 1..1 and in your your mapping you use the function ifWithoutElse, because the node has to appears always according the cardinality.

Regards

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

i got that and i changed but i have doubt that

according to my scenario O/p should be <Mapping_Task>

<SAP_Companies>3</SAP_Companies>

<Non_SAP_Companies>3</Non_SAP_Companies>

<Total_No_Of_Years_SAP>18</Total_No_Of_Years_SAP>

<Total_No_Of_Years_Non_SAP>27</Total_No_Of_Years_Non_SAP>

</Mapping_Task>.

But in my O/P it crest two node how to do that without creating the new node

how to do that in single node O/P

0
avatar image
Former Member Nov 17, 2017 at 09:54 PM
0

Hi Manohar,

Since you are using different context of elements to calculate the value of the target element, you need to change the context of source element and fulfill your requirement by using user defined function.

Share
10 |10000 characters needed characters left characters exceeded
Sanjali Salian Nov 17, 2017 at 08:54 AM
0

Mapping MCS to MCT is creating the many nodes since in the source MCS is one to many, you can either map a constant to MCT or Message1 from the source structure to MCT.

Share
10 |10000 characters needed characters left characters exceeded