Application Development 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: 

Selection Screen drop down list display problem.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Narsi,

Can you show the output screenshot?

Regards,

Sudeesh Soni

0 Kudos

Hi Sudeesh Soni,

Regards,

Narsireddy.

former_member201275
Active Contributor
0 Kudos

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.

former_member201275
Active Contributor
0 Kudos

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.

Piyushmatrixs
Participant
0 Kudos

Hi,

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

Regards

Piyush

0 Kudos

at selection-screen output is correct

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Narsi,

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

Regards,

Sudeesh Soni

Former Member
0 Kudos

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