<?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 table control field not getting the value. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-field-not-getting-the-value/m-p/6613679#M1439428</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;        Iam writing a select query to fetch the description(MAKTX of MAKT) from the material number (MATNR of MARA). So in the table control , I need to display the description. &lt;/P&gt;&lt;P&gt;This is the Scenario  :   in Table Control, iam having the data for  maktx. The matnr field is editable so that the end user can enter material number and get the description from material master (MARA).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if table control already holds the description,  If I enter matnr and press enter key,  the maktx field should be populated and here if already existed maktx is same as mara-maktx for given matnr, No need to change otherwise, the old description should be overwritten by the new description. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is my code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xmatdesc -&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;  internal table&lt;/P&gt;&lt;P&gt;xekpo3 -&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt; internal table for table control.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    WHEN 'ENT'.
        SELECT a~matnr
               b~maktx
               INTO CORRESPONDING FIELDS OF TABLE xmatdesc
               FROM mara AS a INNER JOIN makt AS b
               ON a~matnr = b~matnr
               WHERE a~matnr = xekpo3-matnr AND
                     b~spras = 'EN'.
        IF NOT xekpo3-maktx = xmatdesc-maktx.    "checking existed maktx with mara-maktx for given matnr.
          CLEAR xekpo3-maktx.
          MOVE-CORRESPONDING xmatdesc TO xekpo3.
          APPEND xekpo3.
        ELSE.
          EXIT.
        ENDIF.
      
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but iam not getting the maktx value in my table control field.  Please provide your views and tell me where it is going wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanking you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Murali Krishna T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Feb 2010 10:16:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-02-01T10:16:37Z</dc:date>
    <item>
      <title>table control field not getting the value.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-field-not-getting-the-value/m-p/6613679#M1439428</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;        Iam writing a select query to fetch the description(MAKTX of MAKT) from the material number (MATNR of MARA). So in the table control , I need to display the description. &lt;/P&gt;&lt;P&gt;This is the Scenario  :   in Table Control, iam having the data for  maktx. The matnr field is editable so that the end user can enter material number and get the description from material master (MARA).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if table control already holds the description,  If I enter matnr and press enter key,  the maktx field should be populated and here if already existed maktx is same as mara-maktx for given matnr, No need to change otherwise, the old description should be overwritten by the new description. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is my code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xmatdesc -&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;  internal table&lt;/P&gt;&lt;P&gt;xekpo3 -&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt; internal table for table control.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    WHEN 'ENT'.
        SELECT a~matnr
               b~maktx
               INTO CORRESPONDING FIELDS OF TABLE xmatdesc
               FROM mara AS a INNER JOIN makt AS b
               ON a~matnr = b~matnr
               WHERE a~matnr = xekpo3-matnr AND
                     b~spras = 'EN'.
        IF NOT xekpo3-maktx = xmatdesc-maktx.    "checking existed maktx with mara-maktx for given matnr.
          CLEAR xekpo3-maktx.
          MOVE-CORRESPONDING xmatdesc TO xekpo3.
          APPEND xekpo3.
        ELSE.
          EXIT.
        ENDIF.
      
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but iam not getting the maktx value in my table control field.  Please provide your views and tell me where it is going wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanking you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Murali Krishna T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2010 10:16:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-field-not-getting-the-value/m-p/6613679#M1439428</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-01T10:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: table control field not getting the value.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-field-not-getting-the-value/m-p/6613680#M1439429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are moving entries into internal table "CORRESPONDING FIELDS OF TABLE xmatdesc" and comparing with the structure "xekpo3-maktx = xmatdesc-maktx"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Either you remove mapping into internal table Or compare it inside loop - endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you got my point..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2010 10:30:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-field-not-getting-the-value/m-p/6613680#M1439429</guid>
      <dc:creator>Manohar2u</dc:creator>
      <dc:date>2010-02-01T10:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: table control field not getting the value.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-field-not-getting-the-value/m-p/6613681#M1439430</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;OK_CODE of enter is 'OK'&lt;/P&gt;&lt;P&gt;try writing OK insted of ENT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2010 10:51:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-field-not-getting-the-value/m-p/6613681#M1439430</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-01T10:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: table control field not getting the value.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-field-not-getting-the-value/m-p/6613682#M1439431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Murali,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do a very simple  thing,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here it is,&lt;/P&gt;&lt;P&gt;In the PAI write this code,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHAIN.&lt;/P&gt;&lt;P&gt;FIELD  MATNR,&lt;/P&gt;&lt;P&gt;FIELD MAKTX. MODULE get_description.&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;"Double click on the Module get_description and write the code in it&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;ENDCHAIN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE get_description.&lt;/P&gt;&lt;P&gt; SELECT single  b~maktx&lt;/P&gt;&lt;P&gt;               into  xmatdesc&lt;/P&gt;&lt;P&gt;               FROM mara AS a INNER JOIN makt AS b&lt;/P&gt;&lt;P&gt;               ON a&lt;SUB&gt;matnr = b&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;               WHERE a~matnr = MATNR AND &lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;/SPAN&gt;"MATNR - Field Content{color]&lt;/P&gt;&lt;P&gt;                     b~spras = 'EN'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        maktx =  xmatdesc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the above code will run for all the rows in the table control and update the  material description if it is the same then it will overrite.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Abhijit G. Borkar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2010 13:11:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-field-not-getting-the-value/m-p/6613682#M1439431</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-01T13:11:05Z</dc:date>
    </item>
  </channel>
</rss>

