SAP Fiori for SAP S/4HANA, SAP Fiori, SAP HANA, SAPUI5

S/4 HANA FIORI Transactional App data validations with FIORI ELEMENT Template and CDS -BOPF framework

Introduction: This Blog is to show S/4 hana fiori transactional app data validations with FIORI ELEMENT Template and CDS -BOPF framework.This covers CDS creation, app crud operations(transactional behaviour), Odata Publish withannotations and Odata registration to be used in front end. Required SAP landscape prerequisites are Eclipse ADT, WebIDE, S/4 HANA On-Premise with SAP_GWFND and SAP_UI components.

Main Part : The below steps are required to perform data validations with BOPF framework in S/4 HANA app.

Step 1 ) In Eclipse ADT, Create consumption and interface CDS on existing database table and publish consumption CDS as Odata service with Odata annotation to be used in fiori app.In this scenario, ztfitx_tier is esixting table in S/4 HANA.

Interface CDS:

SAP Fiori for SAP S/4HANA, SAP Fiori, SAP HANA, SAPUI5

Consumption CDS:

SAP Fiori for SAP S/4HANA, SAP Fiori, SAP HANA, SAPUI5

@OData.publish: true annotation takes care of publishing CDS as a Odata service.

BOPF annotations : Enables create, delete and modify operations in fiori element app and needs to be used as below in CDS.

@ObjectModel.transaction Processing Delegated: true

@ObjectModel.createEnabled: true

@ObjectModel.deleteEnabled: true

@ObjectModel.updateEnabled: true

Step 2): Maintain Odata service with transaction code /IWFND/MAINT_SERVICE with below steps:

SAP Fiori for SAP S/4HANA, SAP Fiori, SAP HANA, SAPUI5

SAP Fiori for SAP S/4HANA, SAP Fiori, SAP HANA, SAPUI5

Step 3): Test Odata service with sap gateway client button with transaction code /IWFND/MAINT_SERVICE as below.

SAP Fiori for SAP S/4HANA, SAP Fiori, SAP HANA, SAPUI5

Objectmodel annotations(@ObjectModel in CDS) generates bopf object as below in eclipse adt under bopf node and can see with BOBX transaction code.

SAP Fiori for SAP S/4HANA, SAP Fiori, SAP HANA, SAPUI5

Step 4): Next step is creating fiori element application the above registered odata service in web ide.

SAP Fiori for SAP S/4HANA, SAP Fiori, SAP HANA, SAPUI5

SAP Fiori for SAP S/4HANA, SAP Fiori, SAP HANA, SAPUI5

Test the application with fiori sandbox.

SAP Fiori for SAP S/4HANA, SAP Fiori, SAP HANA, SAPUI5

The below screen shows list report with crud opetaions, that is the magic with BOPF annotations.

SAP Fiori for SAP S/4HANA, SAP Fiori, SAP HANA, SAPUI5

Step 5)Making Data validations with BOPF Validations: Cretae new method under validations tab of generated BOPF object as below.

SAP Fiori for SAP S/4HANA, SAP Fiori, SAP HANA, SAPUI5

SAP Fiori for SAP S/4HANA, SAP Fiori, SAP HANA, SAPUI5

SAP Fiori for SAP S/4HANA, SAP Fiori, SAP HANA, SAPUI5

 

Write custom code in /BOBF/IF_FRW_VALIDATION~EXECUTE to trigger validations as below.

SAP Fiori for SAP S/4HANA, SAP Fiori, SAP HANA, SAPUI5

SAP Fiori for SAP S/4HANA, SAP Fiori, SAP HANA, SAPUI5

Step 6)Testing Data validations with BOPF Validations: Create new entry and save, BOPF validation method gets triggered and does validation as per custom code as below.

SAP Fiori for SAP S/4HANA, SAP Fiori, SAP HANA, SAPUI5

Leave a Reply

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