SAP Material Management
SAP Material Management
Introduction
This sample shows the automation of SAP GUI desktop client.
The idea behind sample is to perform a simple action like creating material upon which the more complex automation can be built.
During execution the bot makes use of both desktop and SAP driver.
Prerequisites
- Configured Debtor Notification Channel. Config name parameter is related to
notification.channels.config
value from ControlServer configuration.
To run SAP automation the initial setup must be performed as described in SAP Driver node preparation
configuration params:
key | default value | required | description |
---|---|---|---|
sap.path | C:/Program Files (x86)/SAP/FrontEnd/SAPgui/saplogon.exe | no | |
sap.connection | S4HANA 1909 | no |
secret vault:
alias | value |
---|---|
sap.user | {"user": "RPABOT", "password": "Password1"} |
AP module is implemented in eu.ibagroup.easyrpa.ap.productsreader.ProductsReaderAp
class and consists of a single task CreateMaterial.
In standalone mode the AP can be started from main method of eu.ibagroup.easyrpa.ap.creatematerial.LocalRunner
class.
Included Steps
Execution starts with desktop driver opening Sap Logon. After first window is loaded the bot clicks on the connection defined in sap.connection
setting.
Then the bot types in User and Password retrieved from sap.user
secret vault alias
After successful login the bot enters /NMM01
transaction code in upper left field.
/N
prefix signifies that the transaction will be open in the same window
MM01
corresponds to new material creation
Create Material (Initial Screen) Page. The bot fills in the fields 'Industry Sector', 'Material Type fields' and clicks Continue.
Select View(s) popup appears, where the bot selects 'Basic Data 1' and clicks on the green check.
Next opens the Create Material page, where Description field is set to 'EasyRPA material. Material code: 2353' and base unit is set to AU.
All is set, the bot presses Ctrl+S to save material and the view returns to Create Material (Initial Screen) Page.
Now to logoff the bot enters /nex
which means to finish session without warnings.
Finally to close the last SAP Logon window the bot runs the command TASKKILL /F /IM saplogon.exe /T
which immediately terminates the application.
As the last step the bot sends an Excel file with information on materials created via email.
You can later check newly created material by using transaction code MM60. Start typing in code or name in material field and you'll see it in a dropdown list.