You are on page 1of 15

SAP Knowledge Base Article

2220102 - Debugging guide for SD scheduling


Component: LE-SHP-GF-DS (Delivery and transport scheduling), Version: 3, Released On: 09.09.2019

Symptom
The purpose of this SAP Knowledge Base Article is to explain how you can debug the SD scheduling on a high level. Using
debugging you will be able to tackle SD scheduling related issues.
"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is
purely coincidental."

Environment
Sales And Distribution (SD)
Logistics Execution (LE)
SAP ERP SD scheduling
SAP R/3
SAP R/3 Enterprise 4.7
SAP ERP Central Component
SAP ERP
SAP Enhancement package for SAP ERP
SAP Enhancement package for SAP ERP, version for SAP HANA

Resolution
If you need more information about how to debug, how to manage breakpoints, how to check the content of important
variables, please check SAP Knowledge Base Article 2229827.

Important function modules, tables, structures, user exits and how to debug them.

For the scheduling two function modules are relevant:


SD_SCHEDULING
SD_SCHEDULING_ATP_CALC
The flow logic is the following. First function module SD_SCHEDULING will be called and the material availability date will
be determined. This date will be passed to ATP check (see debugging guide for the ATP check). If this date can be confirmed
then the dates from FM SD_SCHEDULING will be taken over. If the date cannot be confirmed then the ATP check
determines the next possible confirmation date. In this case function module SD_SCHEDULING_ATP_CALC will be called
with this new date and the other dates will be redetermined.

Now we will check function module SD_SCHEDULING in details.

In the first step the system determines the entry. This is the date from which the scheduling will be carried out. Usually the
system will start with a backwards scheduling and the entry date is the requested delivery date.
There are two important structures where you will find a lot of useful information. LS_SCHEDEV contains the scheduling
dates and LS_SCHEDDU contains the relevant data from the customizing.
In the first step usually LS_SCHEDEV-LFDAT gets filled which represents the requested delivery date. Double-click on the
structure LS_SCHEDEV will get you to the following screen:
MBDAT material availability date

MBUHR material availability time

TDDAT transportation planning date

TDUHR transportation planning time

LDDAT loading date

LDUHR loading time

WADAT goods issue date

WAUHR goods issue time

LFDAT delivery date

LFUHR delivery time

DATLO system date

TIMLO system time


AULWE route schedule

ELDAT unloading date

ELUHR unloading time

LS_SCHEDDU

TRANSDISP transportation planning time

TRANSDISP_FC transportation planning factory calendar

TRANSDISP_TS transportation planning time stream

TRANSDISP_TZ transportation planning time zone


PICKPACK pick pack time

PICKPACK_FC pick pack factory calendar

PICKPACK_TS pick pack time stream

PICKPACK_TZ pick pack time zone

LOADING loading time

LOADING_FC loading factory calendar

LOADING_TS loading time stream

LOADING_TZ loading time zone

TRANSIT transit time

TRANSIT_FC transit factory calendar

TRANSIT_TS transit time stream

TRANSIT_TZ transit time zone

ROUND_GROSS rounding up

UNLOADING unloading time

UNLOADING_FC unloading factory calendar

UNLOADING_TS unloading time stream

UNLOADING_TZ unloading time zone

So usually after the first step LS_SCHEDEV-LFDAT is filled.


In the second step the customizing is read. All relevant times, calendars and time zones will be determined.
After having executed the subroutine structure LS_SCHEDDU is filled.
The times are considered in hours, minutes and seconds. In this case the pick/pack time is 5 hours 00 minutes and 00
seconds. The transit time is 504 hours 00 minutes and 00 seconds. You can also see the IDs of the factory calendars, the time
streams and time zones.
In step 3 the system considers whether you are using the MAIS process. In that case there is no need for the transportation
planning time, pick pack time, transit time, and unloading time, therefore the corresponding LS_SCHEDDU will be deleted.
Scheduling works with different time zones. All dates except the delivery date are displayed in the time zone of then shipping
point. The delivery date is displayed in the time zone of the ship-to-party. In case of a forwards scheduling the system sets the
transportation planning date or the material availability date to the current date. In step 4 of the scheduling the current date
will be converted from the user’s time zone into the time zone of the shipping point.

