Skip to Content

Table Control - Dropdown List

Hi,

I have a Table Control Element on a Dynpro. Some colums are displayed as a Dropdown List (Listbox).

How can I put values into this listbox? I have looked at this thread http://scn.sap.com/thread/764416 and tried to use the FB F4IF_INT_TABLE_VALUE_REQUES. But it did not work. The Dropdown Box is still empty.

Every example I looked at, used a reference to DDIC Objects. But my table structure has no DDIC Referenz. I is defined in the report by TYPE statements. How can I build the DropDown List with a structure without any DDIC Reference?

Thank you very much in advance!

Best regards.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 30, 2013 at 01:59 PM

    Hi Daniel,

    Can you try this code?

    Global Data Def.

    DATA : GT_VALUES TYPE VRM_VALUES.

    DATA : GS_VALUES LIKE LINE OF GT_VALUES.

    in PROCESS BEFORE OUTPUT.

    loop at gc_control.

    MODULE INIT_LISTBOX.

    endloop.


    *&---------------------------------------------------------------------*

    *& Module INIT_LISTBOX OUTPUT

    *&---------------------------------------------------------------------*

    MODULE INIT_LISTBOX OUTPUT.

    REFRESH GT_VALUES.

    LOOP AT GT_APACT INTO GS_APACT.

    MOVE : GS_APACT-VALUE TO GS_VALUES-KEY,

    GS_APACT-TEXT TO GS_VALUES-TEXT.

    APPEND GS_VALUES TO GT_VALUES.

    ENDLOOP.

    PERFORM VRM_SET_VALUES

    USING

    'G_APACT' " Screen element name

    GT_VALUES.

    ENDMODULE. " INIT_LISTBOX OUTPUT

    *&---------------------------------------------------------------------*

    *& Form vrm_set_values

    *&---------------------------------------------------------------------*

    form vrm_set_values using id values.

    call function 'VRM_SET_VALUES'

    exporting

    id = id

    values = values

    * EXCEPTIONS

    * ID_ILLEGAL_NAME = 1

    * OTHERS = 2

    .

    if sy-subrc <> 0.

    * Implement suitable error handling here

    endif.

    endform. "vrm_set_values

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 02, 2014 at 04:32 PM

    Make Use of VRM_SET_VALUES.

    Follow the Alenlee and oldun.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 30, 2013 at 02:09 PM

    some sample code

    * datas

    DATA: it_dropdown TYPE lvc_t_drop,
    ty_dropdown TYPE lvc_s_drop.


    *set

    ty_dropdown-handle = '1'.

    ty_dropdown-value = ' '.

    APPEND ty_dropdown TO it_dropdown.

    ty_dropdown-handle = '1'.

    ty_dropdown-value = '1 kalite'.

    APPEND ty_dropdown TO it_dropdown.

    ty_dropdown-handle = '1'.

    ty_dropdown-value = '2 kalite'.

    APPEND ty_dropdown TO it_dropdown.

    ty_dropdown-handle = '1'.

    ty_dropdown-value = '3 kalite'.

    APPEND ty_dropdown TO it_dropdown.

    CALL METHOD alv_con->set_drop_down_table

    EXPORTING

    it_drop_down = it_dropdown.

    LOOP AT fcat .

    CASE fcat-fieldname .

    WHEN 'KALITE'.

    fcat-drdn_hndl = '1'.

    fcat-outputlen = '10'.

    MODIFY fcat.

    ENDCASE.

    ENDLOOP.


    PR.JPG (71.7 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 31, 2013 at 04:05 AM

    Hi,

    In the PBO create a module for the listbox.Use the FM VRM_SET_VALUES to set initial values to list.

    MODULE LISTBOX.

    x_drop-KEY = '001'.

    x_drop-TEXT = 'Test1'.

    append x_drop to t_drop.

    x_drop-KEY = '002'.

    x_drop-TEXT = 'Test2'.

    append x_drop to t_drop.

    CALL FUNCTION 'VRM_SET_VALUES'

    EXPORTING

    id = 'X_TAB-TYPE' --->Table Control fieldName

    values = t_drop

    EXCEPTIONS

    ID_ILLEGAL_NAME = 1

    OTHERS = 2.

    ENDMODULE.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi!

      Thanks for your reply!

      Here are the properties of the table control and the field, which should get DropDown. I'm working in a German system, unfortunantelly se80 don't show me the english property labels even if I log in with english. Therefore I have translated the Properties by my own, hope you can see which one I mean.

      Table Control TC_KRITERIEN

      Type of Table:
      X With Column Heading
      X Configurable
      No Title

      Resizing:
      X Vertical
      X Horizontal

      Separator:
      X Vertical
      X Horizontal

      Row Markers:
      Multiple

      Column Markers:
      No

      With Marking Column:
      WA_SEL_KRITERIEN-LFD_NR

      Fixed Columns:
      0

      Input/Output Field for DropDown WA_SEL_KRITERIEN-QUELLSYSTEM
      Dropdown: Listbox

      FktCode: empty

      Format: Char; No DDIC
      No SET/GET Parameter

      Inputfield: Yes
      Outputfield: Yes

      Input Assistance: Yes
      Value List: Space (From Dict. / Flow Control)

      Best regards,

      Daniel

  • author's profile photo Former Member
    Former Member
    Posted on Dec 31, 2013 at 05:21 AM

    Hi Daniel,

    In the top include of the program declare internal table and workarea like this.

    TYPES : BEGIN OF ty_value_tab,
    TEXT TYPE char100,
    END OF ty_value_tab.



    DATA : return_tab TYPE STANDARD TABLE OF ddshretval,
    t_itab TYPE STANDARD TABLE OF ty_value_tab,
    x_itab TYPE ty_value_tab.


    And in the flow logic of your screen write the code like this.


    "New event

    PROCESS ON VALUE-REQUEST.

    FIELD LV_LIST MODULE f4_help_test.


    "LV_LIST is a input field that we declared it in the layout.


    "f4_help_test is a module that we are going to create in which we are going to write the logic.


    Double click on the ""f4_help_test" and create a new module


    Inside the module write code like .



    x_itab-TEXT = 'alen'.
    APPEND x_itab TO t_itab.

    x_itab-TEXT = 'lee'.
    APPEND x_itab TO t_itab.


    x_itab-TEXT = 'mj'.
    APPEND x_itab TO t_itab.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield = 'LV_LIST'
    value_org = 'S'
    dynprofield = 'LV_LIST'
    TABLES
    value_tab = t_itab
    return_tab = return_tab
    EXCEPTIONS
    parameter_error = 1
    no_values_found = 2
    OTHERS = 3.


    "Hope this helps.

    "Change the code according to requirement. I am saying about the internal table and all.


    Regards,

    Alenlee MJ



    Add a comment
    10|10000 characters needed characters exceeded

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.