cancel
Showing results for 
Search instead for 
Did you mean: 

Determining Condition in Interface Determination??

Former Member
0 Kudos

Hi,

I have a scenario in which I have to Run Two interfaces based on some Interface determination Condition.

I have an IDOC :-

IDOC is having Segment E1EDP01 with Occurence 1..10 and these multiple E1EDP01 is having a field PSTYV

So now my interface will be determine on the basis of value of this PSTYV....

Lets Say

IDOC

--> E1EDP01 (Occurence 1..10)

-


> PSTYV = T

--> E1EDP01

-


> PSTYV =B

--> E1EDP01

-


> PSTYV =A

--> E1EDP01

-


> PSTYV= D

So now my condition is if any of the PSTYV among all E1EDP01 contains A'

i.e IDOC/E1EDP01/PSTYV='A' then Interface_A/mapping_A should determine else interface_B/Mapping_B should determine by interface determination condition editor.

So Now please help me with conditoon .. how to make that conditon...

Regards

P.S

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If you want to use 4 interfaces for those 4 conditions then you need to do the map for 4 times and specify the condition in Interface determination.

In Interface determination at the time of giving receiver details we have condition (Before operation mapping), here you have to give the condition like PSTYV = T then give respective mapping name, again click on + and add another condition for PSTYV = B and so on.

Regards,

Venkata Ramesh

Former Member
0 Kudos

Yes Ramesh , I did the same ... But every time on execution of interface........both interface are determined..

because payload coming from sender are having ...... all subset of Values of PSTVY ('T', 'A', 'B', 'C').

But my condition is A is coming then Interface_B should not execute only Interface_A should determine.. and in other case when A is not coming like PSTVY ('T', 'B', 'C') then only interface_B should determine.....

PSTVY ('T', 'A', 'B', 'C'). = if any of the value has A = Determine only A not B

PSTVY ('T', 'B', 'C') = A is not there = Determine only B not A

Regards

PS

Edited by: prabhatxi on Nov 15, 2011 11:58 AM

Former Member
0 Kudos

Hi,

Use below 2 conditions in interface determination

1. if PSTVY = A or (T and A) or (B and A) or (C and A) then call the Interface A mapping

2. if PSTVY not equals to A and (PSTVY=B or PSTVY=C or PSTVY=T) then call the Interface B mapping

OR

For this we can write simple UDF in the mapping then assign the result value (either interface A or Interface B) to one tempararly variable, we can check the condition in Interface determination by using this temp variable.

Regards,

Venkata Ramesh

Edited by: Venkata Ramesh Boppana on Nov 15, 2011 12:21 PM

Former Member
0 Kudos

Hi Venkata, you can use the XPath function count() to identify the number of occurrences of 'A'. Choose mapping B when 0 occurrences of 'A', choose mapping A for occurrence different from 0.

In the condition editor of the interface mapping it should look like this:

As Left operand use the XPath:

count(//E1EDP01[PSTYV = 'A'])

Then use the operation in conjunction with the right operand to choose the appropriate mapping:

Op. | Right Operand --> Mapping

!= | 0 --> mapping A

= | 0 --> mapping B

Best regards, Martin

Answers (1)

Answers (1)

martin_dejl2
Participant
0 Kudos

Or try to use XPath in your condition:

//E1EDP01[PSTYV='A'] (multiline)

and condition "EX" (exist)

Picture [here|https://weblogs.sdn.sap.com/weblogs/images/251856626/XPath_01.png].

Let us know if it works,

Martin