guide (sap erp and sap s/4hana) sap supply base

72
PUBLIC SAP Supply Base Optimization 2019-03-18 SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA) © 2020 SAP SE or an SAP affiliate company. All rights reserved. THE BEST RUN

Upload: others

Post on 09-Jan-2022

16 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

PUBLICSAP Supply Base Optimization2019-03-18

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

© 2

020

SAP

SE o

r an

SAP affi

liate

com

pany

. All r

ight

s re

serv

ed.

THE BEST RUN

Page 2: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

Content

1 Purpose. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

3 Preparation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3.1 Steps in SAP Supply Base Optimization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3.2 Setup for Outbound IDocs – From SAP ERP or SAP S/4HANA On Premise Using SAP Cloud Platform Integration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3.3 Setup for Inbound IDocs - To SAP ERP or SAP S/4HANA On Premise Using SAP Cloud Platform Integration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

4 Configuration for SAP Cloud Platform Integration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

4.1 Deployment of Credentials. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

Deploy Certificates in Keystore. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

Open Firewall Request at SAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

Deploy Technical Communication User Data with a Credential Artifact. . . . . . . . . . . . . . . . . . . . 51

4.2 Deployment and Configuration of the Integration Package. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

Create a Copy of the Pre-Packaged Integration Scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

Configuration of the Integration Flows – Fetch Token. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52

Configuration of the Integration Flows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

Configurations Required Within SAP Cloud Platform Integration. . . . . . . . . . . . . . . . . . . . . . . . 56

5 Troubleshooting and Log. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57

6 Error Mail Notification. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

7 Scheduled System Downtimes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

8 Data Protection and Privacy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60

8.1 Deletion of Suppliers or Contacts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

9 Relevant Components for Customer Incidents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

10 Appendix: Entities and Mappings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

2 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Content

Page 3: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

1 Purpose

The purpose of this document is to describe the general configuration steps required to set up the system landscape that has been installed using the corresponding installation or configuration guides. The scope of this integration guide covers the integration between SAP Supply Base Optimization and SAP ERP or SAP S/4HANA On Premise, using SAP Cloud Platform Integration as an interface.

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Purpose PUBLIC 3

Page 4: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

2 Overview

This integration package implements the integration of SAP ERP data and SAP S/4HANA On Premise data into SAP Supply Base Optimization. This allows you to create or update entries in your SAP Supply Base Optimization tenant.

This integration package runs on the SAP Cloud Platform Integration service tenant and connects to the SAP Supply Base Optimization using REST services.

4 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Overview

Page 5: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

3 Preparation

3.1 Steps in SAP Supply Base Optimization

For communication with the SAP Supply Base Optimization REST web services, a technical user needs to be created in SAP Supply Base Optimization. This user needs to subscribe to SAP Supply Base Optimization services and create a service instance. The user must then create client credentials for this service instance through which the authentication URL, client_id, and client_secret, are obtained. These are required to fetch OAuth token to establish connection to the SAP Supply Base Optimization services.

For more information, refer to the SAP Supply Base Optimization - Administrator's Guide.

3.2 Setup for Outbound IDocs – From SAP ERP or SAP S/4HANA On Premise Using SAP Cloud Platform Integration

RFC

For communication between SAP ERP or SAP S/4HANA On Premise and SAP Cloud Platform Integration, an RFC connection must be established. This RFC connection is used to send the IDocs from SAP ERP/SAP S/4HANA On Premise to SAP Cloud Platform Integration.

To set up the RFC connection, refer to steps in Defining RFC Destination in SAP Help Portal documentation. Use the following parameters in the Technical Settings tab:

Field Value

Target Host <SAP Cloud Platform Integration Host>

Service No. 443

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 5

Page 6: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

Field Value

Path Prefix

This identifies the integration flow to which the IDoc will be sent.

/cxf/<nameofpathprefix>

Sample formats:

● Address: /cfx/ADRMAS_SAT● Material: /cfx/ /MATMAS_SAT● Order History: /cfx/ORDERS_SAT● Source List: /cfx/SRCLST_SAT● Supplier and Contact: /cfx/CREMAS_SAT● Material Group: /cfx/MaterialGroup_SAT

PORT

A port is a way to identify a specific process to which an Internet or other network message is to be forwarded when it arrives at a server. To set up the port, proceed as follows:

1. In the SAP ERP/SAP S/4HANA system, go to Logistics Logistics Execution Internal Whse ProcessesCommunication with External Systems ALE Administration Runtime Settings Port Maintenance .

Alternatively, execute transaction WE21.2. Create a new port of type XML HTTP.3. Enter a unique port name or number.4. Enter the RFC destination created earlier.5. Select Text/XML as the content type.6. Select the SOAP Protocol indicator.7. Save your entries.

LOGICAL SYSTEM

The logical system is used to identify an individual client in a system for ALE communication between SAP systems. To create a logical system, proceed as follows:

1. In SAP ERP/SAP S/4HANA Customizing, go to SAP Customizing Implementation Guide SAP NetWeaver Application Server IDoc Interface/Application Link Enabling (ALE) Basic SettingsLogical Systems Define Logical System . Alternatively, execute transaction SALE.

2. Create a new entry with partner profile number.

PARTNER PROFILE

Partner profiles are a prerequisite for data exchange. This involves defining who can exchange what kind of messages with an SAP system and using which port.

To set up a partner profile, proceed as follows:

1. In the SAP ERP/SAP S/4HANA system, go to Logistics Logistics Execution Internal Whse ProcessesCommunication with External Systems ALE Administration Runtime Settings Port Profiles .

Alternatively, execute transaction WE20.2. Create a new partner profile under the type Logical System.3. Enter a partner profile number (that was specified as the logical system) and partner type as LS.4. On the Post-Processing: Permitted Agent tab, perform the following:

○ Enter US as the Ty., your username for Agent, and EN as language.

6 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 7: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

○ In the Outbound Parameters, enter the message type, receiver port as created earlier, and the basic type.

5. On the Outbound Options tab, enter the port created earlier in Receiver Port and select the Collect IDocs option; in the Basic Type field, enter the IDOC basic type (for example, MATMAS05).

For more information, refer to Defining Partners.

DISTRIBUTION MODEL

You need to define with which systems you are communicating and what data (message type) you are sending to or receiving from those systems.

To set up the distribution model, proceed as follows:

1. In SAP ERP/SAP S/4HANA Customizing, go to SAP Customizing Implementation Guide SAP NetWeaver Application Server IDoc Interface/Application Link Enabling (ALE) Modeling and Implementing Business Processes Master Data Distribution Serialization for Sending and Receiving Data Maintain Distribution Model . Alternatively, execute transaction BD64.

2. Create the model by selecting the option Create Model View.3. Enter the required fields to create the model.4. Select the model you created and select the option Add Message Type. Here enter the Sender (For

example, <SystemID>CLNT<ClientNumber>), Receiver (Created partner profile number), and Message Type that you want to send.

5. Save your entries.

After the above configuration is done, you can proceed with creating or changing a material, a supplier, and so on.

For more information, refer to Distribution Model.

PREPARATION OF SAP ERP OR SAP S/4HANA ON PREMISE SYSTEMS FOR PROCESSING DATA

SAP Supply Base Optimization uses standard IDocs for processing master data like materials, suppliers, contacts, and order history. For enabling SAP ERP or SAP S/4HANA On Premise to send data related to Approved Manufacturer List (AML), Approved Supplier List (ASL), or Material Group, you must implement RFC-enabled function modules. The RFCs that are created are then configured to be called in the SAP Cloud Platform Integration integration flows, to enable the data to be pulled by SAP Cloud Platform Integration and, in turn, pushed to SAP Supply Base Optimization.

Prerequisites:

The following table types need to be created as per the structure given below for the respective master data. The sample code implementation cannot be executed without these table types:

ZMAT_GRP_T

Component Component Type

MATKL MATKL

SPRAS SPRAS

WGBEZ60 WGBEZ60

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 7

Page 8: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

ZSOURCELIST_T

Component Component Type

MATNR MATNR

WERKS EWERK

ZEORD DZEORD

ERDAT ERDAT

VDATU ORDAB

BDATU ORDBI

LIFNR ELIFN

EMATN EMATN

EKORG EKORG

MFRNR MFRNR

ZAMPL_READ_T

Component Component Type

BMATN BMATN

EMATN EMATN

WERKS WERKS

MFRNR MFRNR

DATUV DATUV

DATUB DATUB

REOAM REOAM

ZSSO_T_AWARD_INFO

Component Component Type

MATERIALID MATNR

MPNID EMATN

MANUFACTURERID MFRNR

MATERIALREVISION REVLV

AWARDPRICE BAPICUREXT

8 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 9: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

Component Component Type

WERKS WERKS_D

CURRENCYCODE WAERS

AWARDSPLIT QUOTE

LEADTIME PLIFZ

PRICEDATEFROM QUOBI

PRICEDATETO QUOAB

CREATIONDATE ERDAT

CREATEDBY ERNAM

UNITOFMEASURE MEINS

NONCANCELABLE CHAR1

NONREFUNDABLE CHAR1

SHIPMENTTERM CHAR2

MINORDERQTY MINBM

MINORDERQTYUOM MEINS

SCALEPRICEFROM QUBAS

SCALEPRICETO QUBAS

QUOTEPRICE BAPICUREXT

SUPPLIERID LIFNR

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 9

Page 10: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

The sample implementation of the function modules can be found below:

Master Data Sample Code

Material Group

Sample Code

FUNCTION z_sso_materialgroup_read. *"----------------------------------------------------------------------*"*"Local Interface:*" IMPORTING*" VALUE(IV_DATE_SYNC_LAST) TYPE CDHDR-UDATE DEFAULT '20181101'*" VALUE(IV_DATE_SYNC_UNTIL) TYPE CDHDR-UDATE DEFAULT '99991231'*" VALUE(IV_TIME_SYNC_UNTIL) TYPE CDHDR-UTIME DEFAULT '235959'*" VALUE(IV_TIME_SYNC_LAST) TYPE CDHDR-UTIME DEFAULT '000000'*" EXPORTING*" VALUE(ET_MAT_GRP) TYPE ZMAT_GRP_T*"---------------------------------------------------------------------- TYPES: BEGIN OF mg_num, sign TYPE c LENGTH 1, option TYPE c LENGTH 2, low TYPE cdred-objectid, high TYPE cdred-objectid, END OF mg_num. DATA: ls_mg_num TYPE mg_num, lt_mg_num TYPE TABLE OF mg_num, ls_editpos TYPE cdred, lt_editpos TYPE ttcdred, lt_editpos_prc TYPE ttcdred, lv_lines TYPE i. CALL FUNCTION 'CHANGEDOCUMENT_READ' EXPORTING objectclass = 'WBASISWG' date_until = iv_date_sync_until time_until = iv_time_sync_until TABLES editpos = lt_editpos EXCEPTIONS no_position_found = 1 wrong_access_to_archive = 2 time_zone_conversion_error = 3 OTHERS = 4. IF sy-subrc <> 0.* Implement suitable error handling here ENDIF. LOOP AT lt_editpos INTO ls_editpos .* IF ls_editpos-objectid = 'TEST123'.* RETURN.* ENDIF. IF ls_editpos-udate LE iv_date_sync_until AND ls_editpos-udate GE iv_date_sync_last AND ls_editpos-utime LE iv_time_sync_until AND ls_editpos-utime GE iv_time_sync_last. APPEND ls_editpos TO lt_editpos_prc. CLEAR ls_editpos . ENDIF. ENDLOOP. DESCRIBE TABLE lt_editpos_prc LINES lv_lines. IF lv_lines EQ 0 . RETURN. ENDIF.

10 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 11: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

Master Data Sample Code

SORT lt_editpos_prc BY objectid . DELETE ADJACENT DUPLICATES FROM lt_editpos_prc COMPARING objectid . ls_mg_num-sign = 'I' . ls_mg_num-option = 'EQ' . LOOP AT lt_editpos_prc INTO ls_editpos. ls_mg_num-low = ls_editpos-objectid . ls_mg_num-high = ls_editpos-objectid . APPEND ls_mg_num TO lt_mg_num . ENDLOOP.*This RFC reads data from Material group table*100 for testing purpose SELECT main~matkl text~spras text~wgbez INTO TABLE et_mat_grp UP TO 100 ROWS FROM t023 AS main INNER JOIN t023t AS text ON ( main~matkl = text~matkl ) WHERE main~matkl IN lt_mg_num . ENDFUNCTION.

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 11

Page 12: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

Master Data Sample Code

Approved Manufacturer List

Sample Code

FUNCTION z_sso_ampl_read. *"----------------------------------------------------------------------*"*"Local Interface:*" IMPORTING*" VALUE(IV_DATE_SYNC_LAST) TYPE CDHDR-UDATE DEFAULT '20181101'*" VALUE(IV_DATE_SYNC_UNTIL) TYPE CDHDR-UDATE DEFAULT '99991231'*" VALUE(IV_TIME_SYNC_UNTIL) TYPE CDHDR-UTIME DEFAULT '235959'*" VALUE(IV_TIME_SYNC_LAST) TYPE CDHDR-UTIME DEFAULT '000000'*" EXPORTING*" VALUE(ET_AMPL) TYPE ZAMPL_READ_T*"---------------------------------------------------------------------- TYPES: BEGIN OF ampl_num, sign TYPE c LENGTH 1, option TYPE c LENGTH 2, low TYPE cdred-objectid, high TYPE cdred-objectid, END OF ampl_num. DATA: ls_ampl_num TYPE ampl_num, lt_ampl_num TYPE TABLE OF ampl_num, ls_editpos TYPE cdred, lt_editpos TYPE ttcdred, lt_editpos_prc TYPE ttcdred, lv_lines TYPE i.*Get the changed objects between the input date and time CALL FUNCTION 'CHANGEDOCUMENT_READ' EXPORTING objectclass = 'AMPL' date_until = iv_date_sync_until time_until = iv_time_sync_until TABLES editpos = lt_editpos EXCEPTIONS no_position_found = 1 wrong_access_to_archive = 2 time_zone_conversion_error = 3 OTHERS = 4. IF sy-subrc <> 0 .* Implement suitable error handling here ENDIF. LOOP AT lt_editpos INTO ls_editpos . IF ls_editpos-udate LE iv_date_sync_until AND ls_editpos-udate GE iv_date_sync_last AND ls_editpos-utime Le iv_time_sync_until AND ls_editpos-utime GE iv_time_sync_last. APPEND ls_editpos TO lt_editpos_prc. CLEAR ls_editpos . ENDIF. ENDLOOP. DESCRIBE TABLE lt_editpos_prc LINES lv_lines. IF lv_lines EQ 0 . RETURN. ENDIF. SORT lt_editpos_prc BY objectid . DELETE ADJACENT DUPLICATES FROM lt_editpos_prc COMPARING objectid . ls_ampl_num-sign = 'I' .

12 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 13: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

Master Data Sample Code

ls_ampl_num-option = 'EQ' . LOOP AT lt_editpos_prc INTO ls_editpos. ls_ampl_num-low = ls_editpos-objectid . ls_ampl_num-high = ls_editpos-objectid . APPEND ls_ampl_num TO lt_ampl_num . ENDLOOP.*Get the list of AMPL that have been changed SELECT bmatn ematn werks mfrnr datuv datub reoam INTO TABLE et_ampl FROM ampl WHERE bmatn IN lt_ampl_num . ENDFUNCTION.

Approved Supplier List

Sample Code

FUNCTION z_sso_source_list_read. *"----------------------------------------------------------------------*"*"Local Interface:*" IMPORTING*" VALUE(IV_DATE_SYNC_LAST) TYPE CDHDR-UDATE DEFAULT '20181101'*" VALUE(IV_DATE_SYNC_UNTIL) TYPE CDHDR-UDATE DEFAULT '99991231'*" VALUE(IV_TIME_SYNC_UNTIL) TYPE CDHDR-UTIME DEFAULT '235959'*" VALUE(IV_TIME_SYNC_LAST) TYPE CDHDR-UTIME DEFAULT '000000'*" EXPORTING*" VALUE(ET_SOURCELIST) TYPE ZSOURCELIST_T*"---------------------------------------------------------------------- DATA: tz TYPE ttzz-tzone VALUE 'UTC', teord TYPE TABLE OF eord. CONVERT DATE iv_date_sync_last TIME iv_time_sync_last INTO TIME STAMP DATA(last_sync_ts) TIME ZONE tz. CONVERT DATE iv_date_sync_until TIME iv_time_sync_until INTO TIME STAMP DATA(sync_until_ts) TIME ZONE tz. SELECT matnr werks zeord erdat vdatu bdatu lifnr ematn ekorg FROM eord INTO CORRESPONDING FIELDS OF TABLE et_sourcelist UP TO 500 ROWS WHERE lastchangedatetime BETWEEN last_sync_ts AND sync_until_ts . ENDFUNCTION.

