3. Database Issues
3.0.1. ERROR 41025: Unknown error when adding BO with key... 0x80010105 (RPC_E_Serverfault)
ERROR 41025: Unknown error when adding BO with key '0' of type XXX in SBO with exception message 'The server threw an exception. (exception from HRESULT: 0x80010105 (RPC_E_Serverfault))
Often this error occurs when the server runs out of memory because of a heavy transaction. The PMX SP will be killed first because it's so heavy and needs a lot of memory. When restarting the server, this issue will not occur anymore.
Produmex is looking further into this, by removing the cause, which is a large SP, and cutting it up into several smaller SP's.
3.1. Database Upgrade
3.1.1. Unable to end SQL transaction (HANA)
Issue
On HANA, sometimes you can get the following error message while executing the Produmex database upgrade:
Error: TargetInvocationException: Exception has been thrown by the target of an invocation. —>
ProdumexError 41028: SBO error when updating BO with key 'OITM.PMX_UMMT' of type 'Produmex.Foundation.Data.Sbo.BusinessObjects.SboUserFieldMD' in SBO with error code '-1116' and description 'Unable to end SQL transaction
'
Solution
In this case, you have to:
- disable the stored procedure
PMX_SP_TransactionNotification
by removing the corresponding code from theSBO_SP_TRANSACTIONNOTIFICATION
procedure - execute the Produmex database upgrade again
- re-enable the
PMX_SP_TransactionNotification
procedure
3.1.2. Cannot use duplicate view name
Issue
In some cases you can get the following error message while executing the Produmex database upgrade:
transaction rolled back by an internal error: cannot use duplicate view name: PMX_SSCC_SHIPPING_LABEL
Most of the time this error occurs when the view mentioned in the error message exists in both the company database and the Produmex database. This cannot happen for PMX views, as the Produmex database upgrade will automatically create synonyms for views between the 2 databases, and this doesn't work if the synonym to be created already exists as a view.
Solution
Remove the unneeded view. If unsure, and if it's not a custom view, you can remove the view in both databases, as the Produmex database upgrade will re-install the view where it's needed.
3.1.3. Unable to update DB Tools (SQL)
Issue
Error: ComException Cannot resolve the collation conflict between “SQL_Latin__General_CP850_CI_AS” and “SQL_Latin_General_CP1_CI_AS” in the equal to operation.
Solution
On database level, the collation should be SQL_Latin1_General_CP850_CI_AS
--Verify the collation setting. SELECT name, collation_name FROM sys.databases WHERE name = N'MyDatabase'; GO
When installing PDMX on a database with collation SQL_Latin1_General_CP1_CI_AS The installer will first add stuff to this DB like UDF, tables etc, and afterwards we get an error saying that the collation is not correct. The problem is that at this time, it’s too late to change the collation to SQL_Latin1_General_CP850_CI_AS because when we change it on database level, the UDF’s aren’t changed and they stay on CP1.
The solution is to drop the database and restore it back with the basic SAP DB (without PDMX fields), change the collation and redo the PDMX installation.
3.1.3. Error updating UDF during DB upgrade
Issue
A UDF cannot be updated with the Produmex database upgrade tool.
Solution
- try to update the same UDF with the SAP B1 client.
- Disable the call to our SP from within the SBO_SP_TransactionNotification.
- Stop running the Produmex add-on loader
- Recompile PMX_SP_TransactionNotification
3.1.4. Error updating UDF during DB upgrade
Issue
When upgrading Produmex WMS to a newest version the following error may come up:
Error: SqlException: Error: The new name 'IX_PMX_OSEL:TypeCode' is already in use as a INDEX name and would cause a duplicate that is not permitted.
Solution
- Delete the following database index in your system: Tables→dbo.PMX_OSEL→Indexes→IX_PMX_OSEL:TypeCode (Non-Unique, Non-Clustered)
- Then run the database upgrade process again
3.2. HANA
3.2.1. Violation of primary key constraint
Issue
When performing some operation in Produmex, you get the following error message:
Could not execute 'INSERT INTO PMX_xxxx (…)
[301]: unique constraint violated: Table(PMX_xxxx)
Solution
When the system cannot insert new records into PMX tables, it most usually means that the key sequences are inconsistent, and need to be rebuilt.
This typically occurs after importing a database, or importing data with the Produmex import tool. The reason is that the sequences are reinitialized by the import process, so the next insert would try to insert key 1 again, leading to primary key issues.
In these cases the procedure below needs to be executed, in order to rebuild the Produmex sequences from the actual data found in the tables.
Note: in Produmex version 5.1 and older, the procedure doesn't exist and you need to create it before executing it. You can create the procedure with the following code:
CREATE PROCEDURE "PMX_SP_RebuildSequences" () LANGUAGE SQLSCRIPT AS v_seqName NVARCHAR(256); v_resetByQuery NCLOB; v_restartWith BIGINT; BEGIN DECLARE CURSOR cur FOR SELECT SEQUENCE_NAME, RESET_BY_QUERY FROM sys.sequences WHERE SCHEMA_NAME = current_schema AND SEQUENCE_NAME LIKE 'PMX_%' AND LENGTH(RESET_BY_QUERY) > 0; OPEN cur; FETCH cur INTO v_seqName, v_resetByQuery; WHILE v_seqName IS NOT NULL DO DELETE FROM TMP_TN_CharListTable; EXEC 'INSERT INTO TMP_TN_CharListTable ("idx") ' || v_resetByQuery; SELECT TOP 1 "idx" INTO v_restartWith FROM TMP_TN_CharListTable; EXEC 'ALTER SEQUENCE "' || current_schema || '"."' || v_seqName || '" RESTART WITH ' || v_restartWith || ' RESET BY ' || v_resetByQuery; FETCH cur INTO v_seqName, v_resetByQuery; END WHILE; END;
After having created it, or if it was already existing, you have to execute the procedure the following way:
CALL "PMX_SP_RebuildSequences" ()
3.2.2. Inconsistent calculation model
Issue
Sometimes an SQL query can fail with an error message similar to this:
[SAP AG][LIBODBCHDB32 DLL][HDBODBC32] General error;2048 column store error: search table error: [34011] Inconsistent calculation model;CalculationNode(TABLE_EW_PRODUCTION:hana01:30003:COL_0x7f0926c872000x7f09260a5e701) → attributes → attribute (COL38):Datatype string(1) of COL38 does not match to datatype fixedstring(1) in datasource
Solution
This error is usually not an SQL syntax error, but an error on the HANA server. If the error persists, restarting the HANA server should solve the issue in most of the cases.
3.2.3. Invalidated procedure
Issue
It can happen that a procedure needs to be recompiled after having been modified. When this happens, you'll get an error message like the following:
Could not execute 'CREATE PROCEDURE SBO_SP_TransactionNotification ( in object_type nvarchar(20), – SBO Object Type …' in 14 ms 515 µs .
SAP DBTech JDBC: [430] (at 961): invalidated procedure: PMX_SP_TransactionNotification: line 32 col 7 (at pos 961)
Solution
To solve this problem, you have to recompile the invalidated procedure. This can be done as follows:
ALTER PROCEDURE "<yourSchema>"."PMX_SP_TransactionNotification" RECOMPILE
or
ALTER PROCEDURE "<yourSchema>"."SBO_SP_TRANSACTIONNOTIFICATION" RECOMPILE
Note that if the SBO_SP_TRANSACTIONNOTIFICATION
procedure is the invalidated procedure, it's impossible to book transactions or modify master data in SAP B1: strange red error messages come every time.
If this doesn't help, you can also try to re-create completely the stored procedure, with the DROP PROCEDURE
and CREATE PROCEDURE
commands.
3.2.4. Crystal report cannot connect to HANA server
On MSSQL, the connection data will be replaced dynamically when printing, therefore it is not necessary to save the report with the actual connection data.
On HANA, the connection data will not be replaced dynamically therefore it is necessary to save the report with the actual connection to the right database and schema. Use the “ODBC (RDO)” connection type, with the following connection string:
DRIVER={HDBODBC32};SERVERNODE=yourserver:30015;DATABASE=yourdatabase
3.2.5. Cannot display view definition in HANA Studio
Issue
In some old versions of HANA Studio, you might get the following error message when trying to open the definition of a view:
Invalid table name: Could not find table/view M_VIEW_CACHE in schema PUBLIC
Solution
First try to upgrade your HANA Studio installation to the latest available version.
If that's not an option, you can get the view definitions with the following query:
SELECT CAST(DEFINITION AS NVARCHAR(4000)) FROM PUBLIC.VIEWS WHERE SCHEMA_NAME = 'YOUR_SCHEMA' AND VIEW_NAME = 'YOUR_VIEW'
3.2.6. Cannot create pick list proposal due to special character in address
Issue
The creation of a pick list proposal fails when some special Unicode characters are present in the business partner's address.
For example, the Canadian flag can be represented by these Unicode characters, which causes this issue:
ERROR [42000] [SAP AG][LIBODBCHDB32 DLL][HDBODBC32] Syntax error or access violation;257 sql syntax error: incorrect syntax near “27 Kings College Circle Canada ????
Toronto ON M5S 1A1
CANADA”: line 1 col 542 (at pos 542)'
Solution
Remove the special characters from the business partner's address.
3.2.7. SYSTEM user is locked
Issue
With default HANA server settings, the SYSTEM user will be automatically locked after a number of failed login attempts.
When this happens, HANA Studio will also fail to connect to the HANA server with the SYSTEM user. The error message is
Invalid user name or password Change…
Solution
It's possible to disable the automatic locking of the SYSTEM user by changing the password_lock_for_system_user parameter to false.
Instructions to reset the SYSTEM user's password are described in SAP Note 2274157