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

Former Member
0 Likes
392

Hi,

Is there any way so that in drop-down list I can enter the values manually and even i need drop-down list along with that??

Thanks & Regards

Santhosh

2 REPLIES 2
Read only

Former Member
0 Likes
366

Even I was serching for this but unfortunatly it is not possible Either you can enter value using parameters or you can have a list box.

Regards

Bikas

Read only

p291102
Active Contributor
0 Likes
366

Hi,

Go through the below sample report for that one.

REPORT  YMS_DROPDOWNLISTBOX.
      TYPE-POOLS : VRM.
TABLES : AFKO,AFPO,SSCRFIELDS.

DATA : BEGIN OF IAFKO OCCURS 0,
       AUFNR LIKE AFKO-AUFNR,
       END OF IAFKO.

DATA : BEGIN OF IAFPO OCCURS 0,
       MATNR LIKE AFPO-MATNR,
       END OF IAFPO.
DATA : ITAB TYPE VRM_VALUE.

DATA : VID TYPE VRM_ID.

DATA : ITAB1 TYPE VRM_VALUES,
       ITAB2 TYPE VRM_VALUES.


DATA : FLAG.

PARAMETERS : P_AUFNR LIKE AFKO-AUFNR AS LISTBOX VISIBLE LENGTH 15.

INITIALIZATION.
  SELECT AUFNR FROM AFKO UP TO 10 ROWS INTO TABLE IAFKO WHERE AUFNR LIKE
  '%704%'.
  LOOP AT IAFKO.
    ITAB-KEY = IAFKO-AUFNR.
    ITAB-TEXT = IAFKO-AUFNR.
    APPEND ITAB TO ITAB1.
  ENDLOOP.

AT SELECTION-SCREEN OUTPUT.

  VID = 'P_AUFNR'.
  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      ID              = VID
      VALUES          = ITAB1
    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.

Thanks,

Sankar M