cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove context in UDF?

nitinlpatil12
Participant
0 Kudos

Hi Experts,

Following is my scenario, where Queues coming in needs to club under one record if condition satisfy. In functional language if incoming delivery order has same trailer no. then lines of those order need to be clubbed together.

Queue 0 records separated by context change corresponds to Queue2 records.

Queue 0 needs to be clubbed if Queue 1 records are repeated, In above screenshot as Queue 1 has first 2 value same BMAV85236 then first context change in result needs to be removed. Result will have 3 + 2 records -- context change -- 1 record.

Please let me know how can we achieve this remove context in UDF based on condition?

Regards,

Nitin Patil

Accepted Solutions (1)

Accepted Solutions (1)

former_member182412
Active Contributor
0 Kudos

Hi Nitin,

You can use below mapping.

Regards,

Praveen.

nitinlpatil12
Participant
0 Kudos

Hi Praveen,

Thanks for your answer, as Queue 0 has extra context at the end and hence it is failing while doing the suggested mapping.

Error:  Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Too many values in the first queue in function useOneAsMany. It must have the same number of contexts as the second queue] in class com.sap.aii.mappingtool.flib7.NodeFunctions method useOneAsMany[[Ljava.lang.String;@1d3c3b01, [Ljava.lang.String;@5d45cda5, [Ljava.lang.String;@11c03b7a, com.sap.aii.mappingtool.tf7.rt.ResultListImpl@6380cfb0, com.sap.aii.mappingtool.tf7.rt.Context@1dc35ed9]

Please suggest.

Regards,

Nitin Patil

nitinlpatil12
Participant
0 Kudos

Hi Praveen,

Also I need to pass the Queue 0 values as a result output in a required format and not the Queue 1.

Regards,

Nitin Patil

former_member182412
Active Contributor
0 Kudos

Hi Nitin,

Can you paste sample input xml and required output xml then we will be able to help you.

Regards,

Praveen.

Answers (1)

Answers (1)

nitindeshpande
Active Contributor
0 Kudos

Hello Nitin,

You can do this, by using removecontext for queue 0 and split by value, value change node function for 2nd queue.

And for 3rd queue output, use format by example for the field of 2nd queue.

I hope i was clear.

Regards,

Nitin