Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Drop down in selection-screen

hi,

suppose in the selection screen i have Customer No. and i want the result for only 4 customers like 1000, 1002, 1009, 1020. can anyone help me how to select only those in the selection screen.

thanks,

swamy

Tags:
Former Member
Former Member replied

hi,

Check this example

check this code..

copy paste it and see...

REPORT  ZTEST_CODE_VRM.

TYPE-POOLS: VRM.

TYPES: NAME TYPE VRM_VALUE-TEXT.
DATA: V_VBELN LIKE VBAK-VBELN.
DATA: IT_VALUES TYPE STANDARD TABLE OF VRM_VALUE.
DATA: WA TYPE VRM_VALUE.
TABLES: KNA1.

SELECT-OPTIONS: S_VBELN FOR V_VBELN.
PARAMETERS: P_KUNNR AS CHECKBOX USER-COMMAND ABC.
PARAMETERS: P_CHK1 AS CHECKBOX USER-COMMAND ABC.
PARAMETERS: P_KUNNR1 TYPE NAME AS LISTBOX VISIBLE LENGTH 30.

INITIALIZATION.
  S_VBELN-LOW = '123'.
  APPEND S_VBELN.

  WA-KEY = '1'.
  WA-TEXT = 'One'.
  APPEND WA TO IT_VALUES.
  CLEAR WA.

  WA-KEY = '2'.
  WA-TEXT = 'Two'.
  APPEND WA TO IT_VALUES.
  CLEAR WA.
  READ TABLE IT_VALUES INTO WA INDEX 1.
  P_KUNNR1 = WA-KEY.
  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      ID              = 'P_KUNNR1'
      VALUES          = IT_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.
  ENDIF.



AT SELECTION-SCREEN.
  CLEAR S_VBELN.
  REFRESH S_VBELN.
  S_VBELN-LOW = '456'.
  APPEND S_VBELN.


AT SELECTION-SCREEN ON P_KUNNR.
* This event should fire only only for parameters not for select options
  P_KUNNR = 'X'.

*
AT SELECTION-SCREEN OUTPUT.

  IF P_KUNNR = 'X'.
    P_KUNNR = ' '.
  ENDIF.
  IF P_CHK1 = ' '.
    P_CHK1 = 'X'.
  ELSE.
    P_CHK1 = ' '.
  ENDIF.

regards

vijay

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question