<?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: Performance problem in This program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-this-program/m-p/2331906#M513196</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;just remove joins and use for all entries.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;use delete adjacent duplicates from itab comparing key fields.(it will increase performance)&lt;/P&gt;&lt;P&gt;then write another select statement.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;some tips:&lt;/P&gt;&lt;P&gt;Always check the driver internal tables is not empty, while using FOR ALL ENTRIES&lt;/P&gt;&lt;P&gt;Avoid for all entries in JOINS&lt;/P&gt;&lt;P&gt;Try to avoid joins and use FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;Try to restrict the joins to 1 level only ie only for tables&lt;/P&gt;&lt;P&gt;Avoid using Select *.&lt;/P&gt;&lt;P&gt;Avoid having multiple Selects from the same table in the same object.&lt;/P&gt;&lt;P&gt;Try to minimize the number of variables to save memory. &lt;/P&gt;&lt;P&gt;The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)&lt;/P&gt;&lt;P&gt;Avoid creation of index as far as possible&lt;/P&gt;&lt;P&gt;Avoid operators like &amp;lt;&amp;gt;, &amp;gt; , &amp;lt; &amp;amp; like % in where clause conditions&lt;/P&gt;&lt;P&gt;Avoid select/select single statements in loops.&lt;/P&gt;&lt;P&gt;Try to use 'binary search' in READ internal table. Ensure table is sorted before using BINARY SEARCH.&lt;/P&gt;&lt;P&gt;Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,) &lt;/P&gt;&lt;P&gt;Avoid using ORDER BY in selects&lt;/P&gt;&lt;P&gt;Avoid Nested Selects &lt;/P&gt;&lt;P&gt;Avoid Nested Loops of Internal Tables&lt;/P&gt;&lt;P&gt;Try to use FIELD SYMBOLS.&lt;/P&gt;&lt;P&gt;Try to avoid into Corresponding Fields of&lt;/P&gt;&lt;P&gt;Avoid using Select Distinct, Use DELETE ADJACENT&lt;/P&gt;&lt;P&gt;Go through the following Document&lt;/P&gt;&lt;P&gt;Check the following Links&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1591512"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1429297"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/performance.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/performance.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.thespot4sap.com/Articles/SAPABAPPerformanceTunin" target="test_blank"&gt;http://www.thespot4sap.com/Articles/SAPABAPPerformanceTunin&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Jun 2007 04:59:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-01T04:59:41Z</dc:date>
    <item>
      <title>Performance problem in This program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-this-program/m-p/2331900#M513190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends ,&lt;/P&gt;&lt;P&gt;              Below is the one of the perform in my program which is taking more time .. Can you please suggest me to find a solution to take less time for execution. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Adv .&lt;/P&gt;&lt;P&gt;Varma ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: l_count TYPE i.&lt;/P&gt;&lt;P&gt;  SELECT m~customer&lt;/P&gt;&lt;P&gt;         m~name&lt;/P&gt;&lt;P&gt;         m~payer&lt;/P&gt;&lt;P&gt;         t~txtmd&lt;/P&gt;&lt;P&gt;    INTO TABLE gt_cust2&lt;/P&gt;&lt;P&gt;    FROM /bi0/pcustomer AS m&lt;/P&gt;&lt;P&gt;    JOIN /bi0/tcustomer AS t&lt;/P&gt;&lt;P&gt;      ON m&lt;SUB&gt;customer EQ t&lt;/SUB&gt;customer&lt;/P&gt;&lt;P&gt;   WHERE m~objvers   EQ 'A'&lt;/P&gt;&lt;P&gt;     AND m~accnt_grp NE space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SORT gt_cust2 BY customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT m~customer&lt;/P&gt;&lt;P&gt;         m~name&lt;/P&gt;&lt;P&gt;         m~payer&lt;/P&gt;&lt;P&gt;         t~txtmd&lt;/P&gt;&lt;P&gt;    INTO TABLE gt_cust&lt;/P&gt;&lt;P&gt;    FROM /bi0/pcustomer AS m&lt;/P&gt;&lt;P&gt;    JOIN /bi0/tcustomer AS t&lt;/P&gt;&lt;P&gt;      ON m&lt;SUB&gt;customer EQ t&lt;/SUB&gt;customer&lt;/P&gt;&lt;P&gt;   WHERE m~objvers   EQ 'A'&lt;/P&gt;&lt;P&gt;     AND m~accnt_grp IN s_ktokd&lt;/P&gt;&lt;P&gt;     AND m~payer     NE space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    SORT gt_cust BY customer.&lt;/P&gt;&lt;P&gt;    LOOP AT gt_cust.&lt;/P&gt;&lt;P&gt;      CLEAR l_count.&lt;/P&gt;&lt;P&gt;      LOOP AT gt_cust2 WHERE payer = gt_cust-payer.&lt;/P&gt;&lt;P&gt;        ADD 1 TO l_count.&lt;/P&gt;&lt;P&gt;        IF l_count &amp;gt; 1.&lt;/P&gt;&lt;P&gt;          EXIT.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;      gt_soldto-customer = gt_cust-customer.&lt;/P&gt;&lt;P&gt;      gt_soldto-payer    = gt_payer-payer = gt_cust-payer.&lt;/P&gt;&lt;P&gt;      IF l_count &amp;gt; 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Payer found&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        CLEAR gt_cust2.&lt;/P&gt;&lt;P&gt;        READ TABLE gt_cust2 WITH KEY customer = gt_cust-payer&lt;/P&gt;&lt;P&gt;                            BINARY SEARCH.&lt;/P&gt;&lt;P&gt;        IF NOT gt_cust2-name IS INITIAL.&lt;/P&gt;&lt;P&gt;          gt_payer-name  = gt_cust2-name.&lt;/P&gt;&lt;P&gt;        ELSE.&lt;/P&gt;&lt;P&gt;          gt_payer-name  = gt_cust2-txtmd.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Stand alone customer&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        gt_soldto-payer = gt_payer-payer = p_nonpyr.&lt;/P&gt;&lt;P&gt;        gt_payer-name   = p_nonpnm.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;      COLLECT: gt_soldto,&lt;/P&gt;&lt;P&gt;               gt_payer.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;    SORT: gt_soldto,&lt;/P&gt;&lt;P&gt;          gt_payer.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 11:40:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-this-program/m-p/2331900#M513190</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-31T11:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Performance problem in This program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-this-program/m-p/2331901#M513191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check with following things in your progam&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1-Use Move corresponding in all the select statement.&lt;/P&gt;&lt;P&gt;2-If you r reading single field from the table than mention that field name in the select statement rather than select all the fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 12:24:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-this-program/m-p/2331901#M513191</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-31T12:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Performance problem in This program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-this-program/m-p/2331902#M513192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Varma,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Always use Joins in an appropriate situation. Always split the complex and time consuming queries and use FOR ALL ENTRIES instead of using JOINS. Try to write your code as below, I think this may help you. Try to avoid nested LOOPs, instead use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB1......&lt;/P&gt;&lt;P&gt;   READ TABLE ITAB2.......&lt;/P&gt;&lt;P&gt;   .....................................&lt;/P&gt;&lt;P&gt;   .....................................&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT customer name payer FROM /bi0/pcustomer INTO TABLE it_pcustomer&lt;/P&gt;&lt;P&gt;WHERE objvers EQ 'A'&lt;/P&gt;&lt;P&gt;AND accnt_grp IN s_ktokd&lt;/P&gt;&lt;P&gt;AND payer NE space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;if you don't want duplicates in IT_PCUSTOMER uncomment below two lines&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;sort it_pcustomer by customer.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;delete adjacent duplicates from it_pcustomer comparing customer.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF it_pcustomer[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;  SELECT txtmd FROM /bi0/tcustomer INTO TABLE it_tcustomer&lt;/P&gt;&lt;P&gt;  FOR ALL ENTRIES IN it_pcustomer&lt;/P&gt;&lt;P&gt;  WHERE customer = it_pcustomer-customer.&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;Reward with points if the solution is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Venkat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 12:26:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-this-program/m-p/2331902#M513192</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-31T12:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: Performance problem in This program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-this-program/m-p/2331903#M513193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Venkat ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         In above code m~accnt_grp IN s_ktokd in one select is there and &lt;/P&gt;&lt;P&gt;                              m~accnt_grp NE space is in another select &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can we do it ???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 12:44:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-this-program/m-p/2331903#M513193</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-31T12:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Performance problem in This program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-this-program/m-p/2331904#M513194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have a couple of potential problems - the SELECTs and the nested LOOPs. Have you done a performance trace to pinpoint the problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 13:54:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-this-program/m-p/2331904#M513194</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-31T13:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Performance problem in This program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-this-program/m-p/2331905#M513195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi varma,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use for all entries instead of inner join,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and try to avoid nested loops instead u can use read statement in the loop.&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;seshu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2007 04:53:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-this-program/m-p/2331905#M513195</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-01T04:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Performance problem in This program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-this-program/m-p/2331906#M513196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;just remove joins and use for all entries.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;use delete adjacent duplicates from itab comparing key fields.(it will increase performance)&lt;/P&gt;&lt;P&gt;then write another select statement.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;some tips:&lt;/P&gt;&lt;P&gt;Always check the driver internal tables is not empty, while using FOR ALL ENTRIES&lt;/P&gt;&lt;P&gt;Avoid for all entries in JOINS&lt;/P&gt;&lt;P&gt;Try to avoid joins and use FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;Try to restrict the joins to 1 level only ie only for tables&lt;/P&gt;&lt;P&gt;Avoid using Select *.&lt;/P&gt;&lt;P&gt;Avoid having multiple Selects from the same table in the same object.&lt;/P&gt;&lt;P&gt;Try to minimize the number of variables to save memory. &lt;/P&gt;&lt;P&gt;The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)&lt;/P&gt;&lt;P&gt;Avoid creation of index as far as possible&lt;/P&gt;&lt;P&gt;Avoid operators like &amp;lt;&amp;gt;, &amp;gt; , &amp;lt; &amp;amp; like % in where clause conditions&lt;/P&gt;&lt;P&gt;Avoid select/select single statements in loops.&lt;/P&gt;&lt;P&gt;Try to use 'binary search' in READ internal table. Ensure table is sorted before using BINARY SEARCH.&lt;/P&gt;&lt;P&gt;Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,) &lt;/P&gt;&lt;P&gt;Avoid using ORDER BY in selects&lt;/P&gt;&lt;P&gt;Avoid Nested Selects &lt;/P&gt;&lt;P&gt;Avoid Nested Loops of Internal Tables&lt;/P&gt;&lt;P&gt;Try to use FIELD SYMBOLS.&lt;/P&gt;&lt;P&gt;Try to avoid into Corresponding Fields of&lt;/P&gt;&lt;P&gt;Avoid using Select Distinct, Use DELETE ADJACENT&lt;/P&gt;&lt;P&gt;Go through the following Document&lt;/P&gt;&lt;P&gt;Check the following Links&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1591512"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1429297"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/performance.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/performance.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.thespot4sap.com/Articles/SAPABAPPerformanceTunin" target="test_blank"&gt;http://www.thespot4sap.com/Articles/SAPABAPPerformanceTunin&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2007 04:59:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-this-program/m-p/2331906#M513196</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-01T04:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Performance problem in This program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-this-program/m-p/2331907#M513197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: l_count TYPE i.&lt;/P&gt;&lt;P&gt;SELECT m~customer&lt;/P&gt;&lt;P&gt;m~name&lt;/P&gt;&lt;P&gt;m~payer&lt;/P&gt;&lt;P&gt;m~accnt_grp &lt;/P&gt;&lt;P&gt;t~txtmd&lt;/P&gt;&lt;P&gt;INTO TABLE gt_cust&lt;/P&gt;&lt;P&gt;FROM /bi0/pcustomer AS m&lt;/P&gt;&lt;P&gt;JOIN /bi0/tcustomer AS t&lt;/P&gt;&lt;P&gt;ON m&lt;SUB&gt;customer EQ t&lt;/SUB&gt;customer&lt;/P&gt;&lt;P&gt;WHERE m~objvers EQ 'A'&lt;/P&gt;&lt;P&gt;AND m~accnt_grp IN s_ktokd&lt;/P&gt;&lt;P&gt;AND m~payer NE space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;DELETE gt_cust where accnt_grp EQ space.&lt;/P&gt;&lt;P&gt;SORT gt_cust BY payer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear l_count.&lt;/P&gt;&lt;P&gt;LOOP AT gt_cust .&lt;/P&gt;&lt;P&gt;gt_soldto-customer = gt_cust-customer.&lt;/P&gt;&lt;P&gt;gt_soldto-payer = gt_payer-payer = gt_cust-payer.&lt;/P&gt;&lt;P&gt;ADD 1 TO l_count.&lt;/P&gt;&lt;P&gt;if l_count = 1.&lt;/P&gt;&lt;P&gt;g_payer = gt_cust-payer.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;if g_payer = gt_cust-payer.&lt;/P&gt;&lt;P&gt;IF NOT gt_cust-name IS INITIAL.&lt;/P&gt;&lt;P&gt;gt_payer-name = gt_cust-name.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;gt_payer-name = gt_cust-txtmd.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;clear : g_payer ,&lt;/P&gt;&lt;P&gt;          l_count.          &lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Stand alone customer&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;gt_soldto-payer = gt_payer-payer = p_nonpyr.&lt;/P&gt;&lt;P&gt;gt_payer-name = p_nonpnm.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;COLLECT: gt_soldto,&lt;/P&gt;&lt;P&gt;                 gt_payer.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;SORT: gt_soldto,&lt;/P&gt;&lt;P&gt;           gt_payer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have not done a syntax check for this. But this should help you in some way.&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;&lt;P&gt;shivika&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jun 2007 23:22:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-problem-in-this-program/m-p/2331907#M513197</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-05T23:22:45Z</dc:date>
    </item>
  </channel>
</rss>

