
In Integration development often we are required to do Lookups and there is a need to produce output based on certain conditions and we are needed do perform Value Lookups.
SAP PO provide such few options to perform these lookups using SOAP, RFC or even based on fixed parameterized table, but sometime maintaining such tables with large no of records is not possible and not to mention doing lookups calls on external system is not that performance centric. Hence, the use of NetWeaver BRM for such lookup with logic validation is helpful.
The Use Case:
The purpose of this use case it to create a simple SAP BRM Rule service utilizing a Decision table (to store conditional records) and based on Input values and preset conditions and output is passed to interface for further message processing.
Environment:
- SAP PO 7.50 SP14
- Compatible SAP NetWeaver Developer Studio (NWDS)
Step1: Create Structure or External Definition
To Begin with we require a Structure to act as Request / Response for our Business Rules.
We can follow either of the option as below:
Option1 – Create a Data Type/Message Type in SAP PO
Option2 – Create an XML Scheme (XSD) directly in NWDS
Note: For our use case we will be going with Option1 since we already have to create other repository objects for our Integration.
- Login to Enterprise Service Builder, Select your Software Component Version, Namespace and create a Data Type/Message Type with name “BRM_ExtendedReceiver” as below:

- Export Message Type as Schema definition

Step2: Create Business Rule
- Open SAP NWDS and select “Rules Composer”
WindowàPerspectiveàOpen PerspectiveàotheràRules Composer

- Create New Project (Name the project as per your need)
Import XML Schema to project under srcàwsdl

- Add/Select schema elements to be used in Rules Definition
Select “Project Resources”àOpenàAliasesàAdd (XSD elements)


Note: Elements containing {} in their names as used as Output parameters.
- Create new Ruleset “ExtendedRules”

- Create one Decision Table “Tab_ExtendedRules” and select Import/Export parameters.
Decision table act as Value table and enables determining further behavior based on validations and conditions as described in Ruleset against table values.
In our scenario we have Plant and Storage Location as Conditions (Input parameters) based on their combination recipient Service (Party) and Component as Action (Output) will be determined.

- Add entries to newly created Decision Table by selecting “Add Condition Values by Pressing Ctrl++”

- Create Rule under Project as “ExtendedRule”
Add Condition and Actions to rules by clicking +
Condition = If Exists
Then
Action = Evaluate decision Table

- Create Web Service definition from out Rules Artefact as

Step3: Build and Deploy
Finally, it’s time to Save All of our changes and Build our project in Development Component and deploy it to Repository.
- Build the Development Artefacts
Select Project (Right Click) àDevelopment ComponentàBuild

Wait for the Processing to complete:

- Deploy our Artefacts
Select Project (Right Click) àDevelopment ComponentàBuild

Step3: Testing
We can perform initial testing of our Published service either by directly accessing it in WS Navigator or getting the WebService Definition (WSDL) and consuming it in external Tools such as SoapUI or Portman.
Note: For the sake of simplicity and in the interest of keeping this blog precise, we will use WS Navigator which is SAP PO out of the box tool for web service access and testing.
- Follow NWAàConfigurationàConnectivityàSingle Service Administration
Find service using keyword *rule*, select WSDLs and click “Test”
- On the Service Test screen input condition as Plant = ‘P100’ and Storage Location = ‘S101’

- These input values are validated against our Decision Table for existence.
Output is generated and can be validated in Result tab as
