<?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 reports in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reports/m-p/1538076#M245373</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;can anyone give me the solution for this logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get all entries from table EKKO where EKKO-BSTYP = &amp;#145;K&amp;#146; and the other fields meet the selection critera entered.&lt;/P&gt;&lt;P&gt;The Validity Date entered must be &amp;gt;= EKKO-KDATB and &amp;lt;= EKKO-KDATE. &lt;/P&gt;&lt;P&gt;If Include Deleted Contracts ? = unset, only select entries where EKKO-LOEKZ = blank. &lt;/P&gt;&lt;P&gt;If any selection criteria (including Validity Date) is left blank, then the selection of EKKO entries should not be restricted by that selection criteria. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each entry found on table EKKO, get the related Contract Items from table EKPO (i.e. where EKPO-EBELN = EKKO-EBELN).&lt;/P&gt;&lt;P&gt;If Include Deleted Contracts/Items ? = unset, only select entries where EKPO-LOEKZ = blank. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each entry found on table EKPO, get the related PO Items from table EKPO (i.e. where EKPO-KONNR = EKPO-EBELN and EKPO-KTPNR = EKPO-EBELP and EKPO-LOEKZ = blank). Accumulate EKPO-NETWR to calculate the Actual Spend of a particular Contract Item.  &lt;/P&gt;&lt;P&gt;If the currency of the PO is not the same as the currency of the Contract, then the value of EKPO-NETWR will need to be converted to the Contract currency before the accumulation takes place.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that all related POs are selected, irrespective of where they are in the purchasing cycle (e.g. just created, receipted but not invoiced etc).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Aug 2006 07:13:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-02T07:13:42Z</dc:date>
    <item>
      <title>reports</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reports/m-p/1538076#M245373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;can anyone give me the solution for this logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get all entries from table EKKO where EKKO-BSTYP = &amp;#145;K&amp;#146; and the other fields meet the selection critera entered.&lt;/P&gt;&lt;P&gt;The Validity Date entered must be &amp;gt;= EKKO-KDATB and &amp;lt;= EKKO-KDATE. &lt;/P&gt;&lt;P&gt;If Include Deleted Contracts ? = unset, only select entries where EKKO-LOEKZ = blank. &lt;/P&gt;&lt;P&gt;If any selection criteria (including Validity Date) is left blank, then the selection of EKKO entries should not be restricted by that selection criteria. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each entry found on table EKKO, get the related Contract Items from table EKPO (i.e. where EKPO-EBELN = EKKO-EBELN).&lt;/P&gt;&lt;P&gt;If Include Deleted Contracts/Items ? = unset, only select entries where EKPO-LOEKZ = blank. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each entry found on table EKPO, get the related PO Items from table EKPO (i.e. where EKPO-KONNR = EKPO-EBELN and EKPO-KTPNR = EKPO-EBELP and EKPO-LOEKZ = blank). Accumulate EKPO-NETWR to calculate the Actual Spend of a particular Contract Item.  &lt;/P&gt;&lt;P&gt;If the currency of the PO is not the same as the currency of the Contract, then the value of EKPO-NETWR will need to be converted to the Contract currency before the accumulation takes place.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that all related POs are selected, irrespective of where they are in the purchasing cycle (e.g. just created, receipted but not invoiced etc).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2006 07:13:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reports/m-p/1538076#M245373</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-02T07:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: reports</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reports/m-p/1538077#M245374</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;This is a rough outline for the above requirement, modify it according to your needs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT zztest.

TABLES : ekko.

DATA : it_ekko TYPE STANDARD TABLE OF ekko WITH HEADER LINE.
DATA : it_ekpo TYPE STANDARD TABLE OF ekpo WITH HEADER LINE.
DATA : it_ekpo1 TYPE STANDARD TABLE OF ekpo WITH HEADER LINE.


SELECT-OPTIONS : s_kdatb FOR  ekko-kdatb NO-EXTENSION NO INTERVALS ,
                 s_kdate FOR  ekko-kdate NO-EXTENSION NO INTERVALS .

CONSTANTS : c_k(1) VALUE 'K'.


*Get all entries from table EKKO where EKKO-BSTYP = &amp;#145;K&amp;#146; and date criteria

IF s_kdatb IS NOT INITIAL.
  s_kdatb-sign = 'GE'.
  APPEND s_kdatb.
ENDIF.

IF s_kdate IS NOT INITIAL.
  s_kdate-sign = 'LE'.
  APPEND s_kdate.
ENDIF.

SELECT * FROM ekko INTO TABLE it_ekko
   WHERE          bstyp EQ c_k
            AND   kdatb IN s_kdatb
            AND   kdatb IN s_kdate
            AND   loekz EQ space.


*For each entry found on table EKKO, get the related Contract Items from table EKPO

