cancel
Showing results for 
Search instead for 
Did you mean: 

dropdownListBox helpValues from model: sort & defaults

Former Member
0 Kudos

I want to get as much as possible of the basic functionality of my BSP application without programming. I prefer a declarative way of programming, where you use the data dictionary as much as possible. The Model-View-Controller paradigm is a step in that direction. However, the htmlb:dropdownListBox has two big problems in here: sorting the list by code (not by name) and ignoring default values in Search Helps.

For example, if you want a list box of Employee Groups:


<htmlb:dropdownListBox id = "persg"
  selection = "//model/pa0001.persg"
  helpValues = "//model/enh_ddic.persg" />

This code fragment is from a "view", which has page attribute model, which points to the model class. The model class has an attribute pa0001 of type pa0001.

In my first version I used "//model/pa0001.persg" as the value of the helpValues attribute as well, but that did not work at all. To use helpValues, you <b>must</b> define a search help at the <b>data element</b> level, or you must have a domain with list of values. So I created a new data element ZPERSG and attached search help H_T501T to it. Then I created a new structure with a dummy field PERSG of type ZPERSG, and the I added a new attribute ENH_DDIC of the structure I just created to my model class. Then I modified my helpValues attribute to point to the new dummy field with my fancy new data element. But it still didn't work!

Then I copied search help H_T501T to ZH_T501T and re-arranged the fields and Import/Export attributes so that PERSG and PTEXT were in the beginning of the parameter list. Then the drop down list listed ALL Employee Groups in EVERY language!

To list the values only in the correct language, I added Default value of SY-LANGU to my search help. When I test my search help in SAP GUI SE11, it works fine, listing Employee Groups only in the logon language. But in my BSP application, all Employee Groups in every language are still shown! I'm afraid this is a bug in SAP.

And I would like to sort the drop down list alphabetically. Now the list seems to be sorted by the code, not by the name.

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I think that perhaps you are expecting too much from the simple value domain binding functionality of the dropDownListBox. This was really designed to automically supply value based upon a fixed domain value list not a more complex search help.

You might want to have a look at re-creating something closer to the full search help:

/people/thomas.jung3/blog/2004/11/01/bsp-value-input-help-popups-version-20-part-1

and /people/thomas.jung3/blog/2005/08/22/bsp-value-input-help-popups-version-30

With the 3rd release of this example you get automatic local help functionality based upon data binding data type. There is actually a 4th release of this value help that I wrote for the Advanced BSP Programming Book that has much better dialog windows based upon Web Dynpro ABAP. It comes on the CD with the book (also as a transport file for easy import into your systems).