Skip to Content
Technical Articles
Author's profile photo Richard Büffing

Hide unused statuses in SAP ChaRM status overview (Roadmap)

Summary

In this blog you will learn how to hide statuses from the graphical status overview section (roadmap) of your ChaRM transaction in case they are unused/undesired for some reason.

The requirement from a process point of view

If you are working with SAP ChaRM on the SAP Solution Manager, usually the current status of a change transaction (change request or change document) is shown graphically in the status overview section.

If you have undesired user statuses that you don’t want to use in your process, it is not advisable to delete them in the status schema of your Z-transaction type as it might lead to inconsistencies. Deleting them would also reduce your capability to update your z-transaction types after upgrading to a new support package.
So, for the sake of consistency and release-robustness, it would be better to just jump over those statuses by adapting the actions in the action profile (not covered in this blog) so that from a process point of view these statuses can never be reached.

But what about the status overview section (roadmap/bread crumbs view) in your ChaRM solution?
Since those statuses aren’t technically deleted and even though they cannot be reached by any action anymore they will still show up.
But what if you and more importantly your users really don’t want to see them?

Status%20overview%20with%20undesired%20statuses

Status overview with undesired statuses

The solution

So how do we go about the get rid of those statuses in the graphical status overview?

Luckily SAP has prepared us for that by providing the BAdI AI_CRM_CM_UI_ROADMAP.
There is also the note 2720397 describing the basic possibility to achieve our goal, but it doesn’t contain any sample code.

Let me give you a detailed step-by-step guide on how to create the BAdI implementation and what to pay attention to.

For this example let’s pretend we are using transaction type ZMMJ and we want to make the two statuses “Testing for preliminary import” (E0012) and “Tested for production import” (E0013) disappear.

Create a new BAdI implementation

Open transaction SE19 enter the BAdI AI_CRM_CM_UI_ROADMAP and create a new implementation for it:

Transaction%20SE19%20%28BAdI%20Builder%29

Transaction SE19 (BAdI Builder)

Give your enhancement implementation a Z-name and a description
Note: the implementation doesn’t have to contain the name of the BAdI you are free to choose any name from the customer namespace. I just chose this one for ease of remembering it:
Naming%20the%20enhancement%20implementation

Naming the enhancement implementation

In the next screen you get to choose the name of the implementation and the class:
Naming%20the%20implementation%20and%20class

Naming the implementation and class

Note: Again it is not required to use the same name for the implementation. Also they do not need to contain the name of the BAdI, but I chose to do so because it’ll be easier to find them again later.

Now create an object catalog entry and choose an existing package (or create an new package in SE80):
Object%20catalog%20entry%20and%20package

Object catalog entry and package

Choose an existing transport for your class or create a new one:
Transport%20request%20prompt

Transport request prompt

Now from the overview screen of the enhancement implementation make a double-click on “Implementing Class”:
Navigation%20to%20implementing%20class

Navigation to implementing class

Make a double-click on the method
Navigation%20to%20method

Navigation to method

 

Once you have double-clicked on the method you will be asked if you want to create an implementation for it. Answer with yes:
Popup%20for%20implementation%20creation

Popup for implementation creation

Now you will end up in the class builder:
Class%20builder%20code%20editor

Class builder code editor

 

Enter the code

You can use the code below as an example:

  method IF_AI_CRM_CM_UI_ROADMAP~MODIFY_ROADMAP.
    "Hide steps "Testing for Preliminary Import" and "Tested for Production Import"

    try.
        data(ls_order) = order->get_header( ).
      catch cx_ai_crm_cm_com_generic.  "
      catch cx_ai_crm_cm_com_no_authority.  "
    endtry.

    if ls_order-process_type eq 'ZMMJ'.
      delete roadmap
        where state ne cl_thtmlb_roadmapitem=>gc_state_active
          and txt04 eq 'TIMP'.

      delete roadmap
        where state ne cl_thtmlb_roadmapitem=>gc_state_active
          and txt04 eq 'GETP'.
    endif.
  endmethod.

Please note that in this case we used the transaction type ZMMJ.
But where do you find the status names of the statuses you want to hide?
Code%20with%20highlighted%20important%20parts

Code with highlighted important parts

 

Well, the answer is: directly from the status schema.
When you open the status schema (in this case ZMMJHEAD) you can see the names:
Status%20schema%20of%20transaction%20type%20ZMMJ

Status schema of transaction type ZMMJ

Once you’re done with the code do not forget to make a syntax check and activate it:
Syntax%20check%20function%20in%20ABAP%20editor

Syntax check function in ABAP editor

Activation%20of%20newly%20created%20ABAP%20objects

Activation of newly created ABAP objects

Once you’re done with the code, go back, double click on the enhancement again and activate it:
Activation%20of%20enhancement%20implementation

Activation of enhancement implementation

You might need to switch tabs to get the system to show the correct status.
Make sure it says “The implementation will be called”.

Result

Now you shouldn’t see the statuses anymore that you included in the code:
Graphical%20status%20overview%20with%20hidden%20statuses

Graphical status overview with hidden statuses

So we have learned how to hide unused statuses from the graphical overview section.
In combination with adapting the action profiles and the actions therein, you will be able to effectively exclude certain user statuses from the process without actually having to delete them.

Hope you find this information useful.
I’ll be happy to try and answer any questions in the comments section below.

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Dino Philips
      Dino Philips

      HINT: when streamlining ChaRM-flows please make sure to check transaction: CM_ADM_PROC_VIS . It is a very useful tool to get a quick overview of how everything interconnects.

      CM_ADM_PROC_VIS

      CM_ADM_PROC_VIS

      Author's profile photo Richard Büffing
      Richard Büffing
      Blog Post Author

      That is indeed a very useful tool. Thanks for the hint.

      Author's profile photo Raquel Pereira da Cunha
      Raquel Pereira da Cunha

      Thanks for this blog. Very useful!

      Author's profile photo Stefan Thomann
      Stefan Thomann

      Thanks for sharing, Richard!

      Author's profile photo Sharath Vuppula
      Sharath Vuppula

      Thanks for this blog.

       

      Will this also take care about the next status, if we use CRM_SOCM_UTILITY_REPORT to change the status ?

      Author's profile photo Richard Büffing
      Richard Büffing
      Blog Post Author

      Thanks.

      Since this is more of cosmetical nature I'm afraid it wont help with the report.

      You could however try to change the status sequence number in the status schema so that the undesired statuses are at the end.

      Author's profile photo Daniel Enderli
      Daniel Enderli

      Thank you Richard Büffing and congratulations for this very detailed blog post.