Step 5 is where scheduling is carried out.


Usually the system starts with backwards scheduling, starting from the delivery date. As you can see in the screenshot above
there are two different subroutines for backwards scheduling. In the ERP system you have two different scheduling types. One
is exact to days and the other is exact to seconds. The scheduling is carried out in subroutine
SCHEDULE_BACKWARDS_CLASSIC when you are not working with working times. In that case the scheduling is carried
out with whole days. So scheduling is exact to days in this case. When you work with working times then scheduling is carried
out exact to seconds and the second subroutine SCHEDULE_BACKWARDS is used for the calculation.

Let’s go inside subroutine SCHEDULE_BACKWARDS.


Inside this subroutine LS_SCHEDEV is not accessible. All data has been passed over to CS_SCHEDEV. The calculated dates
are stored in CS_SCHEDEV and later on in the coding they will be passed back to LS_SCHEDEV. When you go further on in
this subroutine you will see that all other dates will be determined. At the end another subroutine is called where the system
checks whether it has to switch to a forwards scheduling.
The prerequisite for switching to a forwards scheduling is a date that lies in the past and only backwards scheduling is
deactivated in transaction OVLY.

Let’s have a closer look on this subroutine TOGGLE_SCHEDULING.


Forwards scheduling starts from the transportation planning date or the material availability. One of these dates will be set to
the current time at the shipping point. Which of the two dates (transportation planning date or material availability date) is
set to the current date and time depends on the result of backwards scheduling. Both dates will be compared and the one
which was earlier will be set to the current date and time.
The forwards scheduling is carried out in subroutine SCHEDULE_FORWARDS starting from this date and all other dates will
be determined.
At the end of this subroutine the delivery date is checked against the goods receiving times at the unloading point. If the
determined delivery date has to be postponed according to the receiving times at the unloading point then a backwards
scheduling is triggered starting from that new delivery date.
Now all dates are determined so we go back to our starting point in function module SD_SCHEDULING.
In step 5 the route schedule scheduling is carried out. This can change the result of the SD scheduling. Regarding the route
schedule scheduling please check the related debugging guide.

After the scheduling the ATP check is carried out. Please check Knowledge Base Article 2219495. The ATP check is carried out
for the material availability date that is determined during scheduling.
When this date cannot be confirmed during the ATP check but a confirmation is possible on a later date then scheduling again
will be called with the new material availability date. In that case a forwards scheduling is carried out starting from the new
material availability date. This scheduling is carried out in function module SD_SCHEDULING_ATP_CALC. Here a route
schedule determination is also carried out.
For further information, please check the troubleshooting guide for SD Scheduling in Knowledge Base Article 2140434.

Keywords
Versandterminierung, Transportterminierung, Materialbereitstellungsdatum, Rückwärtsterminierung,
Vorwärtsterminierung, Transportdispositionsdatum, Ladedatum, Warenausgangsdatum, Einteilungsdatum, Abladedatum,
Routenfahrplan, Fabrikkalender, Richtzeit, Ladezeit, Transitzeit, Teitstrahl, Vorwärtsterminierung, Rückwärtsterminierung,
Verfügbarkeitsprüfung
Products
Products

SAP ERP Central Component all versions

SAP ERP all versions

SAP R/3 Enterprise all versions

SAP R/3 all versions

SAP enhancement package for SAP ERP all versions

SAP enhancement package for SAP ERP, version for SAP HANA all versions

This document refers to


SAP Note/KBA Component Title

2229827 SD-BF-AC How to debug

2219495 SD-BF-AC Debugging guide ERP ATP check

2140434 LE-SHP-GF-DS Troubleshooting guide for ERP SD scheduling

This document is referenced by


SAP Note/KBA Component Title

2195518 Everything about stock transport orders and ATP

2221849 LE-SHP-GF-DS Customizing and process flow of SD scheduling

2196410 SD-BF-AC Everything about ERP ATP check and SD scheduling

You might also like