This is a test message to test the length of the message box.
Login
ABAP BOPF Determination
Created by Software-Heroes

ABAP - BOPF Determination

What about derived data that does not stand in the database? We want to pursue this question in today's article.

Advertising

With data collection, you can read additional data at runtime when accessing BOPF. We had already presented this transient data with the data model and today we would like to show you an example of how the data can simply be read.

 

Create a determination

The determination is created on the respective node. For this, transaction BOBX must be called again. On the corresponding node, you now create a determination.

 

For this, the individual fields are filled, whereby the name of the processing class can be generated again via "Extras -> Propose Repository Names". As a category you choose Transient, because we want to read additional data for this node.

 

The next step is to set, when the determination should be made. For transient data in most cases the determination is sufficient for "load".

 

The evaluation timepoint is right here after loading the data from the database so that the data is complete. There are no dependencies for this node and determination.

 

Implementation

The implementation of the logic takes place in a separate class which implements the interface /BOBF/IF_FRW_DETERMINATION. In method EXECUTE, you receive all selected nodes, in this case only the table with keys. The implementation example is explained in the following code example:


DATA:
  lt_head TYPE ztest_t_contract.

io_read->retrieve(
  EXPORTING
    iv_node       = is_ctx-node_key
    it_key        = it_key
    iv_fill_data  = abap_true
  IMPORTING
    et_data       = lt_head
).

LOOP AT lt_head REFERENCE INTO DATA(lr_head).
  SELECT SINGLE name1
   FROM lfa1
   WHERE lifnr = @lr_head->creditor
   INTO @lr_head->creditor_name.

  IF sy-subrc = 0.
    io_modify->update(
      EXPORTING
        iv_node     = is_ctx-node_key
        iv_key      = lr_head->key
        iv_root_key = lr_head->root_key
        is_data     = lr_head
    ).
  ENDIF.
ENDLOOP.

 

Using the Retrieve method, you can read the corresponding data for the keys, using the combination table type that accepts the data. Then a loop about the header data by reference, reading the custom properties from the supplier's master record and updating the data with the update method, passing in the new data as a reference. The loop by reference has already solved this problem.

 

Test

When reading the node, the data is automatically read at the right time and the structure is enriched. The easiest way to check that is to try the test transaction BOBT. If you look at the sample data now, the field CREDITOR_NAME will be filled.

 

Conclusion

Not all data must always be persisted in the data model on the tables. With the example shown, you'll get an insight into how easily additional dependent data can be loaded. During implementation, you should make sure that the data determination is called with each read access, which can slow down the individual accesses a lot.


Included topics:
BOPFDeterminationDerive additional data
Comments (0)
Advertising

ABAP - BOPF Quick Guide (Update)

Category - ABAP

A little update to our book that we published. For all people who find the paperless office boring.

10/23/2020

ABAP - BOPF Quick Guide

Category - ABAP

You need a quick introduction to the SAP Business Object Processing Framework (BOPF), we have the right guide for you here.

09/11/2020

ABAP - BOPF Eclipse

Category - ABAP

Can you also develop BOPF in Eclipse? Here we show you how well the search and navigation works in the system.

03/20/2020

ABAP - BOPF Performance

Category - ABAP

What about the performance when accessing BOPF? We want to investigate this question today.

03/13/2020

ABAP - BOPF Helper methods

Category - ABAP

The framework provides you with various methods and objects that are intended to simplify use.

02/21/2020