cancel
Showing results for 
Search instead for 
Did you mean: 

Picking the Row user has selected for F4, ( lead Selection is in other row)

Former Member
0 Kudos

Hi Web Dynpro Experts,

I have to give F4 Functionality for WBS Element which is in a table.

This F4 should pick the WBS elements for the project which is in that particular row.

So i have given OVS.

In OVS I am Getting the project value of the Lead Selection, but not the one the User has selected for F4.

Can any one help me in picking that particular row user has selected for F4, when the lead selection is on other row.

Thanks

Santosh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Santhosh,

You can use the attribute CONTEXT_ELEMENT of OVS_CALLBACK_OBJECT to get the context element.

WHEN if_wd_ovs=>co_phase_2.

lr_context_element = ovs_callback_object->context_element.

lr_context_element->get_attribute( EXPORTING name = 'PRONR' IMPORTING value = lv_pronr ).

I have tried this its working.

Best Regards,

Loveline Thomas.

Former Member
0 Kudos

Hi all

Great .....

It Worked...Now I am able to pick my Correct Project Number.

Thanks For the Great Help

Regards

Santosh..

Answers (3)

Answers (3)

Former Member
0 Kudos

I think have Implemented the OVS Correctly.

For Fetching the value of the Project in the OVS , I have written the below code.

DATA lo_nd_disp TYPE REF TO if_wd_context_node.

DATA lo_el_disp TYPE REF TO if_wd_context_element.

DATA ls_disp TYPE wd_this->element_disp.

DATA lv_pronr LIKE ls_disp-pronr.

lo_nd_disp = wd_context->get_child_node( name = wd_this->wdctx_disp ).

lo_el_disp = lo_nd_disp->get_element( ).

lo_el_disp->get_attribute(

EXPORTING

name = `PRONR`

IMPORTING

value = lv_pronr ).

As it is a table , the above Code is returning the Lead Selection's Project Number.

But I want the Project Number in the row which user presses for F4.

How can I get that Project Number.

Any where i press F4 other than the Lead Selection, Iam Getting the Same values of WBS elements which are of Lead Selection's Project Number

Thanks

Santosh

arjun_thakur
Active Contributor
0 Kudos

Hi,

Attribute PRONR is binded to an input field or to a column of a table on which you have implemented OVS ?

Regards

Arjun

Former Member
0 Kudos

Hi Arjun

Project PRONR is Binded to a column of a Table.

Another Column is wbs element.

I have given OVS for the WBS Element.

PRONR WBS Element

100 ______ F4

200 ________F4

300 ________F4

just Take the Example Above.

if the Lead Selection is in the First Row ie 100.

I am Getting the WBS Elements of The Project Number 100 only, in any other Rows F4

arjun_thakur
Active Contributor
0 Kudos

Hi,

You actually need to find the index of the row in which OVS help was used. For that use this code:


 data: lr_element type ref to if_wd_context_element,
          lv_index type i.
 
  lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT'  ).
  lv_index = lr_element->get_index( ).

Use this code in the event handler for OVS. Now use get_static_attributes_table( ) method to get all the values in the table in an internal table. Then with the help of index of the row find the value of WBS for that perticular row.


DATA lo_nd_node1 TYPE REF TO if_wd_context_node.
DATA lo_el_node1 TYPE REF TO if_wd_context_element.
DATA ls_node1 TYPE wd_this->element_node1.
lo_nd_node1 = wd_context->get_child_node( name = wd_this->wdctx_node1 ).
data: it_tab type table of wd_this->element_node1.
data: wa_itab type wd_this->element_node1.
lo_nd_node1->get_static_attributes_table(
importing
table = it_tab ). 

Read it_tab into wa_itab index lv_index.

I hope it helps.

Regards

Arjun

Former Member
0 Kudos

Hi Arjun

I have Tried this

But it is Giving ' Access via 'NULL' object reference not possible. '

Do I need to give CONTEXT_ELEMENT some where else.

lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).

lv_index = lr_element->get_index( ).

In the above code lr_element is staying Initial.

Thanks

Santosh

Former Member
0 Kudos

Hi,

go thru this thread regarding OVS HELP.

THNKS

arjun_thakur
Active Contributor
0 Kudos

Hi Santosh,

Ideally the row which is selected by the user ( may or may not be the lead selected row) gets selected if the OVS is properly implemented. Please refer this [blog|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9502] [original link is broken] [original link is broken] [original link is broken]; to check if you have implemented all the three steps properly.

I hope it helps.

Regards

Arjun