You are on page 1of 12

Supply Chain Planning

Cloud Integration
Automation with
Oracle eBS R12

WHITEPAPER || August 2021

Author: Krushna Sahoo, Application Architect

1 Copyright © 2021, Oracle and/or its affiliates/ Confidential – Oracle Internal


PURPOSE STATEMENT

This document provides instructions for custom extension development and configuration for automation of Oracle
eBS R12 - Oracle Fusion Supply Chain Planning Cloud Integration. It is a pre-requisite that the current eBS system is
enabled with recommended patches for the prebuilt eBS to Fusion Supply Chain Planning Cloud integration.

DISCLAIMER

The following is intended to outline our general product direction. It is intended for information purposes only and
may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and
should not be relied upon in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.

DOCUMENT HISTORY/ VERSION CONTROL

This Document Version Version 1.0

This Document Release Date 17-Aug-2021

Document Owner(s) Krushna Sahoo, Application Architect - OCSC SCM

Document Reviewer(s) Karthikeya Venkatasubba Rao, Presales and Architecture Leader - OCSC SCM
Gururaman Subramanian, Application Architect - OCSC SCM
Prasanna Panchapakesan, Consulting Practice Manager - OCSC SCM
Dattatreya Arya, Application Architect - OCSC SCM

DOCUMENT VERSION HISTORY

VERSION RELEASE DATE DETAILS LAST UPDATED BY


Version 1.0 17 AUG 2021 Initial Release Version Krushna Sahoo

2 Copyright © 2021, Oracle and/or its affiliates/ Confidential – Oracle Internal


Table of Contents

Introduction 4
Inbound Flow (Oracle eBS to Oracle Fusion Supply Chain Planning) 6
Outbound Flow (Oracle Fusion Supply Chain Planning to Oracle eBS) 6
Configuration 11
Automation Testing 11
Security 11
Deployment 11
Conclusion 12
References 12

3 Copyright © 2021, Oracle and/or its affiliates/ Confidential – Oracle Internal


Introduction
Introduction

The predefined integration between Oracle EBusiness Suite and Oracle Fusion Supply Chain Planning Cloud
allows on-prem e-Business customers to continue using their current supply chain fulfillment processes for
operations while leveraging the advanced capabilities in demand management, replenishment planning and
supply planning offered by Oracle Fusion Supply Chain Planning Cloud applications.
The prebuilt integration provides an easy way to collect data from e-Business Suite to Supply
Chain Planning Cloud and ability to publish plan recommendations to e-Business Suite
modules. Together these integrations deliver rapid deployment capabilities and help
customers avoid the need to build custom integrations that require processing and
transformation of data.
This document provides steps to automate the file movement between Oracle eBS and Oracle Fusion Supply
Chain Planning cloud as the current prebuilt integration requires several manual steps such as download of the
extract from Oracle eBS, upload of files to Oracle Fusion Supply Planning cloud, download the plan
recommendations from Oracle Fusion Supply Planning Cloud and upload to Oracle eBS for execution.

Diagram 1: Business objects flow between eBS and Fusion SCP cloud

4 Copyright © 2021, Oracle and/or its affiliates/ Confidential – Oracle Internal


Diagram 2: End to End Integration flow eBS → Fusion SCP Cloud

In the above process flow the manual steps mentioned in red color can be automated with the help of the ERP
Integration webservice based java custom extension proposed in this whitepaper.

Pre-requisites
1. To enable integration between on-prem Oracle eBS and Oracle Fusion SCP Cloud, you need
to apply the recommended eBS integration patches as per the eBS version into eBS so that
the required metadata objects, views and concurrent requests will be available.

2. Please refer MOS notes 2339436.1, 2388134.1 and raise SR to get recommendation about
the correct Oracle eBS patches needed as per your eBS version. 2400184.1 for planned order
recommendation manual import into Oracle eBS.

Fusion ERP Integration Service


