01-04-2024 1:20 PM
Hello community
I have the following code:
IF option EQ 'SAVE_DATA'.
* Eliminar o registro existente para não gerar duplicidade..
DELETE ztbfi905 FROM TABLE it_ztbfi905_sel.
"
COMMIT WORK AND WAIT.
* Atualizar o registro da tabela ztbfi905 com as informações referentes ao estorno e correção da hora de criação do documento de provisão
MODIFY ztbfi905 FROM TABLE it_ztbfi905_sel.
"
COMMIT WORK AND WAIT.
"
LOOP AT it_ztbfi905_sel INTO wa_ztbfi905.
* Armazenar os registros que serão retornados pela função
APPEND wa_ztbfi905 TO it_ztbfi905_back.
ENDLOOP.
ELSE.
it deletes it first and then puts it back, but in some cases the update doesn't work
This only occurs in the production environment
Does anyone have any idea how to monitor this to know if the problem is really in the database?
01-04-2024 1:24 PM
The code is in one line and full of <br>.
Ctrl+Shift+V (unformatted paste) may help you.
01-04-2024 10:00 PM
Based on my experience, 99% of all such cases were due to a program bug. If there's a database error, the ABAP program should abort (or the exception is intercepted by a calling program). The 1% left were due to database triggers or database indexes which prevent the update.
Now, back to the 99%, I advise to debug the program to understand what the problem is. As always, if you can't find the issue, you must add ABAP code to facilitate the analysis.
01-05-2024 6:07 AM
This program runs once at a time ?
(but why this do you use this strange code ??)
01-08-2024 1:11 PM
Why do you delete records before using MODIFY, the deletion should not be required, could you explain ?