<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Multiple Drop Down boxes in ALV in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-drop-down-boxes-in-alv/m-p/3131838#M744016</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Uwe -- solution was fine. Points awarded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was referred to that program before but someone on the system I'm currently working on deleted all the programs BCALV* higher than BCALV_EDIT_04 and I don't currently have my "minisap" system available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Dec 2007 13:02:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-10T13:02:45Z</dc:date>
    <item>
      <title>Multiple Drop Down boxes in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-drop-down-boxes-in-alv/m-p/3131836#M744014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;I seem to have a problem in trying to create several drop down boxes. It's easy enough to create a drop down box for a cell in a column but if I want drop down boxes in multiple columns it doesn't seem to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I build the table with the following structure for example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:  BEGIN OF s_elements,&lt;/P&gt;&lt;P&gt;   tabname  TYPE dd02l-tabname,&lt;/P&gt;&lt;P&gt;   tabclass TYPE dd02l-tabclass,&lt;/P&gt;&lt;P&gt;   as4user  TYPE dd02l-as4user,&lt;/P&gt;&lt;P&gt;   as4date  TYPE dd02l-as4date,&lt;/P&gt;&lt;P&gt;   as4time  TYPE dd02l-as4time,&lt;/P&gt;&lt;P&gt;   viewed(1) TYPE c,&lt;/P&gt;&lt;P&gt;   drop_down_handle  type int4.&lt;/P&gt;&lt;P&gt;TYPES: END OF    s_elements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I create and adust the field catalog &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Here before displaying you can change the field catalog to&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;adjust your own column names.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*col_name  col-nr 'your name' output length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  col_name 1 'Table name' 30.&lt;/P&gt;&lt;P&gt;  col_name 2 'Table class' 12.&lt;/P&gt;&lt;P&gt;  col_name 3  'Changed By' 12.&lt;/P&gt;&lt;P&gt;  col_name 4  '    On'   12.&lt;/P&gt;&lt;P&gt;  col_name 5  '    At'   8.&lt;/P&gt;&lt;P&gt;  col_name 6  'Act' 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Make any other changes to the field catalog&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;for example colour cells or drop down box&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;set some colours&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_fldcat into  wa_it_fldcat.&lt;/P&gt;&lt;P&gt;if wa_it_fldcat-fieldname = 'TABNAME'.&lt;/P&gt;&lt;P&gt;  wa_it_fldcat-emphasize = 'C210'.&lt;/P&gt;&lt;P&gt;  modify it_fldcat from wa_it_fldcat. " index sy-tabix.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if wa_it_fldcat-fieldname = 'AS4USER'.&lt;/P&gt;&lt;P&gt;  wa_it_fldcat-emphasize = 'C710'.&lt;/P&gt;&lt;P&gt;  modify it_fldcat from wa_it_fldcat. " index sy-tabix.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;set a drop down box as test&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if wa_it_fldcat-fieldname = 'VIEWED'.&lt;/P&gt;&lt;P&gt;  wa_it_fldcat-edit = 'X'.&lt;/P&gt;&lt;P&gt;  wa_it_fldcat-drdn_field = 'DROP_DOWN_HANDLE'.&lt;/P&gt;&lt;P&gt;  wa_it_fldcat-checktable = '!'.&lt;/P&gt;&lt;P&gt;  modify it_fldcat from wa_it_fldcat. " index sy-tabix.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; I don't need the actual handle value to be displyed in the grid so I define it as a Technical Field&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if wa_it_fldcat-fieldname = 'DROP_DOWN_HANDLE'.&lt;/P&gt;&lt;P&gt; wa_it_fldcat-tech = 'X'.&lt;/P&gt;&lt;P&gt; modify it_fldcat from wa_it_fldcat.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt; clear wa_it_fldcat.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Insert values for the drop down box&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ls_dropdown-handle = '1'.&lt;/P&gt;&lt;P&gt;ls_dropdown-value = 'V'.&lt;/P&gt;&lt;P&gt;append ls_dropdown to lt_dropdown.&lt;/P&gt;&lt;P&gt;ls_dropdown-handle = '1'.&lt;/P&gt;&lt;P&gt;ls_dropdown-value = 'X'.&lt;/P&gt;&lt;P&gt;append ls_dropdown to lt_dropdown.&lt;/P&gt;&lt;P&gt;ls_dropdown-handle = '1'.&lt;/P&gt;&lt;P&gt;ls_dropdown-value = ' '.&lt;/P&gt;&lt;P&gt;append ls_dropdown to lt_dropdown.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;now set the drop down table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method z_object-&amp;gt;set_drop_down_table&lt;/P&gt;&lt;P&gt;            exporting&lt;/P&gt;&lt;P&gt;            it_drop_down = lt_dropdown.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(the method set_drop_drop_down_table is  the same as in cl_gui_alv_grid).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the question is how to I relate a 2nd or 3rd drop down table to the display for different columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2007 07:36:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-drop-down-boxes-in-alv/m-p/3131836#M744014</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-06T07:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Drop Down boxes in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-drop-down-boxes-in-alv/m-p/3131837#M744015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello James&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution is provided by sample report &lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;BCALV_EDIT_06&lt;/P&gt;. I copied this report and made the following changes:&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  BUILD_FIELDCAT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      &amp;lt;--P_GT_FIELDCAT  text
