How to get the correct integrated margins when the material does not have the correct procurement code

The case to solve

When the special procurement code is wrong into RCS, the computation of the integrated margin is wrong. Even if the correction is done in RCS, it is no more possible to have a retroactive computation in RCS. So the only way to have correct values in BW, is to correct directly in BW.

To do this, all the process has to replay, starting from the extraction of the “CCR”. The different steps are described below:

  1. To extract once again the CCR in the PSA
  2. To correct the PSA in order to put the correct setting
  3. Launch the computation process
  4. Generate the file for BO
  5. Load the file into BO

For the example, we are going to correct the setting of the material 72841 in the plant 0228 for the March costing period.The material is built in the plant 7822 and sell from the plant 0228.

Because the procurement code was wrong for this material, we do not have the correct information for the issuing plant. This is this setting which have to correct.

The data flow

The procedure

  1. To extract once again the CCR in the PSA

Before to start the extraction, you have to know the following information:

Costing date (0COSTDATE) = 01.03.2010

Material number (C_MATNR) = 72841

Plant (0PLANT) = 0228

The data have to be loaded in the ODS_PCP1 form the DTS_KEKO_CKIS but only in the PSA

Once the infopackage is open, you have to enter the correct selection:

Be sure now that the data will be loaded in the PSA only.

2. To correct the PSA in order to put the correct setting

First you have to check if the data loading is well finished into the PSA, go to the monitor for this.

Select the loading and click on the “PSA Maintenance” button , the following screen will appear.

Click on the continue button to have the list of all the records which are in the PSA

Now, you have to identify which record to correct. In our example it is the record for the plant 0228 which have to come from plant 7822. But in the selected record, you can see that issuing plant is not 7822 but again 0228.

Once the record is selected, click on the button to edit the record and move until to see the field to correct (Issuing Plant).

Right now, put the correct value in the issuing plant field

Once the correct value is entered, the record is identified as modified

Click on the save button and come back to the monitor screen.

To load the corrected data to the ODS_PCP1, the PSA has to be processed manually.

To do this click on the button.

The following message will appear.

Click on the Continue button and refresh the monitor until to have the loading successfully ended.

Before to lauch the computation, be sure that the request is well activated in the ODS_PCP1

The second step is now finished.

3. Launch the computation process

The program to compute the integrated margins is using the data coming from ODS_PCP1, ODS_PCP3, ODS_PCP5 and ODS_MARM and store the data in a transactional ODS which is ODS_PCP6.

So before to launch the computation, the ODS_PCP6 has to be emptied.

To empty the ODS_PCP6, you have to do a right-click on the ODS and select “delete data”

The confirmation message below will appear :

To empty the ODS_PCP6, you have to click on the Yes button.

Once the ODS is empty, the following screen will appear:

Once the ODS_PCP6 is empty, the program can be launch.

Launch the se38 transaction and select the Z_M_INT program.

Then click on the execute button or type on the F8 key on the keyboard.

The following selection screen will appear.

Select the correct period to compute the integrated margin, 003.2010 in our example.

Then launch the program in background after chose this option in the menu.

Once the program has been launched in background, with the sm37 transaction

Once the program is finished, the Active line in the job overview screen will change to Finished:

At this moment, the computation is finished but the data are not yet ready to send to BO. You have to send them to the ODS_PCP4.

Using the 8ODS_PCP6 infopackage, you will load the result of the last computation to the final ODS.

There is only one infopackage to load all the content of ODS_PCP6.

Launch the loading immediately

When the loading will be finished and the request activated, the computation step is finished.

6. Generate the file for BO

To generate the file, the program Z_DOWNLOAD_MBI has to be launched with the se38 transaction.

Click on the execute button and the selection screen will appear:

Enter the correct period, 003.2010 in our example.

Uncheck the “Load last period too” checkbox because we just want to generate the file for only the one month.

(By default, in WBP on the date of 26/03/2021, plant type NDIR is excluded).

Click on the execute button

When the file is generated, you will have a screen which give you the number of records which have inserted in the file.

To check if the file is properly generated, you can launch the al11 transcation.

Then go to the DIR_CIS folder and sort in the LastChange field by descending order

The generated file is named MBI-yyyymmm.csv, in our example, the file MBI-2010003.csv is the last file generated in the server.

At this step the file is generated and is available

7. Load the file into BO

New procedure : to be apply at September, 5th (Reverse Shadow) :


Make a child freshdesk tickets for BO team to load the data on BO database about integrated margin.


Old procedure :

To load the file generated into the BO database, send an email to DE-ZEEUW, Laurence and ask them to reload the integrated margins file(s) from BW.

You have to rename the file(s).

  • No labels