We blocked billing document for some contracts using billing lock reason in contract (es21)
We want to remove this billing block from this month but we want to keep the lock for past period and invoice only new billing documents ( standard billing will invoice all the past billing documents during lock period)
We used from/to validity lock period but it doesn't work : the contract is still blocked for invoicing.
SAP Support told us to use event R403 :
"in transaction FQEVENTS you may find all information about the event
R403. You may keep on eye on the following tables before and after
calling R403. The current content with the contract lock is
T_EITRGR[] Table[0x99] <<< empty
T_EVERLOCK[] Table[1x47]
T_EITRLOCK[] Table[9x95]
T_C_BILL_DOC Table[9x592]
Since the internal table T_EITRGR[] is empty the invoicing terminates.
Table T_C_BILL_DOC contains all billing document which can be invoiced.
So here, you may decide which billing documents should be included"
we added the following code to r403 event ( FM copy of ISU_SAMPLE_R403)
---------------------------------------------------------------------------------------------------------------------
CLEAR: yjis_ever_lock,
yjis_eitr_lock,
yjit_eitr_lock[],
ls_eitr,
ls_bill_doc.
*
* reald blocked contracts, blocking reason et blocking period
LOOP AT t_ever_lock INTO yjis_ever_lock.
EXIT.
ENDLOOP.
*
IF ( yjis_ever_lock IS NOT INITIAL AND
yjis_ever_lock-invlockr = '9' ). "Cas EP - éclairage public
LOOP AT t_bill_doc INTO ls_bill_doc.
IF ( ls_bill_doc-erch-endabrpe >= yjis_ever_lock-invlockrvon AND
ls_bill_doc-erch-endabrpe <= yjis_ever_lock-invlockrbis ).
*
* The newest T_EITR_LOCK will be YJIT_EITR_LOCK
READ TABLE t_eitr_lock INTO yjis_eitr_lock
WITH KEY belnr = ls_bill_doc-erch-belnr BINARY SEARCH.
IF sy-subrc = 0.
APPEND yjis_eitr_lock TO yjit_eitr_lock.
ENDIF.
*
ELSE.
* The move to T_EITR
READ TABLE t_eitr_lock INTO yjis_eitr_lock
WITH KEY belnr = ls_bill_doc-erch-belnr BINARY SEARCH.
IF sy-subrc = 0.
MOVE-CORRESPONDING yjis_eitr_lock TO ls_eitr.
MOVE xe_group TO ls_eitr-e_group.
APPEND ls_eitr TO t_eitr.
ENDIF.
ENDIF.
*
ENDLOOP.
IF yjit_eitr_lock[] IS NOT INITIAL.
t_eitr_lock[] = yjit_eitr_lock[].
ENDIF.
ENDIF.
----------------------------------------------------------------------------------------------------
But after the execution of the R403 event, the standard billing ignores all the modifications made by the R403 event.
Can anyone help us?
Regards.
Al Mahdi BENABDESSELAM.
ONEE