*----------------------------------------------------------------------*
FORM build_fieldcat CHANGING pt_fieldcat TYPE lvc_t_fcat.

  DATA ls_fcat TYPE lvc_s_fcat.

  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
      i_structure_name = 'SBOOK'
    CHANGING
      ct_fieldcat      = pt_fieldcat.

  LOOP AT pt_fieldcat INTO ls_fcat.
    CASE ls_fcat-fieldname.
      WHEN 'WUNIT'.  " first dropdown column
*§2.Set status of column WUNIT to editable and set a dropdown handle.
        ls_fcat-edit = 'X'.
        ls_fcat-drdn_hndl = '1'.
        ls_fcat-outputlen = 7.
* Field 'checktable' is set to avoid shortdumps that are caused
* by inconsistend data in check tables. You may comment this out
* when the test data of the flight model is consistent in your system.
        ls_fcat-checktable = '!'.        "do not check foreign keys

      WHEN 'CLASS'.  " second dropdown column
        ls_fcat-edit = 'X'.
        ls_fcat-drdn_hndl = '2'.         " handle in fieldcatalog, not output itab !!!
        ls_fcat-outputlen = 20. 
        ls_fcat-checktable = '!'.        "do not check foreign keys

      WHEN OTHERS.
        CONTINUE.
    ENDCASE.

    MODIFY pt_fieldcat FROM ls_fcat.

  ENDLOOP.

ENDFORM.                    "build_fieldcat&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  set_drdn_table
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM set_drdn_table.
*§1.Define a dropdown table and pass it to ALV.
*   One listbox is referenced by a handle, e.g., '1'.
*   For each entry that shall appear in this listbox
*   you have to append a line to the dropdown table
*   with handle '1'.
*   This handle can be assigned to several columns
*   of the output table using the field catalog.
*
  DATA: lt_dropdown TYPE lvc_t_drop,
        ls_dropdown TYPE lvc_s_drop.

* First listbox (handle '1').
  ls_dropdown-handle = '1'.
  ls_dropdown-value = 'KG'.
  APPEND ls_dropdown TO lt_dropdown.

  ls_dropdown-handle = '1'.
  ls_dropdown-value = 'G'.
  APPEND ls_dropdown TO lt_dropdown.


* Second listbox (handle = '2' ).
  ls_dropdown-handle = '2'.
  ls_dropdown-value = 'Economy'.
  APPEND ls_dropdown TO lt_dropdown.

  ls_dropdown-handle = '2'.
  ls_dropdown-value = 'Business'.
  APPEND ls_dropdown TO lt_dropdown.

  ls_dropdown-handle = '2'.
  ls_dropdown-value = 'First Class'.
  APPEND ls_dropdown TO lt_dropdown.



  CALL METHOD g_grid-&amp;gt;set_drop_down_table
    EXPORTING
      it_drop_down = lt_dropdown.

ENDFORM.                               " set_drdn_table
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;Note&lt;/P&gt;: The dropdown handle is defined at the level of the fieldcatalog and not as additional field within the output itab.&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;   Uwe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2007 20:29:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-drop-down-boxes-in-alv/m-p/3131837#M744015</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-12-06T20:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Drop Down boxes in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-drop-down-boxes-in-alv/m-p/3131838#M744016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Uwe -- solution was fine. Points awarded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was referred to that program before but someone on the system I'm currently working on deleted all the programs BCALV* higher than BCALV_EDIT_04 and I don't currently have my "minisap" system available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2007 13:02:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-drop-down-boxes-in-alv/m-p/3131838#M744016</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-10T13:02:45Z</dc:date>
    </item>
  </channel>
</rss>

