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

Transfert IBP to ECC

https://blogs.sap.com/2020/06/03/sap-ibp-data-integration-via-cpi-ds-how-to-synchronize-data-from-sap-ibp-through-webservice/

SAP IBP Data Integration via CPI-DS – How to synchronize data from SAP IBP through webservice

FollowRSS feedLike2 Likes 1,148 View 1 Comment

In this blog, you will get an end to end case for how to synchronize data from SAP Integrated Business Planning for Supply Chain solution through webservice.

Let’s assume the following scenario: Planners want to maintenance some additional information in SAP IBP and send these data to SAP ERP Central Component (SAP ECC)’s Z-table. To implement this scenario, we need SAP Cloud Platform Integration for data services (CPI-DS) as a middleware to connect both SAP IBP and SAP ECC.  The data flow will be SAP IBP>>CPI-DS>>SAP ECC. Let’s have a look at how to complete this scenario step by step.

1. Webservice Part

Firstly, SAP ECC as a service provider need to publish a web service to receive the data which is sent by SAP IBP through CPI-DS. In this part, I will show you how to deal with these in SAP ECC side. If you have already known these steps, you can skip to CPI-DS part.

1.1 Define a Z-table and create an RFC to receive data.

We need to define a table to store the data sent from SAP IBP, in this example, table is named as ‘ZIBP_DATA_FLITER’. And then, we can use an RFC to receive the data.

1.2 Generate service definition

After the RFC ‘ZIBP_SET_DATA_FILTER’ have been created. We should create an enterprise service and follow the wizard to generate service definition.

1.3 Publish webservice

After that, you can use T-CODE: SOAMANAGER to publish webservice and get the WSDL URL.

Go to the web service configuration pageSelect your service definition ‘ZIBP_SRV_ECC_DATA_INBOUND’ and follow the wizard to create service.After you have created the service, you can use ‘open binding WSDL generation’ button to open binding page where you can get WSDL URL.You can use web browser to open this WSDL URL, like below. It means the service has been published.

Tips:

If you find that the web page occurrs 403 error, like this:That means you need to active some services through T-Code: SICF

Firstly, we need to get service path. You can right click and choose properties in the web page.Find the path under /bndg_url, for this example is /sap/bc/srt/rfc/sap/zibp_srv_ecc_data_inbound …Secondly, back to SAP GUI and use T-Code: SICF to find the service and active it.

Now we’ve finished service provide part. Let’s move to CPI-DS part.

2. CPI-DS Part

2.1 Import SAP IBP source table

CPI-DS need to know service consumer’s metadata, so we need to import SAP IBP source table for datastores first.

In SAP IBP side, the master data types which we want to synchronize to SAP ECC is like below:And we should import this table in CPI-DS. Let’s move to CPI-DS datastores sheet, find SAP IBP’s datastore and click ‘Import object’ button.Tips:

table name is SOPMD_<master data type ID> and folder name is your planning area ID.

SOPMD means S&OP master data. In this example, planning area ID is ‘INT’ and master data type ID is ‘FILTERCONFIG’, so we need to find table ‘SOPMD_ FILTERCONFIG’ which is under folder ‘INT’.

Now we’ve got the table in CPI-DS, and you can review table data in datastores

2.2 Create a web service datastore

After importing SAP IBP table, we should create a datastore to call the web service which we published.

In new datastores screen, we should choose datastore’s type as ‘SOAP Web Service’ and fill the WSDL URL which we got in step 1.3 in WSDL Path.

We also need to fill credentials info, for this example, it’s a http webservice and authentication with user ID/Password, so we should put the username and password which SAP ECC provided for integration.

Tips:

For the WSDL Path field, we can also use WSDL file’s address.

If you want to use this way, you need to download the webservice’s WSDL file and upload to Data Service Agent service’s file folder. After that, you can fill the WSDL file address in WSDL Path field.

For this example, Data Service Agent are installed in a windows server, the WSDL file address will like this:

C:\ProgramData\SAP\DataServicesAgent\workspace\wsdl\zibp_srv_ecc_data_inbound.wsdl

You can use test button to check datastores connection.

After our web service datastores passed connection test, we need to import web service metadata.Now we’ve finished both sides’ datastores configuration.

2.3 Create a task

From this step, Let’s move to CPI-DS project’s sheet to do the configuration.

Select the projects which you want to input new task and click ‘create task’ button.Follow the wizard to name the task, then select source/target datastores and save it.

Let’s open the task which we’ve just saved. We can check source/target datastores in connections sheet, edit data flows in data flows sheet and we can define some global variable for these data flows in execution properties sheet.

2.4 Create a data flow

After task has been created, we need to define movement and transformation of data from SAP IBP to SAP ECC, so we should create a data flow to handle it.

Use ‘Add target Object’ link to choose target object and create data flow

That’s a simple data flow, we just need 3 transform objects to deal with the work.Our data flow begins from source target ’SOPMD_FILTERCONFIG’ to the ‘output Loader’ which is to store web service response by xml file.

Firstly, use a Query transform to filter the fields which we need. If you want to define some field value levels’ filter, you can write some codes in filter sheet.Secondly, use an XML Map transform to map the fields between query and web service’s input.

