Monday, 22 August 2022

Extending SAP FIORI App : My Inbox – Approve Purchase Order (F0402A)

Overview

This blog shares on how SAP FIORI App – My Inbox can be enhanced. FIORI extension is done on My Inbox – Approve Purchase Order (F0402A) enhancing custom field in PO Line Item data.    Custom screen enhancement is done on PO Line Item to add field ‘Last Price’. To display the field on FIORI screen, no enhancement is needed either in Odata, Workflow or UI. Appropriate CDS views related to My Inbox – Purchase Order app to be identified and enhanced to modify the UI output display.

Workflow Configuration

SAP Business Workflow configuration entries maintained for Workflow Task of Purchase Order

Transaction Code – SPRO

Path: SAP Reference IMG -> SAP Customizing Implementation Guide -> SAP Netweaver -> SAP Gateway Service Enablement -> Content -> Workflow Settings -> Maintain Task Names and Decision Options

SAP ABAP Development, SAP ABAP Extensibility, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP News

SAP ABAP Development, SAP ABAP Extensibility, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP News

Transaction code – SWFVISU

SAP ABAP Development, SAP ABAP Extensibility, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP News

SAP ABAP Development, SAP ABAP Extensibility, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP News

GUI Enhancement of PO Line Item

Table EKPO enhanced by adding custom fields in structure ‘CI_EKPODB’

SAP ABAP Development, SAP ABAP Extensibility, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP News

Field enhancement as it appears in ME23N transaction.

SAP ABAP Development, SAP ABAP Extensibility, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP News

UI Visualization

SAP ABAP Development, SAP ABAP Extensibility, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP News
My Inbox – Purchase Order Approval

SAP ABAP Development, SAP ABAP Extensibility, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP News
My Inbox – Purchase Order App Header Data

SAP ABAP Development, SAP ABAP Extensibility, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP News
My Inbox – Purchase Order App Line Item Data

Extending CDS views.

For header level changes CDS view C_PurchaseOrderFs will be extended. For item level changes there are series of CDS views that needs to be extended due to use of Nested CDS concept.    Below chart shows the CDS view that needs to be extended.

SAP ABAP Development, SAP ABAP Extensibility, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP News

In final consumption CDS view C_PurchaseOrderFs, CDS view C_PurOrdItemEnh is used which is a consumption view for the PO Line Item. Open the view C_PurOrdItemEnh in eclipse and open the dependency analyzer view.                                                                                                               

Path – Right Click on CDS View -> Open With -> Dependency Analyzer

SAP ABAP Development, SAP ABAP Extensibility, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP News

Step 1 – CDS view I_PurchasingDocumentItem to be extended with the custom field added in the table EKPO.

ZI_PurchasingDocumentItem
@AbapCatalog.sqlViewAppendName: 'ZCUSTOMFIELDS'
@EndUserText.label: 'Custom Field Extension'
extend view I_PurchasingDocumentItem with ZI_PurchasingDocumentItem {
    ekpo.zzprice as LastPrice
}

Step 2 – CDS view I_PurchaseOrderItem to be extended with the custom field.

ZI_PurchaseOrderItem
@AbapCatalog.sqlViewAppendName: 'ZCUSTOMFIELDS1'
@EndUserText.label: 'Custom Field Extension'
extend view I_PurchaseOrderItem with ZI_PurchaseOrderItem {
    LastPrice
}
 
Step 3 – CDS view I_PurchaseorderItemEnhanced to be extended with the custom field.

ZI_PurchaseorderItemEnhanced
@AbapCatalog.sqlViewAppendName: 'ZCUSTOMFIELDS2'
@EndUserText.label: 'Custom Field Extension'
extend view I_PurchaseorderItemEnhanced with ZI_PurchaseorderItemEnhanced {
    LastPrice
}

Step 4 – CDS view C_PurOrdItemEnh to be extended with custom field and the UI properties. As the UI properties has to be defined in CDS view extension, CDS view C_PurOrdItemEnh has to be reviewed to identify the ‘qualifier’ and ‘position’ properties for the new field.

ZC_PurOrdItemEnh
@AbapCatalog.sqlViewAppendName: 'ZCUSTOMFIELDS3'
@EndUserText.label: 'Custom Field Extension'
extend view C_PurOrdItemEnh with ZC_PurOrdItemEnh {
  
  @UI.lineItem: [{
            qualifier: 'PurchItem',
            position: 120,
            importance: #HIGH }, {
            position: 120,
            importance: #HIGH 
            }]
      LastPrice
  
}

SAP ABAP Development, SAP ABAP Extensibility, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP News
CDS View C_PurOrdItemEnh to identify qualifier and position properties

No comments:

Post a Comment