Skip to Content
Technical Articles
Author's profile photo Christian Sosa

Extending and Exposing BUT0ID for the Fiori App Manage Business Partner Master Data

A common question from customers before migrating to S/4HANA is: How do I move my custom extension fields to the new landscape?

SAP encourages the use of Key User Extensions whenever possible[1]. In fact, many use cases are covered by this approach. There are, however, certain data structures that as of now (Feb. 2022) are not yet supported by Key User Extensions. The following is an analysis of one of such cases.


The customer is planning their migration to S/4HANA, specifically their CRM module. One of their use cases involves adding custom fields to the identifications table (BUT0ID) of business partners. This is typically done by means of traditional Tools for WebClient UI and GUI (BDT[2], EEWB[3], AET[4]). These changes do not automatically impact on the Manage Business Partner Master Data Fiori App.

It is thus required to allow read and write functionality for these fields on the Fiori App.


Key User Extensions are disregarded as a possible solution since they are only available for certain Business Contexts[5] is available. Unfortunately, there is still no applicable Business Context provided by SAP for the identifications table (as of February 2022).

An SAP Note[6] on this exact topic “Extending BUT0ID table with Custom fields” states that the extension must be done manually but no further specifics are given.

Starting point

  • Stack: S/4HANA 2.0 On-premise
  • Fiori Application: Manage Business Partner Master Data[7] (App ID F3163)


Fiori App Manage Business Partner Master Data before extension

  • Database Tables already extended: BUT0ID + Extended Field


Extended table BUT0ID with the custom field

Extend the CDS-Views with the required Fields

According to documentation, the OData Service is MD_BUSINESSPARTNER_SRV, which can be used to locate the underlying CDS Views through Gateway Builder (transaction SEGW). These are:

  • I_BuPaIdentification (Interface View)
@AbapCatalog.sqlViewAppendName: 'ZCJ_BPID2'
@EndUserText.label: 'Extension of Z_I_BuPaIdentification'
extend view I_BuPaIdentification with ZCJ_I_BuPaIdentification {
  • I_BuPaIdentificationTP (Transactional View)
@AbapCatalog.sqlViewAppendName: 'Z_I_BUPAID2'
@EndUserText.label: 'Extension of I_BuPaIdentificationTP V2'
extend view I_BuPaIdentificationTP with Z_I_BuPaIdentificationTP_2
  • C_BuPaIdentification (Consumption View)
@AbapCatalog.sqlViewAppendName: 'ZCBUPAIDENT_EXT'
@EndUserText.label: 'Extension of C BupaIdent'
extend view C_BuPaIdentification with ZC_BuPaIdentificationExt
  @EndUserText.label: 'New Field'

The reason why three views need to be extended is that the transactional view model. It requires that CDS views meant for OData exposition be organized in three levels (consumption, transactional and interface).

Activate CDS Views

Needed artifacts will then be generated and/or updated. Once this step is completed, you should already be able to display the new field in the Fiori App without any extra coding.


The custom field is already accessible from the App. Write access has not yet been implemented.

Since the field should be made editable as per requirement, it is necessary to implement the draft handling.

Extend the draft persistency table BUPA_ID_D

An extra field matching the newly created field on BUT0ID must be appended here as well.

After activating these changes, the Fiori app should already be able to save the draft in edit mode. For saving the draft to the active entry, more logic is needed.


Draft persistency table after custom field extension

Enhance the draft handling class CL_I_DR_BUSINESSPARTNERTP

Business Partners are modelled through a Business Object in SAP. This Business Object gets automatically generated by the standard CDS Views. This draft handling class is responsible for managing the draft lifecycle. In particular, saving draft changes to database is handled by its method COPY_DRAFT_TO_ACTIVE_ENTITY( ).

Depending on the SAP Standard logic, the recommendation is to enhance as less invasive as possible. This could be Pre, Post or Override Exit. To preserve the complex logic within COPY_DRAFT_TO_ACTIVE_ENTITY( ) and only afterwards execute the new custom code, a Post-Exit method was chosen.


Draft handling class enhancement

Implement the logic for saving the draft info to database

See sample code below. It should be noted, that certain non-trivial logic needs to be implemented here: consistency checking, draft validation, update type determination (creation, update or deletion). This demonstration does not include such logic.

  METHOD ipo_z_cj_test~copy_draft_to_active_entity.

    READ TABLE it_draft_key INTO DATA(wa_draft) INDEX 1.

    SELECT FROM bupa_id_d
        mandt AS client,
        businesspartner AS partner,
        bpidentificationtype AS type,
        bpidentificationnumber AS idnumber,
        " Mark the entry as an update
        'U' AS kz
      WHERE draftadministrativedatauuid = @wa_draft-key
      INTO TABLE @DATA(lt_result).

    " Assign draft data to the input table for BUP_BUPA_UPDATE
    MOVE-CORRESPONDING lt_result TO it_t_but0id. 

        " Initialization of empty required tables was removed for clarity
        t_but000        = it_t_but000
        t_but000_td     = it_t_but000_td
        t_but000_td_old = it_t_but000_td_old
        t_but001        = it_t_but001
        t_but0bk        = it_t_but0bk
        t_but0bk_old    = it_t_but0bk_old
        t_but100        = it_t_but100
        t_but100_old    = it_t_but100_old
        t_but0cc        = it_t_but0cc
        t_but0cc_old    = it_t_but0cc_old
        t_but0id        = it_t_but0id
        t_but0id_old    = it_t_but0id_old
        t_but0is        = it_t_but0is
        t_but0is_old    = it_t_but0is_old.

    IF sy-subrc EQ 0.




Test the extension

The new field should now be available on the Fiori App Manage Business Partner Master Data including write functionality.


  • Since the App Manage Business Partner Master Data is based on Fiori Elements, no additional UI code was required. Display configs are handled completely through annotations.
  • For a general extensibility request, finding the right extensibility points can be a daunting task. This has been omitted on this article for clarity.
  • The current implementation was applicable to a specific App within the CRM Module. Although it has not been tested, this approach should be valid for other S4HANA Apps with a similar architecture:
    • Frontend characteristics
      • App built with Fiori Elements
      • Data-Source via BOPF-Object generated by a CDS-View
      • Draft handling enabled
      • Key User Extension not possible, for lack of Business Context
    • Backend characteristics:
      • CDS-View with generated BOPF Object
      • BOPF Object extensibility not available


The following resources were useful for arriving at this solution:


[1] Extensibility Explorer:

[2] Business Data Toolset:

[3] Easy Enhancement Workbench:

[4] Application Enhancement Tool:

[5] Business Context:

[6] SAP Note “Extending BUT0ID table with Custom fields”:

[7] Fiori App Manage Business Partner Master Data:‘F3163’)/S21OP

About the author

Christian Sosa is SAP Consultant at Q_PERIOR focusing on technology and innovation, currently working on end-to-end SAPUI5 development, test management and ABAP on HANA development.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.