cancel
Showing results for 
Search instead for 
Did you mean: 

CopyperValue Function

Former Member
0 Kudos

Hi,

I am a beginner in Java.  I am analysing an existing udf which failed in PI . The error message is

RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /Transaction-PRICAT/Loop-Group_UNB/Loop-Group_UNH/Loop-Group_16/Loop-Group_33[14]/Segment-PIA[2]/Composite-C212/Element-7140. The message is: Exception:[java.lang.ArrayIndexOutOfBoundsException: 0] in class com.sap.xi.tf._mm_PRICAT_PRICAT02_2_PRICAT_UN_D96A_LSC_ method copyPerValue$[com.sap.aii.mappingtool.flib3.IfWithoutElse@3a77263c, com.sap.aii.mappingtool.flib3.IfWithoutElse@646f4b20]

public void copyPerValue(String[] a,String[] b,ResultList result,Container container){

for (int i=0; i<b.length; i++)

result.addValue(a[0]);

The queues shows me that I am passing value 'Test' in string a and some 72 values in string 2.  I assume for each occurrence of string b, string a needs to be created.

Please help as this is an PRICAT EDI mapping.

Regards

Krish

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member184681
Active Contributor
0 Kudos

Hi Krish,

It looks very much like a custom alternative for the standard mapping function useOneAsMany. Why don't you try using the standard function instead?

Regards,

Greg

Former Member
0 Kudos

Hi Gregorz,

I tried and that is also giving me the same error.

Regards

Krish

Former Member
0 Kudos

Hi All,

Thanks, It was an issue with context changes.

Regards

Krish