Extending Legacy SAP Fiori Apps: A Case Study with Clear Incoming Payments (F0773)

Introduction

Clear Incoming Payments (F0773) is a transactional SAP Fiori app that enables accounts receivable accountants to manually clear open customer items against incoming payments.

The app allows users to:

  • Search and select open customer invoices, credit memos, and residual items
  • Enter incoming payment details (amount, bank reference, clearing date, etc.)
  • Propose and simulate clearing before posting
  • Post the clearing document directly into the general ledger

It is typically used when automatic clearing (via electronic bank statements) does not match payments correctly, and manual intervention is required to reconcile customer accounts.

Extension Requirement

In our customer scenario, the business required an additional field payment reference to be visible during the clearing process — enabling accountants to make informed decisions when reconciling payments.

Challenge faced with this Legacy App Extension

Legacy Fiori applications like fin.ar.manualclearing are built using internal reusable libraries (sap.fin.arp.lib.clearing) where the actual logic and UI fragments reside. These apps do not expose extension points and sometimes don’t even have a Component.js. As a result, the usual extension mechanisms (controller extensions, view extensions) fail, leaving developers with no direct way to enhance or customize the app.

App Extension Approach

For the legacy apps, we have to still use the SAPUI5 Extension project, as the Adaptation project is not suited for them. While using.

Extending OData Service

Standard OData service FAR_MANUAL_CLEARING_SRV (Manual clearing of incoming payments) fetches the required data for this app. The Payment Reference is already part of the service and entity set; we do not need to do anything on this. Important classes from the backend are listed in case if it is required for your scenario.

  • CL_FAC_GL_MAN_CLEARING_DPC_EXT
  • CL_FAC_FINANCIALS_POST_DPC_EXT
  • CL_FDC_ACCDOC_HEADER_CHECK
  • CL_FDC_ACCDOC_ITEMS_CHECK
  • CL_FDC_TMP_DOC_ACCESS

How to Create an Extension Project in BAS (for legacy apps)

Please refer to my other blog, Extension Projects in BAS: Handling Legacy SAP Fiori Apps, for creating the extension.

Extending View

As per the customer’s requirement, we have to add the Payment Reference to the Post On Account tab view.

For this, we will have to replace the Clearing.view.xml and then change the code to launch our custom fragment having the custom field.

Update the manifest.json extension code

"sap.ui5": {
	"_version": "1.1.0",
	"dependencies": {
		"minUI5Version": "1.114.0"
	},
	"componentUsages": {
		"attachmentReuseComponent": {
			"name": "sap.se.mi.plm.lib.attachmentservice.attachment",
			"settings": {}
		}
	},
	"extends": {
		"component": "fin.ar.manualclearing",
		"extensions": {
			"sap.ui.controllerExtensions": {
				"fin.ar.manualclearing.App": {
					"controllerName": "customer.app.variant.ext.controller.AppCustom"
				}
			},
			"sap.ui.viewReplacements": {
				"sap.fin.arp.lib.clearing.aparclearing.Clearing": {
					"viewName": "customer.app.variant.ext.view.ClearingCustom",
					"type": "XML"
				}
			}
		}
	},
	"contentDensities": {
		"compact": true,
		"cozy": true
	}
}

Copy the clearing view for replacement and change the code to load the custom fragment

<IconTabFilter id="tabOnAccount" key="keyOnAccount"
	text="{i18nLib>ICON_POST_ON_ACCOUNT}">
	<!-- On Account Posting -->
	<core:Fragment fragmentName="customer.app.variant.ext.view.fragments.OnAccountCustom"
		type="XML" />
</IconTabFilter>

Copy the original fragment and update the logic for the custom field

<VBox visible="{path: 'UxFcPaymentReference', formatter: 'sap.fin.arp.lib.clearing.util.Formatter.deriveVisibleProperty'}" >
    <layoutData>
        <FlexItemData styleClass="sapUiSmallMarginEnd"/>
    </layoutData>
    <smartfield:SmartLabel id="OnAccountPaymentReference"
        labelFor="OnAccountInputPaymentReference" text="{/#FinsPostingAPARItem/RealEstateContract/@sap:label}"
        visible="{path: 'UxFcPaymentReference', formatter: 'sap.fin.arp.lib.clearing.util.Formatter.deriveVisibleProperty'}"
        required="{path: 'UxFcPaymentReference', formatter: 'sap.fin.arp.lib.clearing.util.Formatter.deriveRequiredProperty'}"
        />
    <smartfield:SmartField id="OnAccountInputPaymentReference" value="{PaymentReference}" change="onInputValueChange" clientSideMandatoryCheck="false"/>
</VBox>

If your scenario requires it, you can add logic in the custom controller extension; for our scenario, it was not needed.

Now you can test, build, and deploy your code.

Key Takeaways

  • Classical Fiori apps often cannot be extended using standard extension points.
  • Always check if the app relies on a library (e.g., sap.fin.arp.lib.*) where actual logic resides.
  • View replacement (sap.ui.viewReplacements) is the workaround when extension points are missing.
  • Fragment replacement works by replacing the parent view, not the fragment directly.
  • This approach ensures reusability without modifying SAP standard code.