2014 Feb 11 1:59 PM
Hi,
I am using a SQL INSERT statement to add records to a "Z" table in SAP.
Other than SY_SUBRC, what can I look at to determine the status of the INSERT?
For example, if I write a record that fails due to a duplicate key, other than SY_SUBRC, what can I look at to tell me the exact cause of the failure?
Thanks for your help,
Andy
2014 Feb 11 3:01 PM
If you mean "Native SQL" with EXEC SQL. ... ENDEXEC. ,then you can (should) catch catchable exceptions from CX_SY_NATIVE_SQL_ERROR From there you will get exact error texts of what happened.
If you mean "Native SQL" with EXEC SQL. ... ENDEXEC. ,then you can (should) catch catchable exceptions from CX_SY_NATIVE_SQL_ERROR From there you will get exact error texts of what happened.
2014 Feb 11 2:05 PM
Hi Andrew,
You can check SY-DBCNT which should give you how many records are updated/inserted.
Regards,
R
2014 Feb 11 3:01 PM
If you mean "Native SQL" with EXEC SQL. ... ENDEXEC. ,then you can (should) catch catchable exceptions from CX_SY_NATIVE_SQL_ERROR From there you will get exact error texts of what happened.
2014 Feb 11 3:58 PM
Thank you Tomas and Rurda.
This is exactly what I was looking for!
Appreciate it.
Andy
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |