cancel
Showing results for 
Search instead for 
Did you mean: 

Enhancing F4 Search Help Issue - Standard Component

Former Member
0 Kudos

Hello All,

We have a requirement in SRM to customize couple of standard Search helps attached to the Webdynpro components. As such I know the concept of how we can handle this requirement but hitting an issue.

Standard Working scenario -

1) Standard Structure available with multiple fields. Two fields that are of our interest are SH_VALUE and SH_VALUE_LABEL.

2) Standard Search help for this being used has fields VALUE and VALUE_LABEL.

3) In the Structure the both the fields SH_VALUE and SH_VALUE_LABEL are mapped to the Search help VALUE and VALUE_LABEL.

4) In the WD component the node is mapped to the standard structure.

Running the application and the picking up the values from F4 on the SH_VALUE field will return its corresponding value and also map the SH_VALUE_LABEL field with the Label from the F4 since the structure and Search help mapping are there.

So far good when its standard.

Issue I am facing -

We need to modify this standard search help to customize our needs.

1) Did a Copy of the standard Search help and then modified to suit our needs. The output structure of the search is still the same as the standard one.

2) Did a Post Exit in the WD component to call our custom search help through the below code -


data lo_nd_attrib type ref to if_wd_context_node.

data lo_nd_attrib_info type ref to if_wd_context_node_info.

lo_nd_attrib = wd_context->path_get_node( path = `ATTRIBUTES_DATA.ATTR_DTLS_MULT` ).

lo_nd_attrib_info = lo_nd_attrib->get_node_info( ).

lo_nd_attrib_info->set_attribute_value_help( name = 'SH_VALUE' value_help_mode = '121' value_help = 'Z_ORG_ATTR' ).

lo_nd_attrib_info->set_attribute_value_help( name = 'SH_VALUE_LABEL' value_help_mode = '121' value_help = 'Z_ORG_ATTR' ).

Running the application just returns the SH_VALUE field but does not get the data for the SH_VALUE_LABEL.

Is there something wrong in the way I am calling the Custom Search help or should I need to approach this differently?

Thanks,

Nagarajan.

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Nagarajan,

Well, you are trying to set the search help to both attributes ( sh_value, sh_value_label) individually and it is having no link between these two attributes

i.e. once you select a value from search help of SH_VALUE, its no where linked that the other details to be passed to SH_VALUE_LABEL.

We generally, do the linking of attributes to search help parameters at structure level as below

So, if you need the same behaviour, then you need to assign the Zsearch help at strucuture field SH_VALUE and link the parameters to both fields SH_VALUE & SH_VALUE_LABEL

In case, if find it not possible to to this way,


You need to populate the value of field SH_VALUE_LABEL upon selection of value from search help of SH_VALUE.

i.e. by registering the search help selection event to an OnEnter action and write the logic to populate the value to SH_VALUE_LABEL

Please refer the below link

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Thanks Rama for the reply.

Gotcha!!! I was thinking the same but thought if other line would help by some means to get the SH_VALUE_LABEL.

1) Can we enhance the standard ABAP structure provided by SAP to change our Z Search Help and map the parameters?

2) We are still not on 7.4. Does the onEnter event work on lower versions too?

Thanks,

Nagarajan.

ramakrishnappa
Active Contributor
0 Kudos

Hi Nagarajan,


1) Can we enhance the standard ABAP structure provided by SAP to change our Z Search Help and map the parameters?

Yes,

we can do it by

  • Using Access key : To change the standard structure directly
  • Appending a custom structure ( Lengthy approach )
    • Apped a structure with fields SH_VALUE1 & SH_VALUE_LABEL1
    • Map the Zsearch help parameters to newly created structure fields
    • Update the context node and add two new attributes into context node
    • Remove the old ui elements ( by using Remove Elemetn option )
    • Create new ui elements and bind the properties to newly added attributes

2) We are still not on 7.4. Does the onEnter event work on lower versions too?

The method REGISTER_ON_ENTER_FOR_F4( ) is available from NW 7.31

Instead of the above, you can directly change the standard search help by using access key but make sure that the modified functionality will be fine, even if its used in other places as well

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

The first option is ruled out as we do not get access keys to modify the standard provided by SAP and 2nd one our SRM systems are still on 702 SP11. Looks like a road block for any direct ways of approaching the solution.

Alternates -

1) Getting the SH_VALUE in the WDDOMODIFYVIEW...Then with that value I can query the table to get the SH_VALUE_LABEL and bind the corresponding table element. Catch here...the table is not lead selected so I need to get the context_element index by some means in the WDDOMODIFYVIEW and this method does not have the WDEVENT. Can I still get the value here because If I read the value the element of the node is always null.

2) Build a custom F4 or an OVS and attach to these fields...Still getting the element index without lead selection is a catch here I guess??

Which one of the above would be best? Thoughts please???

If we cannot get the context element index in domodifyview without lead selection then in that case - I will have to make the table read only and then explicitly allow the users lead select a row and then on that event I will have write a post exit to dynamically open that row for value inputs !!!

Thanks,

Nagarajan.

ramakrishnappa
Active Contributor
0 Kudos

Hi Nagarajan,

I suggest you to go ahead with option 2: using OVS, there you get the context_element reference in ovs_callback_object, so you can populate the other fields like SH_VALUE_LABEL .

Please refer the below link for more info

If you would like to go ahead with Option1:

On selection of search help record, you would not get the control in WDDOMODIFYVIEW( ) method. An external action to be triggered like press ENTER key

  • Get the elements of whole node into LT_ELEMENTS using method get_elements( )
  • Check if element is dirty, ( value changed ) , and process only these elements and get the label text

Regards,

Rama

Answers (0)