Skip to Content

Asking yourself how to adjust standard TM processes to match a certain customer requirement? Stumbled over the process controller already?

The Process Controller Framework (PCF) is a concept going beyond BAdIs. With a BAdI you can manipulate a very specific function, while the PCF is meant to enable combining SAP standard functions with customer specific modules in a very generic way by defining strategies for a process. Such a stratgies makes it much more transparent, which enhancements have been done and which modules are used in comparisson to a simple BAdI implementation. The PCF has been used from the very beginning of the SAP TM development in planning, but grew into different areas (GIS integration, Copy Controll, Change Controll, Dangerous Goods handling, Incompatibilities, and so on). The basic idea is to pass all input / output data in a generic request object from one method to the other. Usually this is done in a very unrestricted way, but all OO concepts of information hiding could be applied, too.

From the perspective of a customer project having the need to create a new module, I think the definition of strategies, methods and the strategy – method assignment is well documented in the standard application help. The tricky part is here:

MKS03_PCF_Method_Definition.jpg

In the method defintion you need to point to an implementing class and method, which fullfills the signature (I guess the maintenance should check the compliance):

MKS03_PCF_Method_Signature.jpg

Within the method, you then need to access the request object:

METHOD your_functionality.

  DATA: lo_request            TYPE REF TO /sctm/cl_request,
        lo_[PROCESS]_request  TYPE REF TO [YOUR REQUEST OBJECT].

  LOOP AT it_request INTO lo_request.

    lo_[PROCESS]_request = cast_request( lo_request ).
    CHECK lo_[PROCESS]_request IS NOT INITIAL.

#################################################

Execute your process here; take request data out

of lo_[PROCESS]_request and put in result

#################################################

  ENDLOOP.

ENDMETHOD.

Usually the input table IT_REQUEST holds only 1 object. The cast is required to get the process specific request object. In case you get a dump here when testing, you have probably tried to cast for a wrong service.

That’s all! 🙂

Cheers,

Marcus

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

    1. Marcus Zahn Post author

      You mean the second screenshot? Yes, this is the signature of a method of that interface. But keep in mind ANY method to be used for the Process Controller needs to look the same.

      (0) 

Leave a Reply