Loading WT Not Saved
Loading WT Not Saved
Symptom
You develop an own report/transaction in EWM to perform one of the following actions on delivery
documents: loading, reverse loading, unloading and reverse unloading.
In the custom code you call the standard delivery service provider to perform the action (class
/SCDL/CL_SP or its corresponding subclasses).
In the background warehouse tasks may be created but they are not saved during delivery save
which results an inconsistent state.
Other Terms
It is highly recommended to read the documents attached to consulting note 1414179 before doing
any delivery-related developments in the EWM system.
Disclaimer: Note that most of the mentioned methods are no official released functions. SAP does
not guarantee that they will be kept stable. SAP may change/remove them without notice. Any use is
at your own risk.
Solution
In the standard delivery the core service provider is called to perform loading/unloading actions on
delivery documents. It is handled in the service provider BAdI implementation class
/SCWM/CL_IM_SP_EX_ASPECT.
In the method ACT_HEAD_LOAD the event WT_CREATED is raised when warehouse tasks have to be
saved, not only the delivery changes.
If the WT_CREATED event is not handled and the warehouse tasks are not saved by the custom code
then inconsistencies will occur in the database due to missing data.
You have to prepare your code to handle this event and save the warehouse tasks if necessary
before saving the delivery changes.
When the save action is triggered on the UI of /SCWM/PRDO then the method /SCWM/CL_SP->
/SCMB/IF_SP_TRANSACTION~SAVE is called. If the flag has the value 'X' (abap_true) then it saves the
warehouse tasks by calling /SCWM/TO_POST before saving the delivery documents with the core
service provider (/SCDL/CL_SP->/SCDL/IF_SP1_TRANSACTION~SAVE).
Conclusion: saving the changes by calling the core service provider may not be enough when
warehouse task are created in the background. In such case you also have to call the corresponding
WOP function to save all the data consistently. You may use the standard method /SCWM/CL_SP->
/SCMB/IF_SP_TRANSACTION~SAVE as reference.
Other Components
Component Description