SAP Knowledge Base Article - Public

3246837 - Error message "An instance of a class /CPD/CL_SC_BADI_UTILITY_1 cannot be created outside a class" in Custom Logic app

Symptom

You're not able to use class /cpd/cl_sc_badi_utility_1 inside Custom Logic (business context: Engagement Project, BAdI Description: Generate Project IDs). 

Environment

SAP S/4HANA Cloud

Reproducing the Issue

  1. Create business context "Engagement project".
  2. Use class "/CPD/CL_SC_BADI_UTILITY_1"

Cause

Class "/cpd/cl_sc_badi_utility" is deprecated. It was replaced by a new class "/cpd/cl_sc_badi_utility_1".

However, it is not possible to directly replace /cpd/cl_sc_badi_utility with /cpd/cl_sc_badi_utility_1.

Resolution

Inside the Custom Logic app editor for the implementation, you can click on the example button (upper right corner).

The example shows how to make use of this class:

*--Instantiate the Custom Logic Utility Class
    /cpd/cl_sc_badi_utility_1=>get_utility_class_instance(
          RECEIVING
            utility_class_instance = DATA(utility_class_instance) ).

*--Invoke the method to generate the Project ID
    utility_class_instance->generate_project_id(
      IMPORTING
        project_id = ls_projectid-engagementproject ).

Keywords

class, /cpd/cl_sc_badi_utility_1, custom logic, engagement Project, Generate Project IDs, custom logic, an instance of a class /CPD/CL_SC_BADI_UTILITY_1 cannot be created outside a class , KBA , CA-CPD-SS , S/4HANA Professional Services Cloud - CPM , Problem

Product

SAP S/4HANA Cloud all versions