cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

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

0 Likes
View Entire Topic
yeeloon-khoo
Participant
0 Likes

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

yeeloon-khoo
Participant
0 Likes

Hi,

and change the EXCHRATE_LIST mentioned by Manoj as well.. you have at least 2, daily n monthy.

Regards,

Yee Loon

Former Member
0 Likes

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.

Former Member
0 Likes

it is not working. The occurrence of EXCHANGE_LIST is 1:1. Do I have to create two separate mappings - one for Daily and other for Monthly/Fiscal Monthly.

manoj_khavatkopp
Active Contributor
0 Likes

As this is BAPI you need to ask ABAP team to change the occurrence and then re-import it again.

Former Member
0 Likes

ABAP team saying they can not accept two EXCHRATE_LIST tables. But requirement is to send both daily and Monthly data. Do I have to create two mappings.

Former Member
0 Likes

yes,Or if the input is same,you can split to two.

Former Member
0 Likes

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.