SAP Help create-enhancement-determination









create-enhancement-determination




Step 1 - first create a business object enhancement

find the business object you want to enhance
create enhancement determination step 1



Create enhancement
create enhancement determination step 2



enter name and business object and press ok to create
create enhancement determination step 3





Step 2 - Find business object element Determination

first find the relevant business object enhancement created above
create enhancement determination step 5



double click on business object z enhancement
create enhancement determination step 6



Expand the Node Elements
create enhancement determination step 7



select change mode
create enhancement determination step 8



and find the node you want to create an enhancement determination for (i.e. ROOT). Note you can expanding the determination
node an see all the existing determinations. Very useful to be able to find code that you might want to use in your new determination.
create enhancement determination step 9




Step 3 - Create Enhancement Determination
Right click on the Determinatiuons node and choose "Create Determination"
create enhancement determination step 10



Enter name/details
create enhancement determination step 11



Click Save and then click on the class interface name you just entered. It should ask if you want to create it. Choose yes.
create enhancement determination step 12



Now save and activate the newly created determination class interface.
create enhancement determination step 13



Note the EXECUTE method is where you enter your own code for the determination.
create enhancement determination step 14



Now return back to the previous BOBX screen and click on the generate button
create enhancement determination step 15



Step 4 - Example code to update values within determination

METHOD /bobf/if_frw_determination~execute.
DATA: lt_root TYPE /scmtms/t_tor_root_k,
"ls_root TYPE /scmtms/s_tor_root_k,
ls_key TYPE /bobf/s_frw_key,
iv_key TYPE /bobf/conf_key. "/BOBF/S_FRW_KEY.

DATA: lr_root TYPE REF TO /scmtms/s_tor_root_k.
DATA: lt_fieldnames TYPE /bobf/t_frw_name,
ls_fieldnames LIKE LINE OF lt_fieldnames.

* CREATE DATA lr_root.
* lr_root->tspid = 'SSS'.

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

LOOP AT lt_root REFERENCE INTO DATA(ls_root) WHERE LABELTXT IS INITIAL.

REFRESH lt_fieldnames.
ls_fieldnames = 'LABELTXT'.
APPEND ls_fieldnames TO lt_fieldnames.

ls_fieldnames = 'TSPID'.
APPEND ls_fieldnames TO lt_fieldnames.

LOOP AT it_key INTO ls_key.
iv_key = ls_key-key.
ENDLOOP.

ls_root->tspid = 'Carrier'.
ls_root->labeltxt = 'Desc'.

io_modify->update(
EXPORTING
iv_node = is_ctx-node_key " Node
iv_key = iv_key " Key
* iv_root_key = " NodeID
is_data = ls_root "lr_root " Data
it_changed_fields = lt_fieldnames " List of Names (e.g. Fieldnames)
).

ENDLOOP.
ENDMETHOD.


Step 5 - Set Determination Trigger Conditions
Within the Trigger Conditions tab you can set what BO elements this determination is triggered for
create enhancement determination step 16



Step 6 - Set Determination Evaluation Timepoints
Within the "Evaluation Timepoints" tab you can set when this determination is triggered (i.e. before save, after save etc)
create enhancement determination step 17




Create determination enhancement using BOBX