<?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 Best Way to Replace Hardcoded Values in Source in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388210#M1238680</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning, Experts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are debating the best method to replace hardcoded values in source.  Starting out we hardcoded company codes, customer codes, shipping points, ...  and as we've grown we've had to go back in to these source objects and add more values to the hardcoded list.  Now we're taking a step back and wanting to replace these values within "something" so that an addition or subtraction from the list could be "configured" instead of requiring a programming change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have built a Z-table with program name as part of the key that does appear to be functional.  Any change to the hardcoded list would then be changed using SM30 against this table.  But we're wondering if this is the best way...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What are you using to avoid hardcoding or what ideas might you have???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Mar 2009 12:34:48 GMT</pubDate>
    <dc:creator>ChadRichardson</dc:creator>
    <dc:date>2009-03-26T12:34:48Z</dc:date>
    <item>
      <title>Best Way to Replace Hardcoded Values in Source</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388210#M1238680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning, Experts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are debating the best method to replace hardcoded values in source.  Starting out we hardcoded company codes, customer codes, shipping points, ...  and as we've grown we've had to go back in to these source objects and add more values to the hardcoded list.  Now we're taking a step back and wanting to replace these values within "something" so that an addition or subtraction from the list could be "configured" instead of requiring a programming change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have built a Z-table with program name as part of the key that does appear to be functional.  Any change to the hardcoded list would then be changed using SM30 against this table.  But we're wondering if this is the best way...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What are you using to avoid hardcoding or what ideas might you have???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 12:34:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388210#M1238680</guid>
      <dc:creator>ChadRichardson</dc:creator>
      <dc:date>2009-03-26T12:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: Best Way to Replace Hardcoded Values in Source</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388211#M1238681</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;I prapose you can make a CLUSTER TABLE for it...Pass the KEYS...like PROGRAM NAME in 1st layer then COMpany code in 2nd layer and in that you can maintain values....and write a FM to fetch the valus from that cluster table....values fetched can be used to replace hardcoding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope i am able to explain&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amresh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 12:51:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388211#M1238681</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T12:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Best Way to Replace Hardcoded Values in Source</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388212#M1238682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Chad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this a report which you are concerned with? If so, then may be you can have the &lt;U&gt;company codes, customer codes, shipping points&lt;/U&gt; in the selection-screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So that the user can i/p the values for which he wants to display the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 13:00:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388212#M1238682</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-03-26T13:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Best Way to Replace Hardcoded Values in Source</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388213#M1238683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would try to use selection options first, if not possible introduce custom config tables, if not possible introduce global constants (can be centralised in reusable includes, so just one place must to be updated in the future).&lt;/P&gt;&lt;P&gt;For the config tables, I would not choose program name as key, usually there is some relation between organizational criteria (e.g. find controlling area for a company code via TKA02).&lt;/P&gt;&lt;P&gt;You could quote an example case here for better understanding.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 13:05:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388213#M1238683</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-03-26T13:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Best Way to Replace Hardcoded Values in Source</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388214#M1238684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some are reports but others are user exits, includes and other objects that we would not have access to screen selection variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hidden screen selection variables do work for reports, but a lot of our changes are in other types of objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 14:01:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388214#M1238684</guid>
      <dc:creator>ChadRichardson</dc:creator>
      <dc:date>2009-03-26T14:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Best Way to Replace Hardcoded Values in Source</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388215#M1238685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For example...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of our main shipping label programs needs to ONLY do a specific subroutine for a set of customers.  Something like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF kunnr = '0000000001' OR&lt;/P&gt;&lt;P&gt; kunnr = '0000000002' OR&lt;/P&gt;&lt;P&gt; kunnr = '0000000003' OR&lt;/P&gt;&lt;P&gt; kunnr = '0000000004' OR&lt;/P&gt;&lt;P&gt; kunnr = '0000000005'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PERFORM Process_UPC.&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;Is a "config" table a specific type of table within SAP or is it just a Z-table used for a specific purpose???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 14:04:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388215#M1238685</guid>
      <dc:creator>ChadRichardson</dc:creator>
      <dc:date>2009-03-26T14:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Best Way to Replace Hardcoded Values in Source</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388216#M1238686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For this example I would consider an extension to the customer master (KNA1 if based only on customer number). You can append fields and also add them to the maintenance screens without modifying the standard. How about a new flag "specific &amp;lt;whatever&amp;gt; on shipping label" that can be set for the relevant customers? There is also a few existing attribute fields (KNA1-KATRx) that could be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, I was referring to Z-tables created as "sort of customizing" tables with table maintenance dialogs, and depending on the case with or without transport request handling. You could also solve the example problem with such a table. However, you will have more and more tables to maintain with this approach if you also apply it other cases. Of course you could maybe combine all settings relevant to customer master in one table. It's an extensive topic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 16:05:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388216#M1238686</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-03-26T16:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Best Way to Replace Hardcoded Values in Source</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388217#M1238687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Is a "config" table a specific type of table within SAP or is it just a Z-table used for a specific purpose???&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello Chad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Config" tables are ideally Std. SAP tables which can be maintained through customizing.(e.g., TCURR, T042Z). But in your case i feel you have to create a Z-table which has the values of the Vendors for which you need to trigger some code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 16:15:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388217#M1238687</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-03-26T16:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Best Way to Replace Hardcoded Values in Source</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388218#M1238688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We also had a long debate on the same issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We decided to try the Soft-Code values instead of the Hard Code.&lt;/P&gt;&lt;P&gt;1. Create some custom tables which can hold the constant values. Like: We have some special processing for the normal sales Order ZOR1 and different logic for the Returns order ZRE1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, we have created &lt;/P&gt;&lt;P&gt;One table for the Group - NORM, RETN&lt;/P&gt;&lt;P&gt;One table for the Sales Order &amp;amp; Group relation.&lt;/P&gt;&lt;P&gt;NORM - ZOR1&lt;/P&gt;&lt;P&gt;NORM - ZOR2...&lt;/P&gt;&lt;P&gt;RETN - ZRE1&lt;/P&gt;&lt;P&gt;RETN - ZRE2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a View Cluster to maintain these tables easily.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Create a Classes which can fatch this data&lt;/P&gt;&lt;P&gt;Like: VALID_SALES_ORDER_TYPE&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Definition-
