03-31-2008 12:30 PM
I have a program with a drop down list which shows the client number in it. I want to display details on the same screen for the client number selected from the drop down list.
AT SELECTION-SCREEN ON p_mandt works only by pressing ENTER. But I want to display the details whenever there is a change in the value p_mandt from the drop down list.
Here is the present code.
DATA: name TYPE vrm_id,
list TYPE vrm_values,
wa_list TYPE vrm_value,
c_mandt type t000-mandt.
DATA: it_usr02 type table of usr02 with header line.
parameters: p_mandt(3) AS LISTBOX VISIBLE LENGTH 10 obligatory.
AT SELECTION-SCREEN OUTPUT.
select MANDT
from t000
into c_mandt.
wa_list-key = c_mandt.
wa_list-text = c_mandt.
append wa_list to list.
endselect.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'P_MANDT'
VALUES = list
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.
ENDIF.
03-31-2008 12:35 PM
hi Gaurab,
pls. change your code:
parameters: p_mandt(3) AS LISTBOX VISIBLE LENGTH 10 obligatory USER-COMMAND uc01 .
hope this helps
ec
03-31-2008 12:35 PM
hi Gaurab,
pls. change your code:
parameters: p_mandt(3) AS LISTBOX VISIBLE LENGTH 10 obligatory USER-COMMAND uc01 .
hope this helps
ec
03-31-2008 12:44 PM
Hi Gaurab,
Use USER-COMMAND option to the PARAMETER statement.
When you select value from dropdown, the corresponding defined event is triggered no need to press ENTER.
Regards,
Venkat.O
parameters: p_mandt(3) AS LISTBOX VISIBLE LENGTH 10 obligatory USER-COMMAND UCOM.
03-31-2008 12:52 PM
Hi
Hope it will help you.
Reward if help.
REPORT zwa_test2.
TYPE-POOLS : vrm.
tables: bkpf.
DATA : values TYPE vrm_values.
DATA : wa LIKE LINE OF values.
PARAMETERS : list_box(10) TYPE c AS LISTBOX VISIBLE LENGTH 10.
PARAMETERS: dd type bkpf-BSTAT user-command abc.
select-options: a for bkpf-bukrs MODIF ID buk.
select-options: b for bkpf-belnr MODIF ID SEL.
at selection-screen output.
If list_box = 2.
loop at screen.
if screen-group1 = 'SEL'.
screen-input = 0.
modify screen.
endif.
endloop.
endif.
INITIALIZATION.
wa-key = '1'.
wa-text = 'Orange'.
APPEND wa TO values.
wa-key = '2'.
wa-text = 'Red'.
APPEND wa TO values.
wa-key = '3'.
wa-text = 'Blue'.
APPEND wa TO values.
wa-key = '4'.
wa-text = 'Gray'.
APPEND wa TO values.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'LIST_BOX'
values = values
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
Ref Program: DEMO_DROPDOWN_LIST_BOX