‎2006 Mar 22 9:51 AM
hi frnd's sry.
whether the user can enter a value to a dropdown box at run time.
I had done by selecting from a dropdownbox with available datas.
‎2006 Mar 22 10:04 AM
HiSuganya,
You can only select a value from a drop-down box.
(The values are pre-populated, only selection allowed)
Regards,
Raj
‎2006 Mar 22 10:04 AM
HiSuganya,
You can only select a value from a drop-down box.
(The values are pre-populated, only selection allowed)
Regards,
Raj
‎2006 Mar 22 10:13 AM
HI suganya
you can create a listbox using VRM_SET_VALUES.
try this code
TYPE-POOLS: VRM.
TABLES SPFLI.
TABLES SSCRFIELDS.
DATA flag.
DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST.
PARAMETERS PS_PARM LIKE SPFLI-CARRID AS LISTBOX VISIBLE LENGTH 10
USER-COMMAND
fcodex.
data: i_spfli type spfli occurs 0 with header line.
PARAMETERS PQ_PARAM LIKE SPFLI-connid AS LISTBOX VISIBLE LENGTH 15
USER-COMMAND
fcodey.
*DS AS CHECKBOX USER-COMMAND FLAG.
INITIALIZATION.
NAME = 'PS_PARM'.
DATA T TYPE I VALUE 0.
SELECT DISTINCT carrid into corresponding fields of table i_spfli FROM
SPFLI.
loop at i_spfli.
VALUE-KEY = i_spfli-CARRID.
VALUE-TEXT = i_spfli-CARRID.
APPEND VALUE TO LIST.
endloop.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = NAME
VALUES = LIST.
AT SELECTION-SCREEN.
if sy-ucomm eq 'FCODEX'.
REFRESH LIST.
CLEAR LIST.
PQ_PARAM = ' '.
NAME = 'PQ_PARAM'.
SELECT * FROM SPFLI WHERE CARRID = PS_PARM.
VALUE-KEY = SPFLI-connid.
VALUE-TEXT = SPFLI-connid.
APPEND VALUE TO LIST.
ENDSELECT.
endif.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SY-UCOMM NE 'FCODEX' OR SY-UCOMM NE 'FCODEY'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = NAME
VALUES = LIST.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
START-OF-SELECTION.
clear i_spfli.
refresh i_spfli.
select * into table i_spfli from spfli where carrid = ps_parm and connid
= pq_param.
loop at i_spfli.
WRITE: / 'CITY FROM:', I_SPFLI-CITYFROM, 'CITY TO :',I_SPFLI-CITYTO,
'DEPARTURE TIME :', I_SPFLI-DEPTIME.
ENDLOOP.
regards
kishore
‎2006 Mar 22 10:30 AM
Hi Suganya,
If you want to enter values in to a dropdown box, then you have to use a combobox.
Here is how you can design a combobox in a screen .
Create a custom control in screen 100. Also in this program, there is a button whose function code is 'EXIT'.
REPORT ZSHAIL_BASIC_POPUP .
TO DISPLAY COMBOBOX**************
tables usr03.
data : itabitems like listitem occurs 0 with header line,
dname like usr03-bname,
indx type i,
itemname(256) type c,
first(4) type c value 'true'.
TYPES: BEGIN OF CNTL_FONT,
INIT(1) TYPE C,
F_TYPE TYPE I,
BOLD TYPE I,
ITALIC TYPE I,
SIZE TYPE I,
END OF CNTL_FONT.
TYPES: BEGIN OF CNTL_HANDLE,
OBJ LIKE OBJ_RECORD,
SHELLID TYPE I,
PARENTID TYPE I,
C_TYPE(4) TYPE C,"CNTL_TYPE,
CLSID LIKE CNTLSTRLIS-NAME,
ORIGIN LIKE SY-REPID,
HANDLE_TYPE(10) TYPE C,
LIFETIME TYPE I,
PROGRAM LIKE SY-REPID,
DYNNR LIKE SY-DYNNR,
IMODE TYPE I,
DYNPRO_POS TYPE I,
GUID TYPE I,
END OF CNTL_HANDLE.
data : CNTL_FONT_DEFAULTS TYPE CNTL_FONT.
data : CNTL_HANDLE_TEST TYPE CNTL_HANDLE.
cntl_font_defaults-f_type = 0.
cntl_font_defaults-bold = 1.
cntl_font_defaults-italic = 0.
cntl_font_defaults-size = 0.
cntl_font_defaults-init = ''.
select bname from usr03 into itabitems-item.
append itabitems.
endselect.
call screen 100.
&----
*& Module combopbo_output OUTPUT
&----
text
----
module combopbo_output output.
if first = 'true'.
first = 'false'.
CALL FUNCTION 'OCX_COMBOBOX'
EXPORTING
SHELLSTYLE =
LEFT = 100
TOP = 20
WIDTH = 280
HEIGHT = 16
FONT = CNTL_FONT_DEFAULTS
VISIBLE = 'X'
PARENTID =
DISP_SCREEN = '100'
CURR_REPORT =
FORMNAME =
DYNNR =
IMPORTING
COMBOBOX_HANDLE = cntl_handle_test
TABLES
list_items = itabitems
EXCEPTIONS
LINK_ERROR = 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.
ENDIF.
endif.
endmodule. " combopbo_output OUTPUT
&----
*& Module comboclick_input INPUT
&----
text
----
module comboclick_input input.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN OTHERS.
CALL FUNCTION 'COMBOBOX_GET_SELECTION'
EXPORTING
handle = cntl_handle_test
IMPORTING
INDEX = indx
ITEM = itemname
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
message ID SY-MSGID TYPE 'I' NUMBER 1
with itemname.
ENDCASE.
endmodule. " comboclick_input INPUT
I think this code will satisfy your requirement.
Regards,
Sylendra.
‎2006 Mar 22 11:09 AM
Hi Suganya,
Please don't open the same thread again , request you to please close that.
Please check the sample code :
**whether the user can enter a value to a dropdown box at run time.
I think based on some dynamic conition , you can get the data in the Dropbox using Function Module
<b>VRM_SET_VALUES</b>
Find the code sample: Check (DEMO_DYNPRO_DROPDOWN_LISTBOX)
Say we had a list box with the values entered in it using FM.
In PBO.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = name
values = list.
After selecting any value from the above listbox we can dynamically call another list box with the value based on the above criteria.
that we need to trap on the PAI on User_command_100
where we will call another screen in which we can have the values based on the previous selection.
Do check this DEMO_DYNPRO_DROPDOWN_LISTBOX for full code sample.
If you are satisfied , please close the thread by rewarding appropriate points to the helpful answers.
Cheers
Sunny
Cheers
Sunny
Rewrd points, if found helpful