Skip to Content
0
Former Member
Aug 08, 2011 at 09:14 AM

Dropdownlist depending on parament value

20 Views

Hi gurus,

I'm having parameter plant using that i'm getting data into a dropdown.When i'm giving value in plant after pressing 'Enter' button only data is coming in dropdownlist.If the user changes the value of plant and don't press "Enter' pervious values are there in dropdown.I want to get value in dropdown as soon as the user gives value for plant without press 'Enter' button.

can i use Usercommand.How?

This is my code :

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-023.

PARAMETERS : P_PLANT TYPE WERKS_D DEFAULT 'TKDS'.

SELECT-OPTIONS : S_DATE FOR SY-DATUM.

*ZHRSPLDUTY-FROM_DATE.

PARAMETERS: P_BTRTL(4) AS LISTBOX VISIBLE LENGTH 10.

  • USER-COMMAND ABC.

PARAMETERS: P_SELID(2) AS LISTBOX VISIBLE LENGTH 10.

  • USER-COMMAND ABC.

SELECTION-SCREEN END OF BLOCK B1.

***ListBox

AT SELECTION-SCREEN OUTPUT.

CHECK P_PLANT IS NOT INITIAL.

CLEAR LIST.

SELECT BTRTL AS KEY

BTEXT AS TEXT

INTO TABLE LIST

FROM T001P

WHERE WERKS = P_PLANT.

IF SY-SUBRC = 0.

NAME = 'P_BTRTL'.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = NAME

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.

ENDIF.

Edited by: miriamjs on Aug 8, 2011 11:20 AM