logo

Are you need IT Support Engineer? Free Consultant

Enhancements in SAP S4 HANA Project Manufacturing …

  • By Sanjay
  • 08/05/2026
  • 9 Views


This article will give you an understanding of the two main options that allow you to make enhancements to the PMMO application.
Note: Option 2 requires the use of option 1 but in contrast to option 1 you are not bypassing any SAP delivered coding. This might save you some headaches during an upgrade or support package installation.
With the on premise 2022 release (Release To Customer on 10/12/2022) the development team has introduced more than 30 ABAP OO events that can be used by customers and/or partners to influence the behavior of the PMMO application.

This new enhancement approach was integrated into the PMMO implementation guide (transaction PMMO_IMG):

Zematest

PMMO IMG

The IMG node was also down ported to the 2021 release via note 3198543 but there you will not find  many events.

Executing the IMG activity will lead you to this screen:

Zematest 1

In the list output you can see the PMMO classes and the public events that the classes publish.
On the right hand side you see an icon, indicating that documentation for the event exists.

If you click on the documentation link, you will see a screen like this:

Zematest 2

As the documentation indicates, we deliver a sample class CL_PMMO_PEG_UTIL_CUST_ENH_EX to show you how to use the delivered events.

Zematest 3

Zematest 4

Let's take this example and start from scratch to see how we get to this point.

Zematest 5

We are running transaction PMMO_PEGGING to display the current assignments in the database.

Zematest 6

We select a lot of records and then click the ‘Change Assignments' button.

Zematest 7

The system has limited the number of records that can be edited to 100.

Zematest 8

Now we want to implement the event handler that allows us to increase this limit to 250.
For that we go back to our IMG listing of the available events (the shortcut to get there is transaction PMMO_DISPLAY_EVENTS) :

Zematest 9

Click the hotspot on the SAP delivered class: CL_PMMO_PEGGING_UTILITIES:

Zematest 10

Select the GUI option ‘Create subclass':

Zematest 11

Create the class in your own namespace. Make sure that the instance generation is set to ‘Public'.

Zematest 12

Next, create a CONSTRUCTOR method for the class:

Zematest 13

We'll come back to the constructor in a minute but first we have to create an event handler
method for the event we want to process:

Zematest 14

The typical naming convention for an event handler method is ON_name_of_the_event.
Once you have entered the method name, click on the detail button highlighted above.

Zematest 15

The method has to be marked as an event handler method for the class/event that we want to process.

When this is complete, switch to the Parameters of the method:

Zematest 16

Click on the button ‘Event Parameters' to copy the parameters into your event handler method:

Zematest 17

The parameter has been copied to the method.

Zematest 18

In the method itself, we change the number of records that can be processed:

Zematest 24

Since the event parameter is a reference, we can address it via the ‘->*' selector.

Now the method is ready for use.

It's time to go back to the constructor method and register the method we just created for the actual event handling:

Zematest 19

You have to call the super constructor first before you can use the SET HANDLER command.

Everything is ready now from a coding perspective. The last step we need to complete is the registration of the class in the PMMO subclass manager.

Go to the PMMO IMG and choose the option ‘Replace SAP PMMO Classes with Customer Classes'.

Zematest 20

Execute the activity and select the button ‘New Entries':

Zematest 21

You can choose to run the code only for your user ID or for all users (in this case leave the User ID field empty). In a production client the code can not be run for an individual user. The User ID field must be empty.

In the Class field you enter the standard PMMO class you want to enhance. Use the F4 help on the Subclass field to select your class. As you can see the standard delivered class CL_PMMO_PEG_UTIL_CUST_ENH_EX is also shown, since it inherits from CL_PMMO_PEGGING_UTILITIES as well.

Activate the entry to complete the setup.

Zematest 22

Run Pegging Display again:

Zematest 23

Select a lot of records and try to change them:

Zematest 25

Now we get an error message that reflects the changes we made:

Zematest 26

We have successfully implemented an enhancement via PMMO events!
The previous example is a simple event with one parameter. Most events have multiple parameters and many offer a parameter ER_DO_NOT_EXECUTE, as in the following example:

