Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member245258
Participant
2,381
This blog is continuation of series where I am explaining about the BAdI implementations based on the Customer use-cases.

Previous blog of this series can be found here.

Here you will learn how to set up the automatic and sequential Project IDs while creating a Project in SAP S/4HANA Cloud Professional Services.

Default Functionality:

With given functionality of SAP S/4HANA Cloud, Customers can enter alpha numeric values manually for their Internal and Customer Projects. But a unique number has to be maintained every time a new project is created by a Customer.

Moreover, if a customer is looking for sequential Project IDs, this might be a difficult task to manually enter them in sequence.

Customization:

In order to address the above requirement, SAP S/4HANA Cloud provides a BAdI which can be implemented to generate the sequential project IDs automatically each time a project is created.

This BAdI can generate sequential Project IDs for both Customer and Internal projects. And we may define the unique identifier as a prefix to differentiate among the type of projects. In my example, I have a prefix ‘I’ for Internal Projects and ‘C’ for Customer Projects.

Let’s go through the implementation of this BAdI:

Step1: Go to Custom Fields and Logic App, navigate to Custom Logic tab and Create New Enhanced Implementation.

Step2: Select Business Context – ‘Engagement Project’, BAdI Description – ‘Generate Project IDs’ and give a description.


Step 3: Insert the following code snippet in logic:

*********************************************************************

data(lr_badi_utility) = new /cpd/cl_sc_badi_utility( ).

lr_badi_utility->generate_project_id(

IMPORTING

ev_mp_id =    ls_projectid-engagementproject " Master Project ID(used in BAdi)

).

IF ls_projectid-customer = ''.

ls_projectid-engagementproject = 'I' && ls_projectid-engagementproject.

ELSE.

ls_projectid-engagementproject = 'C' && ls_projectid-engagementproject.

ENDIF.

********************************************************************

In the above code we are putting a logic to generate project ID starting with ‘I’ if it is an internal project and ‘C’ if it a Customer project.

Customers can do further modifications based on their requirement.

 

Let's look at above logic in action in a demo video.

I have structured the demo as following:

  •            Create a Customer Project when the BAdI is not implemented

  •           Create a Internal Project when the BAdI is not implemented

  •           Implement the BAdI

  •           Create Customer Project and notice the automatic Project ID generation

  •        Create Internal Project and notice the automatic Project ID generation




Stay tuned for more.

Happy Learning!
4 Comments
dr_vup
Contributor
Dear Akshay,

 

thank you for sharing! I used the same way like you did. In release 2008 the class you refer to is getting deprecated and the one who they refer to (/cpd/cl_sc_badi_utility_1) is not allowed to get used outside the class.

Any ideas how to solve that ;-)!?

 

Greetings, Cedric
fuchsbianca1
Explorer
0 Kudos
Hi Akshay,

thanks for your blog entry.

I get the same error message as Cedric. Can you help us with this?

I would also like to start the Project ID with the first four digits of the service organization. Is that possible? And how does this change the code?

Thanks for your support.
Best Regards, Bianca
Sycntegral
Active Participant
0 Kudos
Hi all

Will this be available for On premise version of S4HANA?

If yes, when?

Adi
Haaroon_Daya
Explorer
0 Kudos
Good day,

Has there been any solution to Cedric's question? I am currently facing the same issue where /cpd/cl_sc_badi_utility is deprecated and /cpd/cl_sc_badi_utility_1 is not allowed to get used outside the class.

Regards

Haaroon