on 03-04-2014 6:51 AM
Hi All,
I am using OVS help for a field in view,and it is binded to an attribute in view context NODE1 .
In The OVS method for this field, i have to do a calculation and set attribute for another node attribute.
WHEN if_wd_ovs=>co_phase_3.
* apply result
IF ovs_callback_object->selection IS NOT BOUND.
******** TODO exception handling
ENDIF.
ASSIGN ovs_callback_object->selection->* TO <ls_selection>.
IF <ls_selection> IS ASSIGNED.
ovs_callback_object->context_element->set_attribute(
name = `TERM_END`
value = lv_term_end ).
i get the error and dump
regards,
Hi Naren,
As the error message saying that the attribute TERM_END is not available in the context element ovs_callback_object->context_element
Make sure that the attribute TERM_END is available in the same node to which OVS is called. I think you are trying to set the value to other node's attribute.
Otherwise, if you want to set the value lv_term_end to an attribute of other node, proceed as below
data lo_node type ref to if_wd_context_node.
data lo_element type ref to if_wd_context_element.
lo_node_type = wd_context->get_child_node( name = "OTHER_NODE" ).
lo_element = lo_node->get_element( ).
lo_element->set_attribute(
exporting
name = 'TERM_END'
value = lv_term_end ).
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ram,
I have tried this, i am able to set the attribute ,but unable to display the value on the browser.
based on tenure im able to get values on to term start date, now the calculated value for term end date
im unable to display.
the first four fields belong to one node and term end date belongs to other node.
regards,
Hi Ram,
WHEN if_wd_ovs=>co_phase_3.
* apply result
IF ovs_callback_object->selection IS NOT BOUND.
******** TODO exception handling
ENDIF.
ASSIGN ovs_callback_object->selection->* TO <ls_selection>.
IF <ls_selection> IS ASSIGNED.
ovs_callback_object->context_element->set_attribute(
name = `TENOR`
value = <ls_selection>-tenor_ll ).
ovs_callback_object->context_element->set_attribute(
name = `IRATE`
value = <ls_selection>-irate ).
Above code for other fields
This code is to set term _end date
DATA lo_nd_create_data TYPE REF TO if_wd_context_node.
DATA lo_el_create_data TYPE REF TO if_wd_context_element.
DATA ls_create_data TYPE wd_this->element_create_data.
DATA lv_term_end TYPE wd_this->element_create_data-term_end.
* navigate from <CONTEXT> to <CREATE_DATA> via lead selection
lo_nd_create_data = wd_context->get_child_node( name = wd_this->wdctx_create_data ).
* get element via lead selection
lo_el_create_data = lo_nd_create_data->get_element( ).
* @TODO handle not set lead selection
IF lo_el_create_data IS INITIAL.
ENDIF.
* @TODO fill attribute
lv_term_end = ls_end_term.
* set single attribute
lo_el_create_data->set_attribute(
name = `TERM_END`
value = lv_term_end ).
* ovs_callback_object->context_element->set_attribute(
* name = `TERM_END`
* value = lv_term_end ).
in debug i can see the enddate value also
regards,
Hi Naren,
Well, then eveything looks fine.
I suspect that somewhere the value of TERM_END getting re-set may be in WDDOMODIFYVIEW( ) or some other method after OVS call
Please check if anywhere else, the data of CREATE_DATA getting changed?
I think that is clearing the value, whatever you set from OVS.
Hope this helps you in fixing issue this time.. all the best
Hint: try to read the value of term_end in WDDOMODIFYVIEW( ), so that you will come to know, if the value is still existing.
Regards,
Rama
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.