cancel
Showing results for 
Search instead for 
Did you mean: 

Dispatch an operation of a PM order

philippe_tsalos
Participant
0 Kudos

Hi Experts,

Could you tell me if a BAPI, FM, Method or anything else can be used to dispatch an operation of a PM order?

Here is the need:

Our customer uses the Planing Board (CM25) to dispatch operations of PM orders.

When the related work can't be executed on field, corresponding operations need to be dispatched a second time (at another time and day).

Currently we simply add a constraint on the StartPoint date/time and change the status of the operation to DSPT. But this doesn't take into account the workcenter capacity. So it can result to workcenter capacity overload.

For that pupose I'm looking for a standard FM or BAPI or ... that can do the job.

I think the following information should be sufficient to make the dispatching: Order nr, Workcenter, operation, day, time.

I found some threads about his on SDN forums but none answer my question.

Thanks a lot.

Regards,

Philippe

Edited by: Philippe Tsalos on Jan 18, 2010 9:33 AM

Accepted Solutions (1)

Accepted Solutions (1)

AB
Contributor
0 Kudos

Hi Philippe

I understand your context. The difficulty of the issue is this: in order to dispatch an operation the entire capacity levelling environment needs to be established, so that the load from all the dispatched operations on the work centre can be considered. There are a series of function module calls that result in the dispatch of an operation - the pre-condition is the initialisation and establishment of the capacity levelling environment.

The purpose of CM40 is to dispatch or undispatch in background. I'm not suggesting that you call this for each individual order - establishing the capacity levelling environment to determine the capacity load will simply take too much time for every order. Instead, I'd suggest that you log the order operations that need to be re-dispatched and then call CM40 once, with those order operations in the filter, to let CM40 to dispatch them.

Whilst it is possible to build a function module like you are looking for, it is a development which requires a good understanding of how capacity levelling works now.

Regards

Andrew

Answers (2)

Answers (2)

AB
Contributor
0 Kudos

HI Philippe,

It isn't clear to me whether you wish to re-dispatch from the planning table, or from within the PM order itself.

The planning table generates a view from the perspective of the work centre of all the requirements - order operations - that load the work centre. When an operation is dispatched several things happen: the capacity load of those operations are marked as dispatched, which allows the remaining capacity of the work centre to be calculated, a system status is set on the operation to indicate it has been dispatched (which stops it being moved by scheduling) and the dispatched dates are written to the operation (although you don't see them in the PM screen). The order transaction itself doesn't consider all the other orders loading the workcentre, so it isn't possible (without reading them all) to determine the overall load from within the order.

The planning table function you want is "reschedule" - which is the same as dragging a dispatched operation from one date to another. It is technically possible to use the function module CY01_EXTERNAL_INTERFACE to start the planning table (without showing a screen!), use the filter of the interface to define the order operation you want to work with, use the interface of function module again to execute the function re-schedule.

It is a complex piece of work. You might be more willing to simply "un-dispatch" from the order - by remarking the capacities of the order operation as "undispatched" and removing the dispatched status. See subroutine FCODE_KPJS in SAPLCOIH for an example of remakring the capacities etc.

Kind Regards

Andrew Barnard

AB
Contributor
0 Kudos

To determine the current capacity of a work centre on a current date, you can review subroutine CAPACITY_CHECK in function group COIH.

Cheers

Andrew

philippe_tsalos
Participant
0 Kudos

Andrew thank you for helping!

I realize now that my explanation of the need is not really good.

The need is to automatically reschedule PM orders that haven't been executed on field.

SAP receives Idocs containing order number and its user status from field (DONE, NEXE, ...). Currently we use a Z function that simply put a constraint on operation date (must start on today + 2 days) and change its status to DSPT.

In most cases this development do the trick but sometimes when workcenter capacity is already full at day + 2 the workcenter capacity is overloaded. This is what we want to avoid.

This is the reason why I'm looking for a way to dispatch an order operation by a standard FM, BAPI or whatever that take current workcenter capacity into account.

I looked at CY01_EXTERNAL_INTERFACE but there are many tables that I don't really know how to fill.

Can you help me on how to fill this FM in?

Thanks a lot

Regards

AB
Contributor
0 Kudos

Hi Philippe,

So you want to reschedule considering available capacity. That is exactly what dispatching in the planning table does.

If you were to re-dispatch the operation dependent upon the availability of capacity, it may not end up at day + 2. It may be shifted to some other time in the future, assuming you have search in the forward direction as your strategy. So is your intent simply to "throw" it forward somewhere or is it a hard requirement that it is re-scheduled for today + 2? I presume you know how to change the operation details programatically.

For the sake of the following, I presume that the order operations to be re-scheduled were once dispatched in the planning table.

So why don't you explore the following:

Why don't you collect all the order operations together and undispatch (deallocate) them with Transaction CM40 in background? and then after you have changed their dates to day + 2, reschedule them, then dispatch them with CM40 again in background?

By using an appropriate profile, you can specify the appropriate work centres and the order operations belonging to them that need dispatching. say profile SAPPM_G006 - define the plant and workcentre on the first screen, then the orders on the filter screen.

If you feel like a little more of a challenge, you can review the coding of RCCYMAB2, particularly the subroutine EXECUTE_MASS_DISPATCHING, which shows all the details. Unless you are really confident, I'd stick with the transaction CM40 if I were you and set the objects and filter according the definition of your overall profile to define the order operations you wish to dispatch / undispatch.

I should point out that CM40 is designed to let the system do a first cut dispatch for all the requirements on a workcentre prioritised according to the strategy sort key. In your case you don't want (I don't think you want) to deallocate and then dispatch all non-dispatched requirements - just those of the particularl order operations. That is why the filter is necessary to further restrict which order operations are to be processed. You could also use the selection schema as well, selecting those with user status NOEX.

Is that helpful?

Edited by: Andrew Barnard on Jan 26, 2010 11:05 PM

philippe_tsalos
Participant
0 Kudos

Andrew,

We use Service orders in IS-U / Work Management.

When an order couldn't be executed on field (no time enough to do the work for example) my client has to wait at least 2 days before going back on site to execute the work (for example closing Electricity Meters). It is a legal constraint (but it can be more than 2 days if the workcenter is already full).

I tried CM40 which seems to work fine but I can't imagine to use it within a Z program. Creating or Maintaining Jobs + variant in ABAP seems a little bit complicated. In fact we deal with a lot of orders per day and each of them are processed one at a time.

This is why I was looking for a FM to which I can provide AUFPL, AFPLZ, ARBID, dates, ...

I set a break point in FM CY01_DISPATCHING to see how it works. But it seems to be a FM that only collect data.

In CM40, the dispatching seems to be made right after a third call of CY01_EXTERNAL_INTERFACE with FUNKTION = 'XX99'.

When I test this FM alone I always get a shortdump.

I fill FIL_TAB exactly as it is in CM40 debug but ... shortdump again.

Regards,

nishant122
Discoverer
0 Kudos

Hi Andrew

My client is looking for an option to reschedule the work order operations using CM25/Planning Board without dispatching or de-allocating work order operations. It is possible in the system?

Regards

Nishant


philippe_tsalos
Participant
0 Kudos

Any help?

Or maybe a suggestion to determine the current capacity of a particular Workcenter at a particular date?