<?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: Code optimisation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-optimisation/m-p/8302269#M1635777</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;double posting!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is nothing to optimize, the LOOP is nonsense, if no MODIFY is done inside.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Nov 2011 09:11:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-11-08T09:11:50Z</dc:date>
    <item>
      <title>Code optimisation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-optimisation/m-p/8302267#M1635775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello folks, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone please advice mehow to make my codes below more efficient? I cant use a hash table due to non unique data. any help and advice is much appriciated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

    Types :
     BEGIN OF ty_0UCCONTRACT,
          FC_OPBEL TYPE /BI0/OIFC_OPBEL,
          FC_BLART TYPE /BI0/OIFC_BLART,
          UCCONTRACT TYPE /BI0/OIUCCONTRACT,
     END OF ty_0UCCONTRACT.

    TYPES:
    BEGIN OF l_s_logsys,
            LOGSYS TYPE RSDLOGSYS,
      END OF l_s_logsys.

    DATA : I_0UCCONTRACT TYPE STANDARD TABLE OF ty_0UCCONTRACT,
           WA_0UCCONTRACT like line of I_0UCCONTRACT.
    DATA: l_t_logsys TYPE l_s_logsys.

    IF NOT RESULT_PACKAGE IS INITIAL.

      SORT RESULT_PACKAGE BY FC_OPBEL.

      SELECT SINGLE  LOGSYS
              INTO CORRESPONDING FIELDS OF l_t_logsys
              FROM /BIC/AZBPI_D0100.

      SELECT FC_OPBEL FC_BLART UCCONTRACT
            FROM /BIC/AZBPI_D0100 INTO TABLE I_0UCCONTRACT
            FOR ALL ENTRIES IN RESULT_PACKAGE
            WHERE FC_OPBEL = RESULT_PACKAGE-FC_OPBEL AND LOGSYS =
            l_t_logsys-logsys.


    ENDIF.


    SORT I_0UCCONTRACT BY FC_OPBEL FC_BLART UCCONTRACT.

    LOOP AT RESULT_PACKAGE ASSIGNING &amp;lt;RESULT_FIELDS&amp;gt;.
      READ TABLE I_0UCCONTRACT INTO WA_0UCCONTRACT
                                   WITH KEY FC_OPBEL =
                                   &amp;lt;RESULT_FIELDS&amp;gt;-FC_OPBEL.
      IF SY-SUBRC EQ 0.
        &amp;lt;RESULT_FIELDS&amp;gt;-UCCONTRACT = WA_0UCCONTRACT-UCCONTRACT.
        &amp;lt;RESULT_FIELDS&amp;gt;-FC_BLART = WA_0UCCONTRACT-FC_BLART.
      ENDIF.

    ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2011 05:51:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-optimisation/m-p/8302267#M1635775</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-07T05:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Code optimisation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-optimisation/m-p/8302268#M1635776</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;   &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT I_0UCCONTRACT BY FC_OPBEL FC_BLART UCCONTRACT.
 
    LOOP AT RESULT_PACKAGE ASSIGNING &amp;lt;RESULT_FIELDS&amp;gt;.
      READ TABLE I_0UCCONTRACT INTO WA_0UCCONTRACT
                                   WITH KEY FC_OPBEL =
                                   &amp;lt;RESULT_FIELDS&amp;gt;-FC_OPBEL.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use a binary search for the read on I_0UCCONTRACT (or use a sorted table for it)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2011 06:14:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-optimisation/m-p/8302268#M1635776</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2011-11-07T06:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Code optimisation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-optimisation/m-p/8302269#M1635777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;double posting!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is nothing to optimize, the LOOP is nonsense, if no MODIFY is done inside.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 09:11:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-optimisation/m-p/8302269#M1635777</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-08T09:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Code optimisation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-optimisation/m-p/8302270#M1635778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Siegfried,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field symbols have been used in the loop and with that i don't think a Modify statement is required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check again!!&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;Pranav.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 09:33:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-optimisation/m-p/8302270#M1635778</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-08T09:33:51Z</dc:date>
    </item>
  </channel>
</rss>