IF it_ekko[] IS NOT INITIAL.

  SELECT * FROM ekpo INTO TABLE it_ekpo
    FOR ALL ENTRIES IN it_ekko
     WHERE    ebeln  EQ it_ekko-ebeln
              AND   loekz EQ space.

ENDIF.



*For each entry found on table EKPO, get the related PO Items from table EKPO (i.e. where EKPO-KONNR = EKPO-EBELN and
*EKPO-KTPNR = EKPO-EBELP and EKPO-LOEKZ = blank).

IF it_ekpo[] IS NOT INITIAL.

  SELECT * FROM ekpo INTO TABLE it_ekpo1
    FOR ALL ENTRIES IN it_ekpo
     WHERE          konnr  EQ it_ekpo-ebeln
              AND   ktpnr EQ it_ekpo-ebelp
              AND   loekz EQ space.

ENDIF.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then based on the entries in it_ekpo1 proceed further with your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;Accumulate EKPO-NETWR to calculate the Actual Spend of a particular Contract Item.&lt;BR /&gt;If the currency of the PO is not the same as the currency of the Contract, then the value of EKPO-NETWR&lt;BR /&gt; will need to be converted to the Contract currency before the accumulation takes place.&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;AS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2006 07:37:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reports/m-p/1538077#M245374</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-02T07:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: reports</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reports/m-p/1538078#M245375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Varalakshmi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the logic :(please note that you might need to check the syntax)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT A&lt;SUB&gt;EBELN A&lt;/SUB&gt;EBELP A&lt;SUB&gt;BSTYP A&lt;/SUB&gt;WAERS B&lt;SUB&gt;KONNR B&lt;/SUB&gt;KTPNR&lt;/P&gt;&lt;P&gt;INTO ITAB&lt;/P&gt;&lt;P&gt;FROM EKKO AS A INNER JOIN EKPO AS B&lt;/P&gt;&lt;P&gt;ON A&lt;SUB&gt;EBELN = B&lt;/SUB&gt;EBELN&lt;/P&gt;&lt;P&gt;WHERE A~BSTYP = 'K' AND&lt;/P&gt;&lt;P&gt;A&lt;SUB&gt;KDATB &amp;lt;= P_DATE AND A&lt;/SUB&gt;KDATE &amp;gt;= P_DATE&lt;/P&gt;&lt;P&gt;AND A&lt;SUB&gt;LOEKZ = SPACE AND B&lt;/SUB&gt;LOEKZ = SPACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT A&lt;SUB&gt;EBELN B&lt;/SUB&gt;EBELP A&lt;SUB&gt;WAERS B&lt;/SUB&gt;NETWR INTO PTAB&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN ITAB&lt;/P&gt;&lt;P&gt;FROM EKKO AS A INNER JOIN EKPO AS B&lt;/P&gt;&lt;P&gt;ON A&lt;SUB&gt;EBELN = B&lt;/SUB&gt;EBELN&lt;/P&gt;&lt;P&gt;WHERE A~EBELN = ITAB-KONNR&lt;/P&gt;&lt;P&gt;AND B~EBELP = ITAB-KTPNR&lt;/P&gt;&lt;P&gt;AND B&lt;SUB&gt;LOEKZ = SPACE AND A&lt;/SUB&gt;LOEKZ = SPACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT PTAB.&lt;/P&gt;&lt;P&gt;  AT NEW EBELP.&lt;/P&gt;&lt;P&gt;     CLEAR L_SUM.&lt;/P&gt;&lt;P&gt;  ENDAT.&lt;/P&gt;&lt;P&gt;  LOOP AT ITAB WHERE KONNR = PTAB-EBELN AND &lt;/P&gt;&lt;P&gt;                     KTPNR = PTAB-EBELP.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;  IF PTAB-WAERS NE ITAB-WAERS.&lt;/P&gt;&lt;P&gt;     CALL FUNCTION CONVERT_TO_FOREIGN_CURRENCY'&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;             FOREIGN_CURRENCY = PTAB-WAERS&lt;/P&gt;&lt;P&gt;             LOCAL_AMOUNT = PTAB-NETWR&lt;/P&gt;&lt;P&gt;             LOCAL_CURRENCY = ITAB-WAERS&lt;/P&gt;&lt;P&gt;          IMPORTING&lt;/P&gt;&lt;P&gt;             FOREIGN_AMOUNT = L_SUM1.&lt;/P&gt;&lt;P&gt;     L_SUM = L_SUM + LSUM1.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;     L_SUM = L_SUM + PTAB-NETWR.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  AT END OF EBELP.&lt;/P&gt;&lt;P&gt;     WRITE : / PTAB-EBELN, PTAB-EBELP, L_SUM.&lt;/P&gt;&lt;P&gt;  ENDAT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Aug 2006 08:53:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reports/m-p/1538078#M245375</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-02T08:53:00Z</dc:date>
    </item>
  </channel>
</rss>

