Supply Chain Management Blogs by SAP
Expand your SAP SCM knowledge and stay informed about supply chain management technology and solutions with blog posts by SAP. Follow and stay connected.
cancel
Showing results for 
Search instead for 
Did you mean: 
Michael_Haase
Product and Topic Expert
Product and Topic Expert
2,347

Dear friends of TM,

With SAP S/4HANA 2023 FPS1, we published a first version of our TM based Sales Order Scheduling for scenarios with TM embedded. The feedback of customers and partners was very positive, thanks a lot for that!

But soon questions came up whether we offer TM scheduling also for other business documents to support additional scenarios. Any official statement to that can be found in our roadmap. But with this blog post I want to share my personal experiences when I implemented a prototype to enable TM scheduling for stock transport orders, based on the same scheduling capabilities as for TM based Sales Order Scheduling, in an TM embedded scenario.

So, this is no official guideline or anything like that. Also this is no statement that this functionality will be published soon in standard delivery. It’s just my personal experience, giving some hints how it’s possible to do the implementation without any modification to standard code, just by configuration and development in Z-coding, based on SAP S/4HANA FPS1 resp. FPS2. I also don’t want to give any implementation details, just pointing out on high level how it’s achieved in coding. So, I ask for your understanding that I also can’t discuss your coding or share mine.

But let’s go into details.

Scenario Overview

Basically, we have a process component Business Process Scheduling (BPS) which takes care of the scheduling of relevant dates for several business documents.

So, when we implemented TM based Sales Order Scheduling, we integrated with BPS, which is used by the sales order to schedule delivery date etc. As the stock transport order is also already integrated with BPS, it was luckily not too much of an effort to implement a similar functionality.

In detail we’re dealing with the following scenario:

Michael_Haase_0-1730275252068.png

  1. The requested delivery date from the schedule line of the stock transport order is the input for the BPS, where the calculation of the relevant dates is managed. BPS uses a so-called ‘schema’ to configure which dates are relevant and how start and end dates are determined:
    • Durations of a transport process step are calculated in ‘Determinations’ (-> captured with the prototype described here)
    • Dates and times of transport process steps are calculated in ‘Delegations’ (-> not captured with this prototype, but could be adapted similarly)
  2. Based on the requested delivery date, Transportation Management (TM) can calculate durations resp. dates and times for loading, transport and unloading, ending up in a requested picking date by backward scheduling. From that, BPS calculates a requested material availability date as input for Available-to-Promise (ATP).
  3. ATP confirms a material availability date of the product from which BPS calculates the respective confirmed picking date.
  4. If this confirmed picking date differs from the requested picking date, TM calculates the confirmed delivery date with forward scheduling. Otherwise, the requested delivery date becomes the confirmed delivery date.

For the prototype I used the schema ‘STOCK_TRANSP_DAYS_ADV_ATTRIB’ which is set up in standard as follows:

Michael_Haase_1-1730275273986.png

For the dates being relevant for TM this means:

  • The loading duration is from the start of loading until the goods issue.
  • The transport duration is from goods issue until the delivery at the destination location (which can also be an incoterm location).
  • The unloading duration is from the delivery until the goods receipt.

Of course, it’s also possible to set up a new schema when this does not fit to your scenario.

Configuration of BPS

At first, the stock transport order document needs to be enabled for the scheduling with BPS:

Michael_Haase_4-1730275356121.png

Therefore, you need to add respective entries on plant and storage location level, thereby checking the flag for ‘Shipment Scheduling’.

At next, the ‘BPS Determinations’ must be created and configured in transaction BPS_DETN_CONFIG:

Michael_Haase_5-1730275373827.png

Those ‘BPS Determinations’ are responsible for the determination of the durations of respective activities:

  • They need to be created and the Z-class with the implementation needs to be assigned.
  • The business process ‘Stock Transport’ needs to be assigned.

Now, the created ‘BPS Determinations’ need to be added to the mentioned schema in customizing for the TM relevant activities:

Michael_Haase_0-1730275466879.png

And finally, the stock transport document needs to be activated for BPS by assigning the schema to the stock transport order type and shipping point:

Michael_Haase_1-1730275485154.png

That are the necessary steps in configuration, of course assuming that the ‘regular’ configuration for the stock transport order has already been done.

