cancel
Showing results for 
Search instead for 
Did you mean: 

Typical Issue

vijender_p
Active Participant
0 Kudos

Hi all,

Actually am facing a typical issue ,in the which the issue is related to the mapping .

when the OTYPE and STEXT fields of E1P1000 segment are equal then it should replicate the Job _title output field

For this i have written a code and it was working up to pre- production system but why it was failing in Production ???

Error :

Details: com.sap.aii.mappingtool.tf7.MessageMappingException; Runtime exception when processing target-field mapping /ns0:/Record[270]/Job_Title; root message: Exception:[java.lang.ArrayIndexOutOfBoundsException: while trying to load from index 2 of an object array with length 2, loaded from the second parameter of the method] in class com.sap.xi.

Mapping :

helping me will be very appreciation

Regards

Vijender

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Vijendar,

As per my understanding, you have two fields i.e otype,stype. If otype vlaue is 'O' and Stype value is not empty (' ') you wanted to pass the value of stype to target. Else you wanted to add a ' ' value to target.

This logic can be handled without a UDF. If otype -> Map with default-.> EQUALS "O" AND Stype-> EQUALS " "(constant " ")-> NOT then STYPE else Constant " ",

Check the context of both the fields as well. Let us know if you face any issues.

Regards

radek_rucinski
Explorer
0 Kudos

Hi Vijender,

Can you please share a screenshot with queues when running the mapping using the input message from production? It seems that there is a different number of entries for OTYPE and STEXT, so you should consider using mapWithDefault before your UDF. Also, this can be handled using standard IF function without UDF at all.

Regards,

Radek

vijender_p
Active Participant
0 Kudos

Hi Radoslaw ,

Thanks for the reply !!!

can u pls help out how it is possible ??

For the below queue .& also i have changed the udf some what ..

Regards,

Vijender

former_member186851
Active Contributor
0 Kudos

Hello Vijender,

Try using Remove contexts before passing the value to UDF

And also this can be done without UDF.

vijender_p
Active Participant
0 Kudos

Hi Raghu ,

Can u pls help out without UDF ??

suman_saha
Contributor
0 Kudos

Hi Vijender,

As suggested by Raghu, use remove context for both the input fields and at last use splitbyvalue.

Also, you need to create the UDF as context type.

Regards,

Suman

suman_saha
Contributor
0 Kudos

As per my understanding from your code, if OTYPE is "O" then you will add STEXT in output, otherwise it will be blank..right??

suman_saha
Contributor
0 Kudos

You have put the inputs wrongly, please alter and try again.

former_member186851
Active Contributor
0 Kudos

Hello vijendar

STEXT---->    

                   Equals----------IF

OTYPE---->                                 ---------------------------------->Job_Title

                    Stext---------- Then

If its not working try adding Remove context before equals for both the fields.

maheswarareddykonda
Active Contributor
0 Kudos

HI ,

I am thinking below is the causes,

1. Job_Title filed must be 1:1 occurence

2.OTYPE field might have come other than value "C" and same time you had mapped root node of Job_Title field mapped 1 to 1

so please check with root node of Job_Title node count and OTYPE  field match with value :C: count should be same


EX:


Root node comes 10times, then OTYPE fields also matched with C" 10 times