Delivery type is customized to distribute the Inb delivery to EWM during the creation. However, the business requirement is to hinder the distribution for some deliveries during the creation and distribute them later.
The customizing path for the delivery type is customizing is as follows:
Spro > Logistics Execution > Shipping > Deliveries > Define Delivery Types
with the above mentioned customizing, delivery will be created with value B .
Overriding the customizing by enhancing Subroutine beleg_verteilung_pruefen in Program SAPMV50A
At the end of this subroutine , there is an enhancement point which could be used to suspend the distribution.
Sample code as follows.
IF t180-trtyp = 'H'. " H represents Create mode for Inb delivery . * your condition on the basis of which during creation distribution has to be suspended IF sy-subrc eq 0. * Set VLSTK as D , if an entry exists. cf_likp-vlstk = chard. ENDIF. ELSEIF t180-trtyp = 'V'. * Also the change mode has to be handled here. otherwise vlstk is set to status B [Distributed] . V represents the change mode through vl32N. [Change through idoc has to be tested.] * your condition on the basis of which during change distribution has to be suspended or set for release after the checks IF sy-subrc eq 0. IF checks_done EQ 'X'. cf_likp-vlstk = chara. ELSE. cf_likp-vlstk = chard. ENDIF. ELSE. * this delivery is not relevant. No intervention . ENDIF. ENDIF.
Creation and change mode both has to be handled here and the relevant logic to set the release ok has to be implemented too.
Badi le_shp_modify_distrib_status is marked as ‘can only be implemented internally at SAP’, otherwise that could have been a great possibility.
If there are any Questions or additional information, please comment below.