將預先格式化的餘額載入期間中

使用這些指令碼,將對映資料從上傳的檔案匯入至 Account Reconciliation 環境中。

Windows 範例指令碼

透過複製下列指令碼以建立名為 runPreformattedBalances.ps1 的檔案。將它儲存至本機目錄。
$inputproperties = ConvertFrom-StringData(Get-Content ./input.properties -raw)
$username="$($inputproperties.username)"
$passwordfile="$($inputproperties.passwordfile)"
$serviceURL="$($inputproperties.serviceURL)"
$dataFile="$($inputproperties.dataFile)"
$period="$($inputproperties.period)"
$balanceType="$($inputproperties.balanceType)"
$currencyBucket="$($inputproperties.currencyBucket)"

$elements=$dataFile.split('/')
$dataFileName=$elements[-1]

epmautomate login ${username} ${passwordfile} ${serviceURL}
epmautomate uploadfile ${dataFile}
epmautomate importpremappedbalances ${period} ${dataFileName} ${balanceType} ${currencyBucket}
epmautomate deletefile ${dataFileName}
epmautomate logout

Linux/UNIX 範例指令碼

透過複製下列指令碼以建立名為 runPreformattedBalances.sh 的檔案。將它儲存至本機目錄。
#!/bin/bash

. ./input.properties

export JAVA_HOME=${javahome}

dataFileName=$(echo "${dataFile}" | rev | cut -d'/' -f1 | rev)

${epmautomatescript} login "${username}" "${passwordfile}" "${serviceURL}"
${epmautomatescript} uploadfile "${dataFile}"
${epmautomatescript} importpremappedbalances "${period}" "${dataFileName}" "${balanceType}" "${currencyBucket}"
${epmautomatescript} deletefile "${dataFileName}"
${epmautomatescript} logout

範例 input.properties 檔案

若要執行 runPreformattedBalances 指令碼,請建立 input.properties 檔案並根據您環境的需要予以更新。將檔案儲存至儲存 runPreformattedBalances.shrunPreformattedBalances.ps1 的目錄。

Windows

username=exampleAdmin
passwordfile=examplePassword.epw
serviceURL=exampleURL
dataFile=DATA_FILE_NAME.csv
period=PERIOD_NAME
balanceType=BALANCE_TYPE
currencyBucket=CURRENCY_BUCKET

Linux/UNIX

javahome=JAVA_HOME
epmautomatescript=EPM_AUTOMATE_LOCATION
username=exampleAdmin
passwordfile=examplePassword.epw
serviceURL=exampleURL
dataFile=DATA_FILE_NAME.csv
period=PERIOD_NAME
balanceType=BALANCE_TYPE
currencyBucket=CURRENCY_BUCKET

表格 3-22 input.properties 參數

參數 描述
javahome JAVA_HOME 位置。僅適用於 Linux/UNIX。
epmautomatescript EPM Automate 執行檔 (epmautomate.sh) 的絕對路徑。僅適用於 Linux/UNIX。
username 服務管理員。的使用者名稱
password 服務管理員的密碼,或加密密碼檔案所在的名稱和位置。
serviceURL 環境的 URL,預先格式化的餘額會載入至這個環境中裝載的應用程式。
dataFile CSV 檔案,它包含要載入至應用程式的預先格式化餘額 (通常從總帳建立)。此檔案必須已透過 uploadFile 命令上傳至環境。
period 預先格式化餘額要上傳至的調節期間。
balanceType dataFile 中包含之預先格式化餘額的類型。
currencyBucket 預先格式化餘額的幣別分組。

執行指令碼

  1. 透過複製上一節的指令碼以建立 runPreformattedBalances.ps1runPreformattedBalances.sh
  2. 僅適用於 Windows 和 Linux/UNIX:
    • 建立 input.properties 檔案並將它儲存至 runPreformattedBalances 指令碼所在的目錄。此檔案的內容因作業系統而異。請參閱表格 3-22

      確保您在此目錄中具有寫入權限。至於 Windows,您可能需要使用以管理員身分執行選項來啟動 PowerShell,才能執行指令碼。

    • 啟動指令碼。
      • Windows PowerShell:執行 runPreformattedBalances.ps1
      • Linux/UNIX:執行 ./runPreformattedBalances.sh