2008 May 14 5:24 PM
When I pass the verification I obtain the next message:
You may not delete or overwrite table "IBSIS" within a LOOP through itself ...
I don´t understand, can you help me please,
LOOP AT IBSIS.
BSIS = IBSIS-BSIS.
*----- Zur Stornierung vorgemerkte Posten ausschließen, ----------------
*----- z.B. Abgrenzungsposten ------------------------------------------
CHECK BSIS-XSTOV = SPACE.
CLEAR: XBSIS, XBSISGR.
*----- Fuellen der Gruppierungstabelle xbsisgr -------------------------
*----- und der Tabelle xbsis -------------------------------------------
*----- Sonderbearbeitung für WE/RE-Konten ------------------------------
PERFORM XBSIS_XBSISGR_FUELLEN.
DELETE IBSIS.
IF X_EXIT = 'X'.
REFRESH IBSIS.
EXIT.
ENDIF.
ENDLOOP.Cordial greetings.
2008 May 14 5:26 PM
Try with deleting with help of INDEX
LOOP AT IBSIS.
L_INDEX = SY-TABIX.
BSIS = IBSIS-BSIS.
*----- Zur Stornierung vorgemerkte Posten ausschließen, ----------------
*----- z.B. Abgrenzungsposten ------------------------------------------
CHECK BSIS-XSTOV = SPACE.
CLEAR: XBSIS, XBSISGR.
*----- Fuellen der Gruppierungstabelle xbsisgr -------------------------
*----- und der Tabelle xbsis -------------------------------------------
*----- Sonderbearbeitung für WE/RE-Konten ------------------------------
PERFORM XBSIS_XBSISGR_FUELLEN.
DELETE IBSIS INDEX L_INDEX.
IF X_EXIT = 'X'.
REFRESH IBSIS.
EXIT.
ENDIF.
ENDLOOP.
Regards,
Naimesh Patel
2008 May 14 5:28 PM
you can't delete the entire table while you're looping through it. Is that what you're trying to do?
if so, you need to exit the loop then delete the table.
if you are trying to delete just a row out of it, you need to specify that with the INDEX argument.
regards,
robert.
EDIT - Naimesh gave a good hint.. but also, there's a REFRESH IBSIS in there that will trigger a short dump if executed in the loop.
Edited by: robert phelan on May 14, 2008 6:29 PM
2008 May 14 5:32 PM
hi,
If i have understood your question correctly .. do this way ...
LOOP AT IBSIS.
LV_INDEX = SY-TABIX.
BSIS = IBSIS-BSIS.
*----- Zur Stornierung vorgemerkte Posten ausschließen, ----------------
*----- z.B. Abgrenzungsposten ------------------------------------------
CHECK BSIS-XSTOV = SPACE.
CLEAR: XBSIS, XBSISGR.
*----- Fuellen der Gruppierungstabelle xbsisgr -------------------------
*----- und der Tabelle xbsis -------------------------------------------
*----- Sonderbearbeitung für WE/RE-Konten ------------------------------
PERFORM XBSIS_XBSISGR_FUELLEN.
* DELETE IBSIS.
IBSIS-FLAG = 'X'.
IF X_EXIT = 'X'.
* REFRESH IBSIS.
CLEAR IBSIS.
EXIT.
ENDIF.
MODIFY IBSIS INDEX LV_INDEX TRANSPORTING FLAG.
ENDLOOP.
DELETE IBSIS WHERE FLAG = 'X'.