NoteThe above function modules that are provided as sample implementation provide a basic template that can be changed as per your requirements. The sample implementation ensures that the basic scenario of updating the Purchase Info Record and Quota Arrangements is covered as part of integration.

In case there is any deviation or customer requirement for enhancing the sample implementation, you are free to change it. The integration flows provided as part of SAP Cloud Platform Integration setup consider the mapping given as part of the Appendix in this document. In case of any deviation from the standard mapping, you must carry out the necessary adjustments.

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 13

Page 14: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

3.3 Setup for Inbound IDocs - To SAP ERP or SAP S/4HANA On Premise Using SAP Cloud Platform Integration

Registration of Service for SOAP Runtime

Proceed as follows:

1. In SAP ERP/SAP S/4HANA Customizing, go to SAP Customizing Implementation Guide SAP NetWeaver Application Server IDoc Interface/Application Link Enabling (ALE) Basic SettingsInbound SOAP for IDoc: Register Service . Alternatively, execute transaction SRTIDOC.

2. Execute the transaction with the default values and with the option Register Service selected.Registration should be successful and confirmed by a success message.

NoteIf this service has already been registered, you get an error message indicating that access address is already used for the web service. In such a case, this step can be ignored as the SOAP service is already registered and running.

Testing SOAP Runtime Service for Inbound IDocs

Proceed as follows:

1. Go to Tools Administration Administration Network HTTP Service Hierarchy Maintenance . Alternatively, execute transaction SICF.

2. Choose Hierarchy Type SERVICE and execute.

3. Navigate to Default Host sap bc srt IDoc . Right-click and choose Test Service.4. Note the URL that is displayed in your browser. This is the URL to which your IDoc adapter in SAP Cloud

Platform Integration needs to point. The URL must be in the format, http://host:port/sap/bc/srt/idoc?sap-client=<clientnumber>.

5. Note that when you use SAP Cloud Platform Integration, the URL can change because SAP Cloud Platform Integration accesses your SAP ERP or SAP S/4HANA On Premise system from the Internet.

6. Enter the following fields:○ http or https – Depending on what your network administrator has allowed○ Hostname – Either a Reverse Proxy/Web Dispatcher or SAP HANA Cloud Connector Host Name.○ Port – Either a Reverse Proxy/Web Dispatcher or SAP HANA Cloud Connector Port.

Partner Profile

In the partner profile created above, follow the steps described below:

1. Choose Create Inbound Parameter button.2. In the Inbound Parameters window that opens, enter the relevant message type.3. On the Inbound Options tab, enter the relevant process code (Refer to Appendix) and select the Cancel

Processing after Syntax Error indicator. Also select the option Trigger Immediately in the Processing by Function Module box.

4. Save your entries.

For more information, refer to Defining Partners.

Distribution Model

14 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 15: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

In the distribution model set up above, follow the steps described below:

1. To modify the distribution model, switch the processing mode by pressing F9.2. Select the distribution model created for the outbound process and choose the Add Message Type button.3. Enter the partner profile created in the above steps as the receiver and the partner profile of the system

(Example: <SystemID>CLNT<ClientNumber>).4. Enter any one of the message types that will be sent to this system.5. Press Enter.6. Repeat this process for each of the message types that will be sent to this system.

For more information, refer to Distribution Model.

SAP Cloud Connector

The SAP Cloud Connector serves as the link between on-demand applications in SAP Cloud Platform Integration and existing on-premise systems. It combines an easy setup with a clear configuration of the systems that are exposed to the SAP Cloud Platform Integration. In addition, you can control the resources available for the Cloud applications in those systems. You can therefore benefit from your existing assets without exposing the whole internal landscape.

You need to configure SAP Cloud Connector only if data from SAP Supply Base Optimization is being updated back to SAP ERP or SAP S/4HANA On Premise. For the initial configuration of SAP Cloud Connector, refer to Cloud Connector topic in the SAP Cloud Platform Integration Connectivity documentation.

Creating SCC Virtual Address for SOAP Runtime Service for Inbound IDocs

1. Access Cloud Connector Cockpit using the appropriate URL.

2. Navigate to Navigation Cloud To On-Premise .3. If you have subaccounts, search for the subaccount and select the one you are using.4. In the Access Control tab, choose the + (Add) button that is located in the Mapping Virtual To Internal

System table toolbar. The Add System Mapping window opens.5. From the menu list, select SAP HANA System and choose Next.6. Select your protocol, HTTPS, and choose Next.7. Enter the user-defined virtual host name and port number following the example below:

Field Name Entry Value

Internal Host <SAP S/4HANA system host>

Internal Port <44300>

Choose Next.

NoteIf you are using a VPN, enter your VPN IP address in the connection details. Otherwise, enter the network machine name.

If you are using a VPN connection, remember that the IP address comes from DHCP and could change.

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 15

Page 16: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

8. Type your IP address and port number following the example below:

Field Name Entry Value

Virtual Host <sap.s4hana>

Virtual Port <44300>

NoteGive your connection a virtual name to make it easy to recognize and use the same port number as in the previous step.

Choose Next.

9. Retain the Principal Type field with value: None.Choose Next.

10. In the Description field, explain the purpose of the connection.Choose Next.

11. On the review settings screen, choose Finish button.12. Set up the initial RFC configuration; refer to Initial Configuration (RFC).

The sample codes given later in this chapter can be referred to while configuring.

Error Handling

Once the IDoc is triggered from SAP Supply Base Optimization, it gets updated to a specific status in SAP ERP or SAP S/4HANA On Premise. However, depending on the IDoc data getting successfully posted or not in SAP Supply Base Optimization, the SAP ERP/SAP S/4HANA On Premise status must also get updated.

Based on successful or unsuccessful posting, the IDoc status gets updated as follows:

● 51 – Application document not posted (Unsuccessful posting)● 53 – Application document posted (Successful posting)

You can reset this as follows:

1. In the Partner Profiles function (WE20 transaction), open details of the logical system you have created above.

2. In Inbound Parameters table, add a message type STATUS with the following details:○ Partner No.: Enter the partner profile created.○ Partner Type: LS (Logical system)○ On Inbound Options tab, in Process Code, enter STA2.○ Choose the Trigger Immediately option (Recommended).

Sample Codes

For processing data prepared by SAP Supply Base Optimization, you need an inbound RFC-enabled function module that needs to be created. The created RFCs are then configured to be called in the SAP Cloud Platform Integration integration flow, to enable the data to be pushed by SAP Cloud Platform Integration from SAP Supply Base Optimization.

16 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 17: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

Sample code for Purchase Info Record/Quota Arrangements update (SAP S/4HANA):

Sample Code

function zsso_award_update. *"----------------------------------------------------------------------*"*"Local Interface:*" IMPORTING*" VALUE(PURCHASEINFORECORDFLAG) TYPE CHAR01*" VALUE(QUOTAFLAG) TYPE CHAR01*" EXPORTING*" VALUE(ET_RETURN) TYPE BAPIRETURN_T*" TABLES*" IT_AWARD TYPE ZSSO_T_AWARD_INFO*"---------------------------------------------------------------------- types : begin of ty_info, matnr type matnr, supplierid type lifnr, mpn type ematn, manufacturerid type mfrnr, info_rec type infnr, quota_num type qunum, plant type werks, purchase_org type ekorg, end of ty_info, begin of ty_material_profile, matnr type matnr, material_profile type mprof, mpn_flag type mpnpf, end of ty_material_profile, begin of ty_plant_details, matnr type matnr, lifnr type lifnr, werks type werks, ekorg type ekorg, end of ty_plant_details, begin of ty_scale, matnr type matnr, supplierid type lifnr, mpn type ematn, manufacturerid type mfrnr, info_rec type infnr, quota_num type qunum, serial_no type knumh, cond_count type kopos, line_no type klfn1, scale_base_qty type kstbm, cond_value type bapicurext, end of ty_scale. data: ls_equku type equku, ls_equpu type equpu, ls_item type equp, ls_header type equk, lt_award type standard table of zsso_s_award_info, ls_award type zsso_s_award_info, lt_equpu type standard table of equpu, lt_equpu_y type standard table of equpu, lv_update_flag type abap_bool, lt_equku type standard table of equku, lt_equku_y type standard table of equku, lt_equku_read type standard table of equku, ls_equku_read type equku, lt_equpu_tmp type standard table of equpu, lv_quotaarr_no type qunum, ls_eina_read type eina, lt_eina_read type standard table of eina,

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 17

Page 18: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

ls_eine_read type eine, lt_eine_read type standard table of eine, lt_eina type mewieina_mig_t, lt_einax type mewieinax_t, ls_einax type mewieinax_ty, lt_einex type mewieinex_t, ls_einex type mewieinex_ty, lt_final_eina type mewieina_mig_t, lt_final_eine type mewieine_t, ls_eina type mewieina_mig, lt_eine type mewieine_t, ls_eine type mewieine_ty, lt_condition type mewicondition_tt, ls_condition type mewicondition_ty, lt_cond_valid type mewivalidity_tt, ls_cond_valid type mewivalidity_ty, ls_info_read type ty_info, ls_info type ty_info, lt_info type standard table of ty_info, ls_scale type ty_scale, lt_scale type standard table of ty_scale, lt_scale_quan type MEWISCALEQUAN_TT, ls_scale_quan type MEWISCALEQUAN_TY, ls_scale_read type ty_scale, lt_material type standard table of ty_material_profile, ls_material type ty_material_profile, lt_plant_info type standard table of ty_plant_details, ls_plant_info type ty_plant_details, lt_return type fs4mig_t_bapiret2, ls_return type fs4mig_s_bapiret2, ls_e_return type bapiret2, lv_count type i, lv_pir_count type i, lv_number(9) type n, lv_material_id type matnr, lv_index type i. data: lv_pir_number_range(10) type n, "-- Variable to hold Newly generated Number Range lv_quota_number_range(10) type n, "-- Variable to hold Newly generated Number Range lv_rc type inri-returncode. lv_count = 00.* Get the actual data saved for quota if it_award is not initial. lt_award[] = it_award[]. delete lt_award where materialid is initial. sort lt_award ascending by supplierid materialid mpnid manufacturerid pricedatefrom pricedateto scalepricefrom. select m1~matnr m2~mprof t1~mpnpf from mara as m1 inner join mara as m2 on m2~matnr = m1~bmatn inner join tmppf as t1 on t1~mprof = m2~mprof into table lt_material for all entries in lt_award where m1~matnr = lt_award-materialid and t1~mpnpf = ''. select * from eina into table lt_eina_read for all entries in lt_award where ( matnr = lt_award-materialid and lifnr = lt_award-supplierid " and mfrnr = lt_award-manufacturerid ) or ( matnr = lt_award-mpnid and lifnr = lt_award-supplierid and loekz <> 'X' " and mfrnr = lt_award-manufacturerid ) .

18 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 19: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

