Skip to Content
author's profile photo Former Member
Former Member

Screen Painter

Hi all,

How to give dropdown list or list box in screen.Give a simple program.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 29, 2006 at 05:53 PM

    Refer this example program DEMO_DROPDOWN_LIST_BOX

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 29, 2006 at 06:11 PM

    Hi,

    check this example.

    TYPE-POOLS: vrm.

    PARAMETERS: p_test TYPE char4 AS LISTBOX VISIBLE LENGTH 10.

    DATA: t_data TYPE vrm_values.

    INITIALIZATION.

    DATA: s_data TYPE vrm_value.

    s_data-key = 'ABCD'.

    s_data-text = 'First four'.

    APPEND s_data TO t_data.

    s_data-key = 'EFGHI'.

    s_data-text = 'Second four'.

    APPEND s_data TO t_data.

    CALL FUNCTION 'VRM_SET_VALUES'

    EXPORTING

    id = 'P_TEST'

    values = t_data

    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.

    START-OF-SELECTION.

    WRITE: / p_test.

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 30, 2006 at 12:08 PM

    Hi,

    For that field for which u want to attach the drop down list, u need to select the drop down list option in the screen field attributes also, then only u will be able to see drop down list. For coding refer to this program : demo_dropdown_list_box.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      REPORT Z_DDLB.

      DEFINE LB_MACRO_KOART.

      SELECTION-SCREEN BEGIN OF LINE.

      SELECTION-SCREEN COMMENT 1(31) &3.

      PARAMETERS: &1 AS LISTBOX VISIBLE LENGTH &2 OBLIGATORY.

      SELECTION-SCREEN END OF LINE.

      END-OF-DEFINITION.

      ************************************************************************

      • SELECTION-SCREEN *

      ************************************************************************

      SELECTION-SCREEN BEGIN OF BLOCK S1 WITH FRAME TITLE TEXT-001.

      LB_MACRO_KOART MYLIST(1) 5 COMMENT.

      SELECTION-SCREEN END OF BLOCK S1.

      ************************************************************************

      • AT SELECTION - SCREEN

      ************************************************************************

      AT SELECTION-SCREEN OUTPUT.

      PERFORM ADD_VALUES_TO_KOART.

      COMMENT = 'Account type'.

      &----


      *& Form ADD_VALUES_TO_KOART

      &----


      • Fill the values in dropdownlistbox

      ----


      FORM ADD_VALUES_TO_KOART .

      TYPE-POOLS: VRM.

      DATA: MY_LIST TYPE VRM_VALUES,

      VALUE LIKE LINE OF MY_LIST.

      DATA : BEGIN OF I_TAB OCCURS 0,

      KOART TYPE C,

      END OF I_TAB.

      CLEAR I_TAB.

      I_TAB-KOART = 'A'.

      APPEND I_TAB.

      CLEAR I_TAB.

      I_TAB-KOART = 'D'.

      APPEND I_TAB.

      CLEAR I_TAB.

      I_TAB-KOART = 'K'.

      APPEND I_TAB.

      CLEAR I_TAB.

      I_TAB-KOART = 'M'.

      APPEND I_TAB.

      CLEAR I_TAB.

      I_TAB-KOART = 'S'.

      APPEND I_TAB.

      CLEAR I_TAB.

      &----


      *& Filling the list structure with values from MARA table

      &----


      LOOP AT I_TAB.

      VALUE-KEY = SY-TABIX.

      VALUE-TEXT = I_TAB-KOART.

      APPEND VALUE TO MY_LIST.

      ENDLOOP.

      &----


      *& Finally calling the function module to create the list box.

      &----


      CALL FUNCTION 'VRM_SET_VALUES'

      EXPORTING

      ID = 'MYLIST'

      VALUES = MY_LIST.

      ENDFORM. " ADD_VALUES_TO_KOART

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.