cancel
Showing results for 
Search instead for 
Did you mean: 

Search Help displaying description but returning ID

Former Member
0 Kudos

Hi All,

I have a textbox in web dynpro showing description (from table "Description" ) in a textbox after user selected some value from its search help.

The issue is, instead of description shown (which is correct), I want to process the value selected using its ID (from table "ID").

Both tables have child-parent relation.

Unfortunately, both "ID" and "Description" are not key. The keys for both table are GUID (another field).

Any suggested solution ?

TIA,

Tony

Accepted Solutions (0)

Answers (3)

Answers (3)

S-H
Active Participant
0 Kudos

Hi,

You can achieve this functionality using OVS. When user clicks on F4 on the input field we can display all the values to the user. When the user select one of the values then in the OVS method phase 3 we are setting the selected value to the context node at this point we can also find the ID of the description. Either we can add this data to another context element or store it in a component controllers attribute and process further.

Best regards,

Suresh

Surferpeck
Employee
Employee
0 Kudos

Hi Tony,

Search helps used in WDA aren't actually that well supported. What I mean is they are really developed for dialog programs, and not specifically coded for WDA. Having said that, take a look at *_WD search helps and you will see SAP is developing Search Helps for specific use by WDA applications. Further support that the original developed ones don't behave the same in the backend and via a Web Dynpro.

<b>For your issue</b>, depending on the Search help you are using, you want to ensure the ID field is defined as an EXPORT value and is actually exported back to the WDA. It is also beneficial to specifiy the ID field as the first parameter in the Hit List (LPos). You may even need to copy the SAP supplied one and make the changes you require to get it working in your application.

Regards,

Chris

Former Member
0 Kudos

Hi Tony,

In your search help try using index.

You can use the index number to select the value.

I have some sample code, you can use this as per your requirement.

METHOD add_data .

DATA : lt_urls TYPE if_main_view=>elements_drp_text.

DATA : lr_element TYPE REF TO if_wd_context_node.

DATA : url LIKE LINE OF lt_urls.

  • Supply data for the node at runtime

REFRESH lt_urls[].

DO 5 TIMES.

url-key = sy-index + 1 .

CONDENSE url-key.

CONCATENATE `www.` url-key `.com` INTO url-url.

INSERT url INTO TABLE lt_urls.

ENDDO.

lr_element = wd_context->get_child_node( 'DRP_TEXT' ).

lr_element->bind_table( lt_urls ).

ENDMETHOD.

Hope this will help you.

Cheers,

Darshna.

Former Member
0 Kudos

Hi,

Thanks for the effort for helping me.

I don't understand your suggestion using index on search help ?

How may I do that ?

Anyway, what I want to achieve is:

My search help returns two values, one is description and the other is ID, both from different tables, linked by GUID. So both are not key field.

One value (Description) is shown to the user. One value (ID) is going to be processed in the coding.

How may I achive this ? Any other way beside Search Help and Conversion Exit ?

TIA,

Tony Yuwono