作为顾问在项目上,难免会出现需要使用到快速复制功能(在之前老的版本是一个独立的addon叫Copy Express),在9和10的版本里,现在直接作为标准功能了,路径:管理-系统初始化-实施中心-实施任务,第三个选项卡(数据管理),界面中的第三个功能:在公司间复制数据。
当在这过程中出现内部错误,Internal error(-1) 131-183,通过大量的搜索,可以在SAP的交流社区找到解决方案,链接为:https://answers.sap.com/questions/13057997/internal-error-1-occured-131-183-during-quick-copy.html
按照大佬们的提示,可以查SAP的Note:1076082,按照提示SQL还是HANA,来执行数据检查。
内容如下,你也可以直接按照SAP Note号进行查询。
But before checking my article, I strongly suggest you to fix the UDT's and UDF's errors with SAP Note 1076082 - UDT & UDF Related Issues, this will probably lead you to advance to use the Quick Copy tool.
Note 1076082详细内容为:(如想看Note全部内容,则可以按照此链接去查看,不过是需要SAP的S-ID账号和密码登录后才能查看的哈。https://me.sap.com/notes/1076082/E)
Symptom
User-defined table (UDT) and user-defined field (UDF) related issues often have different impacts. For instance, you may not be able to perform an upgrade of the database or you may receive the following error message after logging on to an SAP Business One database: "The database structure has been modified. In order to resume the process, all open windows will be closed. Do you want to continue adding the user-defined field?"
This note provides a few generic queries to detect some common issues about UDTs and UDFs. If an issue is related to a UDT and UDF, the queries provided below will detect the known inconsistencies.
UDT is defined but does not exist.
UDT is not registered.
UDF is defined on an unregistered UDT.
UDF is defined but does not exist.
UDF valid values are defined for a non-existing UDF.
UDF definition does not match actuality.
UDF/UDT contains extra spaces.
UDF contains extra spaces in the TableID field in User-fields description in the CUFD table.
UDF contains extra spaces in the AliasID field in User-fields description in the CUFD table.
UDF column with space characters in its name was found by the SAP Business One upgrade Wizard.
UDT with space characters in its name was found by the SAP Business One upgrade Wizard.
UDF exists but is not defined in the CUFD table.
UDT exists with the name '@'.
Solution
In order to detect whether this issue affects your database, please run the following queries:
DETECTION QUERIES FOR SQL:
UDT is defined but does not exist:
select TableName from OUTB
where not exists (
select 1 from sysobjects where xtype='U' and [name]='@'+TableName
)
UDT is not registered:
select * from sysobjects where [name] like '@%' and name not in
(select '@'+tablename from outb
union all
select '@'+logtable from outb where logtable is not null) and xtype='U'
UDF is defined on an unregistered UDT:
select T0.TableID from CUFD T0 where left(T0.TableID,1)='@' and not exists (
select 1 from OUTB T1 where '@'+T1.TableName = T0.TableID or '@'+T1.LogTable = T0.TableID
)
UDF is defined but does not exist:
select TableID, AliasID from CUFD where not exists (
select t0.name, t1.name
from sysobjects t0 inner join syscolumns t1
on t0.xtype='U' and t0.id=t1.id
where t0.name=TableID and t1.name='U_'+AliasID
)
and TableID not in ('BTNT', 'BTNT1', 'OIBT', 'OSRI', 'SRNT', 'SRNT1', 'ODIB', 'ODSR')
UDF valid values are defined for a non-existing UDF:
select TableId, FieldID from UFD1 T
where not exists (
select 1 from CUFD where TableId=T.TableId and FieldID=T.FieldID
)
UDF definition does not match actuality:
select T1.UDF, T0.nvarchar_size as 'act_size', T1.nvarchar_size as 'def_size' from (
select T2.name + '.' + T3.name as 'UDF', T3.length/2 as 'nvarchar_size' from sysobjects T2 inner join syscolumns T3 on T2.id=T3.id where T2.xtype='U' and T3.xtype in
(select xtype from systypes where [name]='nvarchar')
) T0
inner join (
select tableid + '.U_' + aliasid as 'UDF', editsize as 'nvarchar_size'
from cufd where typeid='A' and editsize>1
) T1
on T0.UDF=T1.UDF
where T0.nvarchar_size>T1.nvarchar_size
UDF contains extra spaces:
UDF contains extra spaces in the TableID field in User-fields description in the CUFD table:
select * from CUFD
where datalength(TableID)<>LEN(TableID)
and ascii(SUBSTRING (TableID, LEN(TableID)+1, 1)) =32
UDF contains extra spaces in the AliasID field in User-fields description in the CUFD table:
select * from CUFD
where datalength(AliasID)<>len(AliasID)
and ascii(SUBSTRING (AliasID, LEN(AliasID)+1, 1)) =32
c. UDF column with space characters in its name was found by the SAP Business One Upgrade Wizard.
*
Select 'UDF column name ''' + COLUMN_NAME + ''' contains space characters in table ' + TABLE_NAME as "Resolution"
FROM INFORMATION_SCHEMA.COLUMNS t0 inner join cufd t1 on t0.TABLE_NAME = t1.TableID and t0.COLUMN_NAME = 'U_' + t1.AliasID
where t0.[COLUMN_NAME] like 'U[_]% %'
d. UDT with space characters in its name was found by the SAP Business One Upgrade Wizard
Select 'UDT name ''' + TABLE_NAME + ''' contains space characters' as "Resolution"
FROM INFORMATION_SCHEMA.TABLES t0 inner join outb t1 on t0.TABLE_NAME = '@' + t1.TableName
where t0.[TABLE_NAME] like '@% %'
For more information on checks 7c and 7d please see note 2781726
8. UDF exists but is not defined:
***
select T1.name [Table name], T0.name [Column name] from sys.columns T0 join sys.objects T1 on T0.object_id = T1.object_id
left join CUFD T2 on T2.TableID = T1.name and ('U_' + T2.AliasID) = T0.name
where T1.type = 'U' and T0.name like 'U/_%' escape '/'
and ('U_' + T2.AliasID) is null
and (T0.name !='U_NAME' and T1.name not in ('OUSR', 'AUSR', 'TDIB', 'TIBT', 'TDSR', 'TSRI','OEML'))
***
9. UDT exists with the name '@'
* Detect user-defined value linked to a table without a name:
SELECT * FROM CUFD WHERE TableID = '@'
* Detect tables without a name in a database:
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '@'
DETECTION QUERIES FOR HANA:
1) UDT is defined but does not exist.
select T0."TableName" from OUTB T0 where not exists (select 1 from sys.tables T1 where T1.schema_name = current_schema and T1.is_system_table = 'FALSE' and T1.table_name = '@' || "TableName");
2) UDT is not registered
select * from sys.tables
where schema_name = current_schema and is_system_table = 'FALSE' and table_name like '@%'
and table_name not in
(
select '@' || "TableName" from outb
union all
select '@' || "LogTable" from outb where "LogTable" is not null
);
3) UDF is defined on an unregistered UDT.*/
select T0."TableID" from CUFD T0
where left(T0."TableID",1)='@'
and not exists (select 1 from OUTB T1 where '@' || T1."TableName" = T0."TableID" or '@' || T1."LogTable"= T0."TableID");
4) UDF is defined but does not exist.*
select "TableID", "AliasID" from CUFD
where not exists
(
select 1 from sys.tables t0 inner join sys.columns t1 on t0.table_oid=t1.table_oid
where t0.schema_name = current_schema and t0.is_system_table = 'FALSE'
and t0.table_name="TableID" and t1.column_name='U_' || "AliasID")
and "TableID" not in ('BTNT', 'BTNT1', 'OIBT', 'OSRI', 'SRNT', 'SRNT1', 'ODIB', 'ODSR'
);
5) UDF valid values are defined for non-existing UDF.
select "TableID", "FieldID" from UFD1 T
where not exists (select 1 from CUFD where "TableID"=T."TableID" and "FieldID"=T."FieldID");
6) UDF definition does not match actuality.
select T2.table_name, T3.column_name "UDF", T3.length, T0."EditSize" from sys.tables T2
inner join sys.columns T3 on t2.table_oid=t3.table_oid
inner join cufd T0 on T0."TableID" = T2.table_name and ('U_' || T0."AliasID") = T3.column_name
where t2.schema_name = current_schema and T2.is_system_table = 'FALSE'
and T3.data_type_name ='NVARCHAR'
and T0."TypeID"='A' and T0."EditSize">1
and T3.length>T0."EditSize" ;
7a) UDF contains extra spaces in field TableID in User-fields description CUFD table.
select "TableID", "AliasID", "Descr" from CUFD where "TableID" LIKE '% %';
7b) UDF contains extra spaces in field AliasID in User-fields description CUFD table
select "TableID", "AliasID", "Descr" from CUFD where "AliasID" LIKE '% %';
7c) UDF column with space characters in its name was found by the SAP business One upgrade Wizard
select 'UDF column name ''' || column_name || ''' contains space characters in table ' || table_name as "Resolution"
FROM public.table_columns t0 inner join cufd t1 on t0.table_name = t1."TableID" and t0.column_name = 'U_' || t1."AliasID"
where schema_name = current_schema and column_name like 'U\_% %' escape '\';
7d) UDT with space characters in its name was found by the SAP business One upgrade Wizard
select 'UDT name ''' || table_name || ''' contains space characters' as "Resolution"
FROM public.tables t0 inner join outb t1 on t0.table_name = '@' || t1."TableName"
where schema_name = current_schema and table_name like '@% %';
8) UDF exists but is not registered
select T2.table_name, T1.column_name "UDF" from sys.columns T1
join sys.tables T2 on t1.table_oid=t2.table_oid
left join CUFD T0 on T2.table_name = T0."TableID" and T1.column_name = ('U_' || T0."AliasID")
where t2.schema_name = current_schema and T2.is_system_table = 'FALSE'
and T1.column_name like 'U/_%' escape '/'
and ('U_' || T0."AliasID") is null
and T2.table_name not in ('OUSR', 'AUSR', 'TDIB', 'TIBT', 'TDSR', 'TSRI','OEML');
9) UDT exists with the name '@'
* Detect user-defined value linked to a table without a name:
SELECT * FROM "CUFD" WHERE "TableID" = '@'
* Detect tables without a name in a database:
SELECT * FROM public.tables WHERE schema_name = current_schema AND table_name = '@'
Note for Points 2 and 8: The result set includes columns created both on SAP Business One system tables and user tables.
However, only columns created on SAP Business One tables should be considered, as those are potentially harmful.
A list of SAP Business One system tables is not available as it may differ from patch to patch.
Note for Point 4: After running the fix for Point 4, please run the detect query for Point 5 also and run the relevant fix if the detect query returns any result.
Note: Issue related to point 1,3,4,5,7a and 7b will be fixed after upgrading the database to SAP Business One 9.3 PL 10, check the SAP Note 2727525 - Auto-fixes for Upgrade UDT / UDF Related Issues for more detail.
Note: Issue related to point 9 will be fixed after upgrading the database to SAP Business one 9.3 PL 09, check the SAP Note 2732587 - Upgrade Wizard Error Precheck: Detect User Defined Value Linked to a Table Without a Name
If you receive any results from above queries, please create an incident using the Support Launchpad for SAP Business One and refer to this SAP Note. Also attach the results of the (attached) detection scripts to the newly created incident.
Other terms
CULG; the database structure has been modified; You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels
A_TABLE was not found in metadata, when loading existing UDFs.
General error; invalid name of function or procedure; CFF_CASHFLOW_OVERVIEW
Products
Products
SAP B1 VERSION FOR SAP HANA all versions
SAP BUSINESS ONE all versions