Importing : 
  Sales Order type
  Group
Exporting
  Valid

Implementation-
  Get the value from the table Sales Order &amp;amp; group relation
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This class contains some other methods also, like VALID_GROUPS_4_SO, VALID_SO_4_GROUP etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Advantage: You can easily maitain a new Hardcoded value in the SM30&lt;/P&gt;&lt;P&gt;Disadvantage: Lots of coding&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Another Approch:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;You can create one Global class for Constants. You can maintain all your constants in that global class and use them in your coding. One main advantage would be, you can easily do the where used list on each individual constant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 16:26:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388218#M1238688</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2009-03-26T16:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: Best Way to Replace Hardcoded Values in Source</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388219#M1238689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the best option for you to maintain a custom table with constant values, where you can keep Program name / Field name / Index as primary key. You can write a FM through which you will copy all the data related to that program, at the very beginning of execution. We are working in this way, to avoid hardcoded value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kuntal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 16:31:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388219#M1238689</guid>
      <dc:creator>former_member376453</dc:creator>
      <dc:date>2009-03-26T16:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Best Way to Replace Hardcoded Values in Source</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388220#M1238690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can only stress again that I would make this &lt;EM&gt;independent&lt;/EM&gt; of program or other technical names. The same functional logic might appear in many different programs, multiplying the maintenance effort.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 16:35:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388220#M1238690</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-03-26T16:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Best Way to Replace Hardcoded Values in Source</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388221#M1238691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes Thomas - I agree maintenance effort is much in this case. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kuntal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 16:47:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388221#M1238691</guid>
      <dc:creator>former_member376453</dc:creator>
      <dc:date>2009-03-26T16:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Best Way to Replace Hardcoded Values in Source</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388222#M1238692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would agree.  By program name does have some limitations.  For example, a single program that has multiple conditions to be configured.  In that case we've configured the program name + "-1", "-2", "-3".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as not using the actual program name is concerned.  I supposed we could use some generic descriptor like "UPC Label Customers" instead of the program name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still even if we used the program name the config tied to that program name could be used in other programs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 17:38:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388222#M1238692</guid>
      <dc:creator>ChadRichardson</dc:creator>
      <dc:date>2009-03-26T17:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Best Way to Replace Hardcoded Values in Source</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388223#M1238693</link>
      <description>&lt;P&gt;Hi, we have one req very similar to this. can you please give an example of how to do this? so I could understand it better?&lt;/P&gt;&lt;P&gt;I already gave 1 constant (has multiple values) in the z table from sm30. now I want to use it in my program instead of hardcoding the values. &lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 19:13:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-way-to-replace-hardcoded-values-in-source/m-p/5388223#M1238693</guid>
      <dc:creator>harshitha-t</dc:creator>
      <dc:date>2023-04-24T19:13:04Z</dc:date>
    </item>
  </channel>
</rss>

