Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Drop Down List with screen modifications

gaurab_banerji
Active Participant
0 Likes
846

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.

1 ACCEPTED SOLUTION
Read only

JozsefSzikszai
Active Contributor
0 Likes
737

hi Gaurab,

pls. change your code:

parameters: p_mandt(3) AS LISTBOX VISIBLE LENGTH 10 obligatory USER-COMMAND uc01 .

hope this helps

ec

3 REPLIES 3
Read only

JozsefSzikszai
Active Contributor
0 Likes
738

hi Gaurab,

pls. change your code:

parameters: p_mandt(3) AS LISTBOX VISIBLE LENGTH 10 obligatory USER-COMMAND uc01 .

hope this helps

ec

Read only

venkat_o
Active Contributor
0 Likes
737

Hi Gaurab, Use USER-COMMAND option to the PARAMETER statement.

parameters: p_mandt(3) AS LISTBOX VISIBLE LENGTH 10 obligatory USER-COMMAND UCOM.
When you select value from dropdown, the corresponding defined event is triggered no need to press ENTER. Regards, Venkat.O

Read only

Former Member
0 Likes
737

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

Link: