IBP Formulas in KF

https://help.sap.com/docs/SAP_INTEGRATED_BUSINESS_PLANNING/bf99e931b8d44aafb4e306ec3602cbdd/b8582c558934753ce10000000a174cb4.html?version=2105&locale=en-US

Standard Functions

SyntaxDetailsExample
IF(intarg , arg2, arg3)Return arg2 if intarg is considered true (not equal to zero), else return arg3.CAPACITYOVERLOADS@PERLOCRES = IF(“CAPADEMANDUTILPCT@PERLOCRES”> 1,1,0)
ISNULL(arg1)Return 1 (= true), if arg1 is set to null.MARKETINGFORECASTQTY@PERPRODCUST = IF(ISNULL(MARKETINGFORECASTQTY@PERPRODCUST), SALESFORECASTQTY@PERPRODCUST, MARKETINGFORECASTQTY@PERPRODCUST)
CASE(arg1, default)CASE(arg1, cmp1, value1, cmp2, value2, …, default)Return value1 if arg1 == cmp1value2 if arg1 == cmp2, and so on, default if there is no match.CASE(SELECTEDOPTION@PERPROD, 1, KF1@PERPROD, 2, KF2@PERRPROD,KF@PERPROD)
ABS(arg)Returns arg, if arg is positive or zero, else –arg.IF(ABS(SUPPLYREV@PERPRODFML – CONSENSUSDEMANDREV@PERPRODFML)/CONSENSUSDEMANDREV@PERPRODFML > 0.2,1,0)
ROUND(double, int)ROUND(123.456, 0) = 123ROUND(123.456, 1) = 123.5ROUND(-123.456, 1) = -123.5ROUND(123.456, -1) = 120KF1@PERPRODLOCSRC = ROUND(KF@ PERPRODLOCSRC, 0)
ROUNDDOWN(double, int)ROUNDDOWN(123.456, -1) = 120ROUNDDOWN(-123.456, -1) = -130KF1@PERPRODLOCSRC = ROUNDDOWN(KF@ PERPRODLOCSRC, 0)
FLOOR(double)FLOOR(35.1) = 35KF1@PERPRODLOC = FLOOR(KF@ PERPRODLOC)
CEIL(double)CEIL(35.1) = 36KF1@PERPRODLOC = CEIL(KF@ PERPRODLOC)
LTRIM(string)LTRIM(string,string)Remove a whitespace prefix from a string. The whitespace characters may be specified in an optional argument. 
RTRIM(string)RTRIM(string,string)Remove trailing whitespace from a string. The whitespace characters may be specified in an optional argument. 
TRIM(string)TRIM(string,string)Remove whitespace from the beginning and end of a string. 
UPPER(arg1)Returns arg1 in upper caseKF1@PERPRODCUST = IF(UPPER( »ATTR1 ») =  »APPROVED », « KF2@PERPRODCUST », NULL)
MIN(arg1,arg2,…)In the case of several input key figures, there is no aggregation; it returns the lowest value of the input key figures.MINCAPACITY@MTHPRODLOC = MIN(« CAPACITYMORNING@MTHPRODLOC », « CAPACITYAFTERNOON@MTHPRODLOC », « CAPACITYNIGHT@MTHPRODLOC »)
MAX(arg1,arg2,…)In the case of several input key figures, there is no aggregation; it returns the highest value of the input key figures.MAXCAPACITY@MTHPRODLOC = MAX(« CAPACITYMORNING@MTHPRODLOC », « CAPACITYAFTERNOON@MTHPRODLOC », « CAPACITYNIGHT@MTHPRODLOC »)

Example

Sample configuration for aggregation of standard deviation

Take the sum of the squares; then calculate the square root of the total:

  1. Calculate the squares:
    1. Square the values:HKF1@PL = PROPAGATEDDEMANDSTDEV@PL ** 2
    2. Sum the squares:HKF1@REQUEST = SUM(HKF1@PL)
  2. Calculate the square root of the total:PROPAGATEDDEMANDSTDEV@REQUEST= HKF1@REQUEST ** 0.5

Example

ISNULL

The ISNULL condition works only when an underlying time series record exists for the planning object.

Imagine that Sales Forecast Quantity and Marketing Forecast Quantity are the stored key figures for planning level PERPROD.

Planning ObjectPeriodKey Figure: Sales Forecast QtyKey Figure: Marketing Forecast Qty
P1Jan 2018100 
P1Mar 2018 100

With the above data, IF(ISNULL(SALESFCSTQTY),1,0) exhibits the following behavior:

