cancel
Showing results for 
Search instead for 
Did you mean: 

Use of range in case of XPATH for receiver determination.

Former Member
0 Kudos

Hi Experts,

I need to achieve the following using standard receiver determination.

The material number in the source message structure has to lie within a perticular range and that should decide the receiver of the message.

For example:

MT_SRC

|---- Ele1

|----


MaterialNo.

If MaterialNo is between 100000100 and 100001000 then it should be sent to BS_TGT1 else it should be sent to BS_TGT2.

Is it possible to achieve this using the standard conditional receiver determination using XPATH and if yes, how exactly?

Regards,

Amol

Accepted Solutions (1)

Accepted Solutions (1)

henrique_pinto
Active Contributor
0 Kudos

What is the occurrence of this node within the message?

If it's just 0...1 (or 1...1), you could use two expressions combined:

(/MT_SRC/Ele1 [MaterialNo > 100000100 ] EX) AND
(/MT_SRC/Ele1 [MaterialNo < 100001000 ] EX)  => BS_TGT1

(/MT_SRC/Ele1 [MaterialNo < 100000100 ] EX) OR
(/MT_SRC/Ele1 [MaterialNo > 100001000 ] EX)  => BS_TGT2

If the max occurrence is more than 1, then the multiple fields will screw up the logic...

Regards,

Henrique.

Former Member
0 Kudos

henrique,

thanks for the useful hint.

Rgds,

Amol

Answers (5)

Answers (5)

Former Member
0 Kudos

Never tried but just a suggestion...

we can manually write condition in expression editor for conditional receiver, using '>' , and 'and' operator..

select MaterialNo in expression editor --> Xpath Expression text box.. write condition as per requirement

The blog also talks about the same..

Former Member
0 Kudos

Hi Amol,

You can give ur own Xpath in the receiver determination screen instead of choosing graphically.

So construct ur own XPath (using the field at input message) for specific range and use it. I think it must be a kind of 100>f1<1000 expression.

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3774] [original link is broken] [original link is broken] [original link is broken];

Regards,

Sudharshan N A

former_member194786
Active Contributor
0 Kudos

Hi Amol,

I think its possible. Never tried though for a range.

Go through this link and check out what is described under the section "Notes Regarding the Use of XPath Expressions"

http://help.sap.com/saphelp_nw04/helpdata/en/43/a513f2632c332ce10000000a11466f/frameset.htm

I am not sure whether it will work for two conditions though, i.e. for a range( Greater than 100000100, less than 100001000).

Just try and let us know.

Regards,

Sanjeev.

Former Member
0 Kudos

Hi,

We can not put the range in xPath in RD, so it is not possible here but my suggestion is you add one more field (sys_name) in your data type target structure and in mapping check if the material number is in between the range then map the BS_TGT1 to sys_name else map BS_TGT2.

Now you can use the xPath easily by checking the value BS_TGT1 & BS_TGT2 from target structure.

sorry, we can not do mapping before RD.

Regards,

Sarvesh

prateek
Active Contributor
0 Kudos

No it is not possible. If u dont want to use the Enhanced receiver determination option, perform this range calculation in mapping and based on it pass true or false value to any dummy or unused target field. Then u can use simple conditions of standard receive determination.

Regards,

Prateek

Former Member
0 Kudos

Are you sure?

A mapping before Standard receiver determination?

prateek
Active Contributor
0 Kudos

Oops.. a mistake U cannot do this way.

The source data can only be used in Standard receiver determination. At sender, then u may try using adapter module to perform the calculations. Or use enhanced receiver determination.

Regards,

Prateek

Former Member
0 Kudos

Hi,

Its pretty straight forward with Enhanced receiver detrmination. But I not sure why you have avoided it.

I doubt if this could be done with X-path expression as the mapping is going to be changed based on the resulting values of Material from source side.

Please can you explain in more detail about the Material Range..as you may try to give the direct range in Conditional editor...but it depends upon the naming format of Material No.

Thanks

Swarup

Former Member
0 Kudos

yes, i know its possible to easily tackle this in ERD but for some reasons I want to avoid the same.

Lets assume that MaterialNo is always going to be a numeric value. Does that help?