04-23-2010 11:12 AM
Hi guys,
I am having a drop down list of 5 values in my selection screen.
I am able to show the list of values in the droplist of the selection screen.
How should I set default value in the list.
Regards
mac
04-23-2010 11:18 AM
Hi Mac,
Did you give a try to set the default value when you are declaring the selection screen parameter or selection option ? i think that should be defaulted in the input box along with the dropdown available.
Regards,
Lohith
04-23-2010 11:20 AM
REPORT ztest1234.
type-POOLs : vrm.
PARAMETERS : dr1 as LISTBOX VISIBLE LENGTH 20,
dr2 as LISTBOX VISIBLE LENGTH 20.
DATA : lv_values TYPE vrm_values,
lv_values1 TYPE vrm_values,
gw_values like LINE OF lv_values.
AT SELECTION-SCREEN OUTPUT.
gw_values-key = '1'.
gw_values-text = 'One'.
append gw_values to lv_values.
gw_values-key = '2'.
gw_values-text = 'Two'.
append gw_values to lv_values.
gw_values-key = '3'.
gw_values-text = 'Three'.
append gw_values to lv_values.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'dr1'
VALUES = lv_values
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2
.
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
else.
dr1 = '1'. ( Just give ur id number which u wants to be default)
ENDIF.
With Regards,
Sumodh.P
Edited by: Sumodh P on Apr 23, 2010 12:25 PM
Edited by: Sumodh P on Apr 23, 2010 12:26 PM
Edited by: Sumodh P on Apr 23, 2010 12:30 PM
04-23-2010 12:37 PM
Hello Boss,
Along with the default, I want the other values to appear in the list. But for example I want 3rd value to be default.
Tellme if that is possible or not.
Regards
Mac
04-23-2010 12:41 PM
Did you try DEFAULT'ing the value of the parameter:
PARAMETER: MY_PARAM TYPE STRING AS LISTBOX DEFAULT 'Third Value'.
I suppose this should work for listbox as well.
04-23-2010 12:49 PM
Hi Mohan,
After filling internal table, you can insert the constant value or default value on 3rd position.
Regards,
Narendra
04-23-2010 1:04 PM
Hi Narendra,
How can you set default value on 3 record of an internal table.
Do you have any code for that.
Regards
mac
04-23-2010 1:07 PM
Hi MOhan,
I think the ques has been marked answered.
Yoou can use INSERT Statement
Regards,
Narendra
04-23-2010 12:12 PM
Hi Mohan,
You can refer given below code.
type-pools: vrm.
parameters : p_logsys type LOGSYS AS LISTBOX VISIBLE LENGTH 15 OBLIGATORY.
at selection-screen on VALUE-REQUEST FOR p_logsys.
DATA: name4 TYPE VRM_ID,
list4 TYPE VRM_VALUES,
list_wa3 like line of list4.
refresh list4.
list_wa3-key = 'BWDEV020'.
list_wa3-text = 'Development'.
append list_wa3 to list4.
clear list_wa3.
list_wa3-key = 'MPBCLNT100'.
list_wa3-text = 'Production'.
append list_wa3 to list4.
clear list_wa3.
name4 = 'P_LOGSYS'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = name4
VALUES = list4.
I hope it will help you.
Regards,
Narendra