Hi All,

Here, we are going to explain the creation of draft capable custom SAP UI5 application.

Prerequisite:  Please visit my previous blog post for overview of the functionality and to know the steps that you need to follow for backend designing.

Develop Draft Capable Custom Apps Using BOPF Framework – Part1

 

Let’s start the backend development:

  1. Since we have taken sales order scenario, so first we have created two custom ZTable for Header and line item details.

 

  1. Next, we have created Basic CDS view on top of the both tables.

 

  1. On top of the above created CDS views we have created an interface view in which, we have enabled the draft functionality and the transactional processing and also, we have provided association of item CDS to header CDS.

 

Here, @ObjectModel annotations is used to provide the draft & transactional capabilities to the CDS view. This view is having the draft capabilities and the draft table will be auto generated when the view is activated.

Detailed explanation:

 

To check BO object has been created or not, just hover on the header CDS view, where the “transactionalProcessingEnabled” is set as true.

 

Then click on the Business Object, which will navigate to the Business Object Overview Page.

After this, click on the “Go to the ROOT node”.

A node overview dialog will get open where you can see the information corresponding to your Business Object implementation details and their behavior and structure.

 

Inside the draft class, we have redefined one method.

Method: /BOBF/IF_FRW_DRAFT~COPY_DRAFT_TO_ACTIVE_ENTITY

In this method we have written logic to convert draft data into active data(database).

 

In our previous blog post, we have mentioned that at root node level some actions will get generated to implement draft functionality and there we can write our own logic too.

So, to implement delete functionality (Delete instances of the active document), we have redefined one of the methods in the delete class.

How to find delete class name?

In the node overview page, Go to the action tab.

In the action tab you can find the delete class name. Then open the class through se24 tcode, and have written logic for deletion in the method BOBF/IF_LIB_DELETE_ACTIVE~DELETE_ACTIVE_ENTITY

To implement locking mechanism in our app, we have redefined one of the methods of the lock class.

Method: /BOBF/IF_LIB_LOCK_ACTIVE~LOCK_ACTIVE_ENTITY

  1. Now the next step, we have created consumption view on top of the header interface view and provide OData annotation, which will automatically create OData service.

 

  1. Then, the last step is to register the OData service in your system.

          Transaction : /n/IWFND/MAINT_SERVICE

Using the above mentioned tcode, we have registered our OData service and then the service will be available to be used by the webide to generate the application.

So, this is how we have developed our backend.

 

Next Step-

Development of SAP UI5 custom app 

 

 

 

For more information regarding back-end creation, please visit the below link:

https://blogs.sap.com/2019/01/09/abap-programming-model-for-sap-fiori-draft-based-for-non-guid-keys-much-more../

 

Thanks,

Anubhuti

 

jooman neshat

jooman

Author Since: April 23, 2021

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x