I have to maintain conditions in Interface Determination of ICO in SAP PI. I have several invoice types like L1, S1, G1, F1, etc. I have two separate mappings as per requirement.
When the Invoice type is L1, S1 or G1, and LAND1 = IND, PARW= W and QUALF=015, I want to pick 1st mapping and for remaining invoice types I want to pick 2nd mapping.
The XPath expressions in the Condition Editor for the two mappings are:
1)
(/ZEINV_INVOIC02/IDOC/E1EDKA1[PARVW = 'W' and LAND1 = 'IND']) EX AND
(/ZEINV_INVOIC02/IDOC/E1EDK14[QUALF = 015 and ORGID = 'L1']) EX OR
(/ZEINV_INVOIC02/IDOC/E1EDKA1[PARVW = 'W' and LAND1 = 'IND']) EX AND
(/ZEINV_INVOIC02/IDOC/E1EDK14[QUALF = 015 and ORGID = 'G1']) EX OR
(/ZEINV_INVOIC02/IDOC/E1EDKA1[PARVW = 'W' and LAND1 = 'IND']) EX AND
(/ZEINV_INVOIC02/IDOC/E1EDK14[QUALF = 015 and ORGID = 'S1']) EX
2) (I have an issue with the second line about ORGID expression)
(/ZEINV_INVOIC02/IDOC/E1EDKA1[PARVW = 'W' and LAND1 = 'IND']) EX AND
(/ZEINV_INVOIC02/IDOC/E1EDK14[QUALF = 015 and ( ORGID ≠ 'L1' or ORGID ≠ 'G1' or ORGID ≠ 'S1' )]) EX
The issue is that when the ICO is run, it is picking both mappings, satisfying both conditions with these values:
ORGID = 'L1'
QALF = 015
PARW = 'W'
LAND1 = 'IND'
What is the XPath expression for the second condition when we have ORGID values other than L1, G1 and S1?
Unfortunately, the expression
ORGID ≠ 'L1' or ORGID ≠ 'G1' or ORGID ≠ 'S1'is a tautology, i.e. it's true ifORGIDis'L1'and true ifORGIDis notL1, so the whole expression is always true whatever the value ofORGIDis.What you want is this:
Note that you may also use the equivalent expression without
not, by using the De Morgan's law, here you have to switch and/or and negate the conditions:NB: does
≠really work? Shouldn't you use!=?