How to identify a cancelled invoice?
I am doing a program that takes invoices from EKBE Table, but I want to know if tinvoice is cancelled or not, otherwise I will not take it.
I have been checking all tables, and I haven´t found a flag or something that could tell me either the invoice is cancelled or not.
Is there a way to know it? A FM? Anything?
I hope you can help me. Thanks in advance.
PS: I have found a way. Take the reference of the invoice and check on RBKP if there is another invoice with same reference and transaction type RS. But I think this is too much, and make my program slow...I dont know. What do you think?
If the invoice is deleted before posting, you can may look for RBKP-RBSTAT = '2'. If the invoice is posted and then reversed, you can find an entry in table EKBE. Search for the entry with BEWTP = 'Q' (PO History Category) and SHKZG = 'H' (Debit/Credit Indicator) for the PO line.