<?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 Exclude values from listbox in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/exclude-values-from-listbox/m-p/3668117#M883493</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'd like to ask, what's the easiest way to exclude values from listbox, which is build on domain. Currently my listbox includes 2 values (from domain textes) and i would like to limit the list just to one. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Juzio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Apr 2008 11:55:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-09T11:55:26Z</dc:date>
    <item>
      <title>Exclude values from listbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exclude-values-from-listbox/m-p/3668117#M883493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'd like to ask, what's the easiest way to exclude values from listbox, which is build on domain. Currently my listbox includes 2 values (from domain textes) and i would like to limit the list just to one. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Juzio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2008 11:55:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exclude-values-from-listbox/m-p/3668117#M883493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-09T11:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude values from listbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exclude-values-from-listbox/m-p/3668118#M883494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Juzio,&lt;/P&gt;&lt;P&gt;  Domain values are stored in DD07T.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a routine I use repeatly to obtain them.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  PERFORM get_dd07t_value USING 'ZLMFUCONTTYPE'
                              p_foltyp
                              p_text.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  get_dd07t_value
*&amp;amp;---------------------------------------------------------------------*
*      --&amp;gt;P_DOMNAME  text
*      --&amp;gt;P_KEY      text
*      --&amp;gt;P_RESULT   text
*----------------------------------------------------------------------*
FORM get_dd07t_value USING    p_domname
                              p_key
                              p_result.

  CLEAR p_result.
  SELECT SINGLE ddtext INTO p_result
    FROM dd07t
    WHERE domname = p_domname
      AND ddlanguage = sy-langu
      AND domvalue_l = p_key.
  IF sy-subrc NE 0.
    p_result = 'None'.
  ENDIF.

ENDFORM.                    " get_dd07t_value
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This could easily be modified to fill a table with just the ones you need.  Then, in your dialog program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the _TOP ( or global area)&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPE-POOLS             vrm.
* These are examples that I used in my needs
DATA: ltype_field   TYPE vrm_id,
      ltype_result  TYPE STANDARD TABLE OF vrm_value,
      ltype_val     LIKE LINE OF ltype_result.

DATA: atype_field   TYPE vrm_id,
      atype_result  TYPE STANDARD TABLE OF vrm_value,
      atype_val     LIKE LINE OF ltype_result.

DATA: lstat_field   TYPE vrm_id,
      lstat_result  TYPE STANDARD TABLE OF vrm_value,
      lstat_val     LIKE LINE OF lstat_result.
DATA: wk_ltype      LIKE zlmlead-ltype,
      prev_ltype    LIKE zlmlead-ltype,
      wk_status     LIKE zlmlead-status.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the PBO logic MODULE to here&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  init_0110  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
MODULE init_0110 OUTPUT.

  REFRESH ltype_result. CLEAR ltype_result.
* Drop down values

  SELECT ltype ltypex
    INTO TABLE ltype_result
    FROM zlmltyp
    WHERE auth NE '9'.    "System Only

* Field name to assign drop down values
  ltype_field = 'WK_LTYPE'.
  CALL FUNCTION 'VRM_SET_VALUES'
       EXPORTING
            id              = ltype_field
            values          = ltype_result
       EXCEPTIONS
            id_illegal_name = 1
            OTHERS          = 2.
  IF sy-subrc &amp;lt;&amp;gt; 0.

  ENDIF.

  IF prev_ltype NE wk_ltype.
    CLEAR: wk_status.
  ENDIF.

  REFRESH lstat_result. CLEAR lstat_result.
* Drop down values

  SELECT status statx
    INTO TABLE lstat_result
    FROM zlmstyp
    WHERE ltype = wk_ltype
      AND auth NE '9'.    "System Only
*         OR status = zlmlead-status ).

  SORT lstat_result.

* Field name to assign drop down values
  lstat_field = 'WK_STATUS'.
  CALL FUNCTION 'VRM_SET_VALUES'
       EXPORTING
            id              = lstat_field
            values          = lstat_result
       EXCEPTIONS
            id_illegal_name = 1
            OTHERS          = 2.
  IF sy-subrc &amp;lt;&amp;gt; 0.

  ENDIF.

  prev_ltype = wk_ltype.
ENDMODULE.                 " init_0110  OUTPUT
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lastly, on the field attributes in Screen Painter, set the Search help to "A" (From Program)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My example above restricts values of the second listbox based on values in the First one.  The first one has a FCode on it so that the 2nd is changed each time the 1st changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2008 12:02:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exclude-values-from-listbox/m-p/3668118#M883494</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-09T12:02:38Z</dc:date>
    </item>
  </channel>
</rss>