select * from eine into table lt_eine_read for all entries in lt_eina_read where ( infnr = lt_eina_read-infnr and loekz <> 'X' " and mfrnr = lt_award-manufacturerid ) . select * from equk into table lt_equku_read for all entries in lt_award where matnr = lt_award-materialid. "and bdatu = lt_award-pricedateto "and vdatu = lt_award-pricedatefrom. select e~matnr e~lifnr e~werks e~ekorg from eord as e into table lt_plant_info for all entries in lt_award where e~matnr = lt_award-materialid and e~lifnr = lt_award-supplierid and e~vdatu le sy-datum and e~bdatu ge sy-datum. loop at lt_award into ls_award. " Preparing data for filling Purchase info record General Data ls_eina-base_uom = ls_award-unitofmeasure. ls_einax-base_uom = 'X'. ls_eina-vendor = ls_award-supplierid. ls_einax-vendor = 'X'. " Preparing data for filling Purchase info record Organizational Data ls_eine-currency = ls_award-currencycode. ls_einex-currency = 'X'. ls_eine-eff_price = ls_award-awardprice. ls_einex-eff_price = 'X'. ls_eine-net_price = ls_award-awardprice. ls_einex-net_price = 'X'.* ls_eine-plant = ls_eine-plnd_delry = ls_award-leadtime. ls_einex-plnd_delry = 'X'. ls_eine-created_at = ls_award-creationdate. ls_einex-created_at = 'X'. ls_eine-created_by = ls_award-createdby. ls_einex-created_by = 'X'. "ls_eine-shipping = ls_award-shipmentterm. "ls_einex-shipping = 'X'. ls_eine-vendor = ls_award-supplierid. ls_einex-vendor = 'X'. ls_eine-quot_date = ls_award-pricedateto. ls_einex-quot_date = 'X'. ls_eine-nrm_po_qty = 0. ls_einex-nrm_po_qty = 'X'. ls_eine-min_po_qty = ls_award-minorderqty. ls_einex-min_po_qty = 'X'. ls_eine-pur_group = '001'. ls_einex-pur_group = 'X'. ls_eine-info_type = '0'. ls_einex-info_type = 'X'. " Preparing data for filling Purchase info record Condition quantity Data if ls_award-scalepricefrom is not initial. ls_scale-matnr = ls_award-materialid. ls_scale-supplierid = ls_award-supplierid. ls_scale-manufacturerid = ls_award-manufacturerid. ls_scale-mpn = ls_award-mpnid. ls_scale-scale_base_qty = ls_award-scalepricefrom. ls_scale-cond_value = ls_award-quoteprice. ls_scale_quan-cond_value = ls_award-quoteprice. ls_scale_quan-scale_base_qty = ls_award-scalepricefrom. endif. ls_condition-cond_type = 'PB00'. ls_condition-cond_value = ls_award-awardprice. ls_condition-cond_unit = ls_award-unitofmeasure. ls_condition-vendor_no = ls_award-supplierid. ls_condition-eine_indx = ls_eine-eine_indx.

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 19

Page 20: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

ls_condition-currency = ls_award-currencycode. ls_condition-change_id = 'I'. ls_cond_valid-valid_from = ls_award-pricedatefrom. ls_cond_valid-valid_to = ls_award-pricedateto. ls_cond_valid-base_uom = ls_award-unitofmeasure. ls_cond_valid-eine_indx = ls_eine-eine_indx. read table lt_scale into ls_scale_read with key supplierid = ls_award-supplierid manufacturerid = ls_award-manufacturerid matnr = ls_award-materialid mpn = ls_award-mpnid. if sy-subrc = 0. ls_scale-line_no = lv_count + 1. ls_scale_quan-line_no = lv_count + 1. lv_count = lv_count + 1. else. lv_count = 01. ls_scale-line_no = lv_count. ls_scale_quan-line_no = lv_count. endif. ls_info-manufacturerid = ls_award-manufacturerid. ls_info-matnr = ls_award-materialid. ls_info-mpn = ls_award-mpnid. ls_info-supplierid = ls_award-supplierid. " Preparing data for Quota Arrangement Header ls_equku-bdatu = ls_award-pricedateto. ls_equku-vdatu = ls_award-pricedatefrom. ls_equku-erdat = ls_award-creationdate. ls_equku-ernam = ls_award-createdby. ls_equku-scmng = 100. " Preparing data for Quota Arrangement Document* ls_equpu-werks = ls_equpu-verid = ls_award-materialrevision. ls_equpu-lifnr = ls_award-supplierid. ls_equpu-plifz = ls_award-leadtime. ls_equpu-quote = ls_award-awardsplit. ls_equpu-beskz = 'F'. " Preparing the material number based on the material profile. read table lt_material into ls_material with key matnr = ls_award-materialid. if sy-subrc = 0. ls_equku-matnr = ls_award-materialid. ls_equpu-ematn = ls_award-materialid. ls_eina-material = ls_award-materialid. ls_einax-material = 'X'. lv_material_id = ls_award-materialid. else. ls_equku-matnr = ls_award-materialid. ls_equpu-ematn = ls_award-mpnid. ls_eina-material = ls_award-mpnid. ls_einax-material = 'X'. lv_material_id = ls_award-mpnid. endif. if purchaseinforecordflag eq 'I'. read table lt_eina_read into ls_eina_read with key matnr = lv_material_id lifnr = ls_award-supplierid."mfrnr = ls_award-manufacturerid . if sy-subrc = 0. ls_eina-info_rec = ls_eina_read-infnr. " Read from Purchase info record which should be updated. "ls_einax-info_rec = 'X'. "ls_einex-info_rec = 'X'. ls_eine-info_rec = ls_eina_read-infnr. ls_einax-info_recn = ls_eina_read-infnr. ls_einex-info_recn = ls_eina_read-infnr. ls_scale-info_rec = ls_eina_read-infnr. ls_scale_quan-info_rec = ls_eina_read-infnr. ls_info-info_rec = ls_eina_read-infnr. ls_cond_valid-info_rec = ls_eina_read-infnr. ls_condition-info_rec = ls_eina_read-infnr. else.

20 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 21: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

read table lt_info into ls_info_read with key supplierid = ls_award-supplierid manufacturerid = ls_award-manufacturerid matnr = ls_award-materialid mpn = ls_award-mpnid. if sy-subrc ne 0. call function 'NUMBER_GET_NEXT' exporting nr_range_nr = '03' "-- This hold the Newly generated Number object = 'INFOSATZ' "---- Passing the Number Range Object importing number = lv_pir_number_range "-- Newly generated Number returncode = lv_rc "-- The Return Code Number exceptions interval_not_found = 1 number_range_not_intern = 2 object_not_found = 3 quantity_is_0 = 4 quantity_is_not_1 = 5 interval_overflow = 6 buffer_overflow = 7 others = 8. if sy-subrc <> 0. message id sy-msgid type sy-msgty number sy-msgno with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. endif.* concatenate '$' lv_number into lv_pir_number_range. ls_eina-info_rec = lv_pir_number_range. ls_einax-info_rec = 'X'. ls_einax-info_recn = lv_pir_number_range. ls_eine-info_rec = lv_pir_number_range. ls_einex-info_rec = 'X'. ls_einex-info_recn = lv_pir_number_range. ls_scale-info_rec = lv_pir_number_range. ls_scale_quan-info_rec = lv_pir_number_range. ls_info-info_rec = lv_pir_number_range. ls_condition-info_rec = lv_pir_number_range. ls_cond_valid-info_rec = lv_pir_number_range.* ls_equku-qunum = lv_quota_number_range.* ls_equpu-qunum = lv_quota_number_range.* ls_info-quota_num = lv_quota_number_range.* append ls_info to lt_info. else. ls_eina-info_rec = ls_info_read-info_rec.* ls_einax-info_rec = 'X'.* ls_einex-info_rec = 'X'. ls_eine-info_rec = ls_info_read-info_rec. ls_einex-info_recn = ls_info_read-info_rec. ls_einax-info_recn = ls_info_read-info_rec. ls_condition-info_rec = ls_info_read-info_rec. ls_cond_valid-info_rec = ls_info_read-info_rec. ls_scale-info_rec = ls_info_read-info_rec. ls_scale_quan-info_rec = ls_info_read-info_rec. endif.* else.* read table lt_eina_read into ls_eina_read with key mfrnr = ls_award-manufacturerid matnr = ls_award-materialid lifnr = ls_award-supplierid.* if sy-subrc = 0.* ls_eina-info_rec = ls_eina_read-infnr. " Read from Purchase info record which should be updated.* ls_einax-info_rec = 'X'.* ls_einex-info_rec = 'X'.* ls_eine-info_rec = ls_eina_read-infnr.* ls_einax-info_recn = ls_eina_read-infnr.* ls_einex-info_recn = ls_eina_read-infnr.

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 21

Page 22: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

* ls_scale-info_rec = ls_eina_read-infnr.* else.** endif.* ls_equku-qunum = ls_info_read-quota_num.* ls_equpu-qunum = ls_info_read-quota_num. endif. endif. if quotaflag eq 'I'. read table lt_equku_read into ls_equku_read with key matnr = ls_award-materialid." bdatu = ls_award-pricedateto vdatu = ls_award-pricedatefrom. if sy-subrc = 0. ls_equku-qunum = ls_equku_read-qunum. ls_equpu-qunum = ls_equku_read-qunum. ls_equku-kz = 'U'. ls_equpu-kz = 'U'. ls_info-quota_num = ls_equku_read-qunum. else. call function 'NUMBER_GET_NEXT' exporting nr_range_nr = '01' "-- This hold the Newly generated Number object = 'QUOTIERUNG' "---- Passing the Number Range Object importing number = lv_quota_number_range "-- Newly generated Number returncode = lv_rc "-- The Return Code Number exceptions interval_not_found = 1 number_range_not_intern = 2 object_not_found = 3 quantity_is_0 = 4 quantity_is_not_1 = 5 interval_overflow = 6 buffer_overflow = 7 others = 8. if sy-subrc <> 0. message id sy-msgid type sy-msgty number sy-msgno with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. endif. ls_equku-qunum = lv_quota_number_range. ls_equpu-qunum = lv_quota_number_range. ls_equku-kz = 'I'. ls_equpu-kz = 'I'. ls_info-quota_num = lv_quota_number_range. endif. else. loop at lt_equku_read into ls_equku_read where matnr = ls_award-materialid and bdatu = ls_award-pricedateto and vdatu = ls_award-pricedatefrom. read table lt_plant_info into ls_plant_info with key matnr = ls_award-materialid lifnr = ls_award-supplierid werks = ls_equku_read-werks. if sy-subrc = 0. ls_equku-qunum = ls_equku_read-qunum. ls_equpu-qunum = ls_equku_read-qunum. ls_equku-kz = 'U'. ls_equpu-kz = 'U'. ls_info-quota_num = ls_equku_read-qunum. ls_equpu-bewrk = ls_plant_info-werks. ls_equku-werks = ls_plant_info-werks. ls_cond_valid-plant = ls_plant_info-werks. endif. append ls_equpu to lt_equpu. endloop. endif.

22 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 23: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

loop at lt_plant_info into ls_plant_info where matnr = ls_award-materialid and lifnr = ls_award-supplierid. ls_eine-plant = ls_plant_info-werks. ls_einex-plant = 'X'. ls_eine-purch_org = ls_plant_info-ekorg. ls_einex-purch_org = 'X'. ls_info-plant = ls_plant_info-werks. ls_info-purchase_org = ls_plant_info-ekorg. ls_cond_valid-plant = ls_plant_info-werks. read table lt_eine with key info_rec = ls_eine-info_rec currency = ls_eine-currency eff_price = ls_eine-eff_price net_price = ls_eine-net_price plnd_delry = ls_eine-plnd_delry plant = ls_eine-plant vendor = ls_eine-vendor quot_date = ls_eine-quot_date pur_group = ls_eine-pur_group info_type = ls_eine-info_type transporting no fields. if sy-subrc <> 0. append ls_eine to lt_eine. append ls_einex to lt_einex. endif. append ls_info to lt_info. read table lt_cond_valid with key info_rec = ls_cond_valid-info_rec plant = ls_cond_valid-plant base_uom = ls_cond_valid-base_uom eine_indx = ls_cond_valid-eine_indx serial_id = ls_cond_valid-serial_id valid_from = ls_cond_valid-valid_from valid_to = ls_cond_valid-valid_to transporting no fields. if sy-subrc <> 0. append ls_cond_valid to lt_cond_valid. endif. endloop. read table lt_eina with key info_rec = ls_eina-info_rec material = ls_eina-material vendor = ls_eina-vendor base_uom = ls_eina-base_uom transporting no fields. if sy-subrc <> 0. append ls_eina to lt_eina. append ls_einax to lt_einax. endif. read table lt_condition with key cond_type = ls_condition-cond_type cond_value = ls_condition-cond_value base_uom = ls_condition-base_uom vendor_no = ls_condition-vendor_no eine_indx = ls_condition-eine_indx currency = ls_condition-currency change_id = ls_condition-change_id transporting no fields. if sy-subrc <> 0. append ls_condition to lt_condition. endif. if ls_award-scalepricefrom is not initial. append ls_scale_quan to lt_scale_quan. append ls_scale to lt_scale. endif. read table lt_equku with key werks = ls_equku-werks qunum = ls_equku-qunum matnr = ls_equku-matnr bdatu = ls_equku-bdatu vdatu = ls_equku-vdatu kz = ls_equku-kz transporting no fields. if sy-subrc <> 0. append ls_equku to lt_equku. endif. endloop. call function 'ME_INFORECORD_MAINTAIN_MULTI' importing et_eina = lt_final_eina et_eine = lt_final_eine tables t_eina = lt_eina t_eine = lt_eine t_einax = lt_einax t_einex = lt_einex condition = lt_condition cond_validity = lt_cond_valid cond_scale_quan = lt_scale_quan

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 23

Page 24: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

return = lt_return. loop at lt_return into ls_return. move-corresponding ls_return to ls_e_return. append ls_e_return to et_return. endloop. if sy-subrc <> 0. rollback work. else. commit work. write: / 'DONE'. endif. lv_count = 0. describe table lt_final_eina lines lv_count. if lv_count > 0. if quotaflag eq 'I'. lt_equku_y = lt_equku. clear lt_equku_y. call function 'ME_UPDATE_QUOTA' tables xequk = lt_equku xequp = lt_equpu yequk = lt_equku_y yequp = lt_equpu_y. else. call function 'ME_UPDATE_QUOTA' tables xequk = lt_equku xequp = lt_equpu yequk = lt_equku yequp = lt_equpu. endif. if sy-subrc <> 0. rollback work. else. commit work. write: / 'DONE'. endif. endif. endif. endfunction.

Sample code for Purchase Info Record/Quota Arrangements update (SAP ERP):

Sample Code

function zsso_award_update. *"----------------------------------------------------------------------*"*"Local Interface:*" IMPORTING*" VALUE(PURCHASEINFORECORDFLAG) TYPE CHAR01*" VALUE(QUOTAFLAG) TYPE CHAR01*" EXPORTING*" VALUE(ET_RETURN) TYPE BAPIRETURN_T*" CHANGING*" VALUE(IT_AWARD) TYPE ZSSO_T_AWARD_INFO*"---------------------------------------------------------------------- types : begin of ty_info, matnr type matnr, supplierid type lifnr, mpn type ematn, manufacturerid type mfrnr, info_rec type infnr, quota_num type qunum, plant type werks, purchase_org type ekorg, end of ty_info,

24 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 25: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

begin of ty_material_profile, matnr type matnr, material_profile type mprof, mpn_flag type mpnpf, end of ty_material_profile, begin of ty_plant_details, matnr type matnr, lifnr type lifnr, werks type werks, ekorg type ekorg, end of ty_plant_details, begin of ty_scale, matnr type matnr, supplierid type lifnr, mpn type ematn, manufacturerid type mfrnr, info_rec type infnr, quota_num type qunum, serial_no type knumh, cond_count type kopos, line_no type klfn1, scale_base_qty type kstbm, cond_value type bapicurext, end of ty_scale. data: ls_equku type equku, ls_equpu type equpu, ls_item type equp, ls_header type equk, lt_award type standard table of zsso_s_award_info, ls_award type zsso_s_award_info, lt_equpu type standard table of equpu, lt_equpu_y type standard table of equpu, lv_update_flag type abap_bool, lt_equku type standard table of equku, lt_equku_y type standard table of equku, lt_equku_read type standard table of equku, ls_equku_read type equku, lt_equpu_tmp type standard table of equpu, lv_quotaarr_no type qunum, ls_eina_read type eina, lt_eina_read type standard table of eina, ls_eine_read type eine, lt_eine_read type standard table of eine, lt_eina type mewieina_t, lt_einax type mewieinax_t, ls_einax type mewieinax_ty, lt_einex type mewieinex_t, ls_einex type mewieinex_ty, lt_final_eina type mewieina_t, lt_final_eine type mewieine_t, ls_eina type mewieina, lt_eine type mewieine_t, ls_eine type mewieine_ty, lt_condition type mewicondition_tt, ls_condition type mewicondition_ty, lt_cond_valid type mewivalidity_tt, ls_cond_valid type mewivalidity_ty, ls_info_read type ty_info, ls_info type ty_info, lt_info type standard table of ty_info, ls_scale type ty_scale, lt_scale type standard table of ty_scale, lt_scale_quan type mewiscalequan_tt, ls_scale_quan type mewiscalequan_ty, ls_scale_read type ty_scale, lt_material type standard table of ty_material_profile, ls_material type ty_material_profile,

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 25

Page 26: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

lt_main_material type standard table of ty_material_profile, ls_main_material type ty_material_profile, lt_plant_info type standard table of ty_plant_details, ls_plant_info type ty_plant_details, lt_return type mewi_tt_return, ls_return type mewi_ty_return, ls_e_return type bapiret2, lv_count type i, lv_pir_count type i, lv_number(9) type n, lv_material_id type matnr, lv_index type i. data: lv_pir_number_range(10) type n, "-- Variable to hold Newly generated Number Range lv_quota_number_range(10) type n, "-- Variable to hold Newly generated Number Range lv_rc type inri-returncode. lv_count = 00.* Get the actual data saved for quota if it_award is not initial. lt_award[] = it_award[]. delete lt_award where materialid is initial. delete lt_award where awardprice is initial. sort lt_award ascending by supplierid materialid mpnid manufacturerid pricedatefrom pricedateto scalepricefrom. select m1~matnr m1~mprof t1~mpnpf from mara as m1 inner join tmppf as t1 on t1~mprof = m1~mprof into table lt_main_material for all entries in lt_award where m1~matnr eq lt_award-materialid and t1~mpnpf = 'X'. if sy-subrc = 0. select m1~matnr m1~mprof from mara as m1 into table lt_material for all entries in lt_main_material where m1~bmatn = lt_main_material-matnr. endif. loop at lt_main_material into ls_main_material. append ls_main_material to lt_material. endloop. select * from eina into table lt_eina_read for all entries in lt_award where ( matnr = lt_award-materialid and lifnr = lt_award-supplierid " and mfrnr = lt_award-manufacturerid ) or ( matnr = lt_award-mpnid and lifnr = lt_award-supplierid and loekz <> 'X' " and mfrnr = lt_award-manufacturerid ) . select * from eine into table lt_eine_read for all entries in lt_eina_read where ( infnr = lt_eina_read-infnr and loekz <> 'X' " and mfrnr = lt_award-manufacturerid ) . select * from equk into table lt_equku_read for all entries in lt_award where matnr = lt_award-materialid. "and bdatu = lt_award-pricedateto "and vdatu = lt_award-pricedatefrom. select e~matnr e~lifnr e~werks e~ekorg from eord as e into table lt_plant_info

26 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 27: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

for all entries in lt_award where e~matnr = lt_award-materialid and e~lifnr = lt_award-supplierid and e~vdatu le sy-datum and e~bdatu ge sy-datum. loop at lt_award into ls_award. read table lt_material with key matnr = ls_award-materialid transporting no fields. if sy-subrc = 0. " Preparing data for filling Purchase info record General Data ls_eina-base_uom = ls_award-unitofmeasure. ls_einax-base_uom = 'X'. ls_eina-vendor = ls_award-supplierid. ls_einax-vendor = 'X'. " Preparing data for filling Purchase info record Organizational Data ls_eine-currency = ls_award-currencycode. ls_einex-currency = 'X'. ls_eine-eff_price = ls_award-awardprice. ls_einex-eff_price = 'X'. ls_eine-net_price = ls_award-awardprice. ls_einex-net_price = 'X'.* ls_eine-plant = ls_eine-plnd_delry = ls_award-leadtime. ls_einex-plnd_delry = 'X'. ls_eine-created_at = ls_award-creationdate. ls_einex-created_at = 'X'. ls_eine-created_by = ls_award-createdby. ls_einex-created_by = 'X'. "ls_eine-shipping = ls_award-shipmentterm. "ls_einex-shipping = 'X'. ls_eine-vendor = ls_award-supplierid. ls_einex-vendor = 'X'. ls_eine-quot_date = ls_award-pricedateto. ls_einex-quot_date = 'X'. ls_eine-nrm_po_qty = ls_award-minorderqty. ls_einex-nrm_po_qty = 'X'. ls_eine-min_po_qty = ls_award-minorderqty. ls_einex-min_po_qty = 'X'. ls_eine-pur_group = '001'. ls_einex-pur_group = 'X'. ls_eine-info_type = '0'. ls_einex-info_type = 'X'. " Preparing data for filling Purchase info record Condition quantity Data if ls_award-scalepricefrom is not initial. ls_scale-matnr = ls_award-materialid. ls_scale-supplierid = ls_award-supplierid. ls_scale-manufacturerid = ls_award-manufacturerid. ls_scale-mpn = ls_award-mpnid. ls_scale-scale_base_qty = ls_award-scalepricefrom. ls_scale-cond_value = ls_award-quoteprice. ls_scale_quan-cond_value = ls_award-quoteprice. ls_scale_quan-scale_base_qty = ls_award-scalepricefrom. endif. ls_condition-cond_type = 'PB00'. ls_condition-cond_value = ls_award-awardprice. ls_condition-cond_unit = ls_award-unitofmeasure. ls_condition-vendor_no = ls_award-supplierid. ls_condition-eine_indx = ls_eine-eine_indx. ls_condition-currency = ls_award-currencycode. ls_condition-change_id = 'I'. ls_cond_valid-valid_from = ls_award-pricedatefrom. ls_cond_valid-valid_to = ls_award-pricedateto. ls_cond_valid-base_uom = ls_award-unitofmeasure. ls_cond_valid-eine_indx = ls_eine-eine_indx. read table lt_scale into ls_scale_read with key supplierid = ls_award-supplierid manufacturerid = ls_award-manufacturerid matnr = ls_award-materialid mpn = ls_award-mpnid. if sy-subrc = 0. ls_scale-line_no = lv_count + 1.

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 27

Page 28: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

ls_scale_quan-line_no = lv_count + 1. lv_count = lv_count + 1. else. lv_count = 01. ls_scale-line_no = lv_count. ls_scale_quan-line_no = lv_count. endif. ls_info-manufacturerid = ls_award-manufacturerid. ls_info-matnr = ls_award-materialid. ls_info-mpn = ls_award-mpnid. ls_info-supplierid = ls_award-supplierid. " Preparing data for Quota Arrangement Header ls_equku-bdatu = ls_award-pricedateto. ls_equku-vdatu = ls_award-pricedatefrom. ls_equku-erdat = ls_award-creationdate. ls_equku-ernam = ls_award-createdby. ls_equku-scmng = 100. " Preparing data for Quota Arrangement Document* ls_equpu-werks = ls_equpu-verid = ls_award-materialrevision. ls_equpu-lifnr = ls_award-supplierid. ls_equpu-plifz = ls_award-leadtime. ls_equpu-quote = ls_award-awardsplit. ls_equpu-beskz = 'F'. " Preparing the material number based on the material profile. if ls_award-mpnid is initial. read table lt_material into ls_material with key matnr = ls_award-materialid. if sy-subrc = 0. ls_equku-matnr = ls_award-materialid. ls_equpu-ematn = ls_award-materialid. ls_eina-material = ls_award-materialid. ls_einax-material = 'X'. lv_material_id = ls_award-materialid. else. ls_equku-matnr = ls_award-materialid. ls_equpu-ematn = ls_award-mpnid. ls_eina-material = ls_award-mpnid. ls_einax-material = 'X'. lv_material_id = ls_award-mpnid. endif. else. read table lt_material into ls_material with key matnr = ls_award-mpnid. if sy-subrc = 0. ls_equku-matnr = ls_award-materialid. ls_equpu-ematn = ls_award-mpnid. ls_eina-material = ls_award-mpnid. ls_einax-material = 'X'. lv_material_id = ls_award-mpnid. endif. endif. if purchaseinforecordflag eq 'I'. read table lt_eina_read into ls_eina_read with key matnr = lv_material_id lifnr = ls_award-supplierid."mfrnr = ls_award-manufacturerid . if sy-subrc = 0. ls_eina-info_rec = ls_eina_read-infnr. " Read from Purchase info record which should be updated. "ls_einax-info_rec = 'X'. "ls_einex-info_rec = 'X'. ls_eine-info_rec = ls_eina_read-infnr. ls_einax-info_recn = ls_eina_read-infnr. ls_einex-info_recn = ls_eina_read-infnr. ls_scale-info_rec = ls_eina_read-infnr. ls_scale_quan-info_rec = ls_eina_read-infnr. ls_info-info_rec = ls_eina_read-infnr. ls_cond_valid-info_rec = ls_eina_read-infnr. ls_condition-info_rec = ls_eina_read-infnr.

28 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 29: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

else. read table lt_info into ls_info_read with key supplierid = ls_award-supplierid manufacturerid = ls_award-manufacturerid matnr = ls_award-materialid mpn = ls_award-mpnid. if sy-subrc ne 0. call function 'NUMBER_GET_NEXT' exporting nr_range_nr = '03' "-- This hold the Newly generated Number object = 'INFOSATZ' "---- Passing the Number Range Object importing number = lv_pir_number_range "-- Newly generated Number returncode = lv_rc "-- The Return Code Number exceptions interval_not_found = 1 number_range_not_intern = 2 object_not_found = 3 quantity_is_0 = 4 quantity_is_not_1 = 5 interval_overflow = 6 buffer_overflow = 7 others = 8. if sy-subrc <> 0. message id sy-msgid type sy-msgty number sy-msgno with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. endif.* concatenate '$' lv_number into lv_pir_number_range. ls_eina-info_rec = lv_pir_number_range.* ls_einax-info_rec = 'X'. ls_einax-info_recn = lv_pir_number_range. ls_eine-info_rec = lv_pir_number_range.* ls_einex-info_rec = 'X'. ls_einex-info_recn = lv_pir_number_range. ls_scale-info_rec = lv_pir_number_range. ls_scale_quan-info_rec = lv_pir_number_range. ls_info-info_rec = lv_pir_number_range. ls_condition-info_rec = lv_pir_number_range. ls_cond_valid-info_rec = lv_pir_number_range.* ls_equku-qunum = lv_quota_number_range.* ls_equpu-qunum = lv_quota_number_range.* ls_info-quota_num = lv_quota_number_range.* append ls_info to lt_info. else. ls_eina-info_rec = ls_info_read-info_rec.* ls_einax-info_rec = 'X'.* ls_einex-info_rec = 'X'. ls_eine-info_rec = ls_info_read-info_rec. ls_einex-info_recn = ls_info_read-info_rec. ls_einax-info_recn = ls_info_read-info_rec. ls_condition-info_rec = ls_info_read-info_rec. ls_cond_valid-info_rec = ls_info_read-info_rec. ls_scale-info_rec = ls_info_read-info_rec. ls_scale_quan-info_rec = ls_info_read-info_rec. endif.* else.* read table lt_eina_read into ls_eina_read with key mfrnr = ls_award-manufacturerid matnr = ls_award-materialid lifnr = ls_award-supplierid.* if sy-subrc = 0.* ls_eina-info_rec = ls_eina_read-infnr. " Read from Purchase info record which should be updated.* ls_einax-info_rec = 'X'.* ls_einex-info_rec = 'X'.* ls_eine-info_rec = ls_eina_read-infnr.* ls_einax-info_recn = ls_eina_read-infnr.

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 29

Page 30: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

* ls_einex-info_recn = ls_eina_read-infnr.* ls_scale-info_rec = ls_eina_read-infnr.* else.** endif.* ls_equku-qunum = ls_info_read-quota_num.* ls_equpu-qunum = ls_info_read-quota_num. endif. endif. if quotaflag eq 'I'. read table lt_equku_read into ls_equku_read with key matnr = ls_award-materialid." bdatu = ls_award-pricedateto vdatu = ls_award-pricedatefrom. if sy-subrc = 0. ls_equku-qunum = ls_equku_read-qunum. ls_equpu-qunum = ls_equku_read-qunum. ls_equku-kz = 'U'. ls_equpu-kz = 'U'. ls_info-quota_num = ls_equku_read-qunum. else. call function 'NUMBER_GET_NEXT' exporting nr_range_nr = '01' "-- This hold the Newly generated Number object = 'QUOTIERUNG' "---- Passing the Number Range Object importing number = lv_quota_number_range "-- Newly generated Number returncode = lv_rc "-- The Return Code Number exceptions interval_not_found = 1 number_range_not_intern = 2 object_not_found = 3 quantity_is_0 = 4 quantity_is_not_1 = 5 interval_overflow = 6 buffer_overflow = 7 others = 8. if sy-subrc <> 0. message id sy-msgid type sy-msgty number sy-msgno with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. endif. ls_equku-qunum = lv_quota_number_range. ls_equpu-qunum = lv_quota_number_range. ls_equku-kz = 'I'. ls_equpu-kz = 'I'. ls_info-quota_num = lv_quota_number_range. endif. else. loop at lt_equku_read into ls_equku_read where matnr = ls_award-materialid and bdatu = ls_award-pricedateto and vdatu = ls_award-pricedatefrom. read table lt_plant_info into ls_plant_info with key matnr = ls_award-materialid lifnr = ls_award-supplierid werks = ls_equku_read-werks. if sy-subrc = 0. ls_equku-qunum = ls_equku_read-qunum. ls_equpu-qunum = ls_equku_read-qunum. ls_equku-kz = 'U'. ls_equpu-kz = 'U'. ls_info-quota_num = ls_equku_read-qunum. ls_equpu-bewrk = ls_plant_info-werks. ls_equku-werks = ls_plant_info-werks. ls_cond_valid-plant = ls_plant_info-werks. endif. append ls_equpu to lt_equpu. endloop.

30 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 31: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

endif. loop at lt_plant_info into ls_plant_info where matnr = ls_award-materialid and lifnr = ls_award-supplierid. ls_eine-plant = ls_plant_info-werks. ls_einex-plant = 'X'. ls_eine-purch_org = ls_plant_info-ekorg. ls_einex-purch_org = 'X'. ls_info-plant = ls_plant_info-werks. ls_info-purchase_org = ls_plant_info-ekorg. ls_cond_valid-plant = ls_plant_info-werks. read table lt_eine with key info_rec = ls_eine-info_rec currency = ls_eine-currency eff_price = ls_eine-eff_price net_price = ls_eine-net_price plnd_delry = ls_eine-plnd_delry plant = ls_eine-plant vendor = ls_eine-vendor quot_date = ls_eine-quot_date pur_group = ls_eine-pur_group info_type = ls_eine-info_type transporting no fields. if sy-subrc <> 0. append ls_eine to lt_eine. append ls_einex to lt_einex. endif. append ls_info to lt_info. read table lt_cond_valid with key info_rec = ls_cond_valid-info_rec plant = ls_cond_valid-plant base_uom = ls_cond_valid-base_uom eine_indx = ls_cond_valid-eine_indx serial_id = ls_cond_valid-serial_id valid_from = ls_cond_valid-valid_from valid_to = ls_cond_valid-valid_to transporting no fields. if sy-subrc <> 0. append ls_cond_valid to lt_cond_valid. endif. endloop. read table lt_eina with key info_rec = ls_eina-info_rec material = ls_eina-material vendor = ls_eina-vendor base_uom = ls_eina-base_uom transporting no fields. if sy-subrc <> 0. append ls_eina to lt_eina. append ls_einax to lt_einax. endif. read table lt_condition with key cond_type = ls_condition-cond_type cond_value = ls_condition-cond_value base_uom = ls_condition-base_uom vendor_no = ls_condition-vendor_no eine_indx = ls_condition-eine_indx currency = ls_condition-currency change_id = ls_condition-change_id transporting no fields. if sy-subrc <> 0. append ls_condition to lt_condition. endif. if ls_award-scalepricefrom is not initial. append ls_scale_quan to lt_scale_quan. append ls_scale to lt_scale. endif. read table lt_equku with key werks = ls_equku-werks matnr = ls_equku-matnr bdatu = ls_equku-bdatu vdatu = ls_equku-vdatu kz = ls_equku-kz transporting no fields. if sy-subrc <> 0.* read table lt_equku with key matnr = ls_equku-MATNR WERKS = ls_equku BDATU = ls_equku-BDATU VDATU = ls_equku-vdatu TRANSPORTING NO FIELDS.* if sy-subrc = 0. append ls_equku to lt_equku.* endif. clear ls_equku. endif. read table lt_plant_info into ls_plant_info with key matnr = ls_award-materialid lifnr = ls_award-supplierid werks = ls_equku_read-werks. if sy-subrc = 0. ls_equpu-qunum = ls_equku_read-qunum. ls_equku-kz = 'I'. ls_equpu-kz = 'I'. ls_equpu-bewrk = ls_plant_info-werks.

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 31

Page 32: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

endif. read table lt_equpu with key bewrk = ls_equpu-bewrk qunum = ls_equpu-qunum ematn = ls_equpu-ematn lifnr = ls_equpu-lifnr kz = ls_equku-kz transporting no fields. if sy-subrc <> 0. append ls_equpu to lt_equpu. endif. endif. endloop. if lt_eina is not initial and lt_eine is not initial. call function 'ME_INFORECORD_MAINTAIN_MULTI' importing et_eina = lt_final_eina et_eine = lt_final_eine tables t_eina = lt_eina t_eine = lt_eine t_einax = lt_einax t_einex = lt_einex condition = lt_condition cond_validity = lt_cond_valid cond_scale_quan = lt_scale_quan return = lt_return. loop at lt_return into ls_return. move-corresponding ls_return to ls_e_return. append ls_e_return to et_return. endloop. if sy-subrc <> 0. rollback work. else. commit work. write: / 'DONE'. endif. lv_count = 0. describe table lt_final_eina lines lv_count. if lv_count > 0 or lt_return is initial. sort lt_equku ascending by matnr. delete adjacent duplicates from lt_equku. if quotaflag eq 'I'. clear lt_equku_y. call function 'ME_UPDATE_QUOTA' tables xequk = lt_equku xequp = lt_equpu yequk = lt_equku_y yequp = lt_equpu_y. else. lt_equku_y = lt_equku. call function 'ME_UPDATE_QUOTA' tables xequk = lt_equku xequp = lt_equpu yequk = lt_equku yequp = lt_equpu. endif. if sy-subrc <> 0. rollback work. else. commit work. write: / 'DONE'. endif. endif. endif. endif. endfunction.

32 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 33: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

Sample code for Contract creation and update (SAP ERP and SAP S/4HANA):

After negotiations projects are awarded and closed in SAP Supply Base Optimization, contracts can be created or updated in the backend SAP ERP or SAP S/4HANA systems.

Sample Code

function zsso_award_update. *"----------------------------------------------------------------------*"*"Local Interface:*" IMPORTING*" VALUE(PURCHASEINFORECORDFLAG) TYPE CHAR01*" VALUE(QUOTAFLAG) TYPE CHAR01*" VALUE(CONTRACTFLAG) TYPE CHAR01 DEFAULT 'X'*" EXPORTING*" VALUE(ET_RETURN) TYPE BAPIRETURN_T*" TABLES*" IT_AWARD TYPE ZSSO_T_AWARD_INFO*"---------------------------------------------------------------------- types : begin of ty_info, matnr type matnr, supplierid type lifnr, mpn type ematn, manufacturerid type mfrnr, info_rec type infnr, quota_num type qunum, plant type werks, purchase_org type ekorg, end of ty_info, begin of ty_material_profile, matnr type matnr, material_profile type mprof, mpn_flag type mpnpf, end of ty_material_profile, begin of ty_plant_details, matnr type matnr, lifnr type lifnr, werks type werks, ekorg type ekorg, end of ty_plant_details, begin of ty_item_condition_validity, number type ebeln, condition_validity type bapimeoutvalidity, end of ty_item_condition_validity, begin of ty_item_condition_details, number type ebeln, condition type bapimeoutcondition, end of ty_item_condition_details, begin of ty_scale, matnr type matnr, supplierid type lifnr, mpn type ematn, manufacturerid type mfrnr, info_rec type infnr, quota_num type qunum, serial_no type knumh, cond_count type kopos, line_no type klfn1, scale_base_qty type kstbm, cond_value type bapicurext, end of ty_scale, begin of ty_contract, matnr type matnr, supplierid type lifnr, mpn type ematn, contract_num type ebeln, purchase_grp type ekgrp,

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 33

Page 34: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

purchase_org type ekorg, end of ty_contract, begin of ty_material, materialid type matnr, end of ty_material, begin of ty_contract_item, supplierid type lifnr, contract_item type bapimeoutitem, end of ty_contract_item. data: ls_equku type equku, ls_equpu type equpu, ls_item type equp, ls_header type equk, lt_award type standard table of zsso_s_award_info, ls_award type zsso_s_award_info, ls_award_read type zsso_s_award_info, lt_equpu type standard table of equpu, lt_equpu_y type standard table of equpu, lv_update_flag type abap_bool, lt_equku type standard table of equku, lt_equku_y type standard table of equku, lt_equku_read type standard table of equku, ls_equku_read type equku, lt_equpu_tmp type standard table of equpu, lv_quotaarr_no type qunum, ls_eina_read type eina, lt_eina_read type standard table of eina, ls_eine_read type eine, lt_eine_read type standard table of eine, " definition for contract update ls_contract_header type bapimeoutheader, ls_contract_header_read type bapimeoutheader, lt_contract_header_update type standard table of bapimeoutheader, lt_contract_header_create type standard table of bapimeoutheader, ls_contract_headerx type bapimeoutheaderx, lt_contract_headerx type standard table of bapimeoutheaderx, ls_contract_item type bapimeoutitem, ls_contract_item_read type bapimeoutitem, lt_contract_item type standard table of bapimeoutitem, lt_contract_item_read type standard table of bapimeoutitem, lt_contract_item_update type standard table of ty_contract_item, lt_contract_item_create type standard table of ty_contract_item, ls_contract_item_create type ty_contract_item, ls_contract_item_update type ty_contract_item, ls_contract_itemx type bapimeoutitemx, lt_contract_itemx type standard table of bapimeoutitemx, ls_item_cond_validity type bapimeoutvalidity, ls_item_contract_cond type bapimeoutcondition, ls_item_contract_condx type bapimeoutconditionx, lt_item_contract_condx type standard table of bapimeoutconditionx, ls_item_contract_cond_prepare type ty_item_condition_details, lt_item_contract_cond type standard table of bapimeoutcondition, lt_item_cond_validity type standard table of bapimeoutvalidity, lt_item_cond_validity_read type standard table of bapimeoutvalidity, lt_item_cond_validity_update type standard table of ty_item_condition_validity, lt_item_cond_validity_create type standard table of ty_item_condition_validity, lt_item_contract_cond_update type standard table of ty_item_condition_details, lt_item_contract_cond_create type standard table of ty_item_condition_details, ls_item_contract_cond_update type ty_item_condition_details, ls_item_contract_cond_create type ty_item_condition_details, lt_item_contract_cond_read type standard table of ty_item_condition_details, ls_item_cond_validity_update type ty_item_condition_validity,

34 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 35: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

ls_item_cond_validity_create type ty_item_condition_validity, ls_item_cond_validity_prepare type ty_item_condition_validity, ls_item_cond_validityx type bapimeoutvalidityx, lt_item_cond_validityx type standard table of bapimeoutvalidityx, ls_item_cond_scale_quan type bapimeoutitemscalequan, lt_item_cond_scale_quan_read type standard table of bapimeoutitemscalequan, lt_item_cond_scale_value_read type standard table of bapimeoutitemscaleval, lt_item_cond_scale_quan_update type standard table of bapimeoutitemscalequan, lt_item_cond_scale_quan_create type standard table of bapimeoutitemscalequan, lt_item_cond_read type standard table of bapimeoutcondition, ls_item_cond_read type bapimeoutcondition, " definition for contract update lt_eina type mewieina_mig_t, lt_einax type mewieinax_t, ls_einax type mewieinax_ty, lt_einex type mewieinex_t, ls_einex type mewieinex_ty, lt_final_eina type mewieina_mig_t, lt_final_eine type mewieine_t, ls_eina type mewieina_mig, lt_eine type mewieine_t, ls_eine type mewieine_ty, lt_condition type mewicondition_tt, ls_condition type mewicondition_ty, lt_cond_valid type mewivalidity_tt, ls_cond_valid type mewivalidity_ty, ls_info_read type ty_info, ls_info type ty_info, lt_info type standard table of ty_info, ls_contract type ty_contract, lt_contract type standard table of ty_contract, ls_scale type ty_scale, lt_scale type standard table of ty_scale, lt_scale_quan type mewiscalequan_tt, ls_scale_quan type mewiscalequan_ty, ls_scale_read type ty_scale, lt_material type standard table of ty_material_profile, ls_material type ty_material_profile, lt_plant_info type standard table of ty_plant_details, ls_plant_info type ty_plant_details, lt_return type fs4mig_t_bapiret2, ls_return type fs4mig_s_bapiret2, ls_e_return type bapiret2, lv_count type i, lv_item_count type i, lv_pir_count type i, lv_number(9) type n, lv_material_id type matnr, lt_messages type bapirettab, lt_valid_material type table of ty_material, lv_index type i. data: lv_pir_number_range(10) type n, "-- Variable to hold Newly generated Number Range lv_quota_number_range(10) type n, "-- Variable to hold Newly generated Number Range lv_contract_number_range(10) type n, "-- Variable to hold Newly generated Number Range lv_purchase_contract type ebeln, "-- Variable to hold Newly generated Number Range lv_rc type inri-returncode. lv_count = 00. lv_item_count = 00000.* Get the actual data saved for quota

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 35

Page 36: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

read table it_award index 1 transporting no fields. if sy-subrc = 0. lt_award[] = it_award[]. delete lt_award where materialid is initial. sort lt_award ascending by supplierid materialid mpnid manufacturerid pricedatefrom pricedateto scalepricefrom. select m1~matnr m2~mprof t1~mpnpf from mara as m1 inner join mara as m2 on m2~matnr = m1~bmatn inner join tmppf as t1 on t1~mprof = m2~mprof into table lt_material for all entries in lt_award where m1~matnr = lt_award-materialid and t1~mpnpf = ''. select m1~matnr from mara as m1 into table lt_valid_material for all entries in lt_award where m1~matnr = lt_award-materialid. select * from eina into table lt_eina_read for all entries in lt_award where ( matnr = lt_award-materialid and lifnr = lt_award-supplierid " and mfrnr = lt_award-manufacturerid ) or ( matnr = lt_award-mpnid and lifnr = lt_award-supplierid and loekz <> 'X' " and mfrnr = lt_award-manufacturerid ) . select * from eine into table lt_eine_read for all entries in lt_eina_read where ( infnr = lt_eina_read-infnr and loekz <> 'X' " and mfrnr = lt_award-manufacturerid ) . select * from equk into table lt_equku_read for all entries in lt_award where matnr = lt_award-materialid. "and bdatu = lt_award-pricedateto "and vdatu = lt_award-pricedatefrom. select e~matnr e~lifnr e~werks e~ekorg from eord as e into table lt_plant_info for all entries in lt_award where e~matnr = lt_award-materialid and e~lifnr = lt_award-supplierid and e~vdatu le sy-datum and e~bdatu ge sy-datum. " fetch contracts which are already created for a combination of supplier and material select pi~matnr ph~lifnr pi~ematn ph~ebeln ph~ekgrp ph~ekorg from ekko as ph inner join ekpo as pi on ph~ebeln = pi~ebeln into table lt_contract for all entries in lt_award where pi~matnr = lt_award-materialid and ph~lifnr = lt_award-supplierid and pi~mfrpn = lt_award-mpnid and ph~loekz <> 'X' and pi~loekz <> 'L' and ph~bstyp = 'K'. loop at lt_award into ls_award. read table lt_valid_material WITH KEY materialid = ls_award-materialid transporting no fields. if sy-subrc <> 0. continue. endif. " Preparing data for filling Purchase info record General Data ls_eina-base_uom = ls_award-unitofmeasure.

36 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 37: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

ls_einax-base_uom = 'X'. ls_eina-vendor = ls_award-supplierid. ls_einax-vendor = 'X'. " Preparing data for filling Purchase info record Organizational Data ls_eine-currency = ls_award-currencycode. ls_einex-currency = 'X'. ls_eine-eff_price = ls_award-awardprice. ls_einex-eff_price = 'X'. ls_eine-net_price = ls_award-awardprice. ls_einex-net_price = 'X'.* ls_eine-plant = ls_eine-plnd_delry = ls_award-leadtime. ls_einex-plnd_delry = 'X'. ls_eine-created_at = ls_award-creationdate. ls_einex-created_at = 'X'. ls_eine-created_by = ls_award-createdby. ls_einex-created_by = 'X'. "ls_eine-shipping = ls_award-shipmentterm. "ls_einex-shipping = 'X'. ls_eine-vendor = ls_award-supplierid. ls_einex-vendor = 'X'. ls_eine-quot_date = ls_award-pricedateto. ls_einex-quot_date = 'X'. ls_eine-nrm_po_qty = 0. ls_einex-nrm_po_qty = 'X'. ls_eine-min_po_qty = ls_award-minorderqty. ls_einex-min_po_qty = 'X'. ls_eine-pur_group = '001'. ls_einex-pur_group = 'X'. ls_eine-info_type = '0'. ls_einex-info_type = 'X'. " Changes for contract header preperation read table lt_contract into ls_contract with key supplierid = ls_award-supplierid matnr = ls_award-materialid mpn = ls_award-mpnid. if sy-subrc <> 0. ls_contract_header-vendor = ls_award-supplierid. ls_contract_headerx-vendor = 'X'. ls_contract_header-currency = ls_award-currencycode. ls_contract_headerx-currency = 'X'. ls_contract_header-doc_type = 'MK'. ls_contract_headerx-doc_type = 'X'. ls_contract_header-vper_start = ls_award-pricedatefrom. ls_contract_headerx-vper_start = 'X'. ls_contract_header-vper_end = ls_award-pricedateto. ls_contract_headerx-vper_end = 'X'. ls_contract_header-creat_date = sy-datum. ls_contract_headerx-creat_date = 'X'. ls_contract_item-net_price = ls_award-awardprice. ls_contract_item-target_qty = 1000. ls_contract_item-po_unit = ls_award-unitofmeasure. ls_contract_item-acctasscat = 'U'. ls_item_cond_validity_prepare-number = ls_contract-contract_num. ls_item_cond_validity_prepare-condition_validity-valid_from = ls_award-pricedatefrom. ls_item_cond_validity_prepare-condition_validity-valid_to = ls_award-pricedateto. else. call function 'BAPI_CONTRACT_GETDETAIL' exporting purchasingdocument = ls_contract-contract_num item_data = 'X'* ACCOUNT_DATA = ' ' condition_data = 'X'* TEXT_DATA = ' '* PARTNER_DATA = ' '* RELEASE_DATA = ' ' importing header = ls_contract_header_read

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 37

Page 38: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

tables item = lt_contract_item_read* ACCOUNT =* DELIVERY_ADDRESS = item_cond_validity = lt_item_cond_validity_read item_condition = lt_item_cond_read item_cond_scale_value = lt_item_cond_scale_value_read item_cond_scale_quan = lt_item_cond_scale_quan_read* ITEM_TEXT =* HEADER_TEXT =* head_cond_validity = lt_header_cond_validity_read* head_condition = lt_header_cond_read* head_cond_scale_val = lt_header_cond_scale_value_read* head_cond_scale_quan = lt_header_cond_scale_quan_read* PARTNER =* RELEASE_DOCU =* EXTENSIONOUT = return = lt_messages. move-corresponding ls_contract_header_read to ls_contract_header. read table lt_contract_item_read into ls_contract_item_read with key material = ls_award-materialid. if sy-subrc = 0. move-corresponding ls_contract_item_read to ls_contract_item. ls_contract_item-net_price = ls_award-awardprice. ls_contract_item-target_qty = 1000. ls_contract_item-po_unit = ls_award-unitofmeasure. ls_contract_item-agreement = ls_contract-contract_num. ls_contract_item-acctasscat = 'U'. ls_item_contract_cond_prepare-number = ls_contract-contract_num. ls_item_contract_cond_prepare-condition-cond_type = 'PB00'. ls_item_contract_cond_prepare-condition-cond_value = ls_award-awardprice. ls_item_contract_cond_prepare-condition-cond_unit = ls_award-unitofmeasure. ls_item_contract_cond_prepare-condition-vendor_no = ls_award-supplierid. ls_item_contract_cond_prepare-condition-currency = ls_award-currencycode. ls_item_contract_cond_prepare-condition-change_id = 'I'. ls_item_cond_validity_prepare-number = ls_contract-contract_num. ls_item_cond_validity_prepare-condition_validity-valid_from = ls_award-pricedatefrom. ls_item_cond_validity_prepare-condition_validity-valid_to = ls_award-pricedateto. endif. endif. " Changes for contract header preperation " Preparing data for filling Purchase info record Condition quantity Data if ls_award-scalepricefrom is not initial. ls_scale-matnr = ls_award-materialid. ls_scale-supplierid = ls_award-supplierid. ls_scale-manufacturerid = ls_award-manufacturerid. ls_scale-mpn = ls_award-mpnid. ls_scale-scale_base_qty = ls_award-scalepricefrom. ls_scale-cond_value = ls_award-quoteprice. ls_scale_quan-cond_value = ls_award-quoteprice. ls_scale_quan-scale_base_qty = ls_award-scalepricefrom. " Changes for contract scale preperation read table lt_contract with key supplierid = ls_award-supplierid matnr = ls_award-materialid mpn = ls_award-mpnid transporting no fields. if sy-subrc <> 0. ls_item_cond_scale_quan-cond_value = ls_award-quoteprice. ls_item_cond_scale_quan-scale_base_qty = ls_award-scalepricefrom. endif. " Changes for contract scale preperation endif. ls_condition-cond_type = 'PB00'.

38 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 39: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

ls_condition-cond_value = ls_award-awardprice. ls_condition-cond_unit = ls_award-unitofmeasure. ls_condition-vendor_no = ls_award-supplierid. ls_condition-eine_indx = ls_eine-eine_indx. ls_condition-currency = ls_award-currencycode. ls_condition-change_id = 'I'. ls_cond_valid-valid_from = ls_award-pricedatefrom. ls_cond_valid-valid_to = ls_award-pricedateto. ls_cond_valid-base_uom = ls_award-unitofmeasure. ls_cond_valid-eine_indx = ls_eine-eine_indx. read table lt_scale into ls_scale_read with key supplierid = ls_award-supplierid manufacturerid = ls_award-manufacturerid matnr = ls_award-materialid mpn = ls_award-mpnid. if sy-subrc = 0. ls_scale-line_no = lv_count + 1. ls_scale_quan-line_no = lv_count + 1. lv_count = lv_count + 1. " Changes for contract scale preperation read table lt_contract with key supplierid = ls_award-supplierid matnr = ls_award-materialid mpn = ls_award-mpnid transporting no fields. if sy-subrc <> 0. ls_item_cond_scale_quan-line_no = lv_count. endif. " Changes for contract scale preperation else. lv_count = 01. ls_scale-line_no = lv_count. ls_scale_quan-line_no = lv_count. endif. ls_info-manufacturerid = ls_award-manufacturerid. ls_info-matnr = ls_award-materialid. ls_info-mpn = ls_award-mpnid. ls_info-supplierid = ls_award-supplierid. " Preparing data for Quota Arrangement Header ls_equku-bdatu = ls_award-pricedateto. ls_equku-vdatu = ls_award-pricedatefrom. ls_equku-erdat = ls_award-creationdate. ls_equku-ernam = ls_award-createdby. ls_equku-scmng = 100. " Preparing data for Quota Arrangement Document* ls_equpu-werks = ls_equpu-verid = ls_award-materialrevision. ls_equpu-lifnr = ls_award-supplierid. ls_equpu-plifz = ls_award-leadtime. ls_equpu-quote = ls_award-awardsplit. ls_equpu-beskz = 'F'. " Preparing the material number based on the material profile. read table lt_material into ls_material with key matnr = ls_award-materialid. if sy-subrc = 0. ls_equku-matnr = ls_award-materialid. ls_equpu-ematn = ls_award-materialid. ls_eina-material = ls_award-materialid. ls_einax-material = 'X'. lv_material_id = ls_award-materialid. " Changes for contract scale preperation read table lt_contract with key supplierid = ls_award-supplierid matnr = ls_award-materialid mpn = ls_award-mpnid transporting no fields. if sy-subrc <> 0. ls_contract_item-material = ls_award-materialid. ls_contract_itemx-material = 'X'. ls_contract_item-ematerial_external = ls_award-materialid. ls_contract_itemx-ematerial_external = 'X'. endif. " Changes for contract scale preperation else. ls_equku-matnr = ls_award-materialid. ls_equpu-ematn = ls_award-mpnid.

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 39

Page 40: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

ls_eina-material = ls_award-mpnid. ls_einax-material = 'X'. lv_material_id = ls_award-mpnid. " Changes for contract scale preperation read table lt_contract with key supplierid = ls_award-supplierid matnr = ls_award-materialid mpn = ls_award-mpnid transporting no fields. if sy-subrc <> 0. ls_contract_item-material = ls_award-materialid. ls_contract_itemx-material = 'X'. ls_contract_item-ematerial_external = ls_award-mpnid. ls_contract_itemx-ematerial_external = 'X'. endif. " Changes for contract scale preperation endif. if purchaseinforecordflag eq 'I'. read table lt_eina_read into ls_eina_read with key matnr = lv_material_id lifnr = ls_award-supplierid."mfrnr = ls_award-manufacturerid . if sy-subrc = 0. ls_eina-info_rec = ls_eina_read-infnr. " Read from Purchase info record which should be updated. "ls_einax-info_rec = 'X'. "ls_einex-info_rec = 'X'. ls_eine-info_rec = ls_eina_read-infnr. ls_einax-info_recn = ls_eina_read-infnr. ls_einex-info_recn = ls_eina_read-infnr. ls_scale-info_rec = ls_eina_read-infnr. ls_scale_quan-info_rec = ls_eina_read-infnr. ls_info-info_rec = ls_eina_read-infnr. ls_cond_valid-info_rec = ls_eina_read-infnr. ls_condition-info_rec = ls_eina_read-infnr. else. read table lt_info into ls_info_read with key supplierid = ls_award-supplierid manufacturerid = ls_award-manufacturerid matnr = ls_award-materialid mpn = ls_award-mpnid. if sy-subrc ne 0. call function 'NUMBER_GET_NEXT' exporting nr_range_nr = '03' "-- This hold the Newly generated Number object = 'INFOSATZ' "---- Passing the Number Range Object importing number = lv_pir_number_range "-- Newly generated Number returncode = lv_rc "-- The Return Code Number exceptions interval_not_found = 1 number_range_not_intern = 2 object_not_found = 3 quantity_is_0 = 4 quantity_is_not_1 = 5 interval_overflow = 6 buffer_overflow = 7 others = 8. if sy-subrc <> 0. message id sy-msgid type sy-msgty number sy-msgno with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. endif.* concatenate '$' lv_number into lv_pir_number_range. ls_eina-info_rec = lv_pir_number_range. ls_einax-info_rec = 'X'. ls_einax-info_recn = lv_pir_number_range. ls_eine-info_rec = lv_pir_number_range. ls_einex-info_rec = 'X'. ls_einex-info_recn = lv_pir_number_range. ls_scale-info_rec = lv_pir_number_range. ls_scale_quan-info_rec = lv_pir_number_range.

40 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 41: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

ls_info-info_rec = lv_pir_number_range. ls_condition-info_rec = lv_pir_number_range. ls_cond_valid-info_rec = lv_pir_number_range.* ls_equku-qunum = lv_quota_number_range.* ls_equpu-qunum = lv_quota_number_range.* ls_info-quota_num = lv_quota_number_range.* append ls_info to lt_info. else. ls_eina-info_rec = ls_info_read-info_rec.* ls_einax-info_rec = 'X'.* ls_einex-info_rec = 'X'. ls_eine-info_rec = ls_info_read-info_rec. ls_einex-info_recn = ls_info_read-info_rec. ls_einax-info_recn = ls_info_read-info_rec. ls_condition-info_rec = ls_info_read-info_rec. ls_cond_valid-info_rec = ls_info_read-info_rec. ls_scale-info_rec = ls_info_read-info_rec. ls_scale_quan-info_rec = ls_info_read-info_rec. endif.* else.* read table lt_eina_read into ls_eina_read with key mfrnr = ls_award-manufacturerid matnr = ls_award-materialid lifnr = ls_award-supplierid.* if sy-subrc = 0.* ls_eina-info_rec = ls_eina_read-infnr. " Read from Purchase info record which should be updated.* ls_einax-info_rec = 'X'.* ls_einex-info_rec = 'X'.* ls_eine-info_rec = ls_eina_read-infnr.* ls_einax-info_recn = ls_eina_read-infnr.* ls_einex-info_recn = ls_eina_read-infnr.* ls_scale-info_rec = ls_eina_read-infnr.* else.** endif.* ls_equku-qunum = ls_info_read-quota_num.* ls_equpu-qunum = ls_info_read-quota_num. endif. endif. if quotaflag eq 'I'. read table lt_equku_read into ls_equku_read with key matnr = ls_award-materialid." bdatu = ls_award-pricedateto vdatu = ls_award-pricedatefrom. if sy-subrc = 0. ls_equku-qunum = ls_equku_read-qunum. ls_equpu-qunum = ls_equku_read-qunum. ls_equku-kz = 'U'. ls_equpu-kz = 'U'. ls_info-quota_num = ls_equku_read-qunum. else. call function 'NUMBER_GET_NEXT' exporting nr_range_nr = '01' "-- This hold the Newly generated Number object = 'QUOTIERUNG' "---- Passing the Number Range Object importing number = lv_quota_number_range "-- Newly generated Number returncode = lv_rc "-- The Return Code Number exceptions interval_not_found = 1 number_range_not_intern = 2 object_not_found = 3 quantity_is_0 = 4 quantity_is_not_1 = 5 interval_overflow = 6 buffer_overflow = 7

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 41

Page 42: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

others = 8. if sy-subrc <> 0. message id sy-msgid type sy-msgty number sy-msgno with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. endif. ls_equku-qunum = lv_quota_number_range. ls_equpu-qunum = lv_quota_number_range. ls_equku-kz = 'I'. ls_equpu-kz = 'I'. ls_info-quota_num = lv_quota_number_range. endif. else. loop at lt_equku_read into ls_equku_read where matnr = ls_award-materialid and bdatu = ls_award-pricedateto and vdatu = ls_award-pricedatefrom. read table lt_plant_info into ls_plant_info with key matnr = ls_award-materialid lifnr = ls_award-supplierid werks = ls_equku_read-werks. if sy-subrc = 0. ls_equku-qunum = ls_equku_read-qunum. ls_equpu-qunum = ls_equku_read-qunum. ls_equku-kz = 'U'. ls_equpu-kz = 'U'. ls_info-quota_num = ls_equku_read-qunum. ls_equpu-bewrk = ls_plant_info-werks. ls_equku-werks = ls_plant_info-werks. ls_cond_valid-plant = ls_plant_info-werks. endif. append ls_equpu to lt_equpu. endloop. endif. " Fill contract header and item with the relevant information along with number generated.* if contractflag eq 'X'.* read table lt_contract into ls_contract with key matnr = lv_material_id supplierid = ls_award-supplierid."mfrnr = ls_award-manufacturerid .* if sy-subrc = 0.* ls_contract_header-number = ls_contract-contract_num.* ls_contract_item-agreement = ls_contract-contract_num.* else.** call function 'NUMBER_GET_NEXT'* exporting* nr_range_nr = '46' "-- This hold the Newly generated Number* object = 'EINKBELEG' "---- Passing the Number Range Object* importing* number = lv_contract_number_range "-- Newly generated Number* returncode = lv_rc "-- The Return Code Number* exceptions* interval_not_found = 1* number_range_not_intern = 2* object_not_found = 3* quantity_is_0 = 4* quantity_is_not_1 = 5* interval_overflow = 6* buffer_overflow = 7* others = 8.* if sy-subrc <> 0.* message id sy-msgid type sy-msgty number sy-msgno* with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.* endif.** concatenate '$' lv_number into lv_pir_number_range.* ls_contract_header-number = lv_contract_number_range.* ls_contract_headerx-number = 'X'.

42 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 43: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

* ls_contract_item-agreement = lv_contract_number_range.* ls_contract_itemx-agreement = 'X'.* endif.* endif. " Fill contract header and item with the relevant information along with number generated. loop at lt_plant_info into ls_plant_info where matnr = ls_award-materialid and lifnr = ls_award-supplierid. ls_eine-plant = ls_plant_info-werks. ls_einex-plant = 'X'. ls_eine-purch_org = ls_plant_info-ekorg. ls_einex-purch_org = 'X'. ls_info-plant = ls_plant_info-werks. ls_info-purchase_org = ls_plant_info-ekorg. ls_cond_valid-plant = ls_plant_info-werks. " Fill contract header and item with the plant relevant information ls_contract_header-purch_org = ls_plant_info-ekorg. ls_contract_headerx-purch_org = 'X'. ls_contract_item-plant = ls_plant_info-werks. ls_contract_itemx-plant = 'X'. ls_contract_header-pur_group = '001'. ls_contract_headerx-pur_group = 'X'. " Fill contract header and item with the plant relevant information read table lt_eine with key info_rec = ls_eine-info_rec currency = ls_eine-currency eff_price = ls_eine-eff_price net_price = ls_eine-net_price plnd_delry = ls_eine-plnd_delry plant = ls_eine-plant vendor = ls_eine-vendor quot_date = ls_eine-quot_date pur_group = ls_eine-pur_group info_type = ls_eine-info_type transporting no fields. if sy-subrc <> 0. append ls_eine to lt_eine. append ls_einex to lt_einex. endif. append ls_info to lt_info. read table lt_cond_valid with key info_rec = ls_cond_valid-info_rec plant = ls_cond_valid-plant base_uom = ls_cond_valid-base_uom eine_indx = ls_cond_valid-eine_indx serial_id = ls_cond_valid-serial_id valid_from = ls_cond_valid-valid_from valid_to = ls_cond_valid-valid_to transporting no fields. if sy-subrc <> 0. append ls_cond_valid to lt_cond_valid. endif. endloop. read table lt_eina with key info_rec = ls_eina-info_rec material = ls_eina-material vendor = ls_eina-vendor base_uom = ls_eina-base_uom transporting no fields. if sy-subrc <> 0. append ls_eina to lt_eina. append ls_einax to lt_einax. endif. read table lt_condition with key cond_type = ls_condition-cond_type cond_value = ls_condition-cond_value base_uom = ls_condition-base_uom vendor_no = ls_condition-vendor_no eine_indx = ls_condition-eine_indx currency = ls_condition-currency change_id = ls_condition-change_id transporting no fields. if sy-subrc <> 0. append ls_condition to lt_condition. endif. if ls_award-scalepricefrom is not initial. append ls_scale_quan to lt_scale_quan. append ls_scale to lt_scale. endif. read table lt_equku with key werks = ls_equku-werks qunum = ls_equku-qunum matnr = ls_equku-matnr bdatu = ls_equku-bdatu vdatu = ls_equku-vdatu kz = ls_equku-kz transporting no fields. if sy-subrc <> 0. append ls_equku to lt_equku.

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 43

Page 44: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

endif. " Fill contract header and item based on whether it is update or create read table lt_contract with key supplierid = ls_award-supplierid matnr = ls_award-materialid mpn = ls_award-mpnid transporting no fields. if sy-subrc <> 0. read table lt_contract_header_create with key vendor = ls_award-supplierid transporting no fields. if sy-subrc <> 0. append ls_contract_header to lt_contract_header_create. read table lt_contract_item_create with key contract_item-material = ls_award-materialid contract_item-ematerial_external = ls_award-mpnid supplierid = ls_award-supplierid transporting no fields. if sy-subrc = 0.* ls_contract_item-item_no = lv_item_count + 10.* ls_contract_item-agmt_item = lv_item_count + 10.* lv_item_count = lv_item_count + 10. else. lv_item_count = 00000. ls_contract_item-item_no = lv_item_count + 10. lv_item_count = lv_item_count + 10.* ls_contract_item-agmt_item = lv_item_count + 10. ls_contract_item_create-contract_item = ls_contract_item. ls_contract_item_create-supplierid = ls_award-supplierid. append ls_contract_item_create to lt_contract_item_create. endif. else.* append ls_contract_header to lt_contract_header_create. read table lt_contract_item_create with key contract_item-material = ls_award-materialid contract_item-ematerial_external = ls_award-mpnid supplierid = ls_award-supplierid transporting no fields. if sy-subrc = 0. ls_contract_item-item_no = lv_item_count + 10. ls_contract_itemx-item_no = ls_contract_item-item_no. ls_contract_item-agmt_item = cl_mm_po_handler_api=>get_id( ). ls_item_cond_validity_prepare-condition_validity-item_no = ls_contract_item-item_no. ls_item_contract_cond_prepare-condition-item_no = ls_contract_item-item_no. lv_item_count = lv_item_count + 10. else. ls_contract_item-item_no = lv_item_count + 10. ls_contract_itemx-item_no = ls_contract_item-item_no. ls_item_cond_validity_prepare-condition_validity-item_no = ls_contract_item-item_no. ls_item_contract_cond_prepare-condition-item_no = ls_contract_item-item_no. ls_contract_item-agmt_item = cl_mm_po_handler_api=>get_id( ). lv_item_count = lv_item_count + 10. endif. ls_contract_item_create-contract_item = ls_contract_item. ls_contract_item_create-supplierid = ls_award-supplierid. append ls_contract_item_create to lt_contract_item_create. append ls_item_contract_cond_prepare to lt_item_contract_cond_create. append ls_item_cond_validity_prepare to lt_item_cond_validity_create. endif. else. read table lt_contract_header_update with key number = ls_contract_header-number transporting no fields. if sy-subrc <> 0. append ls_contract_header to lt_contract_header_update. endif. ls_contract_item_update-contract_item = ls_contract_item . ls_contract_item_update-supplierid = ls_award-supplierid. append ls_contract_item_update to lt_contract_item_update. read table lt_contract_item_read into ls_contract_item_read with key material = ls_award-materialid ematerial_external = ls_award-mpnid.

44 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 45: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

if sy-subrc = 0. ls_item_contract_cond_prepare-condition-item_no = ls_contract_item_read-item_no. ls_item_cond_validity_prepare-condition_validity-item_no = ls_contract_item_read-item_no. endif. append ls_item_contract_cond_prepare to lt_item_contract_cond_update. append ls_item_cond_validity_prepare to lt_item_cond_validity_update. endif. endloop. if contractflag eq 'X'. if lt_contract_header_create is not initial. loop at lt_contract_header_create into ls_contract_header. ls_contract_headerx-vendor = 'X'. ls_contract_headerx-currency = 'X'. ls_contract_headerx-doc_type = 'X'. ls_contract_headerx-vper_start = 'X'. ls_contract_headerx-vper_end = 'X'. ls_contract_headerx-creat_date = 'X'.* ls_contract_headerx-number = 'X'. ls_contract_headerx-purch_org = 'X'. ls_contract_header-pur_group = '001'. ls_contract_headerx-pur_group = 'X'. clear lt_contract_item. clear lt_contract_itemx. loop at lt_contract_item_create into ls_contract_item_create where supplierid = ls_contract_header-vendor. append ls_contract_item_create-contract_item to lt_contract_item. ls_contract_itemx-material = 'X'. ls_contract_itemx-ematerial_external = 'X'.* ls_contract_itemx-agreement = 'X'. ls_contract_itemx-plant = 'X'. ls_contract_itemx-target_qty = 'X'. ls_contract_itemx-net_price = 'X'. ls_contract_itemx-price_unit = 'X'. ls_contract_itemx-po_unit = 'X'. ls_contract_itemx-acctasscat = 'X'. ls_contract_itemx-item_no = ls_contract_item_create-contract_item-item_no. ls_contract_itemx-item_nox = 'X'.* ls_contract_itemx-agmt_item = 'X'. append ls_contract_itemx to lt_contract_itemx. endloop. loop at lt_item_cond_validity_create into ls_item_cond_validity_create where number = ls_contract_header-number. move-corresponding ls_item_cond_validity_create to ls_item_cond_validity. append ls_item_cond_validity to lt_item_cond_validity. ls_item_cond_validityx-valid_from = 'X'. ls_item_cond_validityx-valid_to = 'X'. ls_item_cond_validityx-item_no = 'X'. append ls_item_cond_validityx to lt_item_cond_validityx. endloop. loop at lt_item_contract_cond_create into ls_item_contract_cond_create where number = ls_contract_header-number. move-corresponding ls_item_contract_cond_create-condition to ls_item_contract_cond. append ls_item_contract_cond to lt_item_contract_cond. ls_item_contract_condx-cond_type = 'X'. ls_item_contract_condx-cond_unit = 'X'. ls_item_contract_condx-item_no = 'X'. ls_item_contract_condx-cond_value = 'X'. ls_item_contract_condx-vendor_no = 'X'. ls_item_contract_condx-currency = 'X'. append ls_item_contract_condx to lt_item_contract_condx. endloop. call function 'BAPI_CONTRACT_CREATE' exporting

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 45

Page 46: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

header = ls_contract_header headerx = ls_contract_headerx* VENDOR_ADDRESS =* testrun = 'X'* TECHNICAL_DATA = importing purchasingdocument = lv_purchase_contract* EXP_HEADER = tables return = lt_messages item = lt_contract_item itemx = lt_contract_itemx* account = lt_account* accountx = lt_accountx. item_cond_validity = lt_item_cond_validity item_cond_validityx = lt_item_cond_validityx item_condition = lt_item_contract_cond item_conditionx = lt_item_contract_condx.* extensionin = x_extensionin. et_return = lt_messages. endloop. endif. if lt_contract_header_update is not initial. loop at lt_contract_header_update into ls_contract_header. ls_contract_headerx-vendor = 'X'. ls_contract_headerx-currency = 'X'. ls_contract_headerx-doc_type = 'X'. ls_contract_headerx-vper_start = 'X'. ls_contract_headerx-vper_end = 'X'. ls_contract_headerx-creat_date = 'X'.* ls_contract_headerx-number = 'X'. ls_contract_headerx-purch_org = 'X'. ls_contract_header-pur_group = '001'. ls_contract_headerx-pur_group = 'X'. clear lt_contract_item. clear lt_contract_itemx. loop at lt_contract_item_update into ls_contract_item_update where contract_item-agreement = ls_contract_header-number. append ls_contract_item_update-contract_item to lt_contract_item. ls_contract_itemx-material = 'X'. ls_contract_itemx-ematerial_external = 'X'.* ls_contract_itemx-agreement = 'X'. ls_contract_itemx-plant = 'X'. ls_contract_itemx-target_qty = 'X'. ls_contract_itemx-net_price = 'X'. ls_contract_itemx-price_unit = 'X'. ls_contract_itemx-po_unit = 'X'. ls_contract_itemx-acctasscat = 'X'. ls_contract_itemx-item_no = ls_contract_item_update-contract_item-item_no. ls_contract_itemx-item_nox = 'X'.* ls_contract_itemx-agmt_item = 'X'. append ls_contract_itemx to lt_contract_itemx. endloop. loop at lt_item_cond_validity_update into ls_item_cond_validity_update where number = ls_contract_header-number. move-corresponding ls_item_cond_validity_update-condition_validity to ls_item_cond_validity. append ls_item_cond_validity to lt_item_cond_validity. ls_item_cond_validityx-valid_from = 'X'. ls_item_cond_validityx-valid_to = 'X'. ls_item_cond_validityx-item_no = ls_contract_item-item_no. append ls_item_cond_validityx to lt_item_cond_validityx. endloop. loop at lt_item_contract_cond_update into ls_item_contract_cond_update where number = ls_contract_header-number. move-corresponding ls_item_contract_cond_update-condition to ls_item_contract_cond.

46 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 47: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

append ls_item_contract_cond to lt_item_contract_cond. ls_item_contract_condx-cond_type = 'X'. ls_item_contract_condx-cond_unit = 'X'. ls_item_contract_condx-item_no = ls_contract_item-item_no. ls_item_contract_condx-cond_value = 'X'. ls_item_contract_condx-vendor_no = 'X'. ls_item_contract_condx-currency = 'X'. append ls_item_contract_condx to lt_item_contract_condx. endloop. call function 'BAPI_CONTRACT_CHANGE' exporting purchasingdocument = ls_contract_header-number header = ls_contract_header headerx = ls_contract_headerx* VENDOR_ADDRESS =* testrun = 'X'* TECHNICAL_DATA = importing exp_header = ls_contract_header* EXP_HEADER = tables return = lt_messages item = lt_contract_item itemx = lt_contract_itemx item_condition = lt_item_contract_cond item_conditionx = lt_item_contract_condx item_cond_validity = lt_item_cond_validity item_cond_validityx = lt_item_cond_validityx.* account = lt_account* accountx = lt_accountx.* extensionin = x_extensionin. et_return = lt_messages. endloop. endif. endif. call function 'ME_INFORECORD_MAINTAIN_MULTI' importing et_eina = lt_final_eina et_eine = lt_final_eine tables t_eina = lt_eina t_eine = lt_eine t_einax = lt_einax t_einex = lt_einex condition = lt_condition cond_validity = lt_cond_valid cond_scale_quan = lt_scale_quan return = lt_return. loop at lt_return into ls_return. move-corresponding ls_return to ls_e_return. append ls_e_return to et_return. endloop. if sy-subrc <> 0. rollback work. else. commit work. write: / 'DONE'. endif. lv_count = 0. describe table lt_final_eina lines lv_count. if lv_count > 0. if quotaflag eq 'X'. lt_equku_y = lt_equku. clear lt_equku_y. call function 'ME_UPDATE_QUOTA' tables xequk = lt_equku xequp = lt_equpu

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Preparation PUBLIC 47

Page 48: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

yequk = lt_equku_y yequp = lt_equpu_y. else.* call function 'ME_UPDATE_QUOTA'* tables* xequk = lt_equku* xequp = lt_equpu* yequk = lt_equku* yequp = lt_equpu. endif. if sy-subrc <> 0. rollback work. else. commit work. write: / 'DONE'. endif. endif. endif. endfunction.

48 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Preparation

Page 49: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

4 Configuration for SAP Cloud Platform Integration

Creating RFC destination in SAP Cloud Platform

1. Go to https://hana.ondemand.com.2. Select the tenant account you created while creating the cluster.

3. Go to Connectivity Destinations .4. Create new destination by selecting New Destination.5. Enter the details for name, URL, user, password and select Type as the RFC that was created in Setup for

Inbound IDocs - To SAP ERP or SAP S/4HANA On Premise Using SAP Cloud Platform Integration chapter.6. Add additional properties and enter required values as configured in SAP Cloud Connector:

○ Jco.client.ashost○ Jco.client.client○ Jco.client.lang○ Jco.client.sysnr○ Jco.destination.pool_capacity (optional)

7. Select Save.

The pre-packaged integration scenario contains integration flows for each separate object, which can be loaded to SAP Cloud for SAP Supply Base Optimization. For each integration flow, the SFTP connection and the receiver HTTP channel need to be configured.

The configuration is structured in the following order:

● Deployment of credentials● Configuration and deployment of the integration flows

4.1 Deployment of Credentials

Context

To establish the communication with the source SFTP system and the SAP Cloud for SAP Supply Base Optimization, it is required to deploy the requisite credentials. Further, some firewall ports need to be opened.

For deploying mail credentials, follow the same steps as in Deploy Technical Communication User Data with a Credential Artifact chapter, but using the user name and password of mail service.

For deploying On Premise credentials, follow the same steps as in Deploy Technical Communication User Data with a Credential Artifact chapter, but using the user name and password of the SAP S/4HANA On Premise or SAP ERP system.

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Configuration for SAP Cloud Platform Integration PUBLIC 49

Page 50: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

4.1.1 Deploy Certificates in Keystore

For connecting sender or receiver systems, the tenant administrator needs to maintain keys and certificates in different systems, sender, receiver and the Cloud integration tenant. The Keystore Monitor available in Cloud integration tenant can be used for this purpose.

The monitor is available in Operations View in Web. In the Manage Security section, you find the Keystore tile, which directly informs you about the number of keys and certificate available in the tenant keystore.

Certificates required for accessing the application include the following:

● SSO Certificate: Server-side certificate for accessing SAP Supply Base Optimization endpoints● SMTP Certificate: Relevant service certificate must be configured.

You must deploy certificates in the SAP Cloud Platform Integration tenant, under Monitor Manage SecurityKeystore Add Browse . Then select the updated keystore, enter the pass-phrase, and choose Deploy.

4.1.2 Open Firewall Request at SAP

When connecting to an SFTP server from SAP Cloud Platform Integration, the firewall needs to be opened at SAP Cloud Support.

The request needs to be addressed through an SAP incident on component LOD-HCI-PI-OPS.

You will need to provide the following information in the ticket:

● Port number● Destination address● Destination IP● Brief description of the purpose● Affected customer● Tenant ID● Name of requesting SAP department● Persons responsible for the request (at least two)● Company name and address of where the SFTP server resides● Estimated project duration

NoteAlso make sure to open the Firewall at your (Customer) side to be able to accept SFTP adapter calls from SAP Cloud Platform Integration (Port 22).

50 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Configuration for SAP Cloud Platform Integration

Page 51: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

4.1.3 Deploy Technical Communication User Data with a Credential Artifact

Context

User credentials of the technical user of your SAP Sourcing Simulation and Optimization for Industries system need to be deployed in your SAP Cloud Platform Integration tenant. For more information, see Configuration of the Integration Flows – Fetch Token.

Procedure

1. Open your SAP Cloud Platform Integration tenant’s web UI.2. On the Tenant menu, choose Monitor.3. Select the Security Material tile in the Manage Security Material section.4. Choose Add.5. Select User Credentials.6. Enter the following values in the Add Users Credential dialog box window:

○ Name: <credential_name>○ Description (optional)○ User: <Client_ID>○ Password: <Client_Secret>

7. Choose OK to save the user credentials.

4.2 Deployment and Configuration of the Integration Package

To work with the integration flows of this package, the pre-packaged integration flow scenario must be copied to your workspace. Constituent integration flows need to be configured next. Finally, to activate the integration flows, they must be deployed. The configuration and deployment must be processed for each integration flow.

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Configuration for SAP Cloud Platform Integration PUBLIC 51

Page 52: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

4.2.1 Create a Copy of the Pre-Packaged Integration Scenario

Context

To create a copy of the pre-packaged integration scenario, proceed as follows:

Procedure

1. In your preferred web browser, open the web UI of your SAP Cloud Platform Integration tenant: <https://your_tenant_URL/itspaces> .

2. On the Discover page, select All to navigate through the available pre-packaged integration scenarios.3. Enter <data load> in the Search field and choose Enter.

4. To copy the integration package from the catalog to your customer workspace, move your cursor over the integration package tile and choose Copy to workspace.

5. The message Integration package copied confirms that the package was copied to your workspace.

NoteIn case the integration scenario is already available in the workspace, a copy with a different name can be created, or the existing package can be overwritten. In case of overwriting, all previous configurations will be lost.

6. Choose the pen icon to choose the Design page to work with the copied package and its integration flows.

4.2.2 Configuration of the Integration Flows – Fetch Token

Proceed as follows:

1. On the Design page, select the package SAP Supply Base Optimization Cloud for customer integration with SAP ERP and SAP S/4HANA, which contains the integration content.An overview of the artifacts available in the selected integration package is displayed.

2. To configure an integration flow, choose Configure in the Actions column for the integration flow.3. On the Sender tab, select the address, end point, and authorization parameters as appropriate.

52 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Configuration for SAP Cloud Platform Integration

Page 53: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

4. On the Receiver tab, provide the relevant details as follows:

Field Value

Address <Authentication URL>

Authentication Basic

Credential Name <OAuth Credentials> (This must be a basic username/password creden­tial with client_id as the username and client_secret as the password) as mentioned in Deploy Technical Communication User Data with a Credential Arti­fact chapter.

For more information, refer to Creating Service Keys.

5. Save the settings and deploy as required.

4.2.3 Configuration of the Integration Flows

The following integration flows must be configured based on the type of their integration, that is to say, whether using IDocs or RFCs:

● Replicating Data from SAP ERP or SAP S/4HANA On Premise to SAP Supply Base Optimization

Integration Flows and Types

Integration Flow Type of Integration

Material Group RFC

Material Master IDoc

Approved Manufacturer List RFC

Approved Supplier List RFC

Order History - Send/Replicate IDoc

Supplier Contact Address - Load/Delete IDoc

Supplier Contact Master - Load/Delete RFC and IDoc

● Replicating Data from SAP Supply Base Optimization to SAP ERP or SAP S/4HANA On Premise

Integration Flows and Types

Integration Flow Type of Integration

Purchase Info Records, Quota Arrangements, and Condition Re­cords

RFC

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Configuration for SAP Cloud Platform Integration PUBLIC 53

Page 54: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

NoteA report executes all the required filters and triggers IDocs for the relevant data to be sent to SAP Supply Base Optimization. For more information, refer to SAP Note 2666092 .

Replicating Master Data from SAP ERP or SAP S/4HANA On Premise to SAP Supply Base Optimization

For configuring an integration flow to replicate master data from SAP ERP or SAP S/4HANA On Premise to SAP Supply Base Optimization, proceed as follows:

1. On the Design page of SAP Cloud Platform Integration, select the package SAP Supply Base Optimization Cloud for Customer Integration with SAP ERP and SAP S/4HANA, which contains the integration content. Proceed to the Artifacts tab page.An overview of the artifacts available in the selected integration package is shown.

2. To configure an integration flow, choose Configure from the Actions icon for the integration flow.3. On the Sender tab page, in the Address field, enter the RFC Destination address of the SAP ERP/SAP S/

4HANA On Premise system, but without the /cxf prefix. Data can be sent to this integration flow through this RFC Destination. For more details, refer to the earlier chapter on setup for outbound IDocs.In the Authorization field, select User Role.

4. Provide the relevant details on the Receiver tab page as follows:○ In Receiver field, for the integration flow Fetch-Token, provide the relevant details as follows:

Fetch-Token

Field Value

Adapter Type SOAP

Address <FetchTokenURL>

Credential Name <OAuth Credentials> (This must be a basic user­name/password credential with client_id as the username and client_secret as the password)

○ In Receiver field, select either Mail_Success, Mail_Exception, or Mail_Errors. All three options are configured with the same mailing parameters.

Adapter Type - Mail

Field Value

Address <mail_server_address>

Credential Name <credential_name>

From <[email protected]>

To <[email protected]>

Subject Enter the subject line as required in the mails

54 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Configuration for SAP Cloud Platform Integration

Page 55: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

Field Value

Other Fields Enter the text as required in the mails

○ In Receiver field, select To_OnPremise. Provide the relevant details if the type of integration is IDoc:

Adapter Type - IDOC

Field Value

Address Address to be as described in Testing SOAP Runtime Service for Inbound IDocs section of Setup for Inbound IDocs - To SAP ERP or SAP S/4HANA On Premise Using SAP Cloud Platform Integration chapter above. This is the URL to which your IDoc adapter in SAP Cloud Plat­form Integration needs to point. It must be in the format http://host:port/sap/bc/srt/idoc?sap-client=<clientnumber> and http://virtual:port/sap/bc/srt/idoc?sap-client=<clientnumber>

Location ID

Credential Name <SAP ERP or SAP S/4HANA Credentials>

○ In Receiver field, select OnPremise. Provide the relevant details if the type of integration is RFC:

Adapter Type - RFC

Field Value

Destination Enter the destination created as part of initial configura-tion in Configuration for SAP Cloud Platform Integration chapter.

○ In Receiver field, select SSO_<integation flow> as follows:

Adapter Type - HTTP

Field Value

Landscape Retain the default option production.

Datacenter Retain the default option us10.

5. Save and deploy the integration flow.

Replicating Info Records and Quota Arrangements from SAP Supply Base Optimization to SAP ERP or SAP S/4HANA On Premise

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Configuration for SAP Cloud Platform Integration PUBLIC 55

Page 56: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

For configuring an integration flow to replicate data from SAP Supply Base Optimization to SAP ERP or SAP S/4HANA On Premise, proceed as follows:

1. On the Design page of SAP Cloud Platform Integration, select the package SAP Supply Base Optimization Cloud for Customer Integration with SAP ERP and SAP S/4HANA, which contains the integration content. Proceed to the Artifacts tab page.

2. To configure the integration flow Replicating Info Records and Quota Arrangements in SAP ERP, choose Configure from the Actions icon for the integration flow.

3. On the Timer tab, select how often you would like to carry out the data replication. Save your changes.4. On the Receiver tab, select the data parameters as required. For more detailed information on mail adapter

parameters, refer to the Configure a Channel with Mail Adapter chapter in SAP Cloud Platform Integration documentation.

5. Enter the appropriate parameters on the More tab.6. Save and deploy the integration flow.

For more details on setting up the RFC connection using the SAP Cloud Connector, see here .

4.2.4 Configurations Required Within SAP Cloud Platform Integration

Configurations required within SAP Cloud Platform Integration are as follows:

Package

On the Design tab in SAP Cloud Platform Integration, select Create and create a package by filling in the relevant information.

Artifact

Inside this package you need to create an artifact. In the edit mode, choose the Add menu, select the option Integration Flow, enter appropriate values in the required fields, and save. The integration flow is created.

IDoc Connector Settings while Sending IDocs to an SAP ERP or SAP S/4HANA On Premise System Using SAP Cloud Connector

Proceed as follows:

1. Set proxy type to On-Premise.2. Address must be the same as what was generated while testing the SOAP runtime service for IDoc

Inbound, but with the following modifications:○ Change the protocol from HTTPS to HTTP.○ Hostname and port must be replaced by the Virtual Host Name and Port defined in SAP Cloud

Connector.3. Set Authentication Type as Basic and enter the credential name defined in Security Artifacts block of the

Overview tab.

56 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Configuration for SAP Cloud Platform Integration

Page 57: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

5 Troubleshooting and Log

Context

In the SAP Cloud Platform Integration web UI, you can analyze the deployed integration flows in the Monitoring section as follows:

Procedure

1. To carry out the activity, open your SAP Cloud Platform Integration tenant web UI, for example, https://<your SAP Cloud Platform Integration tenant URL>/itspaces.

2. In the Tenant menu, choose Monitor, thenMonitor Message Processing.3. On the Overview screen, choose the tile with the message status you wish to analyze.4. On the left, select the integration flow you wish to analyze.5. Access the Message Processing Log from the Log tabs.

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Troubleshooting and Log PUBLIC 57

Page 58: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

6 Error Mail Notification

All integration flows in this integration package provide the facility of sending error mail notifications for errors that occur during processing in the SAP Cloud Platform Integration tenant, or in SAP Supply Base Optimization system.

For this, the SMTP server to be used as well as the email IDs from and to which the error message is to be sent can be configured in the mail adapter connected to the exception sub-process present in each integration flow in the package.

58 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Error Mail Notification

Page 59: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

7 Scheduled System Downtimes

In case of a scheduled system downtime of SAP Supply Base Optimization, you should prevent files from being transferred in advance to avoid Failed messages.

In case of downtime of SAP Supply Base Optimization, all load artifacts are affected.

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Scheduled System Downtimes PUBLIC 59

Page 60: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

8 Data Protection and Privacy

Data protection is associated with numerous legal requirements and privacy concerns. In addition to compliance with general data privacy regulation, it is necessary to consider compliance with industry-specific legislation in different countries. SAP provides specific features and functions to support compliance with regards to relevant legal requirements, including data protection. SAP does not give any advice on whether these features and functions are the best method to support company, industry, regional, or country-specific requirements. Furthermore, this information does not give any advice or recommendation in regards to additional features that would be required in particular IT environments; decisions related to data protection must be made on a case-by-case basis, under consideration of the given system landscape and the applicable legal requirements.

NoteIn most cases, compliance with applicable data protection and privacy laws will not be covered by a product feature. SAP software supports data protection compliance by providing security features and specific data protection-relevant functions, such as simplified blocking and deletion of personal data. SAP does not provide legal advice in any form. Definitions and other terms used in this document are not taken from any given legal source.

Data Protection and Privacy in Integration with SAP Supply Base Optimization

The SAP Supply Base Optimization application works with personal data of suppliers, supplier contacts, and manufacturers. This data can be sent to SAP Supply Base Optimization, as well as changed using integration flows for suppliers and contacts, or even deleted.

● Consent: SAP ERP and SAP S/4HANA On Premise systems belong to the same legal entity as SAP Supply Base Optimization application. Therefore, explicit consent is not required to transfer data to SAP Supply Base Optimization.You can also refer to the User Consent section in the SAP Supply Base Optimization - Administrator's Guide.

● Change Logging: All changes made in SAP Supply Base Optimization using the integration flows are recorded in the application's Audit Log.If any personal data (which is relevant to SAP Supply Base Optimization application) is changed in SAP ERP or SAP S/4HANA On Premise systems, the changes are transferred to SAP Supply Base Optimization and are also captured in the application's Audit Log.

For more information, refer to the SAP Supply Base Optimization - Administrator's Guide.

8.1 Deletion of Suppliers or Contacts

This section explains the process of deletion of suppliers and contacts in SAP Supply Base Optimization. You must implement this section prior to carrying out integration with SAP ERP or SAP S/4HANA.

60 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Data Protection and Privacy

Page 61: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

Integration flows allow you to delete personal information of suppliers, supplier contacts, and manufacturers completely from the SAP Supply Base Optimization application. These deletions are also logged in the application's Audit Log.

There can be two scenarios for deleting suppliers or contacts in SAP Supply Base Optimization:

● End of business purpose of suppliers or contacts across your organization. When the purpose of specific suppliers or contacts has ended across the organization, their records will be either set for deletion using a deletion flag or set for archiving using an archiving flag in SAP ERP or SAP S/4HANA On Premise systems. If either of these actions is carried out, the purpose of those suppliers/contacts ends in the SAP Supply Base Optimization application and will be deleted.For detailed information, refer to Set Deletion/Archiving Flag in SAP Help Portal documentation.

● End of business purpose of suppliers or contacts from the perspective of SAP Supply Base Optimization only. In this case the suppliers or contacts are still active and can be used in other applications.Prerequisite: ABAP knowledge to complete the steps below.The deletion of suppliers or contacts in SAP Supply Base Optimization application only can be done using an API; refer to the SAP API Business Hub . Once deletion is carried out, ensure that there is no further replication of suppliers or contacts into SAP Supply Base Optimization.Once suppliers or contacts are deleted in the application, their entries are maintained in an exclusion table that is part of SAP ERP or SAP S/4 HANA On Premise. This exclusion table must be checked prior to triggering any data replication, thus ensuring that data of the deleted suppliers or contacts does not reach the SAP Supply Base Optimization application again. This is achieved through the following steps:1. Create a table that can store the data for Vendor ID along with additional information. A sample table

can be seen below:

zsso_bp_exclude

MANDT

LIFNR

NAME1

...

...

Purpose: This table becomes the Exclude Vendor list when a supplier or contact is replicated to the SAP Supply Base Optimization application.

2. Create a maintenance view of the above table.Purpose: This maintenance view is used for entering the supplier or contact details that are deleted as part of the end of business purpose process.

3. Create table type ZSSO_T_SUPPLIER_LIST with row type LIFNR.4. Create a function module that excludes the Vendor IDs existing in the table created above.

Sample code implementation is given below for reference:

Sample Code

FUNCTION Z_SSO_BP_EXCLUSION. *"----------------------------------------------------------------------*"*"Local Interface:*" EXPORTING*" VALUE(EX_BP_DETAILS) TYPE ZSSO_T_SUPPLIER_LIST

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Data Protection and Privacy PUBLIC 61

Page 62: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

*"----------------------------------------------------------------------DATA: IT_BP_DETAILS TYPE ZSSO_T_SUPPLIER_LIST. SELECT LIFNR FROM ZSSO_BP_EXCLUDE INTO TABLE IT_BP_DETAILS. IF SY-SUBRC = 0. EX_BP_DETAILS = IT_BP_DETAILS. ENDIF. ENDFUNCTION.

NoteThe sample code provided is a basic implementation done to exclude the suppliers or contacts while replicating to the application. You would need to carry out your own implementation based on your specific business processes and their complexities.

62 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Data Protection and Privacy

Page 63: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

9 Relevant Components for Customer Incidents

In case of errors with the integration content, open a customer ticket in component LOD-SSO-INT.

In case of any resource-related issues (for example, out of memory exceptions), open a ticket on component LOD-HCI-PI-OPS.

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Relevant Components for Customer Incidents PUBLIC 63

Page 64: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

10 Appendix: Entities and Mappings

Input from SAP ERP or SAP S/4HANA On Premise APIs to SAP Supply Base Optimization:

Supplier

Supplier

API Field IDoc Name IDoc Segment IDoc Field Name

SupplierID CREMAS06 E1LFA1M LIFNR

Name CREMAS06 E1LFA1M NAME1+NAME2+NAME3+NAME4

QualityIndex

Contact

LastName CREMAS06 E1KNVKM NAMEV

FirstName CREMAS06 E1KNVKM NAME1

Email ADRMAS03 (Con­tact)

E1BPADSMTP E_MAIL (STD_NO = ‘X’)

AlternateEmail ADRMAS03 (Con­tact)

E1BPADSMTP E_MAIL (Last email entered with STD_NO != ‘X’)

Region ADRMAS03 (Con­tact)

E1BPAD1VL REGION

ValidFromDate

ContactID CREMAS06/ ADR­MAS03 (Contact)

E1KNVKM/E1ADRMAS PARNR/OBJ_ID

ValidToDate

OfficialPhoneNumber ADRMAS03 (Con­tact)

E1BPADTEL TEL_NO (STD_NO = ‘X’)

AlternatePhoneNumber ADRMAS03 (Con­tact)

E1BPADTEL TEL_NO (Last phone number entered with STD_NO != ‘X’)

Address

AddressID ADRMAS03 (Con­tact)

E1BPAD1VL OBJ_ID+” _C” [appending “_C” to ContactId]

64 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Appendix: Entities and Mappings

Page 65: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

API Field IDoc Name IDoc Segment IDoc Field Name

City ADRMAS03 (Con­tact)

E1BPAD1VL CITY

District ADRMAS03 (Con­tact)

E1BPAD1VL DISTRICT

POBox ADRMAS03 (Con­tact)

E1BPAD1VL PO_BOX

POBoxPostalCode ADRMAS03 (Con­tact)

E1BPAD1VL POSTL_COD2

Region ADRMAS03 (Con­tact)

E1BPAD1VL REGION

Street ADRMAS03 (Con­tact)

E1BPAD1VL STREET

State ADRMAS03 (Con­tact)

E1BPAD1VL REGION

Country ADRMAS03 (Con­tact)

E1BPAD1VL COUNTRY

HouseNo ADRMAS03 (Con­tact)

E1BPAD1VL HOUSE_NO

Region CREMAS06 E1LFA1M REGIO

Email ADRMAS03 (Sup­plier)

E1BPADSMTP E_MAIL (STD_NO = ‘X’)

PhoneNumber ADRMAS03 (Sup­plier)

E1BPADTEL TEL_NO (STD_NO = ‘X’)

Address

AddressID CREMAS06 E1LFA1M ADRNR

City CREMAS06 E1LFA1M ORT01

District CREMAS06 E1LFA1M ORT02

POBox CREMAS06 E1LFA1M PFACH

POBoxPostalCode CREMAS06 E1LFA1M PSTL2

Region CREMAS06 E1LFA1M REGIO

CurrencyCode CREMAS06 E1LFM1M WAERS

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Appendix: Entities and Mappings PUBLIC 65

Page 66: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

All SAP Supply Base Optimization fields mapped to CREMAS06 IDoc are being inserted first through one integration flow, followed by an upsert for the fields mapped to ADRMAS03 IDoc in another integration flow.

New Mapping

Supplier of a contact must go before the contact itself.

Supplier

API Field IDoc Name IDoc Segment IDoc Field Name

SupplierID CREMAS06 E1LFA1M LIFNR

Name CREMAS06 E1LFA1M NAME1+NAME2+NAME3+NAME4

QualityIndex

Active CREMAS06 E1LFA1B CVP_XBLCK

Address

AddressID CREMAS06 E1LFA1M ADRNR

City CREMAS06 E1LFA1M ORT01

District CREMAS06 E1LFA1M ORT02

POBox CREMAS06 E1LFA1M

POBoxPostalCode CREMAS06 E1LFA1M PSTL2

Region CREMAS06 E1LFA1M REGIO

HouseNumber CREMAS06 E1LFA1M STRAS[0] [separated by ‘ ’]

Street CREMAS06 E1LFA1M

Country CREMAS06/ ADRMAS03 E1LFA1M/E1BPAD1VL LAND1/TIME_ZONE (better alter­native)

Contact

API Field IDoc Name IDoc Segment IDoc Field Name

SupplierID CREMAS06 E1LFA1M LIFNR

LastName CREMAS06 E1KNVKM NAMEV

FirstName CREMAS06 E1KNVKM NAME1

ContactID CREMAS06/ ADRMAS03 (Contact)

E1KNVKM/E1ADRMAS PARNR/OBJ_ID

Address

66 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Appendix: Entities and Mappings

Page 67: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

The problem with getting the rest of the address details from ADRMAS03 is that there is no field for Address ID in this IDoc.

Supplier

API Field IDoc Name IDoc Segment IDoc Field Name

SupplierID ADRMAS03 E1ADRMAS OBJ_ID

Email ADRMAS03 (Supplier) E1BPADSMTP E_MAIL (STD_NO = ‘X’)

PhoneNumber ADRMAS03 (Supplier) E1BPADTEL TEL_NO (STD_NO = ‘X’)

Contact

API Field IDoc Name IDoc Segment IDoc Field Name

Email ADRMAS03 (Contact) E1BPADSMTP E_MAIL (STD_NO = ‘X’)

AlternateEmail ADRMAS03 (Contact) E1BPADSMTP E_MAIL (Last email entered with STD_NO != ‘X’)

ContactID CREMAS06/ ADRMAS03 (Contact)

E1KNVKM/E1ADRMAS PARNR/OBJ_ID

OfficialPhoneNumber ADRMAS03 (Contact) E1BPADTEL TEL_NO (STD_NO = ‘X’)

AlternatePhoneNumber ADRMAS03 (Contact) E1BPADTEL TEL_NO (Last phone number en­tered with STD_NO != ‘X’)

Address

City ADRMAS03 (Contact) E1BPAD1VL CITY

District ADRMAS03 (Contact) E1BPAD1VL DISTRICT

POBox ADRMAS03 (Contact) E1BPAD1VL PO_BOX

POBoxPostalCode ADRMAS03 (Contact) E1BPAD1VL POSTL_COD2

Region ADRMAS03 (Contact) E1BPAD1VL REGION

Street ADRMAS03 (Contact) E1BPAD1VL STREET

State ADRMAS03 (Contact) E1BPAD1VL REGION

Country ADRMAS03 (Contact) E1BPAD1VL COUNTRY

HouseNo ADRMAS03 (Contact) E1BPAD1VL HOUSE_NO

Material

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Appendix: Entities and Mappings PUBLIC 67

Page 68: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

Material

API Field IDoc Name IDoc Segment IDoc Field Name

MaterialId MATMAS05 E1MARAM If(MFRPN){send MFRPN} else {send MATNR}

MaterialName MATMAS05 E1MAKTM MAKTX

MaterialGroupId MATMAS05 E1MARAM MAKTL

MaterialType MATMAS05 E1MARAM MTART

ProductFamilyID MATMAS05 Constant Constant

BaseUnitOfMeasure MATMAS05 E1MARAM MEINS

internalPartNumberRef MATMAS05 If(MFRPN != “”) {send BMATN}

materialRevisionNo MATMAS05

Description MATMAS05 E1MAKTM

Locale MATMAS05 E1MAKTM SPRAS_ISO

Text MATMAS05 E1MAKTM MAKTX

plantId MATMAS05 E1MARCM

plantIds MATMAS05 E1MARCM WERKS

Material Group

API Field IDoc Name IDoc Segment IDoc Field Name

MaterialGroupID W_WGRP01 E1BPE1WGR01 MATL_GROUP

DefaultDescription

Description

Locale W_WGRP01 E1BPE1WGRT01 LANGU_ISO

Text W_WGRP01 E1BPE1WGRT01 MG_DESCR_SHORT

Award History

● IDOC – ORDERS05● Function module to generate IDOC - MASTER_IDOC_DISTRIBUTE● Function module to trigger IDOC - EDI_DOCUMENT_DEQUEUE_LATER

68 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Appendix: Entities and Mappings

Page 69: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

Award History

AwardHistory Fields SAP ERP Fields Description

Creation Date Eipa-bedat Purchase Order Date

CurrencyCode Eipa-bwaer Currency Key

DemandQty Eipa-menge Quantity

MaterialId Eina-matnr Material

NegotiationId IDOC Number Unique number

SupplierId Eina-lifnr Supplier

AwardsPrice Eipa-preis Price

UnitOfMeasure Eipa-bprme Order Price Unit

Demand

● IDOC Type – LOISTD01● Message Type – LOISTD● API - MRP Header : MD_SELECTION_SR_LIST_RANGE● API - MRP Details : BAPI_MATERIAL_STOCK_REQ_LIST● FM used – MASER_IDOC_DISTRIBUTE

Demand

API Field IDoc Name IDoc Segment IDoc Field Name

DemandId LOISTD01 EDI_DC40 DOCNUM

MaterialId LOISTD01 E1MDSTL MATNR

ProjectId N/A N/A N/A

PlantId LOISTD01 E1MDSTL WERKS

ValidFromDate LOISTD01 E1MDPSL DAT00

ValidToDate LOISTD01 E1MDPSL DAT01

DemandQty LOISTD01 E1MDSTL EINME

AwardedFlag LOISTD01 E1MDPSL BESKZ

LastUpdated LOISTD01 E1MDPSL DAT02

List of Inbound Process Codes by Message Type

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Appendix: Entities and Mappings PUBLIC 69

Page 70: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

Message Types

Message Type Process Code

INFREC INFR

COND_A COND

70 PUBLICSAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)

Appendix: Entities and Mappings

Page 71: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

Important Disclaimers and Legal Information

HyperlinksSome links are classified by an icon and/or a mouseover text. These links provide additional information.About the icons:

● Links with the icon : You are entering a Web site that is not hosted by SAP. By using such links, you agree (unless expressly stated otherwise in your agreements with SAP) to this:

● The content of the linked-to site is not SAP documentation. You may not infer any product claims against SAP based on this information.● SAP does not agree or disagree with the content on the linked-to site, nor does SAP warrant the availability and correctness. SAP shall not be liable for any

damages caused by the use of such content unless damages have been caused by SAP's gross negligence or willful misconduct.

● Links with the icon : You are leaving the documentation for that particular SAP product or service and are entering a SAP-hosted Web site. By using such links, you agree that (unless expressly stated otherwise in your agreements with SAP) you may not infer any product claims against SAP based on this information.

Videos Hosted on External PlatformsSome videos may point to third-party video hosting platforms. SAP cannot guarantee the future availability of videos stored on these platforms. Furthermore, any advertisements or other content hosted on these platforms (for example, suggested videos or by navigating to other videos hosted on the same site), are not within the control or responsibility of SAP.

Beta and Other Experimental FeaturesExperimental features are not part of the officially delivered scope that SAP guarantees for future releases. This means that experimental features may be changed by SAP at any time for any reason without notice. Experimental features are not for productive use. You may not demonstrate, test, examine, evaluate or otherwise use the experimental features in a live operating environment or with data that has not been sufficiently backed up.The purpose of experimental features is to get feedback early on, allowing customers and partners to influence the future product accordingly. By providing your feedback (e.g. in the SAP Community), you accept that intellectual property rights of the contributions or derivative works shall remain the exclusive property of SAP.

Example CodeAny software coding and/or code snippets are examples. They are not for productive use. The example code is only intended to better explain and visualize the syntax and phrasing rules. SAP does not warrant the correctness and completeness of the example code. SAP shall not be liable for errors or damages caused by the use of example code unless damages have been caused by SAP's gross negligence or willful misconduct.

Gender-Related LanguageWe try not to use gender-specific word forms and formulations. As appropriate for context and readability, SAP may use masculine word forms to refer to all genders.

SAP Supply Base Optimization - Integration Guide (SAP ERP and SAP S/4HANA)Important Disclaimers and Legal Information PUBLIC 71

Page 72: Guide (SAP ERP and SAP S/4HANA) SAP Supply Base

www.sap.com/contactsap

© 2020 SAP SE or an SAP affiliate company. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company. The information contained herein may be changed without prior notice.

Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors. National product specifications may vary.

These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP or SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. All other product and service names mentioned are the trademarks of their respective companies.

Please see https://www.sap.com/about/legal/trademark.html for additional trademark information and notices.

THE BEST RUN