Usecase:
Here, we will see how to integrate between SCM and SAP applications for inventory transactions.
This flow consists of following integrations:
- Scheduler:<InterfaceNumber>_OracleSCMToEFMS_Inventory_Transaction_SCH:
- this will call custom ess job by passing 2 params: datefrom and dateTo.
- OIC will use the last successful run date timestamp as the date from and the current date timestamp as the dateto for the data extraction.
- It will call the export bulk data process to trigger the BIP to extract the inventory transaction data.
- Common:SCM_Common_Interface_Outbound_Callback
- Callback will be triggered upon the completion of the ESS job by the ERP cloud. This callback will be subscribed by this callback process.
- This service will feed the job details to the main process.
- Main:<InterfaceNumber>_OracleSCMToEFMS_Inventory_Transaction_Main:
- Decode the data from base64 and tramsform the inventory transaction data
- Transform the data into fixed length file.
- Prepare imventrory transaction target file into EFMS format by addig header and trailer.
Scheduler service:
- Schedule parameters:
- ToDate : format: YYYY-MM-DD HH:MM:SS
- DateFrom : format: YYYY-MM-DD HH:MM:SS
- Assign dateTo: format-dateTime(startTime,'[Y0001]-[M01]-[D01] [H01]:[m01]:[s01]')
- Invoke erp cloud adapter and configure:
- Query create update or delete info
- Services - ErpIntegrationService
- Operation: exportBulkData
- Take a switch and Map erp export bulk data as below
- If ToDate = " map as
- Job name: /oracle/apps/ess/custom/Procurement/InventoryTransaction,InventoryTransactionSyncToEfms
- Param list: Orgcode,#NULL,#NULL,dateFrom,dateTo
- Job options: EnableEvent=Y
- Else map as below:
- Job name: /oracle/apps/ess/custom/Procurement/InventoryTransaction,InventoryTransactionSyncToEfms
- Param list: Orgcode,#NULL,#NULL,dateFrom,ToDate
- Job options: EnableEvent=Y
- Assign params:
- dateFrom = $dateTo
- toDate = ''
- If any error, throw new fault : key as ESSJOBERROR" using lookup where error code and reason is stored. Details van be fetched from the scope fault object.
- In the global fault, we are passing error details to Saas app data dog .
Common service:
- Subscribe the event
- Receive business events raised within ERP Cloud
- ERP Integration Outbound Event
- Add filter like <xpathExpr xmns:ns0="http://xmlns.oracle.com/apps/financials/commonModules/shared"> $inputVariable/ns0:JOBS[1]/ns0:JOBNAME='Inventory Transaction Sync To EFMS' or ... </xpathExpr>
- Assign job name to a variable Var_JobName: /ns15:onEvent/ns9:ErpExportBulkDataEvent/ns9:JOBS[1]/ns9:JOBNAME
- Validation: throw new fault - ESSJOBSTATUSFAILED where skip condition : summarystatus='SUCCEEDED'
- Invoke main integration and map the following info:
- SummaryStatus
- DocumentId
- Jobs details
- Connection properties >> relativeURI: get relative uri based on job name from lookup.
- If any error, In the scope fault handle >> throw new fault - LOCALINTEGRATIONERROR
Main integration:
- Call erp cloud adapter and getDocumentForDocumentId - ERPIntegrationService and map subscribed event Document id
- Write the content to stage as opaque element using xsd opaque schema.
- Unzip the file using stage
- For each unzipped ICS File
- Take switch and check if filetype = 'csv'
- Read the csv file using stage
- Write target file to FTP location. It has 3 sections.
- Header
- Data set
- Footer
Screenshots:
Subscribe event :
Download file:
Write content to stage as opaque:
No comments:
Post a Comment