Technology

Tag Archives

Archive of posts published in the category: ABAP
Apr
17

ABAP Programming Model for SAP Fiori – Part – 12

BOPF with Draft

In this tutorial, lets analyse how to work on Draft class to retrieve data from other entities and push all the data model’s data into respective tables. For our Airline scenario, we don’t have any specific business logic, so direct INSERT or UPDATE or DELETE operations to DB will work.

Our objective inside the Draft class is to collect the data from all the entities and then do DB operations accordingly.

In the Draft generated class, we redefine method /bobf/if_frw_draft~copy_draft_to_active_entity to apply our business logic for the Save sequence.

To retrieve the own data model entity and its child data model entities retrieve() and retrieve_by_association() methods can be used respectively. Follow the below code for retrieving the data from all the entities.

Once the retrieval is complete, data has to be organised in order to find whether the data has to be inserted or updated. Table type of each

Read More
Apr
8

ABAP Programming Model for SAP Fiori – Part – 8



CRUD Operation in SAP BOPF

From our data model of Airline which we have created, there are three Composite Interface views. It is always good practice to add semantic business object annotations to the composite interface views. Because Basic Interface views has to be reused in other applications as well, so we apply business object annotations on Composite interface views. To generate a BOPF business object based on the three composite CDS views, we must add several @ObjectModel annotations to the views.

In the Airline root view (ZAPF_I_AIRLINE), we must add the annotations on the header level.

Read More
Apr
7

ABAP Programming Model for SAP Fiori – Part – 10



Action in BOPF

Action has the literal meaning in BOPF. Do something. We can create an Action to an existing business object node by carrying out the following steps,

  • Open the business object (ZAPF_I_AIRLINE).
  • In the business object editor, click on Go to the Root Node link.
  • Select Actions tab, and choose New.

A dialog appears, where we must specify the details of the action:

  • Name: Enter the name of the action; in our case, we enter “Set URL”.
  • Description: Enter description that describes the purpose of the action, for instance, “Set the URL”.
  • Implementation Class: We can simply accept the suggestion that will lead to the generation of a global ABAP class or enter an already existing class that implements the interface /bobf/if_frw_action~execute. We will call the class ZCL_A_LOCK_APF_I_AIRLINE.
  • Instance Multiplicity: Select multiple node instances here, as we want the action to operate on several
Read More