on 08-21-2014 12:01 PM
Hello Everyone,
I need help on the XPath Condition.I have gone through so many links/forums,but nothing me in going forward.
Please have a look on my Requirement.It is IDOC to SOAP scenario.We have to check some conditions by placing XPATH conditions.
Source file:
case 1 - Should not pass
IDOC-
E1ANAM
VKORG
---------
-------
E1MVKEM
<VTWEG>Z3</VTWEG>
==============
================
E1MVKEM
===========
==============
/IDOC
case 2 - Should pass
IDOC-
E1ANAM
VKORG
---------
-------
E1MVKEM
===========
==============
/IDOC
Conditions:
1. If VTWEG doesnnot exist in E1MVKEM then it has to pass to target system.
I have placed the below condition and it is working /ZMATMAS05_XXXX/IDOC/E1MARAM/E1MVKEM[not(VMSTA)]
2.But if in One IDOC if i have multiple VTWEG with a value in and without a with a value then it shouldnot pass as per case 1
So could any one help how to check both the conditions in case 1 as well as case2.
Hi,
Please provide your valuable solutions on the above query ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sahithi
Since your routing condition is quite complex and you are unable to achieve it using XPath for multiple IDocs, I would suggest that you consider going for Extended Receiver Determination and build the condition logic with graphical mapping.
Defining Extended (Dynamic) Receiver Determination - Integration Directory - SAP Library
Rgds
Eng Swee
Hi Sahithi
Extended Receiver Determination is available in ICO configuration for single stack from SP4 of PI7.31 as per the link below:
You can refer to the following wiki pages on the steps to implement it - the screenshots are based on classical dual-stack configuration but conceptually it is still applicable for usage in ICO.
Dynamic receiver determination through mapping - Process Integration - SCN Wiki
Rgds
Eng Swee
Hi Sahiti,
It will work like kanda and Ankur says
use like this
ZMATMAS05_XXXX/IDOC/E1MARAM/E1MVKEM/[count(VMSTA)] = 0 OR != to 0.
let me know if it doesnt work
Thanks,
Sreenivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Now the logic for XPATH is working as expected.But the logic is not working incase of bundling of IDOC's.
From ECC they are sending 10 IDOC's in one message,so in my case XPATH is checking only first IDOC and passing remaining 9 as-is without checking the condition.
In XPATH i have checked multi line,but still not working.
Please suggest ?
can you please check like this suppose
mesage_1/Name/[SecondNAME]
please check below link...
Hi,
I have multiple IDOC in one message,so is this the correct way of expressing the condition.
I have to check Multiple conditions as below:
Condition 1:
/ZMATMAS05_XXXX/IDOC/E1MARAM/MTART = ABC AND
/ZMATMAS05_XXXX/IDOC/E1MARAM/E1MVKEM[(VKORG = "AB") and (VTWEG = "00") and (MVGR4 = "M03" or MVGR4 = "M04" ) and (count(VMSTA) = "0")] AND
/ZMATMAS05_XXX/IDOC/E1MARAM/E1MARCM[(WERKS = "123" or WERKS = "456")]
OR
Condition 2
/ZMATMAS05_XXXX/IDOC/E1MARAM/MTART = LMN AND
/ZMATMAS05_XXXX/IDOC/E1MARAM/E1MVKEM[(VKORG = "HF") and (VTWEG = "00") and (MVGR4 = "M03" or MVGR4 = "M04" ) and (count(VMSTA) = "0")] AND
/ZMATMAS05_XXX/IDOC/E1MARAM/E1MARCM[(WERKS = "123" or WERKS = "456")]
If any of the the above one conditions satisfies then it has to pass.
Note: They have to pass to the same Receiver.
The above conditions are working fine if we test for single IDOC.But it is not working when they are using collect IDOC.
Could you please suggest how can change the logic inorder to work for multiple IDOC's.
Hi Sahithi,
For the above scenario, if you are using Graphical mapping then at mapping level itself you can handle it.
PFA the screenshot for your reference.
Else if you want to do it exclusively using Xpath, then you can the following:
ZMATMAS05_XXXX/IDOC/E1MARAM/E1MVKEM/[count(VMSTA)] = 0 OR != to 0.
Thanks & Regards,
Ankur.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Check like this
/ZMATMAS05_XXXX/IDOC/E1MARAM/E1MVKEM/[count(VMSTA)] is EQUAL to '0' or NOT EQUAL to '0'.
Thanks,
Kanda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ankur,
My Structure is as below:
Material(1..1)
Soap Header (0..1)
Userid
Password
XMaterial (0..1)
Xmaterials(0..unbounded) - this is mapped to IDOC.
We have have multiple IDOC's in one message.
We can do it with mapping,but i believe we have to change all the field values.Also the soap header is getting created as we are checking condition at xmaterials.
Hi.
Check my thread
http://scn.sap.com/thread/1915764
You need to put the condition in one level up.
Try this.
/ZMATMAS05_XXXX/IDOC/E1MARAM[ ./E1MVKEM[not(VMSTA)]
Or
Try this.
/ZMATMAS05_XXXX/IDOC/E1MARAM[ ./E1MVKEM[count(VMSTA)=0]
Regards
Lucho.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.