cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Reciever Determination Routing Condition

Former Member
0 Kudos

Hi! Gurus

I need with the following routing conidtion to be applied in the receiver determination

It's a File to IDOC scenario: There are 2 fields which need to be considered out of the 10 fields coming on the XML:

Shipment_ID

WMS_ID

Requirement for Reciever Determination Filter Condition:

1. Shipment_ID ≠ 9* (All Shipment ID's starting with 9 should be filtered).

2. WMS_ID = CSA, INA, KSA, FLA, ILA

How best can we achieve this filter condition leveraging XPath under reciever determination condition option  - please let me know your thoughts.

Thank you,
Ritu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

Can u try below xpath:

I am assuming that ur messge type name is MT and ur source node name is "Record"

/p1:MT/Record[(!starts-with(Shipment_ID,'9') and ( WMS_ID = "CSA" or WMS_ID="INA" or WMS_ID="KSA")]     EX

Thanks

Amit Srivastava

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Ritu,

Please check this link , it will help you in finding the solution.

http://scn.sap.com/community/pi-and-soa-middleware/blog/2006/06/07/customise-your-xpath-expressions-...

BR,

Vijay Kumar

Former Member
0 Kudos

Hello,

There is a slight correction in the xpath :

/p1:MT/Record[(not(starts-with(Shipment_ID,"9")) and ( WMS_ID = "CSA" or WMS_ID="INA" or WMS_ID="KSA")]                   EX



Thanks

Amit Srivastava

Former Member
0 Kudos

Hey! Amit

I tried all combinations suggested by you and also by all - However, dint find success - The receiver determination failed - with no receiver found in the above condition - and in some other cases suggested above - Messages are getting processed without the 9* series of Shipment ID getting filtered.

Pl, let me know if there is any other combination of giving the above condition - IF not I would have to filter in mapping - However, IF I can still make it work - It will help reduce unnecessary/Invalid records records right at the receiver determination.

Please, advice ...

Thanks again,

Ritu

Former Member
0 Kudos

Hello,

It seems that u have multiple records in a message?

I have tested above condition and it's working fine in case there is one record in a file.

But having said so, in case there are multiple records in a message and if u want to filter out few records as per above condition then it's not possible. U cannot filter records just by using RD.

So, i would suggest you to filter unwanted records at mapping level.

Thanks

Amit Srivastava

former_member184720
Active Contributor
0 Kudos

path/Shipment_ID[not(starts-with(.,"9"))] EX AND

path/WMS_ID = CSA

or

path/Shipment_ID[not(starts-with(.,"9"))] EX AND

path/WMS_ID = INA

or

path/Shipment_ID[not(starts-with(.,"9"))] EX AND

path/WMS_ID = KSA

or

path/Shipment_ID[not(starts-with(.,"9"))] EX AND

path/WMS_ID = FLA

or

path/Shipment_ID[not(starts-with(.,"9"))] EX AND

path/WMS_ID = ILA

Harish
Active Contributor
0 Kudos

Hi Ritu,

You can achieve this using Xpath query in receiver determination. Please provide more details about your input structure and is your condition 1 and 2 is OR operation or AND operation.

regards,

Harish

Former Member
0 Kudos

Hey! Harish

Thank you for your quick response!!

The above 2 condition are AND condition so WMS_ID can be any of the 5 values (CSA, INA, KSA, FLA,ILA) AND addionally Shipment_ID should NOT start with 9* (Eg: 981000021, 9170004312, 9222004516 are INVALID and need to filtered).

Here is the Input structure:

<?xml version="1.0" encoding="utf-8"?>

<ns:MT_SHIPCONFIRM xmlns:ns=http://SHIPMENT_WEEKLY>

<Recordset>

<LineDetail>

  <Carton_Number>34000002</Carton_Number>

  <Prepack_Number>0001</Prepack_Number>

  <RecDate>201312</RecDate>

  <Shipment_ID>981000021</Shipment_ID>

  <Location_ID>15000003</Location_ID>

  <WMS_ID>INA</WMS_ID>

  <Description></Description>

  <Purchase_Date>20140101</Purchase_Date>

  <Ship_Date>20140101</Ship_Date>

  <TotalAmount>210000.86</TotalAmount>

  <Company_CostCenter>1</Company_CostCenter>

</LineDetail>

</Recordset>

</ns:MT_SHIPCONFIRM>

Thank you,

Ritu

former_member184720
Active Contributor
0 Kudos

Hi Ritu - Can you try replacing the path with /p1:MT_SHIPCONFIRM/LineDetail in the below suggested solution?

Harish
Active Contributor
0 Kudos

Hi Ritu,

please refer the xpath query suggested by Amit and change the path as per your structure

/p1:MT_SHIPCONFIRM/Record/LineDetail[(!starts-with(Shipment_ID,'9') and ( WMS_ID = "CSA" or WMS_ID="INA" or WMS_ID="KSA")]     EX

regards,

Harish