<?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: clear field in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/clear-field/m-p/1047039#M88215</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Whenever you use the SELECT SINGLE statement you will always want to check the return code before you use the data.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm guessing that what is happening in your program is that the select statement is not finding a record and thus the value in VCOLOR will retain it's original contents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The revised code would look like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-mandt = '092'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single color from /upm/gtb02 into /UPM/GTB_EINKAUF-VCOLOR where&lt;/P&gt;&lt;P&gt;colorid = /UPM/GTB_EINKAUF-VCOLOR(02).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    " Do what ever you want&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    " Handle the error of not finding a record&lt;/P&gt;&lt;P&gt;  endif.&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;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Brent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Dec 2005 15:40:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-12-21T15:40:25Z</dc:date>
    <item>
      <title>clear field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clear-field/m-p/1047036#M88212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi to all,&lt;/P&gt;&lt;P&gt;please go through the &amp;lt;b&amp;gt;BOLD CODING&amp;lt;/b&amp;gt; in the below program and please give me an idea..where i have to give the CLEAR the field VCOLOR ...according to my program when ever im creating  a document the vcolor should chage...but it is taking only one color for all documents...i think i have to clear i loop....but im not getting ....if u have any idea...let me share.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE USER_COMMAND_2000 INPUT.&lt;/P&gt;&lt;P&gt;  data: return_code type i.&lt;/P&gt;&lt;P&gt;  data: Mat_Doc     type MBLNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  clear gv_save_ok_code.&lt;/P&gt;&lt;P&gt;  move  gv_ok_code to gv_save_ok_code.&lt;/P&gt;&lt;P&gt;  clear gv_ok_code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CL_GUI_CFW=&amp;gt;DISPATCH must be called if events are registered&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;that trigger PAI&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;this method calls the event handler method of an event&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD CL_GUI_CFW=&amp;gt;DISPATCH&lt;/P&gt;&lt;P&gt;    importing return_code = return_code.&lt;/P&gt;&lt;P&gt;  if return_code &amp;lt;&amp;gt; cl_gui_cfw=&amp;gt;rc_noevent.&lt;/P&gt;&lt;P&gt;    if GV_WERKNR_FLAG = 'T'.              "Auswahl Werknummer&lt;/P&gt;&lt;P&gt;      perform get_data using GV_NODE_KEY.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    if GV_WERKNR_FLAG = 'W'.&lt;/P&gt;&lt;P&gt;      Mat_Doc = GV_NODE_KEY.              "Auswahl Bestellung&lt;/P&gt;&lt;P&gt;      perform WEingang using Mat_Doc.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    exit.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;if sy-mandt = '092'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single color from /upm/gtb02 into /UPM/GTB_EINKAUF-VCOLOR where&lt;/P&gt;&lt;P&gt;colorid = /UPM/GTB_EINKAUF-VCOLOR(02).&lt;/P&gt;&lt;P&gt;endif.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  case gv_save_ok_code.&lt;/P&gt;&lt;P&gt;    when 'EXIT' or 'CANCEL' or 'BACK'.&lt;/P&gt;&lt;P&gt;      perform free_controls.&lt;/P&gt;&lt;P&gt;      leave program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    when 'ORG'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     perform get_new_org.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    when 'SAVE'.&lt;/P&gt;&lt;P&gt;      perform save_item.&lt;/P&gt;&lt;P&gt;      gv_cursorfield = '/UPM/GTB_EINKAUF-MATERIAL'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    when 'NEW'.&lt;/P&gt;&lt;P&gt;      perform new.&lt;/P&gt;&lt;P&gt;      /UPM/GTB_EINKAUF-WERKNUMMER = o_gtb01_data-&amp;gt;get_NewCoNr( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    when 'PURCH_ORD'.&lt;/P&gt;&lt;P&gt;      perform Create_Order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    when 'CALC_EK'.&lt;/P&gt;&lt;P&gt;      perform Calculate_EK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    when 'STOCK_INFO'.&lt;/P&gt;&lt;P&gt;      perform Get_Mat_Stock_Report using /UPM/GTB_EINKAUF-MATERIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    when 'IAUF'.&lt;/P&gt;&lt;P&gt;      perform Get_IAuf_Report using /UPM/GTB_EINKAUF-WERKNUMMER.&lt;/P&gt;&lt;P&gt;  endcase.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " USER_COMMAND_2000  INPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;raju....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2005 14:27:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clear-field/m-p/1047036#M88212</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-21T14:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: clear field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clear-field/m-p/1047037#M88213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raju,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where are populating /UPM/GTB_EINKAUF-VCOLOR(02). this filed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if every time you pass the same then you will get the same color.&lt;/P&gt;&lt;P&gt;are you making any changes to /UPM/GTB_EINKAUF-VCOLOR(02). this field..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2005 14:34:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clear-field/m-p/1047037#M88213</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-21T14:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: clear field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clear-field/m-p/1047038#M88214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The field used in the where condition and the target are the same. &lt;/P&gt;&lt;P&gt;try to use a different variable for that and clear it every before the select.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2005 14:41:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clear-field/m-p/1047038#M88214</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-21T14:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: clear field</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/clear-field/m-p/1047039#M88215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Whenever you use the SELECT SINGLE statement you will always want to check the return code before you use the data.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm guessing that what is happening in your program is that the select statement is not finding a record and thus the value in VCOLOR will retain it's original contents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The revised code would look like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-mandt = '092'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single color from /upm/gtb02 into /UPM/GTB_EINKAUF-VCOLOR where&lt;/P&gt;&lt;P&gt;colorid = /UPM/GTB_EINKAUF-VCOLOR(02).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    " Do what ever you want&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    " Handle the error of not finding a record&lt;/P&gt;&lt;P&gt;  endif.&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;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Brent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2005 15:40:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/clear-field/m-p/1047039#M88215</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-21T15:40:25Z</dc:date>
    </item>
  </channel>
</rss>

