Skip to Content
0
Jul 24, 2019 at 01:24 PM

Field not updating in UI using BOPF CDS

1663 Views

Hi,

I am updating the node instance by retrieving the data from the UI.

DATA lt_item_data  TYPE        zci_t_item.
    DATA lr_item_data  TYPE REF TO zci_s_item.

* For the customer invoice retrieve its ITEM nodes 
    io_read->retrieve(
      EXPORTING
        iv_node = zif_ci_customer_invoice_c=>sc_node-item
        it_key  = it_key
      IMPORTING
        et_data = lt_item_data ).

* Calculate the amount (= price x quantity) for each item  
    LOOP AT lt_item_data REFERENCE INTO lr_item_data.
      lr_item_data->amount = lr_item_data->price * lr_item_data->quantity.
      
* Update the customer invoice with calculated amount
      io_modify->update(
        EXPORTING
          iv_node = zif_ci_customer_invoice_c=>sc_node-item
          iv_key  = lr_item_data->key
          is_data = lr_item_data ).
    ENDLOOP.

In UI, I've changed the value and pressed 'Enter' the status is getting changed.

Our scenario is if the user changes the value and uses tab to move to another field then the status has to change.

Our code is written under 'Initialize' Determination with condition below,

Trigger condition - Update checked

Evaluation time - After modify checked