使用这些脚本可将所上传文件中的映射数据导入到 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.sh 或 runPreformattedBalances.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-23 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 |
预先设置格式的余额的货币组。 |
重新运行该脚本
runPreformattedBalances.ps1 或 runPreformattedBalances.sh。input.properties 文件,并将其保存在 runPreformattedBalances 脚本所在的目录中。此文件的内容因操作系统的不同而异。请参阅“表 3-23”。
请确保您对此目录具有写权限。对于 Windows,您可能需要使用以管理员身份运行选项启动 PowerShell,以便能够运行脚本。
runPreformattedBalances.ps1。./runPreformattedBalances.sh。