cancel
Showing results for 
Search instead for 
Did you mean: 

MCEC-Weekly Time Series Report

0 Kudos
481

we need to create report by MCEC according to weekly period

View Entire Topic
DominikTylczyn
Active Contributor
0 Kudos

Hello ptk.alborz

The MCEC transaction is tightly connected with S012 info structure, in fact S012 is hardcoded in MCEC. Therefore, the only way to change the period unit of MCEC to weeks is to make the change in OMO2. However that has profound effects on purchasing reporting, as all LIS Purchasing reports that use S012 will be switched to weeks. Also, as I've wrote earlier, such a change deletes all the data from S012 and you have to rebuild the statistical data in S012 after the change. That's the option you have in standard.

The only way I see, to implement your requirement without touching S012 is to use "ad hoc evaluation" option of MCEC:

If that is activated, then MCEC doesn't read data from S012, but it reads planning data directly with the SCENARIO_DATA_FOR_S012 function module, but it still uses the period unit as defined in OMO2 for S012. You could modify the function and calculate week number instead. The modification should be implemented in the FILL_S012 routine. The period unit is calculated by calling the PERIODE_ERMITTELN(RMCS1000) routine:

* get currency for value
    PERFORM HWAER_READ USING NO_EKORG PLAF-PLWRK
                       CHANGING WAEHR.
  ENDIF.
*
  PERFORM PERIODE_ERMITTELN(RMCS1000) USING
                                      PLAF-PEDTR
                                      INFO_STRUCTURE       "='S012'
                                      DUMMY_BUKRS
                                      CHANGING
                                      *S012-SPTAG
                                      *S012-SPWOC
                                      *S012-SPMON
                                      *S012-SPBUP
                                      *S012-PERIV.
* currency conversion
  IF *S012-NETWR <> 0 AND *S012-HWAER <> WAEHR.<br>

You could replace the call to PERIODE_ERMITTELN(RMCS1000) with your own logic to calculate week number. The implementation should be like:

if sy-tcode = 'MCEC'.  
      CALL FUNCTION 'DATE_GET_WEEK'
        EXPORTING
          date         = plaf-pedtr
        IMPORTING
          week         = *s012-spwoc
        EXCEPTIONS
          date_invalid = 01.
else.
PERFORM PERIODE_ERMITTELN(RMCS1000) USING
                                      PLAF-PEDTR
                                      INFO_STRUCTURE       "='S012'
                                      DUMMY_BUKRS
                                      CHANGING
                                      *S012-SPTAG
                                      *S012-SPWOC
                                      *S012-SPMON
                                      *S012-SPBUP
                                      *S012-PERIV.

endif.

I've not tested the implementation. It's only to give you a guidance and a rough idea of how to do it.

Best regards

Dominik Tylczynski

0 Kudos

Dear dominik

thanks for your comments

we need similar issue in CNE5 transaction ( project progress percent in weekly period )

could you please help us in this regard ?

DominikTylczyn
Active Contributor
0 Kudos

ptk.alborz CNE5 merits a separate question in SAP Project System, so SAP PS specialists can pick it up. It's completely different from MCEC.