Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
3,238

Small BOPF objects editor.


There are several good BOPF related articles and books of James Wood's Working with the BOPF API BOPF: Business Object Development & Paul Hardy's ABAP to the Future (BOPF chapter)

After reading them, I decided to do something with moderate complexity & desirably practical in the same time. Since in the standard BOBT (or /BOBF/TEST_UI) transaction I didn't find some functionality.

Creating delegated nodes was one of those. (You just can choose existing CUSTOMER & PRODUCT by search helps.)


Insert button is deactivated


It seemed to me creating own analogue of Z* BOBT transaction was good candidate to learn BOPF framework.




Long story short let me show you the the final result of several weeks of development.


For navigation purpose instead of tree a tree control in BOBT transaction, ZBOBT uses hotspot links in ALV for nodes and subnodes. Sometimes it looks like Russian nesting dolls but allows to concentrate your attention to one thing at a time without jumping back and forth by TREE control. Probably some of readers disagree with the privous statement that's why let's jump to discussion of wrapper classes.




The main warpper class is ZCL_BOPF_MANAGER


ZCL_BOPF_MANAGER


 

I hope most of the methods are self explanatory. The difference between *_ROW & *_TAB methods that *_TAB returns reference to entire table.
mo_manager = zcl_bopf_manager=>create( '/BOBF/DEMO_SALES_ORDER' ).

To get instance of class just pass BOPF name to CREATE method. After that you can omit a node key to retrieve data.
    " SELECT_ALL without passing VALUE /BOBF/T_FRW_QUERY_SELPARAM( )
DATA(lt_key) = lo_manager->query_tab( ).

" Retrieve data. Uses ROOT node by default
DATA(lr_rows) = lo_manager->retrieve_tab( it_key = lt_key ).

...

" Cast the result to specific type
DATA(lt_items) = CAST /bobf/t_demo_sales_order_itm_k(
mo_manager->retrieve_by_assoc_tab( iv_key = lv_key
iv_assoc_type = /bobf/if_demo_sales_order_c=>sc_association-root-item ) ).





 

The second class that helps MANAGER class to create dynamic data structures is ZCL_BOPF_METADATA. It wraps /BOBF/IF_FRW_CONFIGURATION interface and has 2 public methods


22


Both of them creates ROW (ER_DATA) or TABLE (ER_DATA_TBLE) based on  BOPF metadata


33


 




If something gets wrong BOPF produces a lot of errors. To handle them ZCL_BOPF_MESSAGES class was created.

 


44


it can store messages from table (BAPIRET2_TAB), bopf message (/BOBF/IF_FRW_MESSAGE) or transactional changes (after calling /BOBF/IF_TRA_SERVICE_MANAGER->MODIFY( ) method)
  CHECK NEW zcl_bopf_messages( iv_severity = 'AXE'
)->add_from_message( lo_message
)->show( ) <> abap_true.

it uses ZCL_EUI_LOGGER class to tackle with messages.




and finally ZCL_BOPF_UI_NODE class uses ZCL_EUI_ALV class to show root or sub nodes level items

Also ZCL_EUI_SCREEN class is used for actions' parameters


Deliver action's screen


 

& dynamic selection screens in Z_BOPF_TEST_UI program.


Selction screen for /BOBF/DEMO_SALES_ORDER







Installation process:

Before zbobt via abapGit you have to install eui library (it contains some UI classes mentioned earlier).

Then SE38->Z_BOPF_TEST_UII

I personally tested zbobt with /BOBF/DEMO_SALES_ORDER andZ_MONSTER (ABAP to the Future) BOPF objects.




PS:

I know about Web Dynpr, FPM & FBI. But I've just created the zbopt repository for self education purpose. Maybe ZCL_BOPF_MANAGER & ZCL_BOPF_METADATA classes will be helpful for me in the future projects
3 Comments
Labels in this area