<?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: Still not solved problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409211#M537237</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Before you do the first SELECT, make sure that select-option or range table vbeln is not empty. For the subsequent SELECTs, make sure that the FOR ALL ENTRIES tables are not empty; otherwise, it will select all and not be able to use the index.&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, 28 Jun 2007 13:19:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-28T13:19:31Z</dc:date>
    <item>
      <title>Still not solved problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409206#M537232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using 6 tables in my report.i want to display recores by AT NEW and Related stuff.&lt;/P&gt;&lt;P&gt;Can i use following code for query and internal tables ?&lt;/P&gt;&lt;P&gt;or Sujjest me Better code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to use loop within loop is not good idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to disply Records &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;total Document type wise -&amp;gt;year wise -&amp;gt; Month wise -&amp;gt; Sales Order Number wise-&amp;gt;Item Numberwise -&amp;gt; Production order numberwise&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is interactive report of 8-9 screens !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Main problem is to make AT new with different loop !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sujjest me with code !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points will be rewarded soon !!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nimesh Master &lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="29" type="ul"&gt;&lt;P&gt;TABLE DECLARATION ************************&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;TABLES : VBAK,AFPO,AUFM,MAKT,KNA1,VBAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="25" type="ul"&gt;&lt;P&gt;INTERNAL TABLE DECLARATION *******************&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;DATA : BEGIN OF T1 OCCURS 0,&lt;/P&gt;&lt;P&gt;AUART TYPE VBAK-AUART,&lt;/P&gt;&lt;P&gt;NETWR TYPE VBAK-NETWR,&lt;/P&gt;&lt;P&gt;KUNNR TYPE VBAK-KUNNR,&lt;/P&gt;&lt;P&gt;VBELN TYPE VBAK-VBELN,&lt;/P&gt;&lt;P&gt;AUDAT TYPE VBAK-AUDAT,&lt;/P&gt;&lt;P&gt;END OF T1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF T2 OCCURS 0,&lt;/P&gt;&lt;P&gt;NETWR TYPE VBAP-NETWR,&lt;/P&gt;&lt;P&gt;POSNR TYPE VBAP-POSNR,&lt;/P&gt;&lt;P&gt;END OF T2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF T3 OCCURS 0,&lt;/P&gt;&lt;P&gt;AUFNR TYPE AFPO-AUFNR,&lt;/P&gt;&lt;P&gt;KDPOS TYPE AFPO-KDPOS,&lt;/P&gt;&lt;P&gt;KDAUF TYPE AFPO-KDAUF,&lt;/P&gt;&lt;P&gt;PSMNG TYPE AFPO-PSMNG,&lt;/P&gt;&lt;P&gt;WEMNG TYPE AFPO-WEMNG,&lt;/P&gt;&lt;P&gt;END OF T3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF T4 OCCURS 0,&lt;/P&gt;&lt;P&gt;DMBTR TYPE AUFM-DMBTR,&lt;/P&gt;&lt;P&gt;MATNR TYPE AUFM-MATNR,&lt;/P&gt;&lt;P&gt;ELIKZ TYPE AUFM-ELIKZ,&lt;/P&gt;&lt;P&gt;END OF T4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF T5 OCCURS 0,&lt;/P&gt;&lt;P&gt;NAME1 TYPE KNA1-NAME1,&lt;/P&gt;&lt;P&gt;END OF T5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF T6 OCCURS 0,&lt;/P&gt;&lt;P&gt;MAKTX TYPE MAKT-MAKTX,&lt;/P&gt;&lt;P&gt;END OF T6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FREE T1.&lt;/P&gt;&lt;P&gt;SELECT VBELN NETWR AUART AUDAT KUNNR FROM VBAK INTO CORRESPONDING FIELDS&lt;/P&gt;&lt;P&gt;OF TABLE T1 WHERE AUART IN AUART AND VBELN IN VBELN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FREE T2.&lt;/P&gt;&lt;P&gt;SELECT NETWR POSNR FROM VBAP INTO CORRESPONDING FIELDS OF TABLE T2&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN T1 WHERE VBELN = T1-VBELN .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FREE T3.&lt;/P&gt;&lt;P&gt;SELECT AUFNR PSMNG WEMNG KDPOS FROM AFPO INTO CORRESPONDING FIELDS OF&lt;/P&gt;&lt;P&gt;TABLE T3 FOR ALL ENTRIES IN T1 WHERE KDAUF = T1-VBELN .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FREE T4.&lt;/P&gt;&lt;P&gt;SELECT DMBTR MATNR ELIKZ FROM AUFM INTO CORRESPONDING FIELDS OF&lt;/P&gt;&lt;P&gt;TABLE T4 FOR ALL ENTRIES IN T3 WHERE AUFNR = T3-AUFNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FREE T6.&lt;/P&gt;&lt;P&gt;SELECT MAKTX FROM MAKT INTO CORRESPONDING FIELDS OF TABLE T6 WHERE&lt;/P&gt;&lt;P&gt;MATNR = T4-MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FREE T5.&lt;/P&gt;&lt;P&gt;SELECT NAME1 FROM KNA1 INTO CORRESPONDING FIELDS OF TABLE T5 WHERE&lt;/P&gt;&lt;P&gt;KUNNR = T1-KUNNR. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT T1.&lt;/P&gt;&lt;P&gt;    AT NEW VBELN.&lt;/P&gt;&lt;P&gt;     WRITE : / T1-VBELN .&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;   AT NEW AUFNR.&lt;/P&gt;&lt;P&gt;      WRITE : / T1-AUFNR.&lt;/P&gt;&lt;P&gt;   ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    AT END OF AUFNR.&lt;/P&gt;&lt;P&gt;      SUM.&lt;/P&gt;&lt;P&gt;      IF T1-PSMNG = T1-WEMNG.&lt;/P&gt;&lt;P&gt;        T1-CLOSE_ORD1 = T1-CLOSE_ORD1 + T1-DMBTR.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;        T1-OPEN_ORD1 = T1-OPEN_ORD1 + T1-DMBTR.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;      TOT_DMBTR_C = TOT_DMBTR_C + T1-CLOSE_ORD1.&lt;/P&gt;&lt;P&gt;      TOT_DMBTR_O = TOT_DMBTR_O + T1-OPEN_ORD1 .&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    AT END OF VBELN.&lt;/P&gt;&lt;P&gt;      SUM.&lt;/P&gt;&lt;P&gt;      P =  TOT_DMBTR_C.&lt;/P&gt;&lt;P&gt;      Q =  TOT_DMBTR_O.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      TMP_OC_SALES  = NET_PRICE - P.&lt;/P&gt;&lt;P&gt;        TMP_PER_SALES = ( TMP_OC_SALES * 100 ) / NET_PRICE .&lt;/P&gt;&lt;P&gt;        TMP_TOT_MAT =  P + Q.&lt;/P&gt;&lt;P&gt;        TMP_PER_MAT = ( TMP_TOT_MAT  * 100 ) / NET_PRICE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        TOT_NET_SALES_A = TOT_NET_SALES_A + NET_PRICE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        TOT_P_A = TOT_P_A + P.&lt;/P&gt;&lt;P&gt;        TOT_Q_A = TOT_Q_A + Q.&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;      FORMAT COLOR 2 ON.&lt;/P&gt;&lt;P&gt;      WRITE : 20 NET_PRICE,&lt;/P&gt;&lt;P&gt;              50 P,&lt;/P&gt;&lt;P&gt;              65 Q,&lt;/P&gt;&lt;P&gt;              83 TMP_OC_SALES,&lt;/P&gt;&lt;P&gt;              100 TMP_PER_SALES,'%',&lt;/P&gt;&lt;P&gt;              120 TMP_TOT_MAT ,&lt;/P&gt;&lt;P&gt;              139 TMP_PER_MAT,'%'.&lt;/P&gt;&lt;P&gt;      FORMAT COLOR 2 OFF.&lt;/P&gt;&lt;P&gt;    ENDAT.&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;1. Tell me is it appropriate to take same number of INTERNAL TABLE as DDIC   &lt;/P&gt;&lt;P&gt;    TABLE ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Wat should be the queries for them ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. How i use AT NEW with Different Loop for Internal tables ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 04:51:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409206#M537232</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T04:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Still not solved problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409207#M537233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nimesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Tell me is it appropriate to take same number of INTERNAL TABLE as DDIC &lt;/P&gt;&lt;P&gt;TABLE ??&lt;/P&gt;&lt;P&gt;- Not necessary. You can use join so that the number of table can be reduced. To use join or not depends on the tables and the number of entries expected.&lt;/P&gt;&lt;P&gt;2. Wat should be the queries for them ?&lt;/P&gt;&lt;P&gt;Answered in 1.&lt;/P&gt;&lt;P&gt;3. How i use AT NEW with Different Loop for Internal tables ?? &lt;/P&gt;&lt;P&gt;_ if you have diffrent internal tables and you want use them in the final output, don't use AT NEW use READ statement. It is easy to use and performance will be very good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 04:56:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409207#M537233</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T04:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Still not solved problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409208#M537234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am new bie in this performance tunning so can u sujjest me queries and read table code.?&lt;/P&gt;&lt;P&gt;So, after that i will follow same format for further projects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;n.Master&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 05:06:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409208#M537234</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T05:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Still not solved problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409209#M537235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Performance Tuning&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Dont use nested select statements&lt;/P&gt;&lt;P&gt;2) If possible use for all entries in addition&lt;/P&gt;&lt;P&gt;3) In the where addition make sure you give all the primary key&lt;/P&gt;&lt;P&gt;4) Use Index for the selection criteria.&lt;/P&gt;&lt;P&gt;5) You can also use inner joins&lt;/P&gt;&lt;P&gt;6) You can try to put the data from the first select statement into an Itab and then in order to select the data from the second table use for all entries in.&lt;/P&gt;&lt;P&gt;7) Use the runtime analysis SE30 and SQL Trace (ST05) to identify the performance and also to identify where the load is heavy, so that you can change the code accordingly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5d0db4c9-0e01-0010-b68f-9b1408d5f234" target="test_blank"&gt;https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5d0db4c9-0e01-0010-b68f-9b1408d5f234&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP performance depends upon various factors and in devicded in three parts:&lt;/P&gt;&lt;P&gt;1. Database&lt;/P&gt;&lt;P&gt;2. ABAP &lt;/P&gt;&lt;P&gt;3. System&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Run Any program using SE30 (performance analys) to improve performance refer to tips and trics section of SE30, Always remember that ABAP perfirmance is improved when there is least load on Database.&lt;/P&gt;&lt;P&gt;u can get an interactive grap in SE30 regarding this with a file.&lt;/P&gt;&lt;P&gt;also if u find runtime of parts of codes then use :&lt;/P&gt;&lt;P&gt;Switch on RTA Dynamically within ABAP Code &lt;/P&gt;&lt;P&gt;*To turn runtim analysis on within ABAP code insert the following code&lt;/P&gt;&lt;P&gt;SET RUN TIME ANALYZER ON.&lt;/P&gt;&lt;P&gt;*To turn runtim analysis off within ABAP code insert the following code&lt;/P&gt;&lt;P&gt;SET RUN TIME ANALYZER OFF.&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;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/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp" target="test_blank"&gt;http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;check the below link&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm" target="test_blank"&gt;http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;See the following link if it's any help:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp" target="test_blank"&gt;http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Check also &lt;A href="http://service.sap.com/performance" target="test_blank"&gt;http://service.sap.com/performance&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;P&gt;books like&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-press.com/product.cfm?account=&amp;amp;product=H951" target="test_blank"&gt;http://www.sap-press.com/product.cfm?account=&amp;amp;product=H951&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-press.com/product.cfm?account=&amp;amp;product=H973" target="test_blank"&gt;http://www.sap-press.com/product.cfm?account=&amp;amp;product=H973&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm" target="test_blank"&gt;http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp" target="test_blank"&gt;http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Performance tuning for Data Selection Statement &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm" target="test_blank"&gt;http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Debugger&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc" target="test_blank"&gt;http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Run Time Analyser&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL trace&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/d1/801f7c454211d189710000e8322d00/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/d1/801f7c454211d189710000e8322d00/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CATT - Computer Aided Testing Too&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/b3/410b37233f7c6fe10000009b38f936/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/b3/410b37233f7c6fe10000009b38f936/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Test Workbench&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/a8/157235d0fa8742e10000009b38f889/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/a8/157235d0fa8742e10000009b38f889/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Coverage Analyser&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/c7/af9a79061a11d4b3d4080009b43351/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/c7/af9a79061a11d4b3d4080009b43351/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Runtime Monitor&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/b5/fa121cc15911d5993d00508b6b8b11/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/b5/fa121cc15911d5993d00508b6b8b11/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Memory Inspector&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/a2/e5fc84cc87964cb2c29f584152d74e/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/a2/e5fc84cc87964cb2c29f584152d74e/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ECATT - Extended Computer Aided testing tool.&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/20/e81c3b84e65e7be10000000a11402f/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/20/e81c3b84e65e7be10000000a11402f/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Just refer to these links...&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="84514"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="23912"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="142272"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="131727"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="84583"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="145177"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="148874"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="151144"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can go to the transaction SE30 to have the runtime analysis of your program.Also try the transaction SCI , which is SAP Code Inspector.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points for useful Answers&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 06:21:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409209#M537235</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T06:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Still not solved problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409210#M537236</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 want to suggest few points according to your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1). In the select query you have written.. you are using into corresponding fields of itb..which reduces the performance. instead create the internal table with the fields u want from the table on which u r writing a select query.. and according to that order create the internal table.&lt;/P&gt;&lt;P&gt;2).Before using control break statements, the best approach is to sort the internal table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Answers to your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1).Tell me is it appropriate to take same number of INTERNAL TABLE as DDIC &lt;/P&gt;&lt;P&gt;TABLE ??&lt;/P&gt;&lt;P&gt;A). Not necessarily as suggested by one of our friend. You can use joins ( though its not best method when it comes to performance)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 06:23:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409210#M537236</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T06:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Still not solved problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409211#M537237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Before you do the first SELECT, make sure that select-option or range table vbeln is not empty. For the subsequent SELECTs, make sure that the FOR ALL ENTRIES tables are not empty; otherwise, it will select all and not be able to use the index.&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, 28 Jun 2007 13:19:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409211#M537237</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T13:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Still not solved problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409212#M537238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can any one put standard code format for this example which i can use in further reports also?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will be helpful in future also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Give me the code for this problem .ie. example of creating internal table , creating such 5 tables query, loop with internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CAUTION : Performance should be fast.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 04:34:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409212#M537238</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T04:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Still not solved problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409213#M537239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nimesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just can you give yourself a try based on all the suggestions and come up with code so that we can do the required changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 04:43:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409213#M537239</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T04:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Still not solved problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409214#M537240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i tried !! but some people say USE INNER JOIN , some say NOT USE INNER JOIN.and such thing for other stuff&lt;/P&gt;&lt;P&gt;so i m comfused related to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so i get proper format with mant tables query stuff. then i will use it further as per performance !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;N.Master&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 05:03:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409214#M537240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T05:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Still not solved problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409215#M537241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am gving u the silmilar kind of code where i used 4-5 tables.&lt;/P&gt;&lt;P&gt;1&amp;gt; used for all entries tat will increase the performance&lt;/P&gt;&lt;P&gt;2&amp;gt; use read instead of at&lt;/P&gt;&lt;P&gt;3&amp;gt; use work area&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZBH_FI_ALV1 No Standard Page Heading.&lt;/P&gt;&lt;P&gt;TABLES:T001,SKA1,SKB1,BKPF,BSEG.&lt;/P&gt;&lt;P&gt;TYPE-POOLS:slis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               TYPES DECLARTIONS&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:begin of str_bkpf,&lt;/P&gt;&lt;P&gt;      blart type blart,&lt;/P&gt;&lt;P&gt;      bukrs type bukrs,&lt;/P&gt;&lt;P&gt;      belnr type bseg-belnr,&lt;/P&gt;&lt;P&gt;      gjahr type gjahr,&lt;/P&gt;&lt;P&gt;      budat type budat,&lt;/P&gt;&lt;P&gt;      end of str_bkpf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: begin of str_bseg,&lt;/P&gt;&lt;P&gt;       belnr type belnr_d,&lt;/P&gt;&lt;P&gt;       gjahr type gjahr,&lt;/P&gt;&lt;P&gt;       buzei type buzei,&lt;/P&gt;&lt;P&gt;       bschl type bschl,&lt;/P&gt;&lt;P&gt;       hkont type hkont,&lt;/P&gt;&lt;P&gt;       bukrs type bukrs,&lt;/P&gt;&lt;P&gt;       blart type blart,&lt;/P&gt;&lt;P&gt;       budat type bkpf-budat,&lt;/P&gt;&lt;P&gt;       saknr type saknr,&lt;/P&gt;&lt;P&gt;       fstag type fstag,&lt;/P&gt;&lt;P&gt;       ktopl type ktopl,&lt;/P&gt;&lt;P&gt;       bilkt type bilkt,&lt;/P&gt;&lt;P&gt;       end of str_bseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:begin of str_t001,&lt;/P&gt;&lt;P&gt;      bukrs type bukrs,&lt;/P&gt;&lt;P&gt;      ktopl type ktopl,&lt;/P&gt;&lt;P&gt;      end of str_t001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:begin of str_ska1,&lt;/P&gt;&lt;P&gt;      bilkt type bilkt,&lt;/P&gt;&lt;P&gt;      ktopl type ktopl,&lt;/P&gt;&lt;P&gt;      saknr type saknr,&lt;/P&gt;&lt;P&gt;      end of str_ska1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:begin of str_skb1,&lt;/P&gt;&lt;P&gt;      fstag type fstag,&lt;/P&gt;&lt;P&gt;      bukrs type bukrs,&lt;/P&gt;&lt;P&gt;      saknr type saknr,&lt;/P&gt;&lt;P&gt;      end of str_skb1.&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;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               DATA  DECLARATIONS&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:it_bkpf type standard table of str_bkpf  ,&lt;/P&gt;&lt;P&gt;     it_bseg type standard table of  str_bseg ,&lt;/P&gt;&lt;P&gt;     it_t001 type standard  table of str_t001 ,&lt;/P&gt;&lt;P&gt;     it_ska1 type standard  table of str_ska1 ,&lt;/P&gt;&lt;P&gt;     it_skb1 type standard table of str_skb1 ,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    fieldcat type slis_t_fieldcat_alv WITH HEADER LINE,&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    events   type slis_t_event WITH HEADER LINE,&lt;/P&gt;&lt;/LI&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;    layout  type slis_layout_alv,&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    layout type  slis_layout_alv1 ,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    ALV type SY-REPID.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:w_index type sy-tabix.&lt;/P&gt;&lt;P&gt;data: wa_bkpf like line of it_bkpf,&lt;/P&gt;&lt;P&gt;      wa_bseg like line of it_bseg,&lt;/P&gt;&lt;P&gt;      wa_t001 like line of it_t001,&lt;/P&gt;&lt;P&gt;      wa_ska1 like line of it_ska1,&lt;/P&gt;&lt;P&gt;      wa_skb1 like line of it_skb1.&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;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                 INPUT VARIABLES&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS:s_BUKRS FOR BKPF-BUKRS obligatory,&lt;/P&gt;&lt;P&gt;               s_BLART FOR BKPF-BLART obligatory,&lt;/P&gt;&lt;P&gt;               s_BUDAT FOR BKPF-BUDAT,&lt;/P&gt;&lt;P&gt;               s_BSCHL FOR BSEG-BSCHL,&lt;/P&gt;&lt;P&gt;               s_HKONT FOR BSEG-HKONT.&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;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               SELECT STATEMENTS&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select   blart      "Document type&lt;/P&gt;&lt;P&gt;           bukrs      "Company Code&lt;/P&gt;&lt;P&gt;           belnr      "Accounting Document Number&lt;/P&gt;&lt;P&gt;           gjahr      "Fiscal Year&lt;/P&gt;&lt;P&gt;           budat      "Posting Date in the Document&lt;/P&gt;&lt;P&gt;           from bkpf&lt;/P&gt;&lt;P&gt;           into&lt;/P&gt;&lt;P&gt;           table it_bkpf&lt;/P&gt;&lt;P&gt;           where bukrs in s_bukrs&lt;/P&gt;&lt;P&gt;           and   blart in s_blart&lt;/P&gt;&lt;P&gt;           and budat in s_BUDAT.&lt;/P&gt;&lt;P&gt;check sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if not it_bkpf[] is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   select belnr "Accounting Document Number&lt;/P&gt;&lt;P&gt;          gjahr "Fiscal Year&lt;/P&gt;&lt;P&gt;          buzei "Number of Line Item Within Accounting Document&lt;/P&gt;&lt;P&gt;          bschl  "Posting Key&lt;/P&gt;&lt;P&gt;          hkont  "General Ledger Account&lt;/P&gt;&lt;P&gt;          bukrs  "Company Code&lt;/P&gt;&lt;P&gt;          from bseg&lt;/P&gt;&lt;P&gt;          into table it_bseg&lt;/P&gt;&lt;P&gt;          for all entries in it_bkpf&lt;/P&gt;&lt;P&gt;          where  belnr = it_bkpf-belnr&lt;/P&gt;&lt;P&gt;          and    gjahr = it_bkpf-gjahr&lt;/P&gt;&lt;P&gt;          and    bukrs = it_bkpf-bukrs.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if not s_BSCHL[] is initial.&lt;/P&gt;&lt;P&gt;    delete it_bseg where not bschl in s_bschl.&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;&lt;/P&gt;&lt;P&gt;  if not s_HKONT[] is initial.&lt;/P&gt;&lt;P&gt;    delete it_bseg where not hkont in s_hkont.&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if it_bseg[] is not initial.&lt;/P&gt;&lt;P&gt;    sort it_bseg by bukrs gjahr belnr.&lt;/P&gt;&lt;P&gt;    refresh it_t001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT bukrs              "Company Code&lt;/P&gt;&lt;P&gt;           ktopl              "Chart of Accounts&lt;/P&gt;&lt;P&gt;           from T001&lt;/P&gt;&lt;P&gt;           into table it_t001&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           where bukrs in s_bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if not it_t001[] is initial.&lt;/P&gt;&lt;P&gt;      sort it_t001 by bukrs.&lt;/P&gt;&lt;P&gt;      refresh it_ska1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SELECT bilkt           "Group Account Number&lt;/P&gt;&lt;P&gt;             ktopl           "Chart of Accounts&lt;/P&gt;&lt;P&gt;             saknr           "G/L account number&lt;/P&gt;&lt;P&gt;             from SKA1&lt;/P&gt;&lt;P&gt;             into table it_ska1&lt;/P&gt;&lt;P&gt;             for all entries in it_t001&lt;/P&gt;&lt;P&gt;             where ktopl = it_t001-ktopl.&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;&lt;/P&gt;&lt;P&gt;      if not it_ska1[] is initial.&lt;/P&gt;&lt;P&gt;        sort it_ska1.&lt;/P&gt;&lt;P&gt;        refresh it_skb1.&lt;/P&gt;&lt;P&gt;        SELECT fstag  "Field status group&lt;/P&gt;&lt;P&gt;               bukrs  "Company code&lt;/P&gt;&lt;P&gt;               saknr  "G/L account number&lt;/P&gt;&lt;P&gt;               from skb1&lt;/P&gt;&lt;P&gt;               into table it_skb1&lt;/P&gt;&lt;P&gt;               for all entries in it_ska1&lt;/P&gt;&lt;P&gt;               where bukrs in s_bukrs and&lt;/P&gt;&lt;P&gt;                       SAKNR = it_ska1-saknr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      endif.&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;  loop at it_bseg into wa_bseg.&lt;/P&gt;&lt;P&gt;    w_index = sy-tabix.&lt;/P&gt;&lt;P&gt;    read table it_bkpf into wa_bkpf with key BUKRS = wa_bseg-bukrs.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    wa_bseg-blart = wa_bkpf-blart.&lt;/P&gt;&lt;P&gt;    Read Table it_t001 into wa_t001 with key bukrs = wa_bseg-bukrs.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    wa_bseg-ktopl = wa_t001-ktopl.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    Read table it_ska1 into wa_ska1 with key ktopl = wa_bseg-ktopl.&lt;/P&gt;&lt;P&gt;    wa_bseg-saknr = wa_ska1-saknr.&lt;/P&gt;&lt;P&gt;    wa_bseg-bilkt = wa_ska1-bilkt.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    Read Table it_skb1 into wa_skb1 with key bukrs = wa_bseg-bukrs saknr = wa_bseg-hkont.&lt;/P&gt;&lt;P&gt;    wa_bseg-fstag = wa_skb1-fstag.&lt;/P&gt;&lt;P&gt;    modify it_bseg  from wa_bseg index w_index transporting ktopl bilkt saknr fstag blart.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;  endloop.&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;bhanu &lt;/P&gt;&lt;P&gt;all the  best&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 05:19:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409215#M537241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-29T05:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Still not solved problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409216#M537242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First thing is look at the selections and the scope.&lt;/P&gt;&lt;P&gt;I understand you may not have much data now but why is BUDAT not mandatory? If I remember well (It's been a few years) this is one index of BKPF....&lt;/P&gt;&lt;P&gt;Even as a range it is still way better than allowing the selection for the whole timeframe present in the DB...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So yes you really need to take a critical view at what you are trying to accomplish and how you are going about it...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Jul 2007 00:02:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/still-not-solved-problem/m-p/2409216#M537242</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-01T00:02:20Z</dc:date>
    </item>
  </channel>
</rss>

