<?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: Reg: hard coding.. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-hard-coding/m-p/1933256#M386263</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Akshita,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an example of hard coding while displaying error message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE e048 WITH 'Error Text'.&lt;/P&gt;&lt;P&gt;('Error Text' is hard coding in code)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can remove hard coding by creating Text Symbols. Example&lt;/P&gt;&lt;P&gt;MESSAGE e048 WITH text-004.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Where text-004 is equivalent to Error Text)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;George&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;reward points if you find this hint useful&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Feb 2007 11:37:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-19T11:37:15Z</dc:date>
    <item>
      <title>Reg: hard coding..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-hard-coding/m-p/1933255#M386262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;could any one tel me what exactly mean by hard coding, and  how to avoid that in program, if you give me one or two exampls that would be great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx in advance.&lt;/P&gt;&lt;P&gt;Akshitha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Feb 2007 05:34:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-hard-coding/m-p/1933255#M386262</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-17T05:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: hard coding..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-hard-coding/m-p/1933256#M386263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Akshita,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an example of hard coding while displaying error message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE e048 WITH 'Error Text'.&lt;/P&gt;&lt;P&gt;('Error Text' is hard coding in code)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can remove hard coding by creating Text Symbols. Example&lt;/P&gt;&lt;P&gt;MESSAGE e048 WITH text-004.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Where text-004 is equivalent to Error Text)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;George&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;reward points if you find this hint useful&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Feb 2007 11:37:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-hard-coding/m-p/1933256#M386263</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-19T11:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: hard coding..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-hard-coding/m-p/1933257#M386264</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;U can avoid hard coding by using local constants,&lt;/P&gt;&lt;P&gt;as if u use a value which is required more than once then it is advisable to use constants as in near future if you would like to change that value you only need to change the value once where you have defined the constant hence it reduces effort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For ex: you want to put a flag after some if conditions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF &amp;lt;variable &amp;gt; IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; flag = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt; falg =  ' '. " space&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;so instead of using 'X' u can use a constant&lt;/P&gt;&lt;P&gt;DATA:  gc_x   TYPE c value 'x'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can also reduce hard coding by using text symbols.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Feb 2007 10:35:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-hard-coding/m-p/1933257#M386264</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-20T10:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: hard coding..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-hard-coding/m-p/1933258#M386265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hard coding is similar to giving the value directly in the code.&lt;/P&gt;&lt;P&gt;This should be avoided, it is the standard of coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg: Say u like to pass teh value 'X' to a field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U have do like.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CONSTANTS: c_x value 'X'.
wa_fieldcat = c_x.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Also when disaplaying error messages use text elements instead of hard coding.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Message e00 WITH text-001.
 
Text-001 -  Enter valid code.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the above instead of &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Message e00 WITH 'Enter valid code'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if you find useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Feb 2007 12:44:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-hard-coding/m-p/1933258#M386265</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-20T12:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Reg: hard coding..</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-hard-coding/m-p/1933259#M386266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Akshita,&lt;/P&gt;&lt;P&gt; Assume that you are writing a report which writes the name of a company at a number of locations. Say the name is 'XYZ'.&lt;/P&gt;&lt;P&gt;A few days later the company name gets cahnged to 'ABC'.&lt;/P&gt;&lt;P&gt;If you have hard code it like&lt;/P&gt;&lt;P&gt;write:/ 'XYZ'.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;write:/ 'XYZ'.&lt;/P&gt;&lt;P&gt;then you msut replace wherever you have written the statement.&lt;/P&gt;&lt;P&gt;but if you have done like this:&lt;/P&gt;&lt;P&gt;data: v_company(3) value 'XYZ'.&lt;/P&gt;&lt;P&gt;write:/ v_company.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;write:/ v_company.&lt;/P&gt;&lt;P&gt;You can just change at one place i.e &lt;/P&gt;&lt;P&gt;data: v_company(3) value 'ABC'.&lt;/P&gt;&lt;P&gt;this is the advantage of avoiding hard coding.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Feb 2007 12:49:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-hard-coding/m-p/1933259#M386266</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-20T12:49:26Z</dc:date>
    </item>
  </channel>
</rss>

