SAPUI5: UI5’s Custom Control

We occasionally find ourselves unable to utilize the software’s built-in functionality. Not everyone fits into one size. We have these multi-million dollar projects because they match the business needs and procedures of our clients. This restriction applies to all products, regardless of whether they are made by SAP, Oracle, or another company. In a similar vein, SAPUI5 occasionally requires the creation of Custom Controls. The purpose of this article is to show how to create new controls that SAP does not provide. It’s time to take on the role of creation (SAPUI5 God).

I’ll walk you through a quick demo of how to add properties, events, and a new button that we made and used in the SAPUI5 application.

Step 1: Open the WebIDE and create an example SAPUI5 project.

Step 2: Make a Custom folder

Step 3: Make a file in JS

I’ve given it the demo name Sagar, which translates to “ocean” in Sanskrit.

Step4: Give the control name.

This will be expanded to sap/ui/core/Control at com/sampleCustom/Custom/Sagar

The characteristics, aggregates, associations, and events make up metadata. I’ve included the parameters width, height, and event hover for demo purposes.

You will write the HTML content in the renderer method, and I have bound the button’s meta properties.

I made a property text for the dynamic passing values and a hover text for the event example.

To trigger the events Make sure to add an additional line of code during render.

WriteControlData(oControl) oRm.write;

Step 5: Define a function in the controller and view using the custom control.

xmlns:Sagar=”com.sampleCustom.Custom” and the hover method “fnHover” should be noted.

Define the function fnHover as follows.

Testing Time

Continue dragging the cursor over that new control to see if the event hover is activated.

I hope it was simple for you to comprehend and apply this instruction. One of the easiest articles I’ve ever written is this one.For more in-depth and useful instructions from me, be sure to check out the part titled “More from the Author” at the conclusion of this post.

Please feel free to ask any questions you may have in the comments area. I respond to every question, recommendation, and critique.


you may be interested in this blog here:-

How can I see the values ​​of variables in OpenSolver as they change?

Navigating SAP’s E070 Table in SAP: The Heartbeat of Transport Management

  • Related Posts

    BAPI_ALM_ORDER_MAINTAIN terminates with the runtime error MESSAGE_TYPE_X

    Let’s know BAPI_ALM_ORDER_MAINTAIN terminates with the runtime error MESSAGE_TYPE_X in depth. Assuming that you experience a runtime dump with MESSAGE_TYPE_X (CO 888) while referring to BAPI as “BAPI_ALM_ORDER_MAINTAIN”, then, at…

    Sales Office Data … Can you change it even if config does not allow?

    Your business needs to change/right the Business Office information, regardless of whether it isn’t permitted in standard change mode in exchange IW32. See the screen capture, it is incapacitated. Sales…

    Leave a Reply

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

    You Missed

    BAPI_ALM_ORDER_MAINTAIN terminates with the runtime error MESSAGE_TYPE_X

    • By Varad
    • April 16, 2025
    • 13 views
    BAPI_ALM_ORDER_MAINTAIN terminates with the runtime error MESSAGE_TYPE_X

    Sales Office Data … Can you change it even if config does not allow?

    • By Varad
    • April 15, 2025
    • 22 views
    Sales Office Data … Can you change it even if config does not allow?

    PO re-price issue in BAPI_PO_CHANGE

    • By Varad
    • April 14, 2025
    • 28 views
    PO re-price issue in BAPI_PO_CHANGE

    Efficient way to retrieve Open Sales Order using FM SD_SELECT_SALES_DOCUMENTS

    • By Varad
    • April 13, 2025
    • 34 views
    Efficient way to retrieve Open Sales Order using FM SD_SELECT_SALES_DOCUMENTS

    ISU – 6 – Bankruptcy Overview and Write-Off Process using BAPI_CTRACDOCUMENT_WRITEOFF

    • By Varad
    • April 12, 2025
    • 32 views
    ISU – 6 – Bankruptcy Overview and Write-Off Process using BAPI_CTRACDOCUMENT_WRITEOFF

    Get Latitude and Longitude of any place using Google Map API in SAP

    • By Varad
    • April 11, 2025
    • 31 views
    Get Latitude and Longitude of any place using Google Map API in SAP