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

How to put drop down list

Former Member
0 Likes
1,530

Hi All,

I have added Z_field in Va01 Transaction. I want to put drop down list for that .

Can you please suggest me how to do that.

Regards

Radha

1 ACCEPTED SOLUTION
Read only

GauthamV
Active Contributor
0 Likes
1,445

hi,

use this function module in the search help.

VRM_SET_VALUES.

also check this.

[https://forums.sdn.sap.com/click.jspa?searchID=19627466&messageID=2805219]

Hi All,

I have added Z_field in Va01 Transaction. I want to put drop down list for that .

Can you please suggest me how to do that.

Regards

Radha

7 REPLIES 7
Read only

Former Member
0 Likes
1,445

Hi,

Go to the screen painter and select DROPDOWN box in the input/output attributes

Regards

Ramchander Rao.K

Read only

Former Member
0 Likes
1,445

Hi ,

Create The UI element DropDown by Index. In the Properties of the drop down Event OnSelect is available .You can create a new action for the first drop down selection.

refer :

https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/91c5e990-0201-0010-4981-9b2075751da5

https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/documents/a1-8-4/tutorial%20on%20internationalizat...

this would be help ful

Read only

GauthamV
Active Contributor
0 Likes
1,446

hi,

use this function module in the search help.

VRM_SET_VALUES.

also check this.

[https://forums.sdn.sap.com/click.jspa?searchID=19627466&messageID=2805219]

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,445

Hi Radha Konjeti,

To have a dropdownlist/listbox in your report, use this demo code for creating a listbox with a set of values in it and select a single value for processing:-


REPORT  Y_MOVIE MESSAGE-ID ZMSG.

TABLES : Y_MOVIES.

TYPE-POOLS: VRM.

TYPES : BEGIN OF MOVIE,
        YR LIKE Y_MOVIES-YR,
        CATEGORY LIKE Y_MOVIES-CATEGORY,
        WINNER LIKE Y_MOVIES-WINNER,
        NOTES LIKE Y_MOVIES-NOTES,
        END OF MOVIE.

DATA: NAME TYPE VRM_ID,
      LIST TYPE VRM_VALUES,
      VALUE LIKE LINE OF LIST,
      MOVIETAB TYPE STANDARD TABLE OF MOVIE INITIAL SIZE 10 WITH HEADER LINE.

PARAMETERS: CATEGORY(10) AS LISTBOX VISIBLE LENGTH 10.

AT SELECTION-SCREEN.
  IF CATEGORY EQ ''.
    MESSAGE E006.
  ENDIF.

AT SELECTION-SCREEN OUTPUT.

  NAME = 'CATEGORY'.

  VALUE-KEY = 'PIC'.
  VALUE-TEXT = 'PIC'.
  APPEND VALUE TO LIST.

  VALUE-KEY = 'MAL'.
  VALUE-TEXT = 'MAL'.
  APPEND VALUE TO LIST.

  VALUE-KEY = 'FEM'.
  VALUE-TEXT = 'FEM'.
  APPEND VALUE TO LIST.

  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      ID     = NAME
      VALUES = LIST.

START-OF-SELECTION.

  WRITE : / 'Category Selected :', CATEGORY.

  ULINE.

  SELECT 
  YR
  CATEGORY
  WINNER
  NOTES
  FROM Y_MOVIES INTO TABLE MOVIETAB
  WHERE CATEGORY = CATEGORY.

END-OF-SELECTION.

  WRITE : /1 'Year', 6 'Category', 16 'Winner', 50 'Notes'.
  ULINE.

  LOOP AT MOVIETAB.

    WRITE : /1 MOVIETAB-YR, 8 MOVIETAB-CATEGORY, 16 MOVIETAB-WINNER, 50 MOVIETAB-NOTES.
    ULINE.

  ENDLOOP.

  IF SY-SUBRC <> 0.
    MESSAGE I005.
  ENDIF.

Hope this solves your problem.

Thanks & Regards.

Tarun Gambhir.

Read only

Former Member
0 Likes
1,445

Hi ,

Thanks for your reply.

What ever code you have give n for the norma lreport code

i have to put drop down list box that is in VA01 custom filed

both are same or not.

Thanks,

Read only

Former Member
0 Likes
1,445

use fm

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'rp50m-ccntr'

values = items

EXCEPTIONS

id_illegal_name = 1.

Read only

Former Member
0 Likes
1,445

Hi,

Goto Screen Painter. select the textbox and double click it. select "Listbox" from property and activate it.

Now comback to Screen Editor and put this sample code:

PROCESS ON VALUE-REQUEST.

FIELD <Table Name-Field name> MODULE CREATE_DROPDOWN_BOX.

double click on CREATE_DROPDOWN_BOX to create subroutine.

in that subroutine you put the following code.

DATA : BEGIN OF ITAB1 OCCURS 0,

SUBJECT LIKE ZSUBJECT-SUB,

END OF ITAB1.

SELECT SUB FROM ZSUBJECT INTO CORRESPONDING FIELDS OF TABLE ITAB1.

SORT ITAB1 DESCENDING.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'SUB'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = ITAB1.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Regards,

Saurabh