集約ストレージ・データベースに対する割当てを実行または確認します。
構文
ESS_FUNC_M EssPerformAllocationASO (
hCtx, verifyOnly, errorList, allocStruct
);
| パラメータ | データ型 | 説明 |
|---|---|---|
hCtx |
ESS_HCTX_T |
APIコンテキスト・ハンドル。 |
verifyOnly |
ESS_BOOL_T |
割当てを実行せずに割当てパラメータを確認することを示すフラグ。これをESS_TRUEに設定すると、割当てパラメータの確認のみが行われます。ESS_FALSEの場合は、割当てが確認され、実行されます。 |
errorList |
ESS_PERF_ALLOC_ERROR_T** |
API関数によって割り当てられ、戻されるエラー構造体のリンク・リストへのポインタ。これにより、クライアントは警告およびエラー・メッセージの詳細を保持します。この引数は0にできません。リンク・リストはクライアントによって解放される必要があります。 |
allocStruct |
ESS_PERF_ALLOC_T* |
割当てパラメータを指定する構造体。 |
戻り値
正常終了の場合は0が戻され、それ以外はエラーが戻されます。
例
void HandleErrors(ESS_HINST_T hInst, ESS_PERF_ALLOC_ERROR_T **pErrorList)
{
if (pErrorList)
{
ESS_PERF_ALLOC_ERROR_T *errorList = *pErrorList;
ESS_PERF_ALLOC_ERROR_T *nextError;
while (errorList)
{
printf("Error number %ld occurred\n", errorList->messageNumber);
if (errorList->argument != ESS_PERF_ALLOC_ARG_NA)
printf(" in argument %d\n", errorList->argument);
if (errorList->lineNumber)
printf(" on line %ld\n", errorList->lineNumber);
if (errorList->token[0] != '\0')
printf(" on token %s\n", errorList->token);
nextError = errorList->nextError;
ESS_STS_T sts = EssFree (hInst, errorList);
printf("\nEssFree sts for errorList %ld\n",sts);
errorList = nextError;
}
*pErrorList = NULL;
}
}
void ESS_GLAllocation()
{
ESS_STS_T sts = ESS_STS_NOERR;
ESS_BOOL_T verifyOnly;
ESS_PERF_ALLOC_ERROR_T *errorList = ESS_NULL;
ESS_PERF_ALLOC_T *allocStruct;
sts = EssAlloc (hInst, sizeof(ESS_PERF_ALLOC_T), (ESS_PPVOID_T)&allocStruct);
printf("EssAlloc sts for allocStruct: %ld\n", sts);
verifyOnly = ESS_FALSE;
errorList = ESS_NULL;
allocStruct->pov = "[[Account]]@[1100]]].Children";
allocStruct->amount = "100";
allocStruct->amountContext = "";
allocStruct->amountTimeSpan = "";
allocStruct->target = "([Allocated], [041509GR PL2], [11], [[All Department Values]].[000]]], [0000], [Base], [USD], [Total])";
allocStruct->targetTimeSpan = "{[Feb-08]}";
allocStruct->targetTimeSpanOption = ESS_ASO_ALLOCATION_TIMESPAN_DIVIDEAMT;
allocStruct->offset = "([Mar-08], [041509GR PL2], [11], [[All Department Values]].[000]]], [0000], [Base], [USD], [Total], [291], [Allocated])";
allocStruct->debitMember = "[Beginning Balance Dr]";
allocStruct->creditMember = "[Beginning Balance Cr]";
allocStruct->range = "DESCENDANTS([Accessories], [Product].Levels(0))";
allocStruct->excludedRange = "";
allocStruct->basis = "([041509GR PL2], [11], [[All Department Values]].[000]]], [0000], [Base], [USD], [Total], [Beginning Balance Cr], [4140], [Actual])";
allocStruct->basisTimeSpan = "{[Feb-08]}";
allocStruct->basisTimeSpanOption = ESS_ASO_ALLOCATION_TIMESPAN_COMBINEBASIS;
allocStruct->allocationMethod = ESS_ASO_ALLOCATION_METHOD_SHARE;
allocStruct->spreadSkipOption = 0;
allocStruct->zeroAmountOption = ESS_ASO_ALLOCATION_ZEROAMT_DEFAULT;
allocStruct->zeroBasisOption = ESS_ASO_ALLOCATION_ZEROBASIS_NEXTAMT;
allocStruct->negativeBasisOption = ESS_ASO_ALLOCATION_NEGBASIS_DEFAULT;
allocStruct->roundMethod = ESS_ASO_ALLOCATION_ROUND_NONE;
allocStruct->roundDigits = "";
allocStruct->roundToLocation = "";
allocStruct->groupID = 0;
allocStruct->ruleID = 0;
sts = EssPerformAllocationAso(hCtx, verifyOnly, &errorList, allocStruct);
printf("EssPerformAllocationAso sts: %ld\n",sts);
HandleErrors(hInst, &errorList);
if(allocStruct)
{
sts = EssFree (hInst, allocStruct);
printf("EssFree sts for allocStruct %ld\n",sts);
}
}