Monday, December 23, 2024

OIC - Seamless Integration: SCM to SAP EFMS Inventory Transactions Flow

Usecase:

Here, we will see how to integrate between SCM and SAP applications for inventory transactions.

This flow consists of following integrations:

  1. 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.
  1. 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.
  2. 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:
  1. Schedule parameters: 
    1. ToDate : format: YYYY-MM-DD HH:MM:SS
    2. DateFrom : format: YYYY-MM-DD HH:MM:SS
  2. Assign dateTo: format-dateTime(startTime,'[Y0001]-[M01]-[D01] [H01]:[m01]:[s01]')
  3. Invoke erp cloud adapter and configure:
    1. Query create update or delete info
    2. Services - ErpIntegrationService
    3. Operation: exportBulkData
  4. Take a switch and Map erp export bulk data as below
    1. If ToDate = " map as
      1. Job name: /oracle/apps/ess/custom/Procurement/InventoryTransaction,InventoryTransactionSyncToEfms
      2. Param list: Orgcode,#NULL,#NULL,dateFrom,dateTo
      3. Job options: EnableEvent=Y
    2. Else map as below:
      1. Job name: /oracle/apps/ess/custom/Procurement/InventoryTransaction,InventoryTransactionSyncToEfms
      2. Param list: Orgcode,#NULL,#NULL,dateFrom,ToDate
      3. Job options: EnableEvent=Y
  5. Assign params:
    1. dateFrom = $dateTo
    2. toDate = ''
  6. 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.
  7. In the global fault, we are passing error details to Saas app data dog .
Common service:
  1. Subscribe the event
    1. Receive business events raised within ERP Cloud
    2. ERP Integration Outbound Event
    3. 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>
  2. Assign job name to a variable Var_JobName: /ns15:onEvent/ns9:ErpExportBulkDataEvent/ns9:JOBS[1]/ns9:JOBNAME
  3. Validation: throw new fault - ESSJOBSTATUSFAILED where skip condition : summarystatus='SUCCEEDED'
  4. Invoke main integration and map the following info:
    1. SummaryStatus
    2. DocumentId
    3. Jobs details
    4. Connection properties >> relativeURI: get relative uri based on job name from lookup.
  5. If any error, In the scope fault handle >> throw new fault  - LOCALINTEGRATIONERROR
Main integration:
  1. Call erp cloud adapter and getDocumentForDocumentId - ERPIntegrationService and map subscribed event Document id
  2. Write the content to stage as opaque element using xsd opaque schema.
  3. Unzip the file using stage
  4. For each unzipped ICS File
    1. Take switch and check if filetype = 'csv'
    2. Read the csv file using stage
    3. Write target file to FTP location. It has 3 sections.
      1. Header
      2. Data set
      3. Footer

Screenshots:

Subscribe event :

Download file:





Write content to stage as opaque:




No comments:

Post a Comment

Featured Post

OIC - Oracle Integration-Bulk load into Oracle ATP OR Oracle ADW

Oracle Integration enhances its database adapters, including Oracle Autonomous Transaction Processing (ATP) and Autonomous Data Warehouse (A...