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: 

drop-down list

Former Member
0 Kudos

hello gurus,

i hav to make drop-down list without using FM VRM_SET_VALUES

.So suggest me the approach and send me the appropiate code for that.

thanks and regard.

Ruchi.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You can do one thing.

In your SE11 you can create a data domain ZDOM and enter the possible values you want in that domain.

After Creatng the domain you can create a data elemet ZELEM using that domain.

Now you can declare your variable like this.

PARAMETER: p_list TYPE ZELEM AS LISTBOX VISIBLE LENGTH N.

In this case you dont need to use FM at all.

Hope it helps.. Please revert if any doubts.

Regards,

Pramod

5 REPLIES 5

former_member212653
Active Contributor
0 Kudos

Is it a screen or a selection screen?

you already asked this question....why are you reposting?

Former Member
0 Kudos

Hi,

You can do one thing.

In your SE11 you can create a data domain ZDOM and enter the possible values you want in that domain.

After Creatng the domain you can create a data elemet ZELEM using that domain.

Now you can declare your variable like this.

PARAMETER: p_list TYPE ZELEM AS LISTBOX VISIBLE LENGTH N.

In this case you dont need to use FM at all.

Hope it helps.. Please revert if any doubts.

Regards,

Pramod

0 Kudos

hi Pramod,

first i hav to create the list like

male

female

others

and then this list is attached to the i/o field in selection screen.

0 Kudos

Hi,

First thing you need to do is go to SE11.

Create a domain ZDOM :

In the domain screen you have a tab where you can maintain single values, value ranges and value tables.

There in the single value fields enter Male, Female, Others

Save and activate this domain.

Again go to SE11. Select data type give a name ZELEM

press create. From that select the option 'Data element'

Once inside give the domain name as ZDOM save and activate it. Once all these are done go to your program and declare your variable like this.

PARAMETER: p_var TYPE ZELEM AS LISTBOX VISIBLE LENGTH 10.

Then you will automatically get a dropdown.

Hope this was of some help.

Regards,

Pramod

Former Member
0 Kudos

Hi,

This code may help u...


PARAMETERS      : P_SOBKZ TYPE sobkz AS LISTBOX VISIBLE LENGTH 11 OBLIGATORY.

AT SELECTION-SCREEN OUTPUT.
  IF values[] IS INITIAL.
    param = 'P_SOBKZ'.

    SELECT sobkz
           sotxt
           INTO (value-key, value-text)
           FROM t148t
           WHERE spras = 'EN'.
      APPEND value TO values.
    ENDSELECT.

    CALL FUNCTION 'VRM_SET_VALUES'                          "#EC *
      EXPORTING
        id              = param
        values          = values
      EXCEPTIONS
        id_illegal_name = 1
        OTHERS          = 2.
  ENDIF.