ABAP Development, MM (Materials Management)

Merchandise Distribution and ABAP

I recently was requested to implement a feature for merchandise distribution in SAP for putaway and cross-docking methods.

There are other methods like stock-placement, flow-through, and others however I will concentrate only on the mentioned ones.

Merchandise distribution consists in to group the storage transfer orders from plants to the distribution centers and create purchase orders by vendors (Pull). It also means that you can make a purchase order to distribute it across some plants using an allocation table (Push).

This feature will let DC distribute goods across the plants using the storage transfer orders when the merchandise is delivered by the vendor.

This procedure relates the purchases with the storage transfer orders, so every time merchandise is delivered by the vendor then those goods can be sent to the plants using these documents.

In this article, I will explain what to configure and provide some hints to implement and use this feature.

Let’s start by executing transaction SPRO and then go to menu Logistics – General / Merchandise distribution.

There we watch the following options but I will explain only some of them:

  1. Plant Profiles for Merchandise Distribution
  2. Plant Profiles for Distribution with Stock Reduction
  3. Adjustment Profiles per Processing Method
  4. Distribution Profile of Material in DC

In menu ‘Plant Profiles for Merchandise Distribution’ we create/copy the profiles for distribution centers. For the example I will copy the ‘001’ profile and create the new profile ‘Z01’ and the double click on the new profile.

There set the following configuration:

CD poss.: Indicates whether cross-docking is possible. Checked

FT possible: Indicates that flow-through is possible. Checked

Block.reas. for sales order: Default blocking reason for sales order delivery block. Empty

Rej. reason for sales order: Default rejection reason for sales order item. Empty

Delivery block: Delivery block (document header). Empty

Not picking-relevant: Cross-docking delivery is not relevant for picking. Empty. By default this option is checked however in our case every delivery in the system must be relevant for picking.

Next step double click on the option ‘Control Data for Each Business Process’ and then double click on the option 02 – ‘Pull’.

We are not going to configure the ‘Push’ scenario because we are not planning to make an allocation table. This scenario is based on the fact that we plan to supply plants with their necessities.

The push scenario is mostly used for promotions where the distribution for plants is made beforehand.

For the ‘Pull’ configuration we set some options for adjustments, delivery generation and others.

By default, the adjustment and delivery generation are set as ‘Manually (using a separate transaction)

When we leave this default configuration we need to execute transaction WF30 to manually make the distribution and manually generate the delivery documents as well.

We can also use transaction WF50 for merchandise distribution and WF51 for the same goal but as a job.

In this configuration, we can automate both the distribution and the delivery generation at the same time. It all depends on your requirements.

Besides manual adjustment in ‘Adjustment Point’, it is possible to adjust the distribution when goods receipt or when goods receipt checking size variance.

This means that when a good receipt is made using transaction MIGO (or any function module that makes receptions) the adjustment will be executed. By default, the system distributes the merchandise assigning all the goods it can to the first transfer order related and the remaining to the next transfer order until no distribution is needed.

For delivery generation besides manual generation, we can generate deliveries when goods receipt and after merchandise adjustment.

When the ‘Goods receipt’ option is set then the distribution is done and then the delivery is created.

Configure Point of Cross-Docking Delivery Generation, Point of Flow-Through Delivery Generation, and Point of Putaway delivery Generation according to your needs

After this configuration, we need to set the ‘Adjustment Profiles per Processing Method’ for the new profile.

In order to make the merchandise distribution to work, it is necessary to configure the adjustment on the profiles.

For our scenario, we will set the ‘Pull’ business process for method ‘Putaway’ and ‘Cross-docking’. We don’t need to configure the other methods unless we make a special configuration for them.

For my requirement, a special merchandise distribution is needed, so it’s necessary to configure and create an ABAP function to make this happen.

Double click on the new rows and check the following configuration:

Either way is there an over-delivery or an under-delivery you can create your own custom function.

The only requirement is to define a function with the same signature.

Let’s review the function ‘W_FRM_DISTR_PROPORTIONAL’ with transaction SE37:


*** Calculated the different single quantities

*   no division by zero!




For this explanation let me define some useful fields of table T_XFRET that you need to know if you need to make your own algorithm.

VMNGB_B: Remaining merchandise from collective purchase order to distribute

OMNGA_B: Remaining quantity of storage transfer order to be delivered

BLNRB: Collective purchase document number

BPOSB: Position of collective purchase

BLNRA: Storage transfer order number

BPOSA: Position of the storage transfer order

Finally, for this part of the configuration, we need to check the distribution profiles for material master data.

By default SAP comes with the distrbution profiles A, C and D. Check the SAP documentation in transaction SPRO for more information.

Double click in the distribution profile ‘A’ and set the adjustment profile to the newly created profile ‘Z01’.

Do the same with the distribution profile ‘C’.

Finally, there’s a BAdI that helped in the generation of collective purchases. In my requirement, I needed to make an implementation for ‘WFRM_DET_ORDER_TYPE’ to set the order type when WF10 is executed and the collective purchase is generated.

The BAdI has only one method; DETERMINE_ORDER_TYPE and is used to set the purchasing document type of the collective document. It also has 2 parameters:

Importing parameter

IM_ORDER_DATA type CPO_ORDER_TYPE_DET_DATA <— Create Coll. PO: Import Parameter BAdI for Document Type

Changing parameter

BSART type BSART <— Order Type

And that’s it, just remember that for any change in the configuration and the BAdI implementation a transport order is requested.

Now two things are left:

Update the distribution profile of the material the master data with ‘A’ or ‘C’ and use transactions WF10 to generate collective purchases and WF30 to make the merchandise distribution and generate the deliveries.

Facts to consider:

  1. Once the transaction WF10 relates collective purchases with storage transfer orders then STOs cannot be processed with transaction VL10B.
  2. If deliveries are generated they cannot be deleted and transaction WF30 will not reset the quantities.
  3. Transaction WF50 is used to adjust the distribution and it is called internally by WF30 when adjusting.
  4. If deliveries are to be generated after adjusting distribution then it would be very handy to use WF51 for mass processing.
  5. If the algorithm for under-delivery fails on goods receipt when deliveries are set to be generated then the only way to adjust merchandise and generate deliveries is using transaction WF30.
  6. The only report to check and review the merchandise distribution is WF30.
  7. Collective purchases can’t be modified.
  8. The table where the relation between collective purchases and STOs is FRET.

Leave a Reply

Your email address will not be published. Required fields are marked *