This page is created to clarify the application logic of report ZZ_CORR_EKES_EKBE and ZZ_CORR_EKES_DABMG.
Using this debugging guide, you can see, how the correction report should work. If the report doesn't correct the document or provide unexpected result, you can use this guide to find the cause.
To determine the relevant report, always refer to KBA 2044484.
First, system checks whether there is maintained customizing for Shipping Notification in OLME path Purchasing → Confirmations → Define Internal Confirmation Categories.
If yes, system gathers the relevant entries from table EKES using the Confirmation Category (EBTYP) in the customizing as filter. Then system loops at the found entries.
For each iteration system checks, if the GR assignment is active for the Confirmation Sequence.
In case it is active, system processes the entry further, if not it skips the entry.
Then system gathers the history entries from tables EKBE and EKBEH and calculates the new DABMG based on the found GRs.
Afterwards system checks, if the newly calculated DABMG differs from the original DABMG in table EKES. If it differs, system sets the new DABMG as EKES-MENGE and EKES-DABMG. This occurs when the new and original DABMG are equal and EKES-MENGE is less than EKES-DABMG.
In case system couldn’t find any GRs in the history, system checks, if it can find any relevant entry for the Confirmation in table LIPS. If yes, system sets the EKES-DABMG zero, because no GR was found in the history. If no, system not only set the DABMG zero, but EKES-MENGE as well, because no Confirmation could be found.
Finally, as the EKES table can be updated, system redistributes the reduced quantities in table EKET as well to be consistent with table EKES. This is done by FM ME_CONFIRMATION_MAINTAIN.
First, system checks if there are any return delivery in EKES. If yes, it loops at the found entries and checks if the DABMG of corresponding Inbound Delivery is negative or zero.
If DABMG is negative or zero, system gathers the schedule lines from EKET and it sets the EKES-MENGE into field DABMG.
As EKES-DABMG has changed, system redistributes the reduced quantities in table EKET as well to be consistent with table EKES. This is done by FM ME_CONFIRMATION_MAINTAIN.