cancel
Showing results for 
Search instead for 
Did you mean: 

Missing Structure node in payload

0 Kudos

Hello PI Pro's,

Let me start by saying I am a PI newbie. I have faced several challenges and have managed to overcome but I have one I am stuck with. I have an XML message the gets generated by ECC, sent to PI, and forwarded on to APO/SNC system. All standard setup from SAP.

The problem comes when I send an XML message to PI and it has a complete Node missing. This is from a SAP delivered standard XML message.

The abbreviated structure is similar to the following:

<PurchaseOrder>

<Item>

     element:ID

     element:...

     <Product>

          element:ManufacturerID

          element:VendorID

          element:SellerID

          element:...

     </Product>

</Item>

</PurchaseOrder>

What I am seeing is the PurchaseOrderXML comes to PI with 4 Items (01,02,03,and 04)

Item01 contains a Product Node with values

Item02 has no Product Node

Item03 contains a Product Node with values

Item04 contains a Product Node with values

During mapping, Item02 has no product node so I add it. (If not node.exists then createNode)

Once I get the product Node created with visual mapping tool, then the queue values associated with Item03 get moved into the newly created Product Node for Item02 instead of letting me insert my custom values (mapwithdefault)

This continues for Item03 containing the Product values from Item04 and Item04 gets an empty Product node.

I think this is a context / queue issue but I do not know yet how to properly deal with it and could use some assistance from the SOA Community.

Thanks in advance for any useful help you can provide.

Accepted Solutions (1)

Accepted Solutions (1)

former_member184720
Active Contributor
0 Kudos

>>>During mapping, Item02 has no product node so I add it. (If not node.exists then createNode)


If the node doesn't exists why are you creating it? Does your target system need's this info?


However can you share target structure too? Share source xml as well.

0 Kudos

Thank you Hareesh for your reply and questions. This will be valuable information for further discussions.

We are using standard delivered Configuration Scenario from SAP for SNC with no modifications yet. The source and target stuctures are as close to identical as you could imagine by the names:

ERP XML OUT: PurchaseOrderERPReplenishmentOrderCollaborationNotification_Out

SNC XML IN : PurchaseOrderERPReplenishmentOrderCollaborationNotification_In

I am not sure of the rules regarding attaching actual SAP structures so I will refrain from doing so.

Our dilema comes from using what our organization calls Service PO's or Text PO's that do not have a real product associated. When ERP creates the XML message, it naturally leaves the node out because there is no real product. I believe this is normal and expected. Because of this scenario, my requirement is to fill in the product node with DUMMY values to keep the entire PO with each line item and associated texts consistent with source system.

Any thoughts on how to insert a missing node and sub-elements?

former_member184720
Active Contributor
0 Kudos

Sorry i don't have the access to system to import SNC content and verify structures.

However If both the structures are identical and if you have mapping between them, just simply use mapwithdefault at every field level. (don't use create if function as such) which should create blank structures ?

Did you try that?

0 Kudos

I did try that initially but the node would not create. I will try again and pay closer detail. Thank you for the suggestion.

0 Kudos

No luck using mapwithdefault. as soon as the missing structure node gets created, the elements and values from the next context populate the newly created structure effectively moving line items up and out of sync with the source system.

former_member184720
Active Contributor
0 Kudos

Did you apply the map with default function to all the fields as well ?? If not yout should do that to fields under the node (not just the nodes)

former_member182412
Active Contributor
0 Kudos

Hi Chris,

You can use below mapping:

  • Product(Source)---->MapWithDefault----->Product(Target)
  • ManufactureID(Change the context to Item)------>MapWithDefault------->ManufacturerID (Use the same mapping for all the fields under Product Node)

Regards,

Praveen.

Answers (2)

Answers (2)

0 Kudos

Another newbie helped by the super heroes at PI & SOA Community! Thank you Praveen.

Former Member
0 Kudos

Hi Chris,

Do like this

Manufacture Id --->MapWithDefault----->Remove Context----->Split By Each Value---->Manufacture ID

Regards,

Suhale Shaik.

former_member184720
Active Contributor
0 Kudos

>>>Manufacture Id --->MapWithDefault----->Remove Context----->Split By Each Value---->Manufacture ID

is this nothing but

Manufacture Id --->MapWithDefault---->Manufacture ID  ???

Former Member
0 Kudos

Hi Hareesh,

He is saying the values he wants to enter as mapwithdefault values for item02 product node is giving the values of item03's product node.

thats y i have given that one.

If i am wrong please correct me.

Regards,

Suhale Shaik.

Former Member
0 Kudos

Sorry Hareesh You are correct.

Regards,

Suhale Shaik.