Hi,
I am facing some issue in PI mapping where I want to generate the nodes twice at target structure based on condition.
At source, API_RESPONSE can come once or multiple times. If ratetype is Daily then one EXCHANGE_LIST will be generated. If ratetype is monthly, we need both EXCHANGE_LISTs.
In mapping, I created duplicate sub tree and did mapping giving condition but while testing, I am not getting two EXCHANGE_LIST.
We need both Daily and Monthly data differently in both structures. Please help.
Thanks,
Swapnashree
Request clarification before answering.
Hi Swapna,
you have to change change context for @rate_type as mentioned by Eng. Use node function createIf for better readability.
Try below:
(right-click, change @rate_type context to one level higher API_RESPONSE)
@rate_type ----|
| ------------- equalS ------------createIf--------- EXCHRATE_LIST (1st)
"D" ---------------|
(right-click, change @rate_type context to one level higher API_RESPONSE)
@rate_type ----|
| ------------- equalS ------------createIf--------- EXCHRATE_LIST (2nd)
"M" ---------------|
Regards,
Yee Loon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually we have one daily, one Monthly and one is Fiscal Monthly. Fiscal Monthly is replica of Monthly. It is coming with same records of Monthly but we need some calculation based on fiscal month for some fields.
But at target we need 2 ECHANGE_LIST.. fiscal month calculated bid value will move to Monthly EXCHANGE_LIST bid field.
Target is a BAPI, I can not change the occurrence.
Hi Swapna,
I know ABAP is not accepting multiple ECXHRATE_LIST nodes, i just want to give you the solution as per your original question incase the requirement changes.
Use below UDF to set the occurrence of the target node as explained in below blog.
Excecution Type : Single Values
public String setOccurences(String sourcenode, String monthlyRateExist, Container container)
throws StreamTransformationException {
StructureNode node = ((StructureNode) container.getParameter("STRUCTURE_NODE"));
if (monthlyRateExist.equals("true"))
node.setOccurences(0, 2);
else
node.setOccurences(0, 1);
return "";
}
Mapping for EXCHRATE_LIST node:
Mapping Result:
Regards,
Praveen.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.