Routing Rule Creating Service


I am interested in a service, which can create a Routing rule and especially Routing Rules for B2B Service

I tried running the addRoutingRule, but the routing rule ends up with Status - Not ready. Further, ran the saveRoutingRule, but this removes all the entries made in the B2B Service transportParams

Could anyone help me?
Working on SAPBC 4.6

Try to set status = 1 at addRoutingRule input

The problem is that a routing rule in the SAP adapter 4.6 uses the sender address, reciever address and flow to invoke. This changes by environment.
So, the sender address in DEV is different than the sender address in QA. When you generate the service from the admin screen in IS, the folder structure includes the name of the SAP server. We have different names in DEV compared to QA.
The dev sap server is xDN , QA is xQN, Prod is xPN.

What do you think of putting all the routing rules in a seperate package?
That way we could call the same service from 3 different folder structures depending on a parameter value (by environment). What happens in PROD when a fix to this Routing rule package is promoted and the whole package is refreshed. If there are transactions using one of the other rules when the package is refreshed, won’t it lose the rule for a short time while the package is reloaded? Could we lose transactions? There is a queue in the SAP adapter that could queue up the transactions until the routing rule is available, has anybody tested this?

I found that there is a queue where messages will go during the refresh of the routing rule package. They will be found in trfc queue as failed. The SAP administrator would have to monitor the queue and either re-send them, or report to us about the issue being faced.
Hearing no objections beside the above, I will start to make a “best Practice”
of keeping all the routing rules in a single package at least for the SAP adapter version 4.6.

" I will start to make a “best Practice”
of keeping all the routing rules in a single package at least for the SAP adapter version 4.6."

Yeh its a good idea though and we did the same at my previous work and no issues with it…


Hello ,

Routing rule could be created using the config file.
1.Maintain three different config file for each environment D,Q & P.
2.Set the routing rule parameters in the config file in respective to the environment (sender, receiver & msg type…)
3. When package is loaded, fetch the config file using the startup service and create the routing rule by fetching the parameters from config file,
use the service ‘wm.PartnerMgr.gateway.admin:editRoutingRule’ with the mode ‘Add’ & ‘Save’
4. similarly the routing rules could be deleted, when the package is shutdown using the service ‘wm.PartnerMgr.gateway.admin:removeRoutingRule’


Thanks for the suggestion. I found the guide to the WmPartner package and it says that these services are not supported but internal. I tried to build a service that would check if the routing rule exists using a paramter file and then create it. I viewed at the source of the dsp pages to see how the service is invoked. One the first screen, there is an Add and on the second screen there is a save on wm.PartnerMgr.gateway.admin:editRoutingRule. I can run it without error (in a try/catch block) but the error log shows a ClassCastException. The generated service keeps getting some wierd characters in the transportParams.

I hard code (local) in the serverAlias in the wm.PartnerMgr.gateway.admin:editRoutingRule service but I get [Lcom.wm.util.Values;@1cb6ea6
I hard code SESSION in the valueScope but I get [Lcom.wm.util.Values;@86fa9f
This looks like an object of some sort.
The other 2 fields don’t get populated at all.

Any clues what’s going on?

Hello Jonb,

Yes, the service wm.PartnerMgr.gateway.admin:editRoutingRule is not supportted internally.
What you did is correct , but you missed to fix value for ‘flow’ & package’
set value for flow = testpackage.routing.%packageName%.%sender%.%receiver%:%msgtype%,
package = TestPackage

  • ‘packagename’ must be in small letter (i.e) indicates the root directory of the package for which
    the routing rule need to be created.
  • ‘package’ is the central package where the routing rule need to be created.
    In this case I used TestPackage

Hope this helps.


Have you done this before?
I tried to set value for flow = %packageName%.%sender%.%receiver%:%msgtype%,
package = %packageName%
and the others with packageName = jonb
but I still get the same problem.

The Routing Rules page looks ok but when I try to Edit the rule, I get an error screen, the Class Cast exception shows in the Error log on WmPartnerMgr.gateway.transport.B2B.getOption
The service that’s created doesn’t have the correct values in the transport fields.

I got it!
I had to have 3 steps:
wm.PartnerMgr.gateway.admin:editRoutingRule with Add
wm.PartnerMgr.gateway.admin:enableRoutingRule and drop the status field
wm.PartnerMgr.gateway.admin:editRoutingRule with Save

I don’t have to follow the path or flow name convention although it might
be useful for administering the rules.
I used jonb.utils:getFile for the transportParams service.
I used jonb.utils:frank for the Flow and jonb for the package.

I have to test it now with an IDOC from SAP. I’ll let you know if I have
any problems.

follow these steps.
wm.PartnerMgr.gateway.admin:editRoutingRule with add
drop status
wm.PartnerMgr.gateway.admin:editRoutingRule with save & overwrite = ‘true’

this will work .

if you still get probs then let me know.



in the third step hardcode overwrite = true.

similarly pass these parameters to delete the routing rule.

‘%sender%/%receiver%/%msgType%’ to the service wm.PartnerMgr.gateway.admin:removeRoutingRule

Shankar R D

In addition to status , drop these values in the second step


yes, I tried all the instructions you gave and it is working now. Thanks for all your help.

Hello bash,
the problem with WmPartners in 4.6 is: the Services are “internal” and what’s even worse: they use undocumented inputs and act quite strangly, if you don’t get these inputs right…

My advice: upgrade to SAP BC 4.7. It has a completely redesigned WmPartners with much better Services for Routing Rule manipulation, and these are even documented (and supported)!
The upgrade is quite easy. Just see the 4.7 InstallationGuide and SAP Note 770239.

Happy new year,