<?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 Report displaying the wrong information in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-displaying-the-wrong-information/m-p/5562946#M1269248</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 have a report that displays a lot of unnecessary information and it looks like the correct information is on the last 9 lines. I am reading data from likp and vbuk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select likp&lt;SUB&gt;lfdat likp&lt;/SUB&gt;kunnr likp&lt;SUB&gt;btgew likp&lt;/SUB&gt;vbeln likp&lt;SUB&gt;voleh likp&lt;/SUB&gt;volum likp&lt;SUB&gt;btgew as btge likp&lt;/SUB&gt;inco2&lt;/P&gt;&lt;P&gt;likp&lt;SUB&gt;vstel likp&lt;/SUB&gt;lfart vbuk&lt;SUB&gt;kostk vbuk&lt;/SUB&gt;vbtyp &lt;/P&gt;&lt;P&gt;from likp join vbuk on likp&lt;SUB&gt;mandt = vbuk&lt;/SUB&gt;mandt&lt;/P&gt;&lt;P&gt;                         and likp&lt;SUB&gt;vbeln = vbuk&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;into corresponding fields of itab&lt;/P&gt;&lt;P&gt;where likp~vstel in s_vstel&lt;/P&gt;&lt;P&gt;and   vbuk~kostk = 'A'&lt;/P&gt;&lt;P&gt;and   vbuk&lt;SUB&gt;vbtyp = 'J' or vbuk&lt;/SUB&gt;vbtyp = 'T'.&lt;/P&gt;&lt;P&gt;check itab-vstel in s_vstel.&lt;/P&gt;&lt;P&gt;check itab-lfart in s_lfart.&lt;/P&gt;&lt;P&gt;check itab-kostk = ' ' or itab-kostk = 'A'.&lt;/P&gt;&lt;P&gt;check itab-vbtyp = 'J' or itab-vbtyp = 'T'.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;clear itab.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May somebody check this select and let me know what I can do in order to make it display only the 9 values and to make the report run faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 May 2009 13:46:44 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-08T13:46:44Z</dc:date>
    <item>
      <title>Report displaying the wrong information</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-displaying-the-wrong-information/m-p/5562946#M1269248</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 have a report that displays a lot of unnecessary information and it looks like the correct information is on the last 9 lines. I am reading data from likp and vbuk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select likp&lt;SUB&gt;lfdat likp&lt;/SUB&gt;kunnr likp&lt;SUB&gt;btgew likp&lt;/SUB&gt;vbeln likp&lt;SUB&gt;voleh likp&lt;/SUB&gt;volum likp&lt;SUB&gt;btgew as btge likp&lt;/SUB&gt;inco2&lt;/P&gt;&lt;P&gt;likp&lt;SUB&gt;vstel likp&lt;/SUB&gt;lfart vbuk&lt;SUB&gt;kostk vbuk&lt;/SUB&gt;vbtyp &lt;/P&gt;&lt;P&gt;from likp join vbuk on likp&lt;SUB&gt;mandt = vbuk&lt;/SUB&gt;mandt&lt;/P&gt;&lt;P&gt;                         and likp&lt;SUB&gt;vbeln = vbuk&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;into corresponding fields of itab&lt;/P&gt;&lt;P&gt;where likp~vstel in s_vstel&lt;/P&gt;&lt;P&gt;and   vbuk~kostk = 'A'&lt;/P&gt;&lt;P&gt;and   vbuk&lt;SUB&gt;vbtyp = 'J' or vbuk&lt;/SUB&gt;vbtyp = 'T'.&lt;/P&gt;&lt;P&gt;check itab-vstel in s_vstel.&lt;/P&gt;&lt;P&gt;check itab-lfart in s_lfart.&lt;/P&gt;&lt;P&gt;check itab-kostk = ' ' or itab-kostk = 'A'.&lt;/P&gt;&lt;P&gt;check itab-vbtyp = 'J' or itab-vbtyp = 'T'.&lt;/P&gt;&lt;P&gt;append itab.&lt;/P&gt;&lt;P&gt;clear itab.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May somebody check this select and let me know what I can do in order to make it display only the 9 values and to make the report run faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2009 13:46:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-displaying-the-wrong-information/m-p/5562946#M1269248</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-08T13:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Report displaying the wrong information</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-displaying-the-wrong-information/m-p/5562947#M1269249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please try the below code:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;       vbeln like likp-vbeln,&lt;/P&gt;&lt;P&gt;       vstel like likp-vstel,&lt;/P&gt;&lt;P&gt;       lfart like likp-lfart,&lt;/P&gt;&lt;P&gt;       lfdat like likp-lfdat,&lt;/P&gt;&lt;P&gt;       inco2 like likp-inco2,&lt;/P&gt;&lt;P&gt;       kunnr like likp-kunnr,&lt;/P&gt;&lt;P&gt;       btgew like likp-btgew,&lt;/P&gt;&lt;P&gt;       volum like likp-volum,&lt;/P&gt;&lt;P&gt;       voleh like likp-voleh,&lt;/P&gt;&lt;P&gt;       kostk like vbuk-kostk,&lt;/P&gt;&lt;P&gt;       vbtyp like vbuk-vbtyp,&lt;/P&gt;&lt;P&gt;      end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select a&lt;SUB&gt;vbeln a&lt;/SUB&gt;vstel a&lt;SUB&gt;lfart a&lt;/SUB&gt;lfdat a&lt;SUB&gt;inco2 a&lt;/SUB&gt;kunnr a~btgew&lt;/P&gt;&lt;P&gt;       a&lt;SUB&gt;volum a&lt;/SUB&gt;voleh&lt;/P&gt;&lt;P&gt;       b&lt;SUB&gt;kostk b&lt;/SUB&gt;vbtyp&lt;/P&gt;&lt;P&gt;from likp as a&lt;/P&gt;&lt;P&gt;inner join vbuk as b&lt;/P&gt;&lt;P&gt;   on   b&lt;SUB&gt;mandt = a&lt;/SUB&gt;mandt&lt;/P&gt;&lt;P&gt;  and  b&lt;SUB&gt;vbeln = a&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;into table itab&lt;/P&gt;&lt;P&gt;where a~vstel in s_vstel&lt;/P&gt;&lt;P&gt;   and a~lfart in s_lfart&lt;/P&gt;&lt;P&gt;   and (  (  b&lt;SUB&gt;kostk = 'A'  )  or  (  b&lt;/SUB&gt;kostk = ' '  )  )&lt;/P&gt;&lt;P&gt;   and (  (  b&lt;SUB&gt;vbtyp = 'J'   )  or  (  b&lt;/SUB&gt;vbtyp = 'T'  )  ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try to avoid CORRESPONDING FIELDS . Also please select the fields in the order of their occurance in the table.&lt;/P&gt;&lt;P&gt;&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;Mamta Gupta.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2009 14:41:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-displaying-the-wrong-information/m-p/5562947#M1269249</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-08T14:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Report displaying the wrong information</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-displaying-the-wrong-information/m-p/5562948#M1269250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;First of all you need to remove the &lt;STRONG&gt;SELECT  and ENDSELECT&lt;/STRONG&gt; , because it is&lt;/P&gt;&lt;P&gt;a costly statement.&lt;/P&gt;&lt;P&gt;Use SELECT directly into internal table by array fetch .&lt;/P&gt;&lt;P&gt;Use another two three select-option and populate them according to value required &lt;/P&gt;&lt;P&gt;and use them in where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this code  - -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select likp~lfdat likp~kunnr likp~btgew likp~vbeln likp~voleh likp~volum
 likp~btgew as btge likp~inco2
