cancel
Showing results for 
Search instead for 
Did you mean: 

runtime exception when processing target field mapping

Former Member
0 Kudos

iam facing this error in the message monitor

singlestack

thisis actually idoc_aae to jdbc scenario..

Mapping "urn:www.mil.com:ERP:Application:09:PriceMaster/COND_A_COND_A04_to_PriceMaster_In" failed to execute: MappingException: Mapping failed in runtimeRuntime Exception when executing application mapping program com/sap/xi/tf/_COND_A_COND_A04_to_PriceMaster_; Details: com.sap.aii.mappingtool.tf7.MessageMappingException; Runtime exception when processing target-field mapping /ns0:PriceMaster/Details/PriceMaster/access/CompanyCode; root message: Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Too few 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;@6304b401, [Ljava.lang.String;@49c5e070, [Ljava.lang.String;@5e11fee6, com.sap.aii.mappingtool.tf7.rt.ResultListImpl@6f75de49, com.sap.aii.mappingtool.tf7.rt.Context@2354c3ca], ApplicationRuntimeException: Runtime Exception when executing application mapping program com/sap/xi/tf/_COND_A_COND_A04_to_PriceMaster_; Details: com.sap.aii.mappingtool.tf7.MessageMappingException; Runtime exception when processing target-field mapping /ns0:PriceMaster/Details/PriceMaster/access/CompanyCode; root message: Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Too few 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;@6304b401, [Ljava.lang.String;@49c5e070, [Ljava.lang.String;@5e11fee6, com.sap.aii.mappingtool.tf7.rt.ResultListImpl@6f75de49, com.sap.aii.mappingtool.tf7.rt.Context@2354c3ca], MessageMappingException: Runtime exception when processing target-field mapping /ns0:PriceMaster/Details/PriceMaster/access/CompanyCode; root message: Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Too few 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;@6304b401, [Ljava.lang.String;@49c5e070, [Ljava.lang.String;@5e11fee6, com.sap.aii.mappingtool.tf7.rt.ResultListImpl@6f75de49, com.sap.aii.mappingtool.tf7.rt.Context@2354c3ca], BaseRuntimeException: Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Too few 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;@6304b401, [Ljava.lang.String;@49c5e070, [Ljava.lang.String;@5e11fee6, com.sap.aii.mappingtool.tf7.rt.ResultListImpl@6f75de49, com.sap.aii.mappingtool.tf7.rt.Context@2354c3ca], BaseRuntimeException: Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Too few 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;@6304b401, [Ljava.lang.String;@49c5e070, [Ljava.lang.String;@5e11fee6, com.sap.aii.mappingtool.tf7.rt.ResultListImpl@6f75de49, com.sap.aii.mappingtool.tf7.rt.Context@2354c3ca], java.lang.reflect.InvocationTargetException, FunctionException: Too few values in the first queue in function useOneAsMany. It must have the same number of contexts as the second queue

Accepted Solutions (0)

Answers (5)

Answers (5)

0 Kudos

Hi SAP guys,

Runtime exception when processing target field mapping -> (Runtime exception when processing target-field mapping /ns0:PriceMaster/Details/PriceMaster/access/CompanyCode; root message: Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Too few values in the first queue in function).

This Error occurs when there is no filed in the Request Mapping, If you mapping request has 10 Fields, need to give 10 fields under item, count from 0 to 9.reqesst-fields-mapping.png.

And in the response structure, Custom Mapping Groovy Scripts works. Its convert the multiple value with getListEntry(String inputStr, String delimiter, String position).

Former Member
0 Kudos

Hi Prasad,

First Copy & paste the incoming payload in OM and check it once... As per your error the input field don't have a sufficient values from your payload.

As Vishnu Discussed, Folow those constraints/conditions and execute once again.

Please check the below links

http://saprainbow.com/sap-pi-mapping/useoneasmany-explained-in-easy-example/

Former Member
0 Kudos

Hi,

I have faced this issue in past, and have also resolved the issue.

Whatever source field is mapped to target field "Company Code", that field is having repitition of values at different positions. What I mean is, the same values are not grouped together for the source field, which is why wherever there is CollapseContext function being used the same values are not coming in group. Source system needs to group the same values together.

Hope this helps!

Regards,

Souvik

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Valli,

The issue has occurred during the population of target field CompanyCode, you might be using useOneAsMany node function, and there is some in the input arguments for this function for the source payload.

Please find below the conditions/constraints for the successful execution of useoneasmany node function:

1. The first input parameter expects the list of values that we want to propagate to the target message.

2. The second input parameter expects the number of iterations or how many times we want to replicate the value given in the first parameter.

3. The third input parameter is the list of context changes. Depending on this parameter the source values will be propagated to the target after every context change.

Note: For this function to work as expected, the first two parameters must contain the same number of contexts while the last two parameters must contain the same number of values.

Please check your mapping now and let us know with proper screenshots if you still face any issues.

Regards

Vishnu

Former Member
0 Kudos

Hi,

My guess is you are still new with SAP PI? This is a mapping error. Not on your adapters. So take your payload and run it through your mapping in Design. It seems Company code is mandatory or the queue in your mapping program is not correct.

Because you are using the useOneAsMany. 2 of the values you are using does not have the same amount of queues in them. So make sure your queues are correct.

Regards,

Jannus Botha