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

how to fill items in a listbox.

hi,

i am using a table control to view data in a table, on a screen. one of the field(columns) needs to be a list box with only pre available data. how do i populate the listbox in the table.

can anyone help me here...

kiran

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2005 at 11:32 AM

    Hi,

    You can use function module VRM_SET_VALUES for this.

    Write the code in a PROCESS ON VALUE-REQUEST module in the screen for the field.

    PROCESS ON VALUE-REQUEST.

    FIELD <your field name> MODULE VALUES_SET.

    Declare the TYPE-GROUP in the TOP include,

    TYPE-POOLS VRM.

    And then in the module write the following logic,

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

    MODULE values_set.

    DATA: t_values TYPE vrm_values WITH HEADER LINE.

    t_values-key = '1'.

    t_values-text = 'abc'.

    APPEND t_values.

    t_values-key = '2'.

    t_values-text = 'syz'.

    APPEND t_values.

    t_values-key = '3'.

    t_values-text = 'fst'.

    APPEND t_values.

    CALL FUNCTION 'VRM_SET_VALUES'

    EXPORTING

    id = <your field name>

    values = t_values[]

    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.

    ENDMODULE.

    Sri

    Message was edited by: Srikanth Pinnamaneni

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Max,

      Yes. Both the methods work.

      I am used to coding it in POV always.

      Also this demo program RSDEMO_DROPDOWN_LISTBOX is useful.

      May be we should start suggesting this program from now onwards for posts on list boxes..

      Good find !!

      And THANKS !! Kiran for points..

      Sri

      Message was edited by: Srikanth Pinnamaneni

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.