Skip to Content
0
Oct 21, 2008 at 07:50 AM

Capturing "Actual Amounts" from previous years

92 Views

Hi Experts,

We had earlier developed a report to produce a list of projects which can be changed from status TECO to CLSD. If the project cannot be closed then the corresponding reason for failure should be displayed.

Now the problem is that there were some direct costs which were booked under certain WBS elements. These elements were created in the previous year & haven't been settled in that year. Our present program isn't able to capture & display these costs in the current year. We have based our logic up on a join of table COBK with tables COEP, PROJ & PRPS. We are referring to the SAP standard TCODE s_alr_87013533 which is able to find the unsettled dollars (Actual amount) even from previous years. Anyone please help advise as to how we can even capture the actual amounts from previous years.

Regards,

Uday

Our inner join statement is as shown below:

SELECT coep~objnr coep~wogbtr coep~megbtr coep~wrttp coep~kstar
         coep~owaer coep~vrgng coep~sgtxt coep~ebeln coep~ebelp
         coep~objnr_n1 coep~belnr coep~gjahr coep~perio
         cobk~blart cobk~refbn cobk~refbk cobk~refgj
    INTO CORRESPONDING FIELDS OF TABLE tb_actual
    FROM coep INNER JOIN cobk ON cobk~kokrs = coep~kokrs AND
                                 cobk~belnr = coep~belnr
              INNER JOIN prps ON coep~objnr = prps~objnr
              INNER JOIN proj ON proj~pspnr = prps~psphi
    WHERE proj~pspnr  = wa_proj-pspnr   "project definition
      AND prps~pspnr  = wa_prps-pspnr   "WBS element
  AND prps~belkz =  c_x             "Account assignment
  AND coep~wogbtr <> 0              "amount
  AND coep~lednr = c_00             "Ledger (needed to hit index)
  AND coep~wrttp IN (c_04, c_11)    "actual value type - real & stat
  AND coep~beknz IN r_beknz.        "D/C Ind <> Settlement