So, let’s take care of the implementation part.

Implementation

As already mentioned, the implementation can be done without any modification to the standard code, just with local development in Z-namespace.

Therefore, the first step is to create a class which implements an interface from BPS being responsible for handling its 'Determinations':

Michael_Haase_2-1730275501206.png

The parameters of the used interface method ‘DETERMINE’ are as follows:

  • REQUEST: Input parameter from the BPS request as e.g., the request ID
  • ACTIVITY_ATTRIBUTE: Calculated durations are provided to BPS along with each activity
  • DETERMINATION: Name of the current determination

 The basic program flow in method ‘DETERMINE’ needs to be implemented like:

Michael_Haase_3-1730275517547.png

Those steps are explained in the following.

After the initialization with the declaration of parameters, instantiation of attributes etc., the data from the stock transport order needs to be retrieved:

Michael_Haase_4-1730275534312.png

This is done with the help of the ATP buffer, which can be read as shown.

Essential for the scheduling in TM is the logistics integration customizing, which needs to be retrieved for the stock transport order document data:

Michael_Haase_5-1730275549343.png

The Transport Duration Determination Profile controls the TM scheduling where you mention e.g., the planning profile, and the scheduling method as the default route.

As there has been a change from FPS1 to FPS2 in storing the Transport Duration Determination Profile we need to distinguish:

  • For FPS1, the Transport Duration Determination Profile is stored at the Logistics Integration Profile
  • For FPS2, this moved to the TM control Key

So, this needs to be adapted to your particular release.

The toughest part to be implemented might be the determination of the source and destination locations.

  • The source location will in most cases be the supplying plant, or it’s shipping point.
  • The destination location could be the receiving plant or it’s shipping/receiving point. But it could also be an incoterm location.

Based on your scenario, the stock transport order document data needs to be analyzed respectively and this could be pretty simple or a bit more complex…frankly spoken. But surely solvable with a little bit of experience in ABAP, knowledge about the data model of the stock transport order and the handling of locations.

When the locations have been determined, we’re ready to do the TM scheduling, as we know:

  • The source location where the loading takes place with the duration as maintained in the planning profile.
  • The destination location where the unloading takes place with the duration as maintained in the planning profile.
  • The route from source to destination location to derive the transport time.

So, we can call the TM scheduling with the so-called TRS request:

Michael_Haase_6-1730275564697.png

The TRS request needs:

  • BPS request ID -> available with lt_request_ids = request->get_requests( ). 
  • Transport Duration Determination Profile -> Retrieved from Logistics Integration customizing.
  • Source / Destination locations -> Determined from the stock transport order document data.
  • Calculation start date from the BPS request.

The result of the TM scheduling is provided in the ‘TRS result’ which contains the respective durations.

Those now need to be provided back to the BPS for the respective activity:

Michael_Haase_7-1730275578448.png

Hereby, the activities are:

  • /scmtms/if_trs_constants=>sc_trs_activity-load
  • /scmtms/if_trs_constants=>sc_trs_activity-transport
  • /scmtms/if_trs_constants=>sc_trs_activity-unload

 And BPS then finally provides the dates to the stock transport order where those should be reflected in the delivery schedule of the item.

Example

Let’s show this with the following example, given the schema and configuration as shown before:

Michael_Haase_8-1730275592903.png

In the delivery schedule of the stock transport order item we can see the following:

  • We have one day for loading at the sending location. According to the schema, this reflects in the time between the start of loading and the goods issue.
  • The five days of transport reflect in the time between goods issue and delivery at the receiving location.
  • Three days of unloading in the receiving location are shown from delivery to goods receipt.

If the stock transport order is integrated with TM, respective freight units are created, just as you know it. But the integration with TM is not necessary, so this runs also when no freight units are created.

If freight units are created and you do transport planning in TM, the results are not written back to the stock transport order, as we never do that.

So, you see that it’s indeed possible to use the TM scheduling for the stock transport order in an SAP S/4HANA 2023 release, as we already do for the sales order, without modification to the standard code. There are surely some pitfalls in the implementation, but with some experiences in ABAP coding and business background this is surely solvable!

Hope this helps you in your stock transport process to deal with a more accurate planning!

Best regards,

Michael

 

4 Comments