Hi,
If you want to differentiate in EKBE table, then proceed as follows:
Invoice: EKBE-BEWTP = "Q" and EKBE-SHKZG = "S"
Credit Memo: EKBE-BEWTP = "Q" and EKBE-SHKZG = "H"
If you want at invoice doc level, you may check in RBKP
Invoice: RBKP -XRECH ="X"
Credit Memo: RBKP-XRECH = blank
If you want in RSEG, you can use the same logic as EKBE, that is RSEG-HKZG = "S" for invoice and RSEG-SHKZG = "H" for credit memo.
Regards,
AKPT