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 in selection screen

Former Member
0 Kudos

HI,

in the selection screen, one of the filed BUKRS should have a drop down on the selection screen to get one record.shouldn't there

be more records.

please let me know drop down means should be declared as PARAMETER or anything else.

thanks in advance

6 REPLIES 6

sreeramkumar_madisetty
Active Contributor
0 Kudos

Hi

type-pools: vrm.

data: it_val type vrm_values,

w_line like line of it_val.

parameters p_stat as listbox

visible length 1 obligatory.

initialization.

w_line-key = '1'.

w_line-text = 'A'.

append w_line to it_val.

w_line-key = '2'.

w_line-text = 'B'.

append w_line to it_val.

at selection-screen output.

call function 'VRM_SET_VALUES'

exporting

id = 'P_STAT'

values = it_val.

end-of-selection.

write: / p_stat.

Regards,

Sreeram

Former Member
0 Kudos

Hi,

Yes you have to use parameter to declare listbox.

Refer this link,

https://wiki.sdn.sap.com/wiki/display/Snippets/Drop-downListBoxintheSelectionScreenforWindowsNT,R3Release4.7

Regards,

Vijay

Former Member
0 Kudos

Give as Parameters;

PARAMETERS p_bukrs TYPE BUKRS AS LISTBOX VISIBLE LENGTH 4.

See F1 help for parameters for more details.

Regards

Karthik D

Former Member
0 Kudos

Hi,

first creat data element with domain.

In domain in value ranges tab in fixed value memention ur compani code.

and finaly declare

Clemenss
Active Contributor
0 Kudos

Hi sree,

[Please follow this link, thank you.|http://forums.sdn.sap.com/search.jspa?objID=f50&q=dropdowninselectionscreen]

Kind regards,

Clemens

venkat_o
Active Contributor
0 Kudos

Hi Sree, Try this way.


 REPORT ztest_notepad.
 "You need to use PARAMETERS to declare dropdown box like below.
 PARAMETERS  list AS LISTBOX VISIBLE LENGTH 20.
 "SELECTION-SCREEN PBO.

 AT SELECTION-SCREEN OUTPUT.
   TYPE-POOLS vrm.
   DATA: g_name  TYPE vrm_id,
         it_list TYPE vrm_values,
         wa_list LIKE LINE OF it_list.
   g_name = 'LIST'.

   wa_list-key  = '1'.
   wa_list-text = '1 is selected'.
   APPEND wa_list TO it_list.
   CLEAR wa_list.
   wa_list-key  = '2'.
   wa_list-text = '2 is selected'.
   APPEND wa_list TO it_list.
   CLEAR wa_list.
   wa_list-key  = '3'.
   wa_list-text = '3 is selected'.
   APPEND wa_list TO it_list.
   CLEAR wa_list.
   wa_list-key  = '4'.
   wa_list-text = '4 is selected'.
   APPEND wa_list TO it_list.
   CLEAR wa_list.
   "We can default value to the drop-down field list
   list = '1'.
   "VRM_SET_VALUES passes the values to the dropdown box
   CALL FUNCTION 'VRM_SET_VALUES'
     EXPORTING
       id              = g_name
       values          = it_list
     EXCEPTIONS
       id_illegal_name = 1
       OTHERS          = 2.
Thanks Venkat.O