3.4. Adaptation of stored procedures
3.4.1. Enable the standard PMX stored procedure
The following sections describe the process of enabling the standard PMX stored procedure with Microsoft SQL (section 3.4.1.1) and SAP HANA (section 3.4.1.2).
3.4.1.1. With Microsoft SQL Server
After the configuration is done, you need to enable the (custom) stored procedures in the stored procedure of SAP named “SBO_TransactionNotification”.
When applying the Produmex Add-on the first time to a database, you also need to adapt the stored procedure “SBO_SP_TransactionNotification”.
1. Open SQL Server Management Studio and connect to your database server.
2. Expand the Databases folder and locate the database to which you want to apply the Produmex Add-on.
3. Open this database directory and open the “Programmability\Stored Procedures” subdirectory.
4. Locate the “dbo.PMX_SP_TransactionNotification” stored procedure, right-click it and select “Modify”.
5. Locate the “Produmex Logex Addon Code” at the end of this stored procedure (see illustration below)
6. Copy the “Produmex Logex Addon Code”.
Now paste the code into the “dbo.SBO_SP_TransactionNotification” stored procedure as follows.
7. Locate the “dbo.SBO_SP_TransactionNotification” stored procedure, right-click it and selectModify
.
8. Paste the “Produmex Logex Addon Code” at the end of it. With a new installation you will see a marked area like “– ADD YOUR CODE HERE”.
9. Uncomment the SP by clicking on the Uncomment
button in SQL Management Studio.
10. Execute the SBO_SP_TransactionNotification stored procedure.
Continue with section 3.4.2. Enable a custom stored procedure.
3.4.1.2. With SAP HANA
After the configuration is done you need to enable the (custom) stored procedures in the stored procedure of SAP named “SBO_TRANSACTIONNOTIFICATION”.
When applying the Produmex Add-on the first time to a database you will also need to adapt the stored procedure “SBO_SP_TRANSACTIONNOTIFICATION”
1. Open the SAP HANA Studio and connect to your SAP HANA server.
2. Expand the “Catalog” folder and locate the schema to which you want to apply the Produmex Add-on.
3. Right-click on this schema and select “SQL Console” to open a new SQL console.
Keep this SQL console open during the whole process.
4. Expand the schema directory and open the “Procedures” subdirectory.
5. Locate the “SBO_SP_TRANSACTIONNOTIFICATION” stored procedure, right-click it and select “Open Definition”.
6. Open its content by opening the Create Statement tab:
7. Copy the content into the SQL console.
8. Locate the “PMX_SP_TransactionNotification” stored procedure, right-click it and select “Open Definition”.
9. Open its content by opening the Create Statement tab, and locate the “Produmex Logex Addon Code” at the end of this stored procedure (see illustration below).
10. Copy the “Produmex Logex Addon Code”.
11. This code should now be pasted into the SQL console, where you have already pasted the content of the “SBO_SP_TRANSACTIONNOTIFICATION” stored procedure. Paste the “Produmex Logex Addon Code” at the end of it. With a new installation you will see a marked area like “– ADD YOUR CODE HERE”.
12. Uncomment the copied code by removing the leading '–' from each line.
13. Add the following line on the top of your SQL console:
DROP PROCEDURE SBO_SP_TransactionNotification;
The SQL console should look like this:
14. Execute the code in your SQL console to modify the SBO_SP_TRANSACTIONNOTIFICATION procedure.
3.4.2. Enable a custom stored procedure
Every custom stored procedure related to Produmex WMS should be called from the PMX_TransactionNotification stored procedure as this stored procedure is executed from all Produmex WMS flows and processes when creating or modifying a document.
The SBO_SP_TransactionNotification is only called when creating or modifying a standard SAP document.
1. Open the custom stored procedure.
In this example: PMX_SP_OECTransactionNotification.
2. Select the commented text and copy it to the clipboard (Ctrl+C).
3. Open the PMX_SP_TransactionNotification for modification.
4. Paste the text to the PMX_SP_TransactionNotification (Ctrl+V) and uncomment it.
Note: If you have an older custom stored procedure, the header of the commented text may say that you should add it to the SBO_SP_TransactionNotification, but it should be added to the PMX_SP_TransactionNotification in this case as well.
5. Alter the PMX_SP_TransactionNotification with this modification.
Stored procedure call hierarchy
3.4.3. Enable the Notification Listener stored procedure
After configuring the SB1 Notification Listener, the stored procedures must be enabled in the “PMX_TransactionNotification” SAP stored procedure as follows.
Note: If the SB1 Notification Listener is not installed, continue with section 3.5. Register the Produmex add-on.
With Microsoft SQL Server
1. Open the SQL Server Management Studio and connect to your database server.
2. Expand the Databases folder and locate the company database to which you want to apply the Produmex Add-on.
3. Open this database directory and open the Programmability / Stored Procedures subdirectory.
4. Locate the dbo.PMX_SP_TransactionNotificationQueue stored procedure, right-click it and select Modify.
5. Locate the Produmex SboNotification Queue Code at the end of this stored procedure (see illustration below).
6. Copy the Produmex SboNotification Queue Code.
This code should now be pasted in the “dbo.PMX_SP_TransactionNotification” stored procedure in the Company database as follows.
7. Locate the “dbo.PMX_SP_TransactionNotification” stored procedure, right-click it and select Modify
.
8. Paste the “Produmex SboNotification Queue Code” at the end of it, right after the code you have copied for the Produmex Addon stored procedure (see 3.3.1. Enable the standard PMX stored procedure).
9. Uncomment the SP by clicking the Uncomment
button in SQL Management Studio.
The result should look like this:
10. Execute the PMX_SP_TransactionNotification stored procedure.
With SAP HANA
1. Open the SAP HANA Studio and connect to your SAP HANA server.
2. Locate the PMX_SP_TransactionNotificationQueue stored procedure, right-click it and select Open Definition
.
3. Open its content by opening the Create Statement tab.
4. Locate and copy the Produmex SboNotification Queue Code at the end of this stored procedure. This code should now be pasted in the PMX_SP_TransactionNotification stored procedure.
5. Locate the PMX_SP_TransactionNotification stored procedure, right-click it and select Open Definition
.
6. Open its content by opening the Create Statement tab.
7. Paste the Produmex SboNotification Queue Code at the end of it.
8. Uncomment the copied code by removing the leading '–' from each line.
9. Execute the code.