INSERT<target>FROMTABLE [ACCEPTING DUPLICATE KEYS] 插入数据时,避免有相同主键引起dump error错误,使用ACCEPTING DUPLICATE。此时sy-subrc返回4. 三、UPDATE 一条数据 UPDATE<target>FROM<wa>."表结构相同 多条数据. UPDATE<target>FROMTABLE.UPDATE<target>SET<set1> <set2>WHERE<cond>. 四、DELETE 一条数据 ...
SY-SUBRCis set to 0. If one or more lines cannot be inserted because the database already contains a row with the same key, a runtime error occurs. We can prevent the runtime error occurring by using the addition ACCEPTING DUPLICATE KEYS. In this case, the rows that would cause ...
ABAP之SQL操作(select、insert、update、delete、modify)⼀、SELECT 语句 SELECT <lines>[DISTINCT]<columns>[AS<alias>]INTO|APPEND [CORRESPONDING FIELDS OF]<wa> TABLE[PACKAGE SIZE<n>]..FROM <dbtab>[AS <alias>]<options> UP TO <n> ROWS...[INNER]JOIN <dbtab> [AS <alias>] ON <cond><...
INSERT <dbtab> FROM TABLE [ACCEPTING DUPLICATE KEYS]. First INSERT statement will insert the lines from the work area (<wa>) into the specified database table (<dbtab>) Second INSERT statement will insert the lines from an internal table into the specified database table. ACCEPTING ...
If the additionACCEPTING DUPLICATE KEYSis not specified, the handleable exception CX_SY_OPEN_SQL_DB is raised when a duplicate row is inserted. Rows continue to be inserted until the exception is raised and handled. The number of inserted rows is undefined. The system fieldssy-subrcandsy-dbcn...
4The additionACCEPTING DUPLICATE KEYSis specified and not all rows of the internal table were inserted, since a row with the sameprimary keyor a uniquesecondary indexexists in the database table. Variant 4 INSERT target FROM ( SELECT subquery_clauses[UNION ...]). ...
SAP Managed Tags: ABAP Development Hi I need a big help, I'm trying to insert 3 rows into ZTABLE with same keys (MANDT,FILENAME) but it's not possible, this is code line: INSERT ZTABLE FROM TABLE IT_ZTABLE ACCEPTING DUPLICATE KEYS. How can I do? Thanks in advance, It's URGE...
SAP Managed Tags: ABAP Development Use, addition ACCEPTING DUPLICATE KEYS , it will avoid inserting duplicates and returns sy-subrc as 0... Hope it helps Regards, Pavan Reply Former Member 2009 Apr 01 1:09 PM 0 Kudos 111 SAP Managed Tags: ABAP Development You cannot do that ...
2. ... FROM TABLE itab [ACCEPTING DUPLICATE KEYS] ... After FROM and VALUES, you can specify a non-table-type data object wa. After FROM, you can also specify an internal table itab. The contents of the row(s) to be inserted are taken from these data objects UPDATE ... { {...
SAP Managed Tags: ABAP Development Duplicate database errors usually occurs if there are more than one entry which is having the same primary key fields...which is totally not acceptable... However you can skip this dump by writing insert...ACCEPTING DUPLICATE... Reply Former Member Optio...