PeriodISNULL ValueNotes
Jan 20180January 2018 has the value “100”.
Feb 2018Not evaluatedThe planning object for the time period February 2018 does not exist.
Mar 20181Though there is no value for Sales Forecast Quantity, the Marketing Forecast Quantity key figure (for the same planning level) has a valid value. Therefore, a record exists in the time series for this planning object.

Sample Expressions

Key FigureCalculation Expression
Actuals PriceACTUALSPRICE@REQUEST = IF(“ACTUALSQTY@REQUEST”=0,0, “ACTUALSREV@REQUEST”/“ACTUALSQTY@REQUEST”)
Capacity OverloadsCAPACITYOVERLOADS@PERLOCRES = IF(“CAPADEMANDUTILPCT@PERLOCRES”> 1,1,0)
Capacity UsageCAPAUSAGE@PERPRODLOCRES = “CAPADEMAND@PERPRODLOCRES”*“(IF(CAPASUPPLYPERDEMAND@PERLOCRES”>1,1, “CAPASUPPLYPERDEMAND@PERLOCRES”))
Marketing Forecast ProfitMARKETINGFORECASTPROFIT@PERPRODCUST = “MARKETINGFORECASTREV@PERPRODCUST”- “HMARKETINGFORECASTCOST@PERPRODCUST”
Marketing Forecast QuantityMARKETINGFORECASTQTY@PERPRODCUST = IF(ISNULL(« MARKETINGFORECASTQTY@PERPRODCUST »), « SALESFORECASTQTY@PERPRODCUST », « MARKETINGFORECASTQTY@PERPRODCUST »)
Constrained Versus Consensus Demand RevenueCONSTRAINEDVSCONSENSUSREV@PERPRODFML = IF(ISNULL(« CONSENSUSDEMANDREV@PERPRODFML »)OR « CONSENSUSDEMANDREV@PERPRODFML »=0,0, IF(ABS(« SUPPLYREV@PERPRODFML » – « CONSENSUSDEMANDREV@PERPRODFML »)/ »CONSENSUSDEMANDREV@PERPRODFML » > 0,2,1,0))
Supply QuantitySUPPLYQTY@PERPRODLOC = IF(« HPROJECTEDINVENTORYQTY@PERPRODLOC »>=0, « DEPENDENTDEMANDQTY@PERPRODLOC », « DEPENDENTDEMANDQTY@PERPRODLOC »+ « HPROJECTEDINVENTORYQTY@PERPRODLOC »)
Bill Cost per Area Demand RevenueBILL_COST_PER_AREA@BSCIRTRSCFRCTOUFRUTO2L3AVG_A = IF(isnull(« ASSETAREA5@BSCIRTRSCFRCTOUFRUTO2L3AVG_A ») or « ASSETAREA5@BSCIRTRSCFRCTOUFRUTO2L3AVG_A »=0,0, »BILL_COST5@BSCIRTRSCFRCTOUFRUTO2L3AVG_A »/ »ASSETAREA5@BSCIRT

Spécifique HR – Include modif orders ZXCO1U06

ZXCO1U06 –

  • Verif des consos/Confirmations ordres Moli
    • Vérif champs ZZPRO et ZZSPRO
    • Blocage sauvegarde si control de dispo raté
    • Envoi Email à Juan Pedro si l’ordre bouge de 1 semaine – L137
    • Envoi Email à Juan Pedro si l’ordre est créé pour la semaine – L176
    • Envoi Email à Juan Pedro si on ramène un ordre sur la semaine – L290
    • Bloque le TECO si l’ordre a encore des COGI – L449
    • Envoi Email à Juan Pedro si on modifie une quantité – L539

Activate Change pointers for Message generation

BD10 to generate Material Idocs (MATMAS)

BD30 to generate BOM idocs (BOMMAT)

BD21 to process changes pointers. Here is how to set them :

https://blogs.sap.com/2014/03/09/change-pointers-in-r3/

Important :

  • By default, change pointers are generated for all changes in the material master (no filter by plant).
    • Filter can be done by Badi BDCP_BEFORE_WRITE for the specific message type to register in change pointer table (BDCP2) only the relevant changes required.
    • It can be done also filtering in the distribution model but then the plant in this case should be in a mandatory segment to avoid those messages to be sent. 

Introduction:

This document explains how to track the Material Master Data changes using change pointers in SAP R/3 environment.

Let us understand by taking following example –

The requirement is to track the Material Master changes in SAP R/3 environment and to send the information to some Legacy system (in form of AL11 Text file), if following fields changes –

  • If any new Material is created.
  • If Material is assigned with Dangerous indicator profile
  • UN Number
  • Dangerous Good Class
  • Dangerous Good Packing Group

Master data changes can be distributed with the SMD (Shared Master Data) tool. Changes to the Master Data are written in change documents interface, which in turn logs entries into change pointers.

The following step shows the change pointers settings and how to track the change logs for modified data.

Step 1 – Create Message Type (WE81)

/wp-content/uploads/2014/03/1_406385.jpg

Step 2: Assign Table Fields to Message type (BD52)

Assign table fields to message type which needs to be considered for Change pointers generation.

/wp-content/uploads/2014/03/2_406386.jpg

Step 3: Activate Change Pointers generally (BD61)

/wp-content/uploads/2014/03/3_406387.jpg

Step 4: Activate change pointers corresponding to fields in message type(BD50)

/wp-content/uploads/2014/03/4_406388.jpg

Also check if the data elements of all the required fields has ‘change Document’ field checked (Below screen shot for Material Number)

/wp-content/uploads/2014/03/5_406389.jpg

Step 5: Create a new Part Number and change following fields to test the generation of change logs in table CDHDR, CDPOS, BDCP and BDCPS.

  • Dangerous indicator profile (Transaction MM02)
  • UN Number (Transaction DGP3)
  • Dangerous Good Class (Transaction DGP3)
  • Dangerous Good Packing Group (Transaction DGP3)
Transaction – MM02Transaction – DGP3
  

Step 6: Create a report which will perform following functions –

  • Read non processed change logs using Function Module CHANGE_POINTERS_READ by passing the Message type name
/wp-content/uploads/2014/03/8_406392.jpg
  • Create a text file with all the required material information
  • Transfer that file on the application server (AL11)

And from application server the file is transferred to legacy system using some UNIX Script (this is out of scope of this BOK)

In addition to above FM (change_pointers_Read) you can also see the logs in following Table –

  • CDHDR (Change Document Header Table)
  • CDPOS (Change Document Items)
  • BDCP   (Change Pointer table
  • BDCPS (Change Pointer Status table)

IDOC Generation to send modified records –

In addition to above report you can also create a Function module and create an IDOC’s to send the modified data to legacy system-

Step1 – Create a Function module (e.g. ZTESTFM)

In this you can populate the IDOC segments and use the FM – MASTER IDOC_DISTRIBUTE to create and IDOC

Step2 – Assign Function module to Message Type (Transaction BD60)

/wp-content/uploads/2014/03/9_406393.jpg

Step 7: For the master data that are processed set the change pointer status to ‘Processed’ by setting its value to ‘X’ by calling function module CHANGE_POINTER_STATUS_WRITE.

/wp-content/uploads/2014/03/10_406394.jpg

Delete change pointers

Transaction is BD22 or the standard program RBDCPCLR deletes the obsolete/processed change pointers.

/wp-content/uploads/2014/03/11_406395.jpg

Improve deletion power of /Sapapo/delete_PP_ORDER

Once in the selection screen, enter « del_execu » in the command bar, and re-run.

Where used : WUF

Suppression ordre converti impossible (Order category BF not getting deleted in APO | SAP Community)

  • Lancer SE38 /SAPAPO/DELETE_PP_ORDER
  • Exécuter
  • Taper dans zone de Transaction : DEL_EXECU
  • Exécuter à nouveau la /SAPAPO/DELETE_PP_ORDER

Suppression commandes ventes : /SAPAPO/SDORDER_DEL

Suppression GUID :

  • OM16 to get the Internal Ids of your orders (ou via RRP3 + GT_IO)
  • /SAPAPO/OM_DELETE_INCON_ORDERS

Suppression articles

  • Témoin de suppression dans MAT1
  • SE38 /SAPAPO/DELETE_PRODUCTS

Suppression Sites

  • LOC3 témoin de suppression
  • SE38 /SAPAPO/DELETE_LOCATIONS

Transportation lanes

You can mass delete transportation lanes using the following reports:

1. /SAPAPO/TR_TRPROD_MASSMAINT –> specific for products

2. /SAPAPO/TR_TRM_MASSMAINT –> vehicles on transportation lanes

3. /SAPAPO/TR_TRMCARR_MASSMAINT –> TSPs for means of transport

But before you can use these reports, you first need to go to transaction WUF and choose object type LOCATION. Choose location as an attribute, then execute. In the Transportation Lane dependencies, you need to copy and paste all those in the reports above. Choose delete in the report then execute. After the reports confirm Transportation Lanes deleted, go to WUF. Transportation Lane button dependency should not be there.

À partir de l’adresse <https://answers.sap.com/questions/5167282/mass-deletion-of-transportation-lanes-in-apo.html>

Publié dans APO