cancel
Showing results for 
Search instead for 
Did you mean: 

How to put a drop down list options in a field?

Former Member
0 Kudos

Hi Gurus,

I want to put a drop down list options say A, B, and C in a field in accounting tab at header level in contract. That means, user will get a drop down list in that field with these 3 options only. Is it possible in the system?

How do I get it?

Please guide.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

Try this sample code, it will solve your problem

see the below programs to fill the field with a valid listbox value, for example, in this program, I am building the listbox in the program and just assign P_FIELD a valid value from internal table'ivrm_values' . Create screen 100 and create a field call P_FIELD, make sure to select "ListBox" from the DropDown Field.

report ztest_0001.

type-pools: vrm.

data: p_field(20) type c.

data: ivrm_values type vrm_values.

data: xvrm_values like line of ivrm_values.

data: name type vrm_id.

start-of-selection.

Set default value, before calling the screen

p_field = 'DEF'.

call screen 100.

&----


*& Module STATUS_0100 OUTPUT

&----


text

-


module status_0100 output.

SET PF-STATUS 'xxxxxxxx'.

SET TITLEBAR 'xxx'.

name = 'P_FIELD'.

xvrm_values-key = 'ABC'.

xvrm_values-text = 'ABC'.

append xvrm_values to ivrm_values.

xvrm_values-key = 'DEF'.

xvrm_values-text = 'DEF'.

append xvrm_values to ivrm_values.

xvrm_values-key = 'GHI'.

xvrm_values-text = 'GHI'.

append xvrm_values to ivrm_values.

call function 'VRM_SET_VALUES'

exporting

id = name

values = ivrm_values.

endmodule. " STATUS_0100 OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


text

-


module user_command_0100 input.

endmodule. " USER_COMMAND_0100 INPUT

regards,

Siddharth