cancel
Showing results for 
Search instead for 
Did you mean: 

Backward scheduling in sales order

kennethkw_chan
Explorer
0 Kudos

Hi all,

I have 2 routes maintained which should be determined by different shipping conditions.  Let's name them as Route A with transit time 4 days and Route B with transit time 2 days.

When creating sales order, the backward scheduling takes place.  To my understanding, in case the material available date is calculated as in the past, forward scheduling will take place.

My question is - I have 2 routes with different transit time.  Is it possible to make the backward scheduling checking all available routes (in my case, ignoring the shipping condition) before start the forward scheduling?

Thanks in advance.

Cheers, Kenneth

Accepted Solutions (1)

Accepted Solutions (1)

former_member223981
Active Contributor
0 Kudos

Hi Kenneth,

When creating sales order, the backward scheduling takes place.  To my understanding, in case the material available date is calculated as in the past, forward scheduling will take place.

This will only happen if you have the backwards flag is not set in transaction OVLY. Otherwise, dates in the past are allowed.

My question is - I have 2 routes with different transit time.  Is it possible to make the backward scheduling checking all available routes (in my case, ignoring the shipping condition) before start the forward scheduling?

This is not possible in the standard system. The standard scheduling will only ever look at one route. I.E only one route will be passed to function module SD_SCHEDULING which is responsible for the scheduling. However, the system can consider different route schedules so maybe that is a functionality that may be of interest to you.

kennethkw_chan
Explorer
0 Kudos

Hi Noel,

Thanks a lot for your input.

The scenario I have is I need to have both backward & forward scheduling.   The only thing is I have more than one option in backward scheduling which I must try before start forward scheduling.

I had checked the functionality of route schedules.  It seemed to me it directly controls the outbound timing instead of focusing on the leadtime.  So if my understanding is correct, it does not fit to my scenario.

In short, I suppose I would need to make it working in an user exit.

Cheers,

Kenneth

former_member223981
Active Contributor
0 Kudos

Hi Kenneth,

Can you elaborate on what your requirement is?

You have two routes that you want to choose from. Between those routes, how should the system decide to pick one over the other? What is the criteria you want to use for a route being chosen?

kennethkw_chan
Explorer
0 Kudos

Hi Noel,

The business case is - there are 2 different shipping conditions (by truck & by air) which lead to 2 different route (said 4 days & 2 days).

In case the first backward scheduling calculated on 1st shipping condition (default) failed, the 2nd shipping condition should be taken and checked.  Only when the result of second route checking is failed, the forward scheduling should take place.

Cheers, Kenneth

former_member223981
Active Contributor
0 Kudos

This is how the system works:

the route is determines in FM SD_ROUTE_DETERMINATION. this is reached via the following call stack:

SAPL0VRF FUNCTION SD_ROUTE_DETERMINATION
SAPFV45P FORM VBAP-ROUTE_ERMITTELN
SAPFV45P FORM VBAP-VSTEL_ERMITTELN
SAPFV45P FORM VBAP_FUELLEN
SAPMV45A MODULE (PAI) VBAP_FUELLEN

As you know, shipping conditions are used as a criteria to find a route.

So lets say:

Shipping Conditions A (Air) ---> Route 1 will be determined
Shipping Conditions T (Truck) ---> Route 2 will be determined

Route 2 gets determined. Later, Function SD_SCHEDULING will be called. The following call stack reflects this:

SAPLV03C FUNCTION SD_SCHEDULING
SAPFV45V FORM VERSANDTERMINIERUNG_NEU
SAPFV45V FORM MVERF_AUFBAUEN_WMENG
SAPFV45V FORM MVERF_AUFBAUEN
SAPFV45V FORM VERFUEGBARKEIT_PRUEFEN
SAPFV45V FORM BESTAND_BEDARF_ABGLEICHEN
SAPFV45P FORM VBAP_BEARBEITEN_ENDE_VERFUEGB
SAPFV45P FORM VBAP_BEARBEITEN_ENDE
SAPMV45A MODULE (PAI) VBAP_BEARBEITEN_ENDE

The call of function SD_SCHEDULING looks like this:

call function 'SD_SCHEDULING'
   EXPORTING
     if_schedule_direction   = v03c_backwards
     if_schedule_shipping    = us_vstrm
     if_schedule_transport   = us_trtrm
     if_shipping_point       = us_vstel
     if_weight_group         = us_grulg
     if_loading_group        = us_ladgr
     if_transport_route      = us_route  <<<<<<<<<<<<<<<

us_route contains the route that is determined in FM SD_ROUTE_DETERMINATION.

So only 1 route will be passed to SD_SCHEDULING. In this example, use_route = "2" (Route 2).

My understanding of your issue is that you may have a requested delivery date = 10th April (for example)


10th - 4 days = 6th, a date in the past so system must do a forwards scheduling, and then we inevitably have a later confirmed delivery date. However, before you have the system do a forwards scheduling, you want the system to see if the requested delivery date of April 10th can
be reached with route 1.

10th - 2 days = 8th, so there is no need to execute the forwards scheduling as the customers requested delivery date can be met


It sounds like a reasonable request to me (Route 2 could be cheaper and meet customer's delivery date but if it cant be reached, then use route 1 as you will get goods to customer on time even if it is more expensive), but I do not think it is easily achieveable. The ECC system is just not as clever as that. Maybe the APO scheduling offers some more flexibility regarding this? The ECC system simply uses the route (i.e. transit time of route) as part of the initial backwards scheduling. If dates in the past, it will switch to forwards scheduling.


There is no method by which it will not switch to forwards scheduling if there is another route available. It cannot do this because as far as FM SD_SCHEDULING is concerned, there is only 1 relevant route.

I am not even sure if this is possible via a user exit. The problem is preventing the forwards scheduling in the case of route 2 resulting in past dates. There is definitely no user exit to do this within SD_SCHEDULING. And then there is the possibility of route 1 determining past dates. In the case of both routes determining past dates, which route should be used. So I do not think there is any possibility to so this from within the scheduling function.

Maybe you could implement your own "rough" scheduling logic in EXIT_SAPL0VRF_001. This exit is called in FM SD_ROUTE_DETERMINATION and allows you to determine your own route. And then this route will later be passed to the standard scheduling function. This would be a fairly significant development effort though.

former_member223981
Active Contributor
0 Kudos

1 more point on this.

I think that user exit USEREXIT_MOVE_FIELD_TO_VBAK could help you. This will be called after the ATP check has been executed and scheduling etc. You could implement a logic in here that changes VBAK-VSBED if the internal table XVBEP has more than one schedule line for a particular item.

By changing VBAK-VSBED, you are changing the shipping conditions and this will re-trigger the whole route determination and scheduling and ATP (you can see this by manually changing the shipping conditions in the order).

I think this user exit would be more straight forward than what I suggested in my previous reply. Would still be a significant development effort though and would have to be tested thoroughly.

Answers (1)

Answers (1)

0 Kudos

Hi Chan , Forward scheduling & backward scheduling depends on the availability date,when shipping condition fail system automatically carryout forward ordering