on 06-09-2015 6:57 PM
Hi Experts,
Below is my requirement.
In INVOICE IDoc
Case1: /INVOIC02/IDOC/E1EDK02[QUALF="002"]/BELNR ≈ 003*) ----> Receiver 1
Case 2: /INVOIC02/IDOC/E1EDK02[QUALF="002"]/BELNR ≠ 003*) ----> Receiver 2
It is working in case 1 but not in case2. All Orders which starts with 003 of QUALF 002 are also going to Receiver2.
I need to send invoices to Receiver1 for which E1EDK02/BELNR starts with 003 in E1EDK02/QUALF 002.
I need to send invoices to Receiver2 for which E1EDK02/BELNR didn't starts with 003 in E1EDK02/QUALF 002.
Input data for Receiver1:
- <E1EDK02 SEGMENT="1">
<QUALF>001</QUALF>
<BELNR>711111111</BELNR>
</E1EDK02>
- <E1EDK02 SEGMENT="1">
<QUALF>002</QUALF>
<BELNR>003111111</BELNR>
<DATUM>20130716</DATUM>
</E1EDK02>
- <E1EDK02 SEGMENT="1">
<QUALF>017</QUALF>
<BELNR>008111111</BELNR>
</E1EDK02>
- <E1EDK02 SEGMENT="1">
<QUALF>087</QUALF>
<BELNR>0091111111</BELNR>
</E1EDK02>
Input data for Receiver 2:
- <E1EDK02 SEGMENT="1">
<QUALF>001</QUALF>
<BELNR>711111111</BELNR>
</E1EDK02>
- <E1EDK02 SEGMENT="1">
<QUALF>002</QUALF>
<BELNR>004111111</BELNR>
<DATUM>20130716</DATUM>
</E1EDK02>
- <E1EDK02 SEGMENT="1">
<QUALF>017</QUALF>
<BELNR>008111111</BELNR>
</E1EDK02>
- <E1EDK02 SEGMENT="1">
<QUALF>087</QUALF>
<BELNR>0091111111</BELNR>
</E1EDK02>
(or)
- <E1EDK02 SEGMENT="1">
<QUALF>001</QUALF>
<BELNR>711111111</BELNR>
</E1EDK02>
</E1EDK02>
- <E1EDK02 SEGMENT="1">
<QUALF>017</QUALF>
<BELNR>008111111</BELNR>
</E1EDK02>
Please help on how to achieve this. Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply.
I have to include partner number as well, so I have added partner number to given logic by you.
(/INVOIC02/IDOC/EDI_DC40/RCVPRN = 0000111111 AND contains(substring(/INVOIC02/IDOC/E1EDK02[QUALF="002"]/BELNR,1,3),'003') = false)
(/INVOIC02/IDOC/EDI_DC40/RCVPRN = 0000222222 AND contains(substring(/INVOIC02/IDOC/E1EDK02[QUALF="002"]/BELNR,1,3),'003') = true)
It is throwing also throwing error "senderChannel 'a3807785dcb93a5ca9a5ca0cf9ed5c86': Catching exception calling messaging system" which is due to receiver determination incorrect logic.
Hi Mohan,
According with Shabarish Vijayakumar blog the operators must be in lowercase, try to set and instead of AND.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply.
If I use below condition, it is throwing error.
/INVOIC02/IDOC/E1EDK02[QUALF="002"]/[@BELNR[not(starts-with(. , '003'))]]
I can not use condition like below because, my requirement has to check BELNR number of QUALF 002.
/INVOIC02/IDOC/E1EDK02[@BELNR[not(starts-with(. , '003'))]] AND /INVOIC02/IDOC/E1EDK02/@QUALF =002
Any other way to acheive this?
It is working. for some of the Receiver 2 IDocs I am not getting E1EDK02 with QUALF 002. So used below logics. Both are not working.
Can you help on this too?
1.
(/INVOIC02/IDOC/EDI_DC40/RCVPRN = 0000222222 AND /INVOIC02/IDOC/E1EDK02[QUALF = "002" and not(starts-with(BELNR,"003"))] EX ) OR (/INVOIC02/IDOC/EDI_DC40/RCVPRN = 0000222222 AND /INVOIC02/IDOC/E1EDK02[not(QUALF)] EX )
2.
(/INVOIC02/IDOC/EDI_DC40/RCVPRN = 0000222222 AND /INVOIC02/IDOC/E1EDK02[QUALF = "002" and not(starts-with(BELNR,"003"))] EX ) OR (/INVOIC02/IDOC/EDI_DC40/RCVPRN = 0000222222 AND /INVOIC02/IDOC/E1EDK02[not(QUALF] EX )
For existence check, you have to depend on count function something like below..
/INVOIC02/IDOC/E1EDK02[count(QUALF)>0] EX
some examples
To Exist Or Not to Exist is the Question - Process Integration - SCN Wiki
It is working, as i said before, for some Idocs, I am not getting QUALF with 002 value. so receiver determination is failing. I should use throw error option in receiver determination due to other customer requirements.
So now I need to send IDoc to receiver2 if
INVOIC02/IDOC/E1EDK02[QUALF = "002" and not(starts-with(BELNR,"003"))] EX )
(or)
INVOIC02/IDOC/E1EDK02[QUALF = "002"] does not exist
Can you help me on what condition do i need to use for does not exist, how can I acheive above logic which in bold letters.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.