SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Create Custom Logic Using Key User Extensibility and Perform Trace

Create custom logic for an existing custom field in S/4HANA Cloud ABAP Environment, then check its parameters using the Custom Logic Tracing app

Overview

🎓 intermediate 15 min. SAP S 4hana Cloud ABAP EnvironmentIntermediateABAP DevelopmentSAP Business Technology PlatformSAP BTP ABAP EnvironmentABAP Extensibility

You will learn

  • โœ”How to create custom logic for an existing custom field in the app Custom Fields
  • โœ”How to run a trace for the Fiori app Create Purchase Order in the app Custom Logic Tracing
  • โœ”How to check the output value of this custom field using Custom Logic Tracing
  • โœ”How to check the custom logic of this custom field, in Custom Fields
Julie Plummer J Julie Plummer September 6, 2024
Created by March 9, 2023
Contributors

Prerequisites

Prerequisites

  • You have a license for SAP S/4HANA Cloud
  • You are familiar with Key User extensibility in SAP S/4HANA Cloud. If not, see the More Information section
  • You are familiar with the app Custom Logic Tracing. If not, see the More Information section
  • In SAP Fiori launchpad, you have the following authorizations:
    • SAP_BR_PURCHASER for the app Create Purchase Order - Advanced
    • SAP_BR_ADMINISTRATOR for Custom Logic Tracing and Custom Logic
  • You have created a custom field using Key User extensibility yy1_zhdrprnt2_pdh_000
  • In Custom Logic, you have created a BAdI implementation YY1_FILLHEADERCUSTOMFIELDS_000 in the business context and BAdI definition Modify Purchase Order Header (MM_PUR_S4_PR_CHECK)

Steps

Intro

The administrator receives an welcome e-mail after provisioning. This e-mail includes the system URL. By removing /ui you can log into the SAP S/4HANA Cloud ABAP Environment system. Further information can be found Developer Extensibility: Connect to the ABAP System.

Throughout this tutorial, the placeholder ### or 000 is used. Always replace this with your initials or group number.


Step 1 Apply custom logic
โ€”

  1. Open the app Custom Fields.

    step1a-open-custom-fields
    step1a-open-custom-fields

  2. Change to the Custom Logic tab, search for the BAdI implementation YY1_FILLHEADERCUSTOMFIELD_000.

    Link text e.g., Destination screen
    Link text e.g., Destination screen

  3. Open the Details screen (by choosing the arrow on the right).

    step6b-badi-implementation-overview
    step6b-badi-implementation-overview

You can now see the Published Logic and Draft Logic, if they exist, relevant to the custom field.

step1c-custom-logic-empty
step1c-custom-logic-empty

Step 2 Add custom logic
+
Step 3 Start trace
+
Step 4 Create purchase order
+
Step 5 Check trace
+
Step 6 Test yourself
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 7
1. Apply custom logic 2. Add custom logic 3. Start trace 4. Create purchase order 5. Check trace 6. Test yourself 7. More information

Learn more →