Moderator notice: the example here is NOT an example of best practice. Please read the discussion following and do not blindly follow this code.
datalt_bseg_tmp type table of bseg. " records not inserted
data lv_count TYPE i.
loop at lt_bseg into ls_bseg.
INSERT bseg fromls_bseg.
ifsy-subrc <> 0.
appendls_bseg into lt_bseg_tmp.
endif.
endloop.
DESCRIBE TABLE lt_bseg_tmp LINES lv_count.
Write:/ lv_count, ' Records could not be inserted'.
loop at lt_bseg_tmp into ls_bseg.
write:/ ls_bseg-BUKRS , ls_bseg-BELNR, ls_bseg-GJAHR, ls_bseg-BUZEI.
endloop.
Regards.
Ibr
Message was edited by: Matthew Billingham