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.
@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
Step 2): Maintain Odata service with transaction code /IWFND/MAINT_SERVICE with below steps:
Step 3): Test Odata service with sap gateway client button with transaction code /IWFND/MAINT_SERVICE as below..
Objectmodel annotations(@ObjectModel in CDS) generates bopf object as below in eclipse adt under bopf node and can see with BOBX transaction code.
Step 4): Next step is creating fiori element application the above registered odata service in web ide.
Test the application with fiori sandbox.
The below screen shows list report with crud opetaions, that is the magic with BOPF annotations.
Step 5)Making Data validations with BOPF Validations: Cretae new method under validations tab of generated BOPF object as below.
Write custom code in /BOBF/IF_FRW_VALIDATION~EXECUTE to trigger validations as below.
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.
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.
Thanks,Mani Kothapalli(SAP Tech Architect)