Objective :

To have a report which can show us detailed information on operation level cost in a work order with details like material cost, labor cost etc.

Case 1 :  Business function LOG_EAM_OLC ( If you are EHP5 & above)

In ECC 6.0 EHP 5 & above it is available as a standard functionality. You just need to activate business function LOG_EAM_OLC. Upon activating this you will be able to see operation level costing on work order screen under COST tab. Some of the useful links are give below which you can refer for this.

Operation Level Costing in Plant Maintenance | SCN

Operation Account Assignment – Business Functions (SAP Enhancement Package 5 for SAP ERP 6.0) – SAP Library

Working with Order Operations as Account Assignments – Orders (CS-SE/PM-WOC-MO) – SAP Library

Case 2 : Without  Business function LOG_EAM_OLC

 

When we do a time confirmation or goods issuance, some FI & CO positing document entries get generated against your work order/reservation. We can use these entries to get a report on operation wise actual cost in a work order.

To achieve this, logically we need to ,

Select the operation wise confirmation entries  from table AFRU by removing cancelled confirmation entries

Select  material documents entries from COEP/COBK ( with reference to MSEG) which are not reversed.

As it is not possible to share full code due to various reasons, I am providing here a brief logic that can be  used to generate this report. You need to work with your ABAP person for Selection screen, list of columns you want to display upon execution of report etc.

 

Tables :

AFRU Order Confirmations

AFVC – Order operations

CAUFV Generated Table for View

AFIH – Order header

IFLO Generated Table for View

ILOA – Location account assignment

————————————————————

MARA General Material Data

MAKT – Material description

MSEG Document Segment: Material

RESB – Reservations

————————————————————-

COEP – Co Objects

COBK – CO object document header

————————————————————-

Logic for material cost (This is only for reference. you need to show this to ABAP’er for more analysis as per your requirement.)

For material cost you can refer below logic,

SELECT SINGLE * FROM MSEG WHERE AUFNR = AUFNR AND
RSNUM
= RSNUM AND
RSPOS
= RSPOS AND BUKRS = BUKRS.


IF SYSUBRC = 0.

SELECT SUM( WTGBTR ) TWAER
FROM COEP AS A INNER JOIN COBK AS B
ON A~KOKRS = B~KOKRS AND A~BELNR = B~BELNR AND A~GJAHR = B~GJAHR
INTO (WTGBTR, TWAER  )
WHERE B~REFBN = MSEGMBLNR AND B~REFBK = MSEGWERKS
AND B~REFGJ = MSEGGJAHR AND A~BUZEI = MSEGZEILE
AND B~STFLG = ‘ ‘ AND B~STOKZ = ‘ ‘ AND B~AWTYP = MKPF
GROUP BY TWAER.
ENDSELECT.
ENDIF.

Logic for operation cost ( This is just for reference. You need to show this to ABAP’er for more analysis as per your requirement)

SELECT SINGLE * FROM AFRU WHERE AUFNR = AUFNR AND

         VORNR = GT_FINALVORNR AND SUMNR = SUMNR AND

         STOKZ = AND STZHL = ‘00000000’.

  IF SYSUBRC = 0.

       PERNR = AFRUPERNR.

         SELECT SINGLE A~WTGBTR  TWAER

           FROM COEP AS A INNER JOIN COBK ASB

        ON A~KOKRS = B~KOKRS AND A~BELNR = B~BELNR AND A~GJAHR = B~GJAHR

           INTO (WTGBTR_OP, TWAER )

           WHERE B~REFBN = AFRURUECK

           AND B~STFLG = ‘ ‘ AND B~STOKZ = ‘ ‘ AND B~AWTYP = AFRU.

      ENDIF.

New NetWeaver Information at SAP.com

Very Helpfull

 

 

User Rating: Be the first one !