2012 Nov 13 12:07 PM
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
2012 Nov 13 10:40 PM
Did you assign your event? Have you verified that your custom logic is being called?
Beyond that, the general concept can be a slippery slope. By invoicing billing documents out of order, you could run into problems later with reversal processes.
regards,
bill.
2012 Nov 23 8:07 AM
Hi
I believe we are trying to get to many things at the same time. Let me take 1 object at a time .
Billing Block : Billing block does not have a time stamp but only a reason for blocking the contract that prevents the system from creating billing documents. As long as the block is present at the contract account the system will not allow the contract to create a billing document.
Invoicing Lock: Using this functinality the system will allow the createing of biling document does not allow the creation of invoice document. Here it should be noted that the lock has a time stamp from and to date which playes a crutiacl role. The dates check only the system date and not the billing period. Hence for example if we have a lock valid from 01.11.2012 to 31.12.2012 and the current system adte is 23-11-2012, the system will nit allow to create an invoice document. The is true if we place a invoicing lock at the contract account level. However if system date crosses 31-12-2012,invoicing will proceed as the lock has expired.
Now comming to your question on selectively setting the invoicing lock for the past period in order to prevent the billing documents from creating invoicing documents. My answer would be that SAP does not allow to create an invoice documents without invoicing the previous billing docuements. The same is true if the previous customer is not ionvoived.
in this regard I completly agree with Bill comments and my advice would be that blocking the previous billing documents and invoiving the current ones is not the best practise followed and would refrian from going ahead with such requirements.
If you need any help kindly revert back