cancel
Showing results for 
Search instead for 
Did you mean: 

XML Iteration Rule in SAP CI-DS

0 Kudos
1,354

Hi All,

Could you please explain the below XML iteration rule concept applied in Standard CI-DS task.

Please find the details attached.

Iteration Rule "*" applied on AggregatePackageNo and AggregateMaxPackageNo

Three Input Transforms used in Input (Mapping, AggregateMaxPackageNo and AggregatePackageNo) and mapped to Output XML structure.

Sample Input data from View Design Time Data

Mapping Transform (with filter applied for Package Number "51")

AggregateMaxPackageNo Transform

AggregatePackageNo transform

Sample Output data ("15" records with Package Number "51" are grouped) from View Design Time Data

Here with Iteration Rule (all Records with same Package Number grouped under one XML Node).

As per SAP Help portal "*" is Cross Join

* - Cross operation
Performs a Cartesian product of two or more sources.
When the sources have no parent-child relationship, the behavior is the same as a standard SQL CROSS JOIN.
When the sources have a parent-child relationship, the Cartesian operation provides a mechanism to iterate through all instances of the repeatable elements identified by the source schemas in the operation in the document order.

Could someone explain this XML Iteration Rule behavior.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi Yeswanth,

Since you use only two nodes for Iteration, it will only process from those two nodes and Mapping node is mapped as a Child node. You need to connect the Child node with the Parent node, else it won't loop and take the value.

If you want the data from Mapping node also in the output, try including it in the first Iteration rule and check. There is also an option to give the condition to join, pls try that also. Let me know how it goes.

Regards,

Krishna

0 Kudos

Hi Krishna,

Mapping node is mapped to CT_PIR_IN and fields are mapped under CT_PIR_IN xml node

Could you please explain how Iteration Rule (all Records with same Package Number grouped under one XML Node and fields mapped under CT_PIR_IN as per group) is applied even though we did not add any condition or perform Join operations.

0 Kudos

Hi Yeswanth,

I see you have mapped the attributes from the 'Mapping' node, but don't see it in the Iteration rule. I think you have added it on the CT_PIR_IN Iteration.

So for this iteration, it will consider only the other two nodes for joining and even though it does a cross join, you will get only one record for each Package number.

Are you getting 96 as Total Package Count for the other Package Numbers also? If you are expecting a different result, please mention that also so that we will get more clarity on the question.

Regards,

Krishna

0 Kudos

Hi Krishna,

Thank you for the quick response.

Yes, for CT_PIR_IN Iteration Rule is "Mapping".

Yes, another Package with "41" is also having Total count as "96".

and could you please provide some insights on how grouping is done here.