Friday, 13 January 2023

Extending Fields in the RAP based Fiori applications

Field Extensions in a Fiori Applications is the most common requirements in many S/4 HANA projects. However this blog will focus on the RAP based Standard Fiori app Extensions for the Custom /Standard Fields.

The below flow charts will illustrate the different decisions and possibilities in extending the custom fields/standard for a RAP based Fiori applications

SAP Fiori Applications, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials, SAP ABAP Guides, SAP ABAP RAP
RAP Custom Field Extension

SAP Fiori Applications, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials, SAP ABAP Guides, SAP ABAP RAP
RAP Custom Field Extension

Custom field extension for a Managed Scenario:

Let us extend a custom field for the below Fiori application.

https://fioriappslibrary.hana.ondemand.com/sap/fix/externalViewer/#/detail/Apps(‘F4710’)/S24OP

◉ As per the above flow chart check if there is any business context available for this application ,if found create a custom field as shown below and enable the  app context in any available

SAP Fiori Applications, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials, SAP ABAP Guides, SAP ABAP RAP

SAP Fiori Applications, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials, SAP ABAP Guides, SAP ABAP RAP
Enable the Application in scope

SAP Fiori Applications, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials, SAP ABAP Guides, SAP ABAP RAP
Publish the custom field

◉ Now go and Verify the CDS Entity if the Extended Custom field is visible as a CDS extension ?
◉ Navigate to the CDS View entity from the Service Binding UI_PROMISETOPAY_MANAGE

SAP Fiori Applications, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials, SAP ABAP Guides, SAP ABAP RAP
CDS extension is generated

SAP Fiori Applications, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials, SAP ABAP Guides, SAP ABAP RAP

◉ Now verify if the field is available in the Fiori application Manage Promises to Pay

SAP Fiori Applications, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials, SAP ABAP Guides, SAP ABAP RAP

Thus you can extend the custom field in Managed scenario of RAP

Standard field Extension in an Un Managed Scenario :

Let us extend the below Un-Managed Application Process Receivables ( Version 2 )

https://fioriappslibrary.hana.ondemand.com/sap/fix/externalViewer/#/detail/Apps(‘F0106A’)/S24OP

Let us try to add some additional fields which are missing in the below Invoices tab in the object page of the application :

SAP Fiori Applications, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials, SAP ABAP Guides, SAP ABAP RAP

◉ Now let us verify the CDS Entity behind the Invoices tab and extend it with the missing standard field as shown in the below example

SAP Fiori Applications, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials, SAP ABAP Guides, SAP ABAP RAP

◉ extend view entity R_CollectionsInvoiceTP with
{
  _OperationalAcctgDocItem.PaymentTerms as paymenterms
}
◉ Now lets test if this CDS extension works in case of Un-Managed Scenario. As we see below the field is extended however the value is filled as empty as this is a implemented via a query class.

SAP Fiori Applications, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials, SAP ABAP Guides, SAP ABAP RAP

and the Fiori app is extended now to show the standard field

SAP Fiori Applications, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials, SAP ABAP Guides, SAP ABAP RAP

◉ Now let us verify if this is a dynamic or a static/BAPI call in the query class to fetch the data.

SAP Fiori Applications, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials, SAP ABAP Guides, SAP ABAP RAP

SAP Fiori Applications, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials, SAP ABAP Guides, SAP ABAP RAP

SAP Fiori Applications, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials, SAP ABAP Guides, SAP ABAP RAP

◉ From the above screenshots its evident that the query is class is using a CDS view P_COLLECTIONSINVOICEMEMORY to fetch the data and fill the fields  that is the reason why table @rt_Data is not filled with data even tough the custom entity shown the field.

◉ Next step is extend the P_COLLECTIONSINVOICEMEMORY CDS view to get the payment terms field.

@AbapCatalog.sqlViewAppendName: 'ZI_invmem'
@EndUserText.label: 'CDS Extension for Invoice'
extend view I_CollectionsInvoiceMemory with Zi_collinvmem
{
_OperationalAcctgDocItem.PaymentTerms as PaymentTerms

}
@AbapCatalog.sqlViewAppendName: 'zp_collext'
@EndUserText.label: 'CDS Extension for Invoice'
extend view P_CollectionsInvoiceMemory with ZP_coll_Ext
{
PaymentTerms
}

After Extended the Query CDS view with the required field now the Fiori Application shows the values during the execution after refresh:

SAP Fiori Applications, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Materials, SAP ABAP Guides, SAP ABAP RAP

Thus you can extend RAP based application for both custom /standard fields for both Managed and Un-managed scenarios

No comments:

Post a Comment