How to forbid deleteing following documents
Hi all,
How can I forbid to delete a following document?
For example, when I have made a good receipt I can delete the PO or when I have entered an invoice I can cancel the receipt.
Does exist some messages or setting? (different to a user exit)
Thanks in advice, Emilio Jofré
UP !!
Up !!
Hi,
At this moment, there is only one validation that SAP will do for you that is when Invoice has been posted, then any reversal of GR will get an error. This will be achievable by not flagging on the 'Reverse GR despite IR' indicator in Transaction OMBZ. For the case of cancellation of PO line item despite GR, then you should use the User Exit to validate it.
Cheers,
HT
I've tried to find that user exit.... no success
Hi,
Check in User Exit EXIT_SAPMM06E_012 which includes ZXM06U43.
Cheers,
HT
_________________
Moderator:
Hi,
Check in User Exit EXIT_SAPMM06E_012 which includes ZXM06U43.
Cheers,
HT
Excellent !!
It works
-------------------------------------------------------------------------------------
*----------------------------------------------------------------------*
* INCLUDE ZXM06U43 *
*----------------------------------------------------------------------*
TABLES: EKBE,
EKPO.
DATA: TOT LIKE EKBE-DMBTR.
LOOP AT TEKPO. " WHERE LOEKZ EQ 'L'.
IF TEKPO-LOEKZ EQ 'L'.
SELECT * FROM EKBE WHERE EBELN EQ TEKPO-EBELN AND
EBELP EQ TEKPO-EBELP AND
( VGABE EQ '1' or
VGABE EQ '2' ).
IF EKBE-SHKZG EQ 'S'.
TOT = TOT + EKBE-DMBTR .
ELSEIF EKBE-SHKZG EQ 'H'.
TOT = TOT - EKBE-DMBTR .
ENDIF.
ENDSELECT.
IF TOT NE 0.
MESSAGE ID '00' type 'E' NUMBER '398'
WITH 'No se puede borrar, posee historial'.
ENDIF.
ENDIF.
ENDLOOP.
---------------------------------------------------------------------------