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

Selection Screen drop down list display problem.

Former Member
0 Likes
3,625

Hi All,

I have created a drop down list using FM VRM_SET_VALUES. But while executing the program for first time list is not displaying properly.

i.e. List is not displaying at the appropriate field Position.

My code.

Thanks & regards,

Narsireddy.

9 REPLIES 9
Read only

Former Member
0 Likes
2,532

Hi Narsi,

Can you show the output screenshot?

Regards,

Sudeesh Soni

Read only

0 Likes
2,532

Hi Sudeesh Soni,

Regards,

Narsireddy.

Read only

former_member201275
Active Contributor
0 Likes
2,532

Please post your complete selection screen code here. Your code for the call to the function is correct, and so is your ‘at selection-screen output’ statement, therefore there must be an issue with how the selection screen is coded.

Read only

former_member201275
Active Contributor
0 Likes
2,532

also… try this… where you have ‘parameters: pa_type(32)’ … i.e. put 32 in brackets as I have, and change visible length to 32 as well.

Read only

Piyushmatrixs
Participant
0 Likes
2,532

Hi,

You must write your code under "INITIALIZATION" event instead of "At SELECTION-SCREEN OUTPUT".

Regards

Piyush

Read only

0 Likes
2,532

at selection-screen output is correct

Read only

Former Member
0 Likes
2,532

hi narsi

it is working fine.

please check code:

REPORT  ZR_TEST1.

TYPE-POOLS : VRM.

data:   name    TYPE VRM_ID ,
         list  TYPE VRM_VALUES,
  value  LIKE LINE OF list.

SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(23) comm28.
PARAMETERS pa_type AS LISTBOX VISIBLE LENGTH 30.
SELECTION-SCREEN END OF LINE.

INITIALIZATION.
comm28 = 'Condition'.

AT SELECTION-SCREEN OUTPUT.
   name = 'PA_TYPE'.
   value-key = '1'.
   value-text = 'First'.
   APPEND value TO list.

   value-key = '2'.
   value-text = 'Last'.
   APPEND value TO list.

   value-key = '3'.
   value-text = 'Saved'.
   APPEND value TO list.

   value-key = '4'.
   value-text = 'Not Saved'.
   APPEND value TO list.

   value-key = '5'.
   value-text = 'Saved, Valid'.
   APPEND value TO list.

   CALL FUNCTION 'VRM_SET_VALUES'
     EXPORTING
      id = name
      values = list
      EXCEPTIONS
      id_illegal_name = 1
      OTHERS = 2.

   IF sy-subrc <> 0.
     FORMAT COLOR 1.
     MESSAGE 'I000' TYPE 'I'.
   ENDIF.
   CLEAR list.

Read only

Former Member
0 Likes
2,532

Hi Narsi,

I created test program using your code lines but not getting any issue mentioned by you.

Regards,

Sudeesh Soni

Read only

Former Member
0 Likes
2,532

hi

see this program

YPE-POOLS:vrm.

PARAMETERS: p_matnr TYPE MARA-MATNR AS LISTBOX VISIBLE LENGTH 20.

DATA: t_mara TYPE TABLE OF mara,

       w_mara TYPE mara.

DATA: name TYPE vrm_id,

       list TYPE vrm_values,

       value TYPE vrm_value.

*--------------------------------------------------------------------*

*  A T  S E L E C T I O N -  S C R E E N  O U T P U T

*--------------------------------------------------------------------*

AT SELECTION-SCREEN OUTPUT.

   SELECT matnr FROM mara INTO CORRESPONDING FIELDS OF TABLE t_mara .

   LOOP AT t_mara INTO w_mara.

     value-key = w_mara-matnr.

     value-text = w_mara-matnr.

     APPEND value TO list.

   ENDLOOP.

   name = 'P_MATNR'.

   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.



regards

laxman