Custom Java Extension Provides external operations for Oracle Cloud ERP integration (web services)
scenarios to execute end-to-end inbound and outbound data flows from
A custom java-based extension
OnPrem or other legacy applications. It also tracks the status of inbound and
using Oracle Cloud ERP
outbound data processes.
integration (web services) is
QName:{http://xmlns.oracle.com/apps/financials/commonModules/shared/
needed to execute end-to-end
model/erpIntegrationService/}ErpIntegrationService
inbound and outbound data flows
Service WSDL URL:
between Oracle eBS and Oracle
https://(FADomain,FSCMServices)/fscmService/ErpIntegrationService?WSDL.
Fusion Supply Chain Planning
To access ERP integration web services from eBS server, you need to use
Cloud.
fusion pod url with valid user authentications in the custom java extension so
that it can upload and download files from fusion and call related ESS jobs.

5 Copyright © 2021, Oracle and/or its affiliates/ Confidential – Oracle Internal


Inbound Flow (Oracle eBS to Oracle Fusion Supply Chain Planning)

Diagram 3: Inbound flow from eBS to Fusion SCP

Process step definitions:

Outbound Flow (Oracle Fusion Supply Chain Planning to Oracle eBS)

Diagram 4: Outbound flow from Fusion SCP to eBS

6 Copyright © 2021, Oracle and/or its affiliates/ Confidential – Oracle Internal


Process step definitions:

Fusion planning plan release action by users – Example:

Table 1: Sample Fusion SCP Supply Plan recommendation release files

Plan recommendations files would be created as and when planners release the plan orders. For each release
action different zip file would be created at UCM server.
• These plan recommendations files need to be downloaded daily into eBS server and status maintained into a
custom table (and actual files at server path).
• Make sure all ReleaseToExternal_*.zip plan recommendations files getting downloaded into eBS server path
• Update below custom table, for example XXCLD_ESS_JOBS for each download success
• Custom PLSQL/Java program to scan below table and upload the not uploaded files in to eBS through
concurrent program

Table 2: Custom table in eBS apps schema to track the fusion plan recommendation files downloaded and processed into eBS

• The next WS call to download the ReleaseToExternal_*.zip would be decided by last ESSJOBID column value.
Like for user A, its 1236. For user B, its 5235. Once the file downloaded, update same entry into above table
with downloaded = Y.

7 Copyright © 2021, Oracle and/or its affiliates/ Confidential – Oracle Internal


• The next concurrent request ‘Collect Flat File Data –Self Service’ call to upload the not uploaded plan
recommendations file into eBS would be decided by username/uploaded = N condition from above table,
once uploaded/processed update uploaded = Y for that file/row.
• Before the ‘Collect Flat File Data –Self Service’ call, you need to have the ReleaseToExternal_xxxx.zip loaded
as an attachment/document into eBS [pseudo code below], then use that as argument/parameter to the
above concurrent request.
• ‘Collect Flat File Data –Self Service’ job intern will call other related concurrent jobs as per the
BUY/MAKE/TRANFER order recommendations.
//-- pseudo code and logical flow
1. Define an eBS Attachment for the planning recommendation zip file
2. Use it for the MSC_FILES entry and mscload id
3. Use the mscload id for the legacy file upload concurrent job into eBS
4. Which in turn will call other child processes to create execution orders as per the planning recommendations from Fusion
supply planning

- Access for example XXCLD_ESS_JOBS custom table which was used to track plan recommendation files downloaded from
Fusion to eBS and find files not uploaded into eBS
FOR r in (select distinct ff.* from apps.XXCLD_ESS_JOBS ff where uploaded = 'N' order by documentid)
LOOP
--example [/uxxxx/…/…/APP/../EBSapps/appl/msc/12.0.0/cloud/../ReleaseToExternal_5240.zip]
temp_l_filename := null;

//-- define eBS attachment for the plan recommendation zip file to be loaded
SELECT NVL (MAX (seq_num), 0) + 10
INTO l_seq_num FROM fnd_attached_documents
WHERE pk1_value = l_pk1_value AND entity_name = l_entity_name;

--Get Data type id for Short Text types of attachments


SELECT max(datatype_id) INTO l_short_datatype_id
FROM apps.fnd_document_datatypes
WHERE NAME = 'FILE';

--Select Category id for Attachments


SELECT category_id
INTO l_category_id
FROM apps.fnd_document_categories_vl
WHERE USER_NAME = l_category_name;

--Select nexvalues of document id, attached document id and


