<?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 DropDown Handler in ALV Grid in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dropdown-handler-in-alv-grid/m-p/1171192#M123121</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;&lt;/P&gt;&lt;P&gt;I have set a drop down for a cell of my ALVGrid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used DropDown Alias table...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunatly data are not well transported to my internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do you have any ideo of the problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In field catalog:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;      WHEN 'STATUSTXT'.
* Set the status as dropdown
        ls_fcat-drdn_hndl = '1'.
        ls_fcat-drdn_alias = 'X'.
        ls_fcat-outputlen = 7.
      WHEN 'ERRORTXT'.
** set the ERROR as Dropdown without change possible
        ls_fcat-drdn_hndl = '2'.
        ls_fcat-drdn_alias = 'X'.
        ls_fcat-outputlen = 7.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In abap:&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;---------------------------------------------------------------------*
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: li_alias TYPE lvc_t_dral,
        lw_alias LIKE LINE OF li_alias .

*1/ set the possible values for the status
  DATA : li_status TYPE zttmdi_status_list,
** list of all the status
         lw_status LIKE LINE OF li_status.
  PERFORM get_allowed_status(saplzvmdi_wf)
              USING
                  c_role
                  'X'
              CHANGING
                  li_status.
** fill li_alias with
** diff codes and text for the dropdown of the status!
  LOOP AT li_status INTO lw_status.
    lw_alias-handle = '1'.
    lw_alias-value = lw_status-zzmdistattxt.
    lw_alias-int_value = lw_status-zzmdistat.
    IF lw_alias-value IS INITIAL.
      lw_alias-value = lw_alias-int_value .
    ENDIF.
    APPEND lw_alias TO li_alias.
  ENDLOOP.

*2/ set the possible values for the error
  DATA : li_error TYPE zttmdi_error_list,
         lw_error LIKE LINE OF li_error .
  PERFORM get_error(saplzvmdi_wf)
              CHANGING
                 li_error.
** fill li_alias with
** diff codes and text for the dropdown of the status!
  LOOP AT li_error INTO lw_error.
    lw_alias-handle = '2'.
    lw_alias-value = lw_error-errortxt.
    lw_alias-int_value = lw_error-error.
    IF lw_alias-value IS INITIAL.
      lw_alias-value = lw_alias-int_value .
    ENDIF.
    APPEND lw_alias TO li_alias.
  ENDLOOP.



  CALL METHOD go_handler-&amp;gt;ato_grid-&amp;gt;set_drop_down_table
    EXPORTING
      it_drop_down_alias = li_alias.
ENDFORM.                    "set_drdn_table
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Feb 2006 13:53:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-02-09T13:53:08Z</dc:date>
    <item>
      <title>DropDown Handler in ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dropdown-handler-in-alv-grid/m-p/1171192#M123121</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;&lt;/P&gt;&lt;P&gt;I have set a drop down for a cell of my ALVGrid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used DropDown Alias table...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunatly data are not well transported to my internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do you have any ideo of the problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In field catalog:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;      WHEN 'STATUSTXT'.
* Set the status as dropdown
        ls_fcat-drdn_hndl = '1'.
        ls_fcat-drdn_alias = 'X'.
        ls_fcat-outputlen = 7.
      WHEN 'ERRORTXT'.
** set the ERROR as Dropdown without change possible
        ls_fcat-drdn_hndl = '2'.
        ls_fcat-drdn_alias = 'X'.
        ls_fcat-outputlen = 7.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In abap:&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;---------------------------------------------------------------------*
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: li_alias TYPE lvc_t_dral,
        lw_alias LIKE LINE OF li_alias .

*1/ set the possible values for the status
  DATA : li_status TYPE zttmdi_status_list,
** list of all the status
         lw_status LIKE LINE OF li_status.
  PERFORM get_allowed_status(saplzvmdi_wf)
              USING
                  c_role
                  'X'
              CHANGING
                  li_status.
** fill li_alias with
** diff codes and text for the dropdown of the status!
  LOOP AT li_status INTO lw_status.
    lw_alias-handle = '1'.
    lw_alias-value = lw_status-zzmdistattxt.
    lw_alias-int_value = lw_status-zzmdistat.
    IF lw_alias-value IS INITIAL.
      lw_alias-value = lw_alias-int_value .
    ENDIF.
    APPEND lw_alias TO li_alias.
  ENDLOOP.

*2/ set the possible values for the error
  DATA : li_error TYPE zttmdi_error_list,
         lw_error LIKE LINE OF li_error .
  PERFORM get_error(saplzvmdi_wf)
              CHANGING
                 li_error.
** fill li_alias with
** diff codes and text for the dropdown of the status!
  LOOP AT li_error INTO lw_error.
    lw_alias-handle = '2'.
    lw_alias-value = lw_error-errortxt.
    lw_alias-int_value = lw_error-error.
    IF lw_alias-value IS INITIAL.
      lw_alias-value = lw_alias-int_value .
    ENDIF.
    APPEND lw_alias TO li_alias.
  ENDLOOP.



  CALL METHOD go_handler-&amp;gt;ato_grid-&amp;gt;set_drop_down_table
    EXPORTING
      it_drop_down_alias = li_alias.
ENDFORM.                    "set_drdn_table
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 13:53:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dropdown-handler-in-alv-grid/m-p/1171192#M123121</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-09T13:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: DropDown Handler in ALV Grid</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dropdown-handler-in-alv-grid/m-p/1171193#M123122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.definition&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    HANDLE_DATA_CHANGED FOR EVENT DATA_CHANGED
                         OF CL_GUI_ALV_GRID
                         IMPORTING ER_DATA_CHANGED
                                   E_ONF4
                                   E_ONF4_BEFORE
                                   E_ONF4_AFTER.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;2.implementation&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;METHOD HANDLE_DATA_CHANGED.
    DATA: X_CHANGE TYPE LVC_S_MODI,
          X_FINAL TYPE T_FINAL,
          X_OCRC LIKE LINE OF IT_OCRC,
          L_FLAG.

LOOP AT ER_DATA_CHANGED-&amp;gt;MT_GOOD_CELLS INTO X_CHANGE.
      IF X_CHANGE-FIELDNAME = 'ZZOCHOLDRC'.
    READ TABLE IT_FINAL INTO X_FINAL 
                         INDEX X_CHANGE-ROW_ID.
        IF SY-SUBRC = 0.
      READ TABLE IT_OCRC INTO X_OCRC WITH 
                      KEY  ZZOCHOLDRC = X_CHANGE-VALUE
                                 TRANSPORTING ZZRCDESC.

          IF SY-SUBRC = 0.
            X_FINAL-ZZRCDESC = X_OCRC-ZZRCDESC.
  MODIFY IT_FINAL FROM X_FINAL INDEX X_CHANGE-ROW_ID
                                  TRANSPORTING ZZRCDESC.
          ENDIF.
        ENDIF.
      ENDIF.
ENDLOOP.
ENDMETHOD.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;in this data changed method modify your itab, from changed content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 14:36:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dropdown-handler-in-alv-grid/m-p/1171193#M123122</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-09T14:36:28Z</dc:date>
    </item>
  </channel>
</rss>