If your web service supports inputting multiple rows of data, you need to define iteration rule for it. Use ‘propose rule’ button to choose the suitable object.Thirdly, use a web service call transform to call SAP ECC’s web service target. In this transform, we can use ‘select function’ button to choose web service input structure.After importing it, don’t forget to map these two structures.You can use ‘configure design time data viewer’ button to check each transform running status.

2.5 Create a process and test data flow

Select the projects which you want to input new process. And then click ‘create process’ button.Fill process name. Deselect the Load to SAP Integrated Business Planning (requires post-processing) box because our target datastores is web service.

Select the data flow which you want to test and drop it in the process pool.

Go back to project sheet, select the process and click ‘run now’And you can use ‘view history’ button to view the process log.Check SAP ECC’s Z-table whether it has received the data.

Hopefully, this article will help you better understand how to synchronize data from SAP IBP through webservice.

IBP – Utiliser l’Addon de connection ECC6 / IBP

  • Setup IBP as a destinatin (BD54 + NDV2)
  • Définir les modèles d’intégration : Divisions et MRP Profiles (Logistics – Central Functions – Supply chain Planning Interface – IBP – Integration Models – Define puis Transfer)
  • Setup change pointers collections :
    • BD61 – BD50 – BD52
  • Setup Live Masterdata collection (PDS/TLanes)

Manage Deletion in IBP

Mass Deletion through Excel input (From: Data Integration jobs) : Download template, then load. Only the Main Key is required, no values needed.

In Excel, use Masterdata Single and Delete.

Through a Job using the « Purge Masterdata » Template and setting how many days in Background

Publié dans IBP

IBP – Scheduling a job

2 tiles exist in the IBP Fiori front end : Application jobs & Application jobs template.

With Application Jobs, you can see what’s scheduled and schedule a new one. From this tile, you can either enter everything manually or call (and change) a template.

So here is the recommanded way :

1- Define building blocks with Application Jobs template

Ex: HCI Masterdata Integration

  • HCI Masterdata Integration
  • HCI Transac data Integration
  • Init KF
  • Copy KF
  • Update KF

Careful, as your small templates will then be copied in the master template, not linked (ie: If you add a step in HCI MasterData Integration, it will not add anything in the mastertemplate.

2- Create your master Template with Application jobs Template

Inside a template, you can add templates. Create one master template for your daily job including the 5 previous building Block, name it « Daily Process »

3- Schedule your job with « Application Jobs »

Create a new scheduled job and select your Master Template. Everything will be set directly according to the master template.

Careful, changing the master template don’t change anything inside the scheduled jobs. You will have to delete the current schedule and re-create it from the template.

Publié dans IBP

CPI-DS / IBP Communication setup

FIORI: Create communication user: Tile- Maintain Communication User

  1. New user
  • Propose password and save it. This password will be use in HCI webservices steps

FIORI: Create communication arrangement: Tile- Communication arrangements

  1. New communication arrangement: SAP_COM_0035
  • OUTBOUND COMMUNICATION- Note that the user name will be like:  WEBSERVICEUSER|”organization ID
  • OUTBOUND SERVICES- Include url HCI services in field “ SERVICE URL”

FIORI: Create Communication System- Tile Communication system

  1. New communication system
  1. Technical data: Include your HCI host name
  1. USER FOR OUTBOUND COMMUNICATION: Add new and include your new communication user and password proposed
  1. COMMUNICATION ARRAGEMENT: Add the communication arrangement created “SAP_COM_0035”

Finally in HCI system

  1. Administration tab
  2. Select WEBSERVICEUSER and copy the password generated in Fiori (FIORI: Create communication user: Tile- Maintain Communication User)
Publié dans IBP

Setup SAP IBP from Scratch

With IBP, SAP have improved a lot the quality of the documentation they provide. Both The Fiori front end and the addon user guide are very good. Still, there is a lack of details in the Integration documentation, and on the initial setup. This Article is a living step-by-step of one IBP Implementation and the integration with a On-premise SAP R3/APO landscape

Get both instances (IBP Test + IBP Prod) activated by SAP. Create users for those instances.

Create access via SDI (or whatever name is the cloud user management solution).

Get access to CPI-DS/HPI and create users in SDI.

Install the IBP Agent in an on premise server and set it up for communication between your on premise systems and HCI.

In ECC, create a RFC « SAPDS » to allow IBP to read it. Create a user with SAP_ALL to be the CPI-DS user.

In CPI-DS, in Sandbox, setup the datastore configuration with ECC IP and communication.

Use of the ERP Add-on

https://help.sap.com/viewer/f0e636d2a3b3440581408534c9d59e43/1.1%20SP12/en-US/88f95d75e9b540518cb9191046581799.html – configuring the Addon. It adds in ECC a new menu : Logistic – Central functions – Supply Chain Planning Interface – Integrated Business Planning

https://help.sap.com/viewer/eab8fd1726934516a89eabced318b210/1911/en-US/50023e90cbe54054b1af556ec65a878e.html

Connection of the AddOn, ECC and IBP ?

Promote / Transport in IBP

Once the Sandbox setup is done (Datastores setup + Projects defined), right click on a Dataflow and select « Promote ». Enter a new « Project » and click « Include Source & Target Datastore »

Go in the Production Datastore and update the source/target.

Tips :

For ECC, if using ABAP endpoint Dataflow :

Publié dans IBP