<?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: Function module to read domain value table texts (not fixed value) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-read-domain-value-table-texts-not-fixed-value/m-p/329382#M5305</link>
    <description>&lt;P&gt;This only works for fixed values, not from a value table. For example check the domain WERKS.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Dec 2016 14:30:56 GMT</pubDate>
    <dc:creator>raghug</dc:creator>
    <dc:date>2016-12-20T14:30:56Z</dc:date>
    <item>
      <title>Function module to read domain value table texts (not fixed value)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-read-domain-value-table-texts-not-fixed-value/m-p/329378#M5301</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i'm looking for an function module or method to read from a known domain the text of a value which is defined in a value table (not as a fixed value).&lt;/P&gt;&lt;P&gt;(All I found is to read the fixed values - but this i don't need.)&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 08:31:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-read-domain-value-table-texts-not-fixed-value/m-p/329378#M5301</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-12-20T08:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Function module to read domain value table texts (not fixed value)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-read-domain-value-table-texts-not-fixed-value/m-p/329379#M5302</link>
      <description>&lt;P&gt;AFAIK there are only FMs for single value text. But you could use same tools than SQ01 generated queries, look for method &lt;A href="https://launchpad.support.sap.com/#/solutions/scnwiki/?q=if_text_identifier_obj-%25253Eread_text&amp;amp;filters=%255B%255D"&gt;if_text_identifier_obj-read_text&lt;/A&gt; in forum.&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Raymond&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 09:45:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-read-domain-value-table-texts-not-fixed-value/m-p/329379#M5302</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2016-12-20T09:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Function module to read domain value table texts (not fixed value)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-read-domain-value-table-texts-not-fixed-value/m-p/329380#M5303</link>
      <description>&lt;P&gt;The closest I got was CL_TEXT_IDENTIFIER which did not suit my purposes. So I ended up writing my own... here are some key code snippets.&lt;/P&gt;&lt;P&gt;Some notes:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The opt_crit is for additional key fields, which some domain text tables have. For example T336T has LGNUM and KZDIF as keys.&lt;/LI&gt;&lt;LI&gt;Reading this now, I would think the DD03L selections should have an ORDER BY POSITION to ensure that it is getting the same field consistently... but apparently this worked for me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;&lt;CODE&gt;        SELECT SINGLE * INTO l_dd1
          FROM dd01l
          WHERE domname = domname
          AND as4local = 'A'
          AND as4vers = ''  ##WARN_OK.
         
        ...IF sy-subrc....
         
        CALL FUNCTION 'DDUT_TEXTTABLE_GET' ##FM_SUBRC_OK
          EXPORTING
            tabname   = l_dd1-entitytab
          IMPORTING
            texttable = l_chktab
          EXCEPTIONS
            OTHERS    = 1.          
       
        ...IF sy-subrc...  
        
        SELECT SINGLE fieldname position INTO (l_txtfield, l_position)
          FROM dd03l
          WHERE tabname = l_chktab
          AND as4local = 'A'
          AND as4vers  = ''
          AND keyflag = ''  ##WARN_OK.
        IF sy-subrc = 0.
          l_position = l_position - 1.
          SELECT SINGLE fieldname INTO l_chkfield
            FROM dd03l
            WHERE tabname = l_chktab
            AND as4local = 'A'
            AND as4vers = ''
            AND position = l_position  ##WARN_OK.
          IF opt_crit IS NOT INITIAL.
            l_position = l_position - 1.

            SELECT SINGLE fieldname INTO l_optfield
              FROM dd03l
              WHERE tabname = l_chktab
              AND as4local = 'A'
              AND as4vers = ''
              AND position = l_position  ##WARN_OK.
            IF sy-subrc = 0.
              CONCATENATE l_optfield ` = '` opt_crit `' AND ` INTO l_entered.
              APPEND l_entered TO li_entered.
            ENDIF.
          ENDIF.

          " Assemble WHERE clause
          CONCATENATE l_chkfield ` = '` chk_value `'` INTO l_entered.
          APPEND l_entered TO li_entered.

          SELECT SINGLE (l_txtfield) INTO e_text
            FROM (l_chktab)
            WHERE (li_entered)
            AND spras = sy-langu.
          IF sy-subrc &amp;lt;&amp;gt; 0.
            l_error = abap_true.
          ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;... And I had my method setup to be able to call it like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;      field_text = my_class-&amp;gt;chk_dd_value(
                                           domname      = 'KZDIF'
                                           chk_value    = l_kzdif
                                           opt_crit     = l_lgnum
                                         ).  
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Dec 2016 11:25:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-read-domain-value-table-texts-not-fixed-value/m-p/329380#M5303</guid>
      <dc:creator>raghug</dc:creator>
      <dc:date>2016-12-20T11:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: Function module to read domain value table texts (not fixed value)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-read-domain-value-table-texts-not-fixed-value/m-p/329381#M5304</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;review the FM DOMAIN_VALUE_GET&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gregory&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 12:33:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-read-domain-value-table-texts-not-fixed-value/m-p/329381#M5304</guid>
      <dc:creator>gregorygotera</dc:creator>
      <dc:date>2016-12-20T12:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Function module to read domain value table texts (not fixed value)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-read-domain-value-table-texts-not-fixed-value/m-p/329382#M5305</link>
      <description>&lt;P&gt;This only works for fixed values, not from a value table. For example check the domain WERKS.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 14:30:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-read-domain-value-table-texts-not-fixed-value/m-p/329382#M5305</guid>
      <dc:creator>raghug</dc:creator>
      <dc:date>2016-12-20T14:30:56Z</dc:date>
    </item>
  </channel>
</rss>

