Friday 27 September 2019

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.

Interface CDS:

SAP HANA Study Materials, SAP HANA Guides, SAP HANA Tutorials and Materials, SAP HANA Fiori

Consumption CDS:

SAP HANA Study Materials, SAP HANA Guides, SAP HANA Tutorials and Materials, SAP HANA Fiori

@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 HANA Study Materials, SAP HANA Guides, SAP HANA Tutorials and Materials, SAP HANA Fiori

SAP HANA Study Materials, SAP HANA Guides, SAP HANA Tutorials and Materials, SAP HANA Fiori

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

SAP HANA Study Materials, SAP HANA Guides, SAP HANA Tutorials and Materials, SAP HANA Fiori

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

SAP HANA Study Materials, SAP HANA Guides, SAP HANA Tutorials and Materials, SAP HANA Fiori

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

SAP HANA Study Materials, SAP HANA Guides, SAP HANA Tutorials and Materials, SAP HANA Fiori

SAP HANA Study Materials, SAP HANA Guides, SAP HANA Tutorials and Materials, SAP HANA Fiori

Test the application with fiori sandbox.

SAP HANA Study Materials, SAP HANA Guides, SAP HANA Tutorials and Materials, SAP HANA Fiori

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

SAP HANA Study Materials, SAP HANA Guides, SAP HANA Tutorials and Materials, SAP HANA Fiori

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

SAP HANA Study Materials, SAP HANA Guides, SAP HANA Tutorials and Materials, SAP HANA Fiori

SAP HANA Study Materials, SAP HANA Guides, SAP HANA Tutorials and Materials, SAP HANA Fiori

SAP HANA Study Materials, SAP HANA Guides, SAP HANA Tutorials and Materials, SAP HANA Fiori

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

SAP HANA Study Materials, SAP HANA Guides, SAP HANA Tutorials and Materials, SAP HANA Fiori

SAP HANA Study Materials, SAP HANA Guides, SAP HANA Tutorials and Materials, SAP HANA Fiori

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 HANA Study Materials, SAP HANA Guides, SAP HANA Tutorials and Materials, SAP HANA Fiori

Conclusion: The above step 6  shows  triggered data validations with BOPF framework . I hope  the above blog gives useful insight to trigger data validations in fiori element app with BOPF framework.

No comments:

Post a Comment