Skip to Content
avatar image
Former Member

MAPPING ERROR

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Nov 16, 2017 at 10:49 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 16, 2017 at 10:31 AM

    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

    Add comment
    10|10000 characters needed 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

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

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 17, 2017 at 08:54 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded