cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver determination condition

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

iaki_vila
Active Contributor
0 Kudos

Hi Mohan,

Have you checked the multiline checkbox?

According with this thread

You can try:


Left operand --> contains(substring(/INVOIC02/IDOC/E1EDK02[QUALF="002"]/BELNR,1,3),'003')

Operator --> =

Right Operand --> true

And the other option with false.

Regards.

Former Member
0 Kudos

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.

iaki_vila
Active Contributor
0 Kudos

Hi Mohan,

According with Shabarish Vijayakumar blog the operators must be in lowercase, try to set and instead of AND.

Regards.

Former Member
0 Kudos

AND came automatically in upper case when I clicked on + Icon. This is not something I added manually.

I think we can not use contains condition including with other logic

former_member184720
Active Contributor
0 Kudos

You can use start with function along with not to check the second condition.

Refer to my reply in below thread

Something like this : /INVOIC02/IDOC/E1EDK02[QUALF = "002" and not(starts-with(BELNR,"003"))]EX

Former Member
0 Kudos

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?

former_member184720
Active Contributor
0 Kudos

Do not use @ symbol.

Provide the actual path. Did you try this?

/INVOIC02/IDOC/E1EDK02[QUALF = "002" and not(starts-with(BELNR,"003"))]EX

Former Member
0 Kudos

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 )


former_member184720
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Thanks.

I will get QUALF field with other values like 043, 087.

Can you help on how to check count of QUALF with value 002?

former_member184720
Active Contributor
0 Kudos

You don't need to check this again explicitly i believe

INVOIC02/IDOC/E1EDK02[QUALF = "002" and not(starts-with(BELNR,"003"))] EX ) -> this should also check if there is a qualf with 002..


Isn't it working?

Former Member
0 Kudos

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.