
6. Under "Responses" you find in the response body the ten requested financial plan data entries. Look for the fields “Ledger”, “PlanningCategory”, “LedgerFiscalYear”, “GLAccount”, “CompanyCode”, “FiscalPeriod”, “FiscalYearPeriod” and the amount fields “AmountInTransactionCurrency”, "AmountInCompanyCodeCurrency", "AmountInGlobalCurrency" with their corresponding currencies.
7. Under "Responses" you find in the response header section the "x-csrf-token" for example x-csrf-token: 1U9-osE5pwCzTRZBEaHzFg==. It will be created newly for each session. This token will be needed to send write data requests.
8. Copy the x-csrf-token and open OData service "Financial Planning Data: Write" in the S/4HANA Cloud section of API Hub or directly open https://api.sap.com/api/API_FINPLANNINGDATA_SRV/resource
9. Under the resource "POST FinancialPlanData", click the button "Try out". Add a new header parameter with “Add” -> “Header”. Enter the header name “X-CSRF-Token” and the value from step 7.
10. Add the following JSON fragment into the body of “FinancialPlanDataType” and replace the fields for “PlanningCategory”, “GLAccount” and “CompanyCode”, with the values that has been found in step 6. Adjust “LedgerFiscalYear”, “FiscalYearPeriod” and the amount in field "AmountInCompanyCodeCurrency". Set the correct currency of the company code in field "CompanyCodeCurrency".
"PlanDataAggrgnLvlFieldsStrings" describes the aggregation level that is posted (here Ledger Fiscal Year, Planning Categroy, Company Code, Fiscal Year Period, GL Account, Company Code Amount and Compnay Code Currency).
"PlanDataRplcScopeFieldsString" describes the replace scope and will be derived from the aggregation level if it is empty as in the example.
Example comprises 5 plan data records of planning category "PLN" that are posted on G/L account "41000000" in the first five periods of ledger fiscal year "2012" and company code "1710".
{
"PlanDataAggrgnLvlFieldsString" : "LedgerFiscalYear,PlanningCategory,CompanyCode,FiscalYearPeriod,GLAccount,AmountInCompanyCodeCurrency,CompanyCodeCurrency",
"PlanDataRplcScopeFieldsString" : "",
"to_FinPlanningEntryItemTP" : {
"results" : [
{
"PlanningCategory" : "PLN",
"LedgerFiscalYear" : "2012",
"GLAccount" : "41000000",
"CompanyCode" : "1710",
"CompanyCodeCurrency" : "USD",
"AmountInCompanyCodeCurrency" : "224501.00",
"FiscalYearPeriod" : "001.2012"
},
{
"PlanningCategory" : "PLN",
"LedgerFiscalYear" : "2012",
"GLAccount" : "41000000",
"CompanyCode" : "1710",
"CompanyCodeCurrency" : "USD",
"AmountInCompanyCodeCurrency" : "424501.00",
"FiscalYearPeriod" : "002.2012"
},
{
"PlanningCategory" : "PLN",
"LedgerFiscalYear" : "2012",
"GLAccount" : "41000000",
"CompanyCode" : "1710",
"CompanyCodeCurrency" : "USD",
"AmountInCompanyCodeCurrency" : "304501.00",
"FiscalYearPeriod" : "003.2012"
},
{
"PlanningCategory" : "PLN",
"LedgerFiscalYear" : "2012",
"GLAccount" : "41000000",
"CompanyCode" : "1710",
"CompanyCodeCurrency" : "USD",
"AmountInCompanyCodeCurrency" : "104501.00",
"FiscalYearPeriod" : "004.2012"
},
{
"PlanningCategory" : "PLN",
"LedgerFiscalYear" : "2012",
"GLAccount" : "41000000",
"CompanyCode" : "1710",
"CompanyCodeCurrency" : "USD",
"AmountInCompanyCodeCurrency" : "230000.00",
"FiscalYearPeriod" : "005.2012"
}
]
}
}
11. Click the button “Execute”. After the plan data is processed, a response code “201” is returned. The response body contains the posted plan data records.
In case of different return code than “201” the posting request failed. See the response body for the returned errors. After correction step 11 can be repeated.
12. To verify your postings go back to OData service “Read Financial Planning Data Entry Item” (see step 3.)
Under the resource “GET A_FinPlanningEntryItem”, click the button “Add” -> “Query". Enter parameter "$filter" and value that you have posted. In the example "PlanningCategory%20eq%20%27PLN%27%20and%20LedgerFiscalYear%20eq%20%272012%27".
Click the button “Execute”. The request is executed and the response should contain the plan data records that you have posted in step 11.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 |