<?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: Best practices for coding in Exits in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-practices-for-coding-in-exits/m-p/834680#M43755</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I can explain why 'check' statement should not be used in certain contexts in Exits. Assume the code in an Exit is as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;1st independent condition&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;check sy-tcode = 'VA01'.&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;2nd independent condition&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if sy-tcode = 'VA02'.&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;Here Block 2 is expected to be executed for va02 but it never happens since the check condition for the transaction fails.&lt;/P&gt;&lt;P&gt;So the following code should be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;1st independent condition&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if sy-tcode = 'VA01'.&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;2nd independent condition&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if sy-tcode = 'VA02'.&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;bye&lt;/P&gt;&lt;P&gt;Madhavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Nov 2004 06:48:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2004-11-19T06:48:03Z</dc:date>
    <item>
      <title>Best practices for coding in Exits</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-practices-for-coding-in-exits/m-p/834676#M43751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anyone have any documents on the Dos and Don'ts in BADIs, Exits and SD routines from the angle of System performance and how to minimise the load. Iam not talking about the generic Optimisation documents but something specific to SD routines and general BADIs and Exits which fall under the Best practices (coding) of SAP. eg. One guideline from SAP is that Clients should not tamper with the 'x' variables (xvbak, xvbap etc.) in the SD form exits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Madhavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2004 06:27:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-practices-for-coding-in-exits/m-p/834676#M43751</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-11-17T06:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Best practices for coding in Exits</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-practices-for-coding-in-exits/m-p/834677#M43752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;a) do not rely on/change data which is not passed as (changing) parameters&lt;/P&gt;&lt;P&gt;b) do not use commit work&lt;/P&gt;&lt;P&gt;c) keep in mind that ue is active in every client, once the project has been actiavted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2004 12:34:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-practices-for-coding-in-exits/m-p/834677#M43752</guid>
      <dc:creator>ChristianFi</dc:creator>
      <dc:date>2004-11-17T12:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Best practices for coding in Exits</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-practices-for-coding-in-exits/m-p/834678#M43753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Madhavan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I like to add one more suggestion.&lt;/P&gt;&lt;P&gt;Don't use CHECK command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2004 13:31:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-practices-for-coding-in-exits/m-p/834678#M43753</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-11-17T13:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Best practices for coding in Exits</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-practices-for-coding-in-exits/m-p/834679#M43754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure why check is a problem in general however it reminds me on another tricky situation. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For exampele there is a user-exit in CO-PA&lt;/P&gt;&lt;P&gt;     call customer-function '001'&lt;/P&gt;&lt;P&gt;           exporting&lt;/P&gt;&lt;P&gt;                erkrs           = i_erkrs&lt;/P&gt;&lt;P&gt;                ep_source       = &amp;lt;ls_ce1xxxx&amp;gt;&lt;/P&gt;&lt;P&gt;                ep_source_bukrs = &amp;lt;gs_ce_bukrs&amp;gt;&lt;/P&gt;&lt;P&gt;                exit_nr         = i_exit_nr&lt;/P&gt;&lt;P&gt;           importing&lt;/P&gt;&lt;P&gt;                ep_target         = &amp;lt;ls_ce1xxxx&amp;gt;&lt;/P&gt;&lt;P&gt;                ep_target_bukrs   = &amp;lt;gs_ce_bukrs&amp;gt;&lt;/P&gt;&lt;P&gt;                e_bukrs_processed = l_bukrs_processed&lt;/P&gt;&lt;P&gt;                et_field          = gt_field_user&lt;/P&gt;&lt;P&gt;           tables&lt;/P&gt;&lt;P&gt;                gt_message_table = gt_message_table&lt;/P&gt;&lt;P&gt;           exceptions&lt;/P&gt;&lt;P&gt;                others    = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as you can see &amp;lt;ls_ce1xxxx&amp;gt; is passed on ep_source and ep_target. If you have several clients but only one in which the user-exit should be active,  you usually encapsulate your coding like following. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-mandt = '100'.&lt;/P&gt;&lt;P&gt;  ep_target = &amp;lt;changed_values&amp;gt;.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;But in this case you will learn that in every other client the values of ep_source will be cleared if you do not add a statement like ep_target = ep_source.&lt;/P&gt;&lt;P&gt;before the if statement. &lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Nov 2004 12:14:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-practices-for-coding-in-exits/m-p/834679#M43754</guid>
      <dc:creator>ChristianFi</dc:creator>
      <dc:date>2004-11-18T12:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Best practices for coding in Exits</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/best-practices-for-coding-in-exits/m-p/834680#M43755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I can explain why 'check' statement should not be used in certain contexts in Exits. Assume the code in an Exit is as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;1st independent condition&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;check sy-tcode = 'VA01'.&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;2nd independent condition&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if sy-tcode = 'VA02'.&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;Here Block 2 is expected to be executed for va02 but it never happens since the check condition for the transaction fails.&lt;/P&gt;&lt;P&gt;So the following code should be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;1st independent condition&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if sy-tcode = 'VA01'.&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;2nd independent condition&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if sy-tcode = 'VA02'.&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;bye&lt;/P&gt;&lt;P&gt;Madhavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Nov 2004 06:48:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/best-practices-for-coding-in-exits/m-p/834680#M43755</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-11-19T06:48:03Z</dc:date>
    </item>
  </channel>
</rss>

