‎2006 Oct 31 8:56 PM
Hi,
How to do list box with <b>default</b> value in <u>module pool screen</u>.
Thanks
aRs
‎2006 Oct 31 9:03 PM
It should be as easy as filling 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 it. Create screen 100 and create a field call P_FIELD, make sure to select "ListBox" from the DropDown Field.
report zrich_0001.
type-pools: vrm.
<b>data: p_field(20) type c.</b>
data: ivrm_values type vrm_values.
data: xvrm_values like line of ivrm_values.
data: name type vrm_id.
start-of-selection.
<b>* Set default value, before calling the screen
p_field = 'DEF'.</b>
call screen 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module status_0100 output.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
<b> 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.</b>
endmodule. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module user_command_0100 input.
endmodule. " USER_COMMAND_0100 INPUT
Regards,
Rich Heilman
‎2006 Oct 31 9:04 PM
Hi,
Please check this demo program.
DEMO_DROPDOWN_LIST_BOX
DEMO_DYNPRO_DROPDOWN_LISTBOX
Regards,
Ferry Lianto