Zematest 27

If you set this parameter ER_DO_NOT_EXECUTE->* = ABAP_TRUE in your event handler method
then the system will skip the processing of further code in the standard implementation.
We are aware that the events we deliver will not cover all the scenarios were you would like to add/change functionality in the PMMO application.

If you have a need or suggestion for additional events, please send us a customer message
on component LO-PMM and explain your scenario to us. We would be happy to provide
additional events as needed.

Does this concept support multi-level inheritance and how does it work?
Yes, it does and we will look at how it works now.

You might need this if you work with one of our partners and they deliver add-on functionality to PMMO via their classes.

Let's assume that partner A delivers a class to you that implements an event handler for the event
CHECK_IN_STK_INDICTR of class CL_PMMO_UTILITIES. You also want to enhance the standard SAP class.

Here is the class that the partner delivers:

Zematest 28

It is important that the partner class is not marked as final:

Zematest 29

Now you can create a class that inherits from the partner class:

Zematest 30

Attributes of your class:

Zematest 31
This class can be final, unless you want/need additional subclasses.

This is what the inheritance hierarchy looks like:

Zematest 32

In the subclass manager you have the following entry:

Zematest 33

In the Subclass field you specify the class with the lowest level in the inheritance hierarchy that you want to process. Because of the inheritance the partner class as well as the customer class will be processed.

Note that the F4 help shows all classes that inherit from CL_PMMO_PEGGING_UTILITIES, even though they might not directly inherit from it. This display feature is only available starting with the PMMO 2022 release .

In the 2021 release the ZCL_PMMO_PEGGING_UTILITIES class would not show in the F4 help but you can
still enter it in the Subclass field and the inheritance functionality will work just fine.

Another nice feature available starting with the 2022 release is the inheritance display in the subclass compare function:

Zematest 34

After you click the ‘Compare' button, you will see this:

Zematest 35

The system has recognized that we have an inheritance chain active and displays that in the list.

Zematest 36

Click the hotspot ‘Multi Level Inheritance Hierarchy' and you will see this:

Zematest 37

The final piece in the PMMO enhancement puzzle are local classes in reports. This was either done because there didn't seem to be a need for a global class or because of a tight integration of the class and the screen/view cluster functionality, e.g. for the change pegging transaction.

These local classes still support the subclass enhancement concept but the implementation is slightly different.

With transaction PMMO_CSUBCL you can see the global and local classes that support our enhancement concept:

Zematest 39

Let's take class LCL_RTM_DISPLAY in report RPMMO_DISPLAY_RTM as an example:

Zematest 40

You can see that most of the methods in the local class have to do with the ALV functionality to display the data.

Note the statement INCLUDE ZRPMMO_DISPLAY_RTM IF FOUND.
Each report with local classes will have one or more INCLUDE report_name IF FOUND statements.

This is intended for you to enhance the local class, if so desired.

The includes are in customer namespace and do not exist in the SAP standard delivery.

Double click on the Z include name to create the object:

Zematest 41

In the new include we can define the subclass and the functionality we want to implement:

Zematest 42

Here we are just making a field visible that was set to TECH in the standard delivery.

When we are done with the enhancement in the report, we still need to register the new subclass in the subclass manager:

Zematest 43

Note that now the fields Class and Program are filled. This is done automatically if you use the F4 help on the Class field and pick the appropriate local class/program combination.

The F4 help for local subclasses is only available starting with the PMMO 2022 release. In the 2021 release you will get a message that an F4 for local subclasses is not available but you can just copy and paste the local class name from the report.

Zematest 45
Make sure to set the entry to Active.

Now you have also implemented a subclass enhancement for a local report.

At this time we do not have events available in the local classes but if one is needed, please let us know.

The runtime measurement macros that are built into the pegging and distribution code can cause syntax errors in subclasses.

See note 3105376 for an explanation and solution.

I hope that you now have a good understanding of the enhancement concept in the PMMO application.

The use of events is preferable and less disruptive then overriding methods delivered in the standard solution. It is the way we would recommend for you to enhance the PMMO solution.

Good luck with your implementation and we are looking forward to your feedback.

 

 



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *