cancel
Showing results for 
Search instead for 
Did you mean: 

Different F4 value help on different rows in a table

0 Kudos

Hi,

I'm in the process of making a WebDynpro ABAP application (my first!), where I need to have different F4 value helps for the different rows in a table column.

To try to achieve this I have implemented an F4 value help using Object Value Selector, and this works fine in the way that I am now able to manipulate and get the value help to look like I want it.

However, in order to get the data for the correct row number I need to push the selection button before using the F4 button, and of course you would not typically do so, but if I just use only the F4 button I always get the values for row number 1, no matter which row the cursor is positioned in.

When debugging my OVS method I can see that the information about the row number is there, because if I e.g. use F4 on row number 8 for node FLIGHTTAB then the parameter ovs_callback_object->context_path has the value ''1.FLIGHTTAB.8".

Unfortunately this parameter is Private so I cannot access it.

So I'm asking you guys in the forum if anyone has any knowledge how to get the row number from within the OVS method, or if you have any other bright ideas on how to solve this.

Kind regards,

Claus

Accepted Solutions (1)

Accepted Solutions (1)

former_member217546
Participant
0 Kudos

Hi,

Please check ovs_callback->CONTEXT_ELEMENT

and check methods in IF_WD_CONTEXT_ELEMENT i,e ovs_callback->CONTEXT_ELEMENT.

you may get path of that context element.  

or

check the methods in table instance (cl_wd_table) in which you are applying OVS for selected row.

0 Kudos

Hi Sudheer,

The methods in IF_WD_CONTEXT_ELEMENT seems to all give data based on the lead selection, and since this is not the values I need, I don't think these can be used for my purposes.

On the other hand some of the methods in CL_WD_TABLE looks like they might give the data I need, but I'm not that used to working with OO programming, so I cannot figure out how to access these method from within the OVS event method.

I've tried implementing some code snatched from SAP standard for test purposes like this:

      * Get root UI element of view
        lo_root_view_element ?= io_view->get_root_element( ).

      * Get table TBL_TREE_ELEMENTS
        lo_uielement = lo_root_view_element->get_child( id = lc_tbl_tree ).
        lo_table ?= lo_uielement

      * Call of a sample method.
        lo_master_column = lo_table->get_master_column( ).

However the "io_view" is not defined, so this will not work.

So if you you anybody could supply me with some sample coding for how to do this, I will be very grateful.

Kind regards,

Claus

former_member217546
Participant
0 Kudos

Hi Christensen,

Please check this method in event handler of OVS.i think it may help your requirement

  v_index = ovs_callback_object->context_element->get_index( ).

           case v_index.

               when 1.

                  -----

               * fill  lt_select_list

              when 2

               --------

              * fill   lt_select_list

                  -------

          endcase.

      ovs_callback_object->set_output_table( output = lt_select_list ).


0 Kudos

Hi Sudheer,

Brilliant, this actually works, thanks a lot for your help.

Kind regards,

Claus

former_member217546
Participant
0 Kudos

Have a nice Day..

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Claus,

Instead of going through all this trouble of OVS why dont you make cell vairants and assign different F4 helps to them based your conditions.

Try this if it solves your problem:

http://wiki.sdn.sap.com/wiki/display/WDABAP/WebDynpro+for+ABAP+Cell+Variants

-Manish

0 Kudos

Hi Manish,

I actually found it quite easy to implement the OVS, but of course if it is not working...

The problem with the cell variants is that as I understand it, you have to create a cell variant for each possible value help at design time, but I need to get the values from a table depending on other data on the line row, so I do not know until runtime how many different types of value helps I need, which as I see it makes it impossible to use this method.

Kind regards,

Claus