Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

no blank record in dropdown values

Former Member

Hi experts,

I have an issue in providing values in dropdown values. Is it possible to provide dropdown values without any blank record using VRM_SET_VALUES or by assigning a domain values through declaration?

Bcoz, when i populate values through VRM_SET_VALUES, i have to set the field as mandatory in order to avoid blank record. Even if i domain for that field, a blank record gets displayed in the dropdown. So i have to make the field as mandatory.

But when i check dropdown in some standard tcode, no blank record gets displayed. At the same time, it is not set as mandatory.

Could anyone tell me how my requirement can be achieved?

4 REPLIES 4

Former Member

Hi Shanthi,

Yes you can do that by initializing the default value for drop down list at the INITIALIZATION event after filling values to drop down list (by calling FM VRM_SET_VALUES)

Remember set parameter of drop down list as

AS LISTBOX VISIBLE LENGTH 15 OBLIGATORY

if you want it has a blank value and make it mandatory.

Best Regards,

Duy

Former Member
0 Kudos

hi friend,

try to pass initial value for list box.

example:


***
TYPE-POOLS : vrm.
DATA: combo_id TYPE vrm_id,
items TYPE vrm_values WITH HEADER LINE,
item TYPE LINE OF vrm_values.
***
selection-secreen begin of block b1.
PARAMETERS: pp1(20) AS LISTBOX VISIBLE LENGTH 30.
selection-screen end of block b1.
***
* for your example
loop at list.
item-key = list-pos.
item-text = list-value.
APPEND item TO items. CLEAR item.
endloop.
*
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'PP1'
values = items[]
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
***
initialization.
pp1 = <your default value>.

regards,

0 Kudos

Hi,

i want to show the dropdown values in the first column of table control. So, this dropdown values are NOT going to be a single parameter as u mentioned. So i cannot declare explicitely as "parameter". I have to assign dropdown values for the first column of table control.

Pls help me out.

0 Kudos

Hi Shanthi,

You can check it out the SAP demo program: RSDEMO_TABLE_CONTROL. It solves your problem.

Good Luck!

Duy