cancel
Showing results for 
Search instead for 
Did you mean: 

NodeElement isChanged() / isChangedByClient()

Former Member
0 Kudos

Hi all.

I'm working with a table that has input fields as cells and some of them have OVS. This table is filled with data that comes out from a BAPI and if the BAPI.

I need to save the data of each row of the table only when this data has changed. I use the isChanged() and isChangedByClient() methods for each row.

The problem is: when i use the OVS to change the cell those methods dont work, trying to solve this i use the changed(<Attribute Name>) method into the applyResult() method of the OVS but it doest work.

I wanna know how to solve this problem. Please is urgent.

Best Regards.

Gregory

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Gregory,

Try to work with model object itself, rather then content node.

Model objects generated from BAPI could be casted to ICMIModificationCount.

For every model object get modCount() after loading. Then, before save, check current modCount() with saved value. If they are equals, then skip saving.

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Former Member
0 Kudos

Hi.

Thx a lot.

Nibu: I alreay tried to set the flag with the method changed(<Attribute Name>) and didnt work. I've thinking putting my own flag in the context element.

Valery: I cant use the model object.

And Ralf: I'm working with webdynpro for java.

If somebody knows a way to do in standard form please say me how.

Best Regards.

Gregory.

Former Member
0 Kudos

<i>Valery: I cant use the model object.</i>

How's that???

If you can access node, then you can access node element, and IWDNodeElement.model().

Or you are using value node (as opposite to model node)?

VS

Former Member
0 Kudos

Hi Valery.

Yes i'm using a value node, not a model node.

And i solve the problem creating a boolean attribute and setting it to true in the OVS method applyResult().

Thx anyway.

Best Regards.

Gregory.

daniel_humberg
Contributor
0 Kudos

if you use the change log, you have to add an entry to the change log manually.

I entered this in the event handler for the DATA_SELECTED event of the search help:


*     tell the change log about it (needed for all freely programmed search helps)
*     (needed before writing it to the context)
      lo_componentcontroller =   wd_this->get_componentcontroller_ctr( ).
      lv_rv_entry_added = lo_componentcontroller->add_context_attribute_change(
                                                          element           = ls_my_element
                                                          iv_attribute_name = 'MY_ATTRIBUTE'
                                                          iv_new_value      = l_data_selected-my_attribute ).
      ls_prstd->set_attribute( name  = 'MY_ATTRIBUTE'
                               value = l_data_selected-my_attribute ).

Details:

http://help.sap.com/saphelp_nw2004s/helpdata/en/5d/395e4254139041e10000000a1550b0/frameset.htm

Answers (3)

Answers (3)

ralf_geiger
Explorer
0 Kudos

Hi Gregory,

if you are using Web Dynpro ABAP you can use the context change log. There every change of the context which has been done on the UI is logged.




  data:
    lr_context type ref to if_wd_context,
    lt_changelist type wdr_context_change_list.

  lr_context = wd_context->get_context( ).

* To switch on logging:
  lr_context->enable_context_change_log( ).

* To get the change log:
  lt_changelist = lr_context->get_context_change_log( and_reset = abap_false ).


Regards,

Ralf

Former Member
0 Kudos

Hi Gregory,

I too had some cases, where 'isChangedByClient()' wasn't recongzised (but that was not for OVS:). I got the functionality by using my own flag and setting it when required. May be in yur case, setting the flag inside the 'applyResult()' method of the OVS might help.

Hope this helps,

Best Regards,

Nibu.

Former Member
0 Kudos

Please i need some help urgent!

Thx

Regards.

Gregory.