Usecase: we have a source who is unable to provide transformed accounting data thats why we can't use FBDI GL journal import so we need to use Fusion Accounting Hub (FAH) - create the subledger source for the 3rd party system and configure the account transformation rules. Then import the transaction data using the fbdi template. Here, we will see the detailed FAH subledger accounting import implementation steps to ERP.
To know when to use GL or FAH, follow
https://soalicious.blogspot.com/2023/12/oic-when-to-use-fah-vs-gl-import.html
Implementation steps:
- List the files using SFTP connection from a specified directory
- Iterate over each file using for each action
- Take a body scope
- Download file as binary using SFTP connection to stage location.
- Assign global variables
- Write header Rows using stage C to C79 CSV file, file name : XlaTrxH.csv
- Write Line Header names : XlaTrxL.csv , https://soalicious.blogspot.com/2022/01/oic-add-header-or-line-file-field-names.html
- Get Open Period dates from ERP using BI report call. See my blog how to call BI report. https://soalicious.blogspot.com/2022/03/oic-how-to-call-and-read-bi-publisher.html
- Decode BI base64 response to reference : Take a assign and use decodeBase64ToReference() to store in a variable
- Read the open period dates file using stage, sample csv file, reference variable
- Read in segments the downloaded source file using stage
- For each record
- Update variables
- If C1 = DHD ( for header records)
- If record line count =0, assign transactionNumberString as empty
- Create a unique transaction number , we can take a sequence number or generate using data and time like concat(month-from-date(current-date()),day-from-date(current-date()),$p_currentTime,c8,c4) where c8= event type code and C4= transaction date and p_currentTime =concat(hours-from-dateTime(current-dateTime()),minutes-from-dateTime(current-dateTime())) declared as a global variable
- For each open period dates row,
- Check if transaction date within open period start and end dates and system matches, then assign openperiod flag as Y
- IF open period flag = N, update reject count as below
- Update closeperiodcount = + 1 and closedperioddates = concat( closedperiod dates , C2 and C4) where C= company code and C4= date
- If contains(TransactionNumberString, transactionNunber) = "true" then just logger with trasaction number. This step means we are skipping to write duplicate header record having same transaction number
- Else:
- update transaction number string.
- Transaction number string = concat(transaction number string, transaction number)
- Write header file using stage
- File name: XlaTrxH.csv
- Append : yes
- Mandatory mapped fields:
- transaction_number : for each unique number , only one header record should be there.
- event_type_code
- Ledger_name
- Transaction_date
- Transaction_reversal_flag
- If C1 = DLN ( For Line records)
- Assign line variables
- recordLineCount = recordLineCount +1
- lineNumber = LineNumber +1
- Take a switch and check amout for credit and debit validation:
- If c30 >= 0.0 then assign debit variables like
- record debit line count = record debit line count +1
- record debit line amount = add(record debit line amount, c30). how to add two numbers with fixed decimal points using javascript. check my blog(https://soalicious.blogspot.com/2021/03/oic-use-of-javascript-in-integration.html)
- else, assign same for credit variables like record credit line count, record credit line amount
- If C1 = BTR ( For Trailer Records)
- Assign Trailer records:
- File line count
- File debit line count
- File credit line count
- File debit line amount
- File credit line amount
- IF closePeriodCount >= 1 then throw new fault
- Code like closed period trasaction exists
- Reason like closed period transaction exists in the source file
- Details like closePeriodDates variable
- Write Lines part:
- Read file in segments using stage and the downloaded file reference : provide a sample.csv file
- For each record
- If C1 = DLN
- Assign newLineNumber = newLineNumber + 1 (where newLineNumber was globally assigned as 0)
- Take a stage and write the lines
- File name: XlaTrxL.csv
- Append yes
- Mandatory mapped fields:
- Transaction_numer: we can take a sequence number or generate using data and time like concat(month-from-date(current-date()),day-from-date(current-date()),$p_currentTime,c8,c4) where c8= event type code and C4= transaction date and p_currentTime =concat(hours-from-dateTime(current-dateTime()),minutes-from-dateTime(current-dateTime())) declared as a global variable (Note: the transaction number should match for header to the lines uniquely)
- Line_Number : assign $newLineNumber generated from
- Default_Currency
- Account_L
- STATE
- Description
- Book_Type
- Company
- CostCenter
- InterCompany
- ExpenseFunction
- Project
- Je_Line_Ref
- Source
- Default_amount
- Write meta data : Create a meta data file using stage with Metadata_File_InterfaceName.txt which will be helpful to track from ERP scheduled process.
- Metadata version number: 3
- Application Short Name : SourceName
- Zip files : Zip the header and line files using a stage.
- Archive zip files : Archive the zip file to a ftp location for support help.
- Validation of Trailer record: Take a switch and validate following:
- File line count = RecordLineCount
- File debit line count = RecordDebitLineCount
- File credit line count = RecordCreditLineCount
- File debit line amount = RecordDebitLineAmount
- File credit line amount = RecordCreditLineAmount
- IF validation is success
- Encrypt and import : https://soalicious.blogspot.com/2021/05/oic-erp-import-technique-1.html
- Get ess job status for import: https://soalicious.blogspot.com/2021/07/oic-get-ess-job-status.html
- Capture child process id: https://soalicious.blogspot.com/2022/01/oic-erp-how-to-get-child-process-id.html
- Get ess job staus from child process : same way like above step2 : https://soalicious.blogspot.com/2021/07/oic-get-ess-job-status.html
- Fah call back part : https://soalicious.blogspot.com/2022/02/oic-custom-callback-from-erp.html
- Else:
- Call child integration like OIC_FILE_HANDLER and feed the downloaded file reference, move file flag = Y, source and target file details so that it can move the file from source to target location.https://soalicious.blogspot.com/2023/12/oic-create-resuable-integration-to.html
- Call child integration like OIC_Notification to create a log file to ftp directory. Also we can create incident to Service now. https://soalicious.blogspot.com/2021/06/oic-send-notification.html
Excellent breakdown of the detailed implementation steps for OIC ERP! It's always helpful to have clear guidance on implementing ERP solutions effectively. At Epicforce Tech, we focus on seamless ERP implementations to ensure businesses achieve maximum efficiency. Looking forward to more insightful content like this
ReplyDelete