SELECT apps.fnd_documents_s.NEXTVAL,
apps.fnd_attached_documents_s.NEXTVAL
into l_document_id,l_attached_document_id
FROM DUAL;

SELECT FND_LOBS_S.NEXTVAL
INTO l_media_id
FROM dual;

SELECT MSC_FILES_S.NEXTVAL
INTO l_mscload_id
FROM dual;

fils := BFILENAME (l_file_path, l_filename);

--Obtain the size of the blob file


DBMS_LOB.fileopen (fils, DBMS_LOB.file_readonly);
blob_length := DBMS_LOB.getlength (fils);
DBMS_LOB.fileclose (fils);

INSERT INTO fnd_lobs


(file_id, file_name, file_content_type, file_data, upload_date,

8 Copyright © 2021, Oracle and/or its affiliates/ Confidential – Oracle Internal


expiration_date, program_name, program_tag, LANGUAGE, oracle_charset, file_format)
VALUES
(l_media_id, l_filename, 'application/x-zip-compressed', EMPTY_BLOB(), SYSDATE,
NULL, 'CLD_PLAN_RECO_ATTACH', NULL, 'US', 'AL32UTF8', 'binary')
RETURNING file_data
INTO x_blob;

-- Load the file into the database as a BLOB


DBMS_LOB.OPEN (fils, DBMS_LOB.lob_readonly);
DBMS_LOB.OPEN (x_blob, DBMS_LOB.lob_readwrite);
DBMS_LOB.loadfromfile (x_blob, fils, blob_length);

-- Close handles to blob and file


DBMS_LOB.CLOSE (x_blob);
DBMS_LOB.CLOSE (fils);
Commit;
DBMS_OUTPUT.put_line ('MEDIA ID CREATED fnd_lobs ' || l_media_id);

fnd_documents_pkg.insert_row
(x_rowid => l_rowid,
x_document_id => l_document_id,
x_creation_date => SYSDATE,
x_created_by => l_user_id,
x_last_update_date => SYSDATE,
x_last_updated_by => l_user_id,
x_last_update_login => fnd_profile.VALUE('LOGIN_ID'),
x_datatype_id => l_short_datatype_id,
X_security_id => NULL,
x_publish_flag => 'Y',
x_category_id => l_category_id,
x_security_type => 4,
x_usage_type => 'O',
x_language => 'US',
x_description => l_description,
x_file_name => l_filename,
x_media_id => l_media_id
);

--Description information will be stored in below table based on languages.


fnd_documents_pkg.insert_tl_row
(x_document_id => l_document_id,
x_creation_date => SYSDATE,
x_created_by => l_user_id,
x_last_update_date => SYSDATE,
x_last_updated_by => l_user_id,
x_last_update_login => fnd_profile.VALUE('LOGIN_ID'),
x_language => 'US',
x_description => l_description
);

fnd_attached_documents_pkg.insert_row
(x_rowid => l_rowid,
x_attached_document_id => l_attached_document_id,
x_document_id => l_document_id,
x_creation_date => SYSDATE,
x_created_by => l_user_id,
x_last_update_date => SYSDATE,
x_last_updated_by => l_user_id,
x_last_update_login => fnd_profile.VALUE('LOGIN_ID'),
x_seq_num => l_seq_num,
x_entity_name => l_entity_name,
x_column1 => NULL,
x_pk1_value => l_pk1_value,
x_pk2_value => NULL,
x_pk3_value => NULL,

9 Copyright © 2021, Oracle and/or its affiliates/ Confidential – Oracle Internal


x_pk4_value => NULL,
x_pk5_value => NULL,
x_automatically_added_flag => 'N',
x_datatype_id => 6,
x_category_id => l_category_id,
x_security_type => 1,
X_security_id => NULL,
x_publish_flag => 'Y',
x_language => 'US',
x_description => l_description,
x_file_name => l_filename,
x_media_id => l_media_id
);

insert into MSC_FILES


(plan_id, file_type, file_name, file_size, file_creation_date, row_count, copy_flag, netchange,
last_update_date, last_updated_by, creation_date, created_by, last_update_login, load_id, attachment_id, request_id,
header_id )
values
(-1, 0, l_filename,null,null,null,null,null,
sysdate, 0, sysdate, 0, fnd_profile.VALUE('LOGIN_ID'), l_mscload_id, l_attached_document_id, null, null );

