Delete Custom table sap abap

IF lt_itab1 IS NOT INITIAL.
*Deleting header table
DELETE ysd_abc FROM TABLE lt_itab1.
IF sy-subrc = 0.
lv_del_hdr
= sy-dbcnt.
*Deleting  item table
DELETE ysd_xyz FROM TABLE lt_itab2.
IF sy-subrc = 0.
lv_del_line
= sy-dbcnt.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.   " to remove atc error we have used this instead of rollback work
CLEAR: lv_del_hdr, lv_del_line.
ENDIF.
ENDIF.
ENDIF.
    


WHEN '2'.
RETURN.

ENDCASE.

IF ( lv_del_hdr IS NOT INITIAL AND
lv_del_line
IS NOT INITIAL ).

WRITE : text-004,lv_del_hdr,
/
text-005,lv_del_line.
ELSE.
WRITE text-006.
ENDIF.

Comments

Popular posts from this blog

Export data to xls using OOPS

Factory method ALV sap abap

Delete Selected Record in ALV Report