cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot cast to Boolean error

Former Member
0 Kudos

Hi

I am working in a multimapping in PI 7.1. I have two Idocs at target side. I used this logic to create the IDocs

If FieldA  equalsS constant XY or YZ, then MT_Sender is IDoc one

I used Boolean Or, Text function equalsS, if without else also

My requirement is like that if a particular field in Source file has XY or YZ, Ist IDoc should be created.

However I get this error in Message Mapping test tab, that

FunctionException: Cannot cast 'XY' to boolean] in class com.sap.aii.mappingtool.flib7.Bool method or[XY, YZ, com.sap.aii.mappingtool.tf7.rt.Context@111644f0] com.sap.aii.utilxi.misc.api.BaseRuntimeException: Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Cannot cast 'XY' to boolean] in class com.sap.aii.mappingtool.flib7.Bool method or[XY,YZ, com.sap.aii.mappingtool.tf7.rt.Context@111644f0]

Accepted Solutions (1)

Accepted Solutions (1)

jyothi_anagani
Active Contributor
0 Kudos

Hi Radhika,

Please use the mapping as attached. Please change the context of FieldAB to Its Message Type Node(MT_Sender).

Please let me know If this doesn't work.

Thanks

Jyothi A

Former Member
0 Kudos

Thanks Jyothi, it worked

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Radhika,

There are 2 equal Functions. Please see attached screenshots. You are probally using the wrong one.

Regards,

Jannus

manigram
Active Participant
0 Kudos

Hi,

use String equal function instead of Boolean function, i think you used boolean function that is the reason showing error as XY is not a Boolean value. So use string equal function to compare the string.

Regards,

Manigandan

iaki_vila
Active Contributor
0 Kudos

HI Radhka,

To the OR boolean function are arriving not boolean values, are you using it after the equalS function?, could you share you mapping?

Regards.