-- document creation end

--Submitting Concurrent Request to upload the document/plan reco zip file


l_request_id := fnd_request.submit_request (
application => 'MSC',
program => 'MSCLOADS',
description => 'User File Upload',
start_time => sysdate,
sub_request => FALSE,
argument1 => l_mscload_id
);

IF l_request_id = 0
THEN
retcode := 2;
errbuf:='Concurrent request failed to submit ' || fnd_message.get;
dbms_output.put_line ('Concurrent request failed to submit');
ELSE
--update XXCLD_ESS_JOBS for the row processed successfully
update apps.XXCLD_ESS_JOBS set Uploaded = 'Y', LastUpdateDate = sysdate, info2=fnd_profile.VALUE('LOGIN_ID')
where DocumentId = r.DocumentId ;
retcode := 0;
errbuf:='Successfully Submitted the Concurrent Request : '|| l_request_id;
dbms_output.put_line('Successfully Submitted the Concurrent Request : '||l_request_id);
END IF;

END LOOP;
--Import JOB end
//

10 Copyright © 2021, Oracle and/or its affiliates/ Confidential – Oracle Internal


Configuration

1. DB apps objects required to keep detail info about 2. xximport_cld_plan_reco(errbuf,retcode)


outbound downloaded files, for example plsql proc, for example
create table apps.XXCLD_ESS_JOBS To upload the plan recommendation zip
( files into eBS and call eBS import
SL number, concurrent request.
ESSJOBID number,
[pseudo code logic mentioned above]
File_Name varchar2(300),
DocumentId varchar2(50),
ContentId varchar2(50),
UserName varchar2(50),
Downloaded varchar2(3),
Uploaded varchar2(3),
LastUpdateDate date default sysdate,
CreateDate date default sysdate,
info1 varchar2(50),
info2 varchar2(50));
CREATE SEQUENCE apps.XXESSJOBS_seq
START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;

Other than custom java code, some components needs to be developed in shell script and PLSQL to make sure
end to end process works seamlessly.
To schedule the inbound and outbound process, you may need to configure eBS concurrent request sets and
jobs. And use shell script, PLSQL proc or java program to configure the custom concurrent requests.

Automation Testing
Oracle Fusion SCP Cloud application user having only integration specialist role can be used for
inbound and outbound testing and automation.
Oracle eBS side concurrent request set, jobs can be run manually or scheduled once custom
extension tested thoroughly.

Security
Adequate firewall security needs to be enabled to give fusion webservice access from eBS server.
For eBS server path and apps schema access, proper security needs to be enabled to make this
automation extension deployment and work.

Deployment

Once the custom extension developed, same can be deployed into eBS app server. The process is
just keeping all config, executables, and shell scripts in one parent folder. And the DB objects
obviously needs to be in eBS apps schema.

11 Copyright © 2021, Oracle and/or its affiliates/ Confidential – Oracle Internal


Conclusion

Conclusion While there exists predefined integration between Oracle eBusiness Suite
and Oracle Fusion Supply Chain Planning Cloud when it comes to user
procedures, there are several manual steps involved right from Data
Collection from eBS, Plan Run in Fusion and implementing planning
recommendations back in eBS.
This white paper describes the steps to automate eBS-Fusion Supply Chain
Planning cloud in great detail and is based on a proven solution
implemented for a global customer enabling them with a hybrid solution
providing seamless user experience.

References
• MOS notes 2339436.1, 2388134.1 and 2400184.1 for prebuilt Integration and related guidelines.
• eBS 12.1.3 to Supply Chain Planning Cloud Integration – https://cloudcustomerconnect.oracle.com/posts/2084629d01
• eBS 12.2.6 to Supply Chain Planning Cloud Integration -https://cloudcustomerconnect.oracle.com/posts/f73f8e0669

For any queries: Contact us on ocsc_scm_presales_in_grp@oracle.com

12 Copyright © 2021, Oracle and/or its affiliates/ Confidential – Oracle Internal

You might also like