cancel
Showing results for 
Search instead for 
Did you mean: 

Idoc Mapping Issue

Former Member
0 Kudos

Dear Experts,

I am developing one Idoc to Idoc scenario. The sender structure is:

<ZABC>          0.. Unbounded

     Field1         0..Unbounded

     Field2         0.. Unbounded

     Filed3         0.. Unbounded

     Field4         0.. Unbounded

     Field5         0.. Unbounded

</ZABC>

Receiver structure is same as sender. Now, the requirement is, if Field1, Field2, Field3, Field4 do not exist then map "Blank" value in the respective fields in the receiver side and If Field1 exists and do not contain any blank value then value of Field5 should be "Y" else value will be "N".

I have used below logic to achieve this:

For some cases, these logics are working fine. But some cases it failed.

  • Suppose Sender is sending values in “Field1” field in first 4 records and next 4 records do not contain “Field1” field and then next 2 records again contain value in “Field1” field. Then, out of total 10 records, PI is setting the value of “Field5” as “Y” for the first 6 records and as “N” for the last 4 records. But that should not be the case.



Could you please help me regarding this. Is there any problem in my logic?


Please advise.


Thanks & Regards,

Moumita


Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Maheswarareddy/ Praveen,

Thanks for your reply.

I have tried both the logics suggested by you. Still I am getting same error. Just elaborating the error.

The Source payload is:


<?xml version="1.0" encoding="UTF-8"?>

<IdocName>

   <IDOC BEGIN="">

      <E1MARAM SEGMENT="">

         <Number>000000000000001</Number>

         <E1MAKTM SEGMENT=""/>

         <ZE1BP>

            <ZABC>

               <Field1>Value1</Field1>

               <Field2>001</Field2>

            </ZABC>

            <ZABC>

               <Field2>002</Field2>

            </ZABC>

         </ZE1BP>

      </E1MARAM>

     

      <E1MARAM SEGMENT="">

         <Number>000000000000002</Number>

         <E1MAKTM SEGMENT=""/>

         <ZE1BP>

            <ZABC>

               <Field1>Value2</Field1>

               <Field2>003</Field2>

            </ZABC>

         </ZE1BP>

      </E1MARAM>

   </IDOC>

</IdocName>

The Output which I am getting using the logic is:


<?xml version="1.0" encoding="UTF-8"?>

<Idoc_Name>

   <IDOC BEGIN="1">

      <E1MARAM SEGMENT="1">

         <Number>000000000000001</Number>

         <ZE1BP SEGMENT="1">

            <ZABC>

               <Field1>Value1</Field1>

               <Field2>001</Field2>

               <Field3/>

               <Field4/>

               <Field5>Y</Field5>

            </ZABC>

            <ZABC>

               <Field1>Value2</Field1>

               <Field2>002</Field2>

               <Field3/>

               <Field4/>

               <Field5>N</Field5>

            </ZABC>

         </ZE1BP>

      </E1MARAM>

      <E1MARAM SEGMENT="1">

         <Number>000000000000002</Number>

         <ZE1BP SEGMENT="1">

            <ZABC>

               <Field2>003</Field2>

               <Field5>Y</Field5>

            </ZABC>

         </ZE1BP>

      </E1MARAM>

   </IDOC>

</Idoc_Name>

Please see above example. The "Field1" value is shifted. Also, foe the last segment, field3 & field4 values are not getting generated.

Please advise.

Thanks & Regards,

Moumita

former_member213558
Active Participant
0 Kudos

HI

can you remove split by value function in your field 1, field 2 , field 3 , field 4 mapping. and test again.

former_member186851
Active Contributor
0 Kudos

hello Moumita,

I guess you didnt map root nodes.

Map all the root nodes and dont use split value.I tested yours seems to be fine

Field 1 to Field 4:

Field 5:

Former Member
0 Kudos

Hi Ramesh,

I have tried removing "Split by Value" function. Still, I am getting the same output/error.

Thanks & Regards,

Moumita

former_member213558
Active Participant
0 Kudos

remove your "Split by Value" function in 'ZABC' segment, then try again.

Former Member
0 Kudos

Hello Raghuraman,

As suggested by you, I have used the same logic. Still, I am getting the same error.

Thanks & Regards,

Moumita

former_member186851
Active Contributor
0 Kudos

Did you map the root nodes Moumita?And in my logic change the Y and N postions.And remove map with default in ZABC.do a direct mapping for root nodes.

If your still facing the issue.Give your IDOC XSD .I will try and same give the solution.

former_member213558
Active Participant
0 Kudos

remove your "mapwithdefault" function in 'ZABC' segment, then try again.


Former Member
0 Kudos

Hi Raghu/Ramesh,

I have tried your suggestion and now this is creating correct "Y" value in Field5. But there is one more point here: If ZABC does not exist then also I have to put "N" Value in the Field5.

Please suggest how to achieve that.

Thanks & Regards,

Moumita

former_member186851
Active Contributor
0 Kudos

Hello Moumita,

ZABC is root node right ,which logic you will use to generate target ZABC even if it doesn;t exists.

Guess your logic is wrong.

former_member213558
Active Participant
0 Kudos

then duplicate target segment as a subtree, then place the below condition

ZABC-- exist -- not-- create if  --- ZABC ( use these highlighted  node function).

map empty constant value for Field1 to field 4 values.

map "N" Constant value for Field5.

Former Member
0 Kudos

Thanks Everyone for your help & support.

Regards,

Moumita

Answers (2)

Answers (2)

former_member182412
Active Contributor
0 Kudos

Hi Moumita,

You can simply do like this.

OR

Regards,

Praveen.

maheswarareddykonda
Active Contributor
0 Kudos

Hi,

Try this for field 5