likp~vstel likp~lfart vbuk~kostk vbuk~vbtyp
from likp join vbuk on likp~mandt = vbuk~mandt
and likp~vbeln = vbuk~vbeln
into corresponding fields of table itab
where
likp~vstel in s_vstel and
vbuk~kostk = 'A'
and vbuk~vbtyp in s_vbtyp and "Populate select-option s_vbtyp by J and T likp~vstel in s_vstel and
likp~lfart in s_lfart and
vbuk~kostk in s_kostk  and " Populate s_kostk by ' ' and A
vbuk~vbtyp in s_vbtyp . " Populate s_vbtyp&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pinaki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2009 14:45:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-displaying-the-wrong-information/m-p/5562948#M1269250</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-08T14:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Report displaying the wrong information</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-displaying-the-wrong-information/m-p/5562949#M1269251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fred,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Remove the ENDSELECT and Use INTO TABLE Internal Table.&lt;/P&gt;&lt;P&gt;2. While you selecting the fields from the DB tables, you also select all the Key fields though its not required for further processing, but a mandatory trick we need to follow otherwise you get abnormal results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Balaji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2009 15:45:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-displaying-the-wrong-information/m-p/5562949#M1269251</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-08T15:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Report displaying the wrong information</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-displaying-the-wrong-information/m-p/5562950#M1269252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mumta,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried the coding you sent me but when I include kostk = ' ' on the where it does not display the right values (no difference to the old problem that I had ).  When I don't include kostk = ' ' on the where clause it does displays the correct values. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May you advice, please! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Fred.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2009 05:53:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-displaying-the-wrong-information/m-p/5562950#M1269252</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-11T05:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Report displaying the wrong information</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/report-displaying-the-wrong-information/m-p/5562951#M1269253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi in your select query u have given the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;likp&lt;SUB&gt;vbeln = vbuk&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LIKP~VBELN is Delivery doc number,&lt;/P&gt;&lt;P&gt;VBUK~VBELN is Sales doc number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you should not compare those 2.&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;Ajay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2009 06:01:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/report-displaying-the-wrong-information/m-p/5562951#M1269253</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-11T06:01:41Z</dc:date>
    </item>
  </channel>
</rss>

