cancel
Showing results for 
Search instead for 
Did you mean: 

BPC Embedded AMDP Read Source Data Best Practice

0 Kudos

Hi All,

I want to understand more about AMDP read source data best practice - whether it should be through i_view or referance tables. Here is the example and doubts about a live case :

Let say I am writing a very basic AMDP code for revenue = price x quantity. Let say price and quantity are planned in different input forms and the user clicks the calculation button in a seperate report (exact case is similar but not the same). In this case, if we reach source data for calculation ,in other words if we reach price and qty data via i_view (through planning filter) , then the user can not run the button if price input form is opened at the same time since input form will lock it and planning function will not be able to reach the data and calculation will throw error.

However, in planning filter , if I give only target data ( revenue data) as filter and AMDP developer reaches the price and volume data through referance tables(aggregation levels) in AMDP code (see this screenshot below), it does not throw lock error. Please see the document and screenshot for what I mean by referance aggregation levels.

https://archive.sap.com/documents/docs/DOC-53376

My question is : What is the best practice? If I don't want the users to face lock issues ( although it is developed by SAP since BI-IP on purpose), I can go with referance tables instead of i_view to reach source data but will I face any of the followings in the future:

1- Even though I filter the data properly in referance aggregation levels , will I face any performance issues after - let say 2 years

2- Will the users face authorization issues since we pull whole data in referance table and not apply any filtering based on authorization variables

3- Will we face any data inconsistency since we are breaking lock mechanisms of BPC Embedded

Thank you for your help.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Gunes,

1 The technical implementation to read data via aggregation level is always the same, so the performance depends on the amount of data you read.

2 Please only read data you really need. As I said, data read in change mode (described by the filter used in the context of planning functions or sequences) requires change authorization, other data read via 'external' aggregation level requires read authorization. Observe, that BW checks authorization already when data is read; using this approach it is not required to check authorization when records are changed/deleted/created since all changes have to be included in the range described by the filter.

3 Assume you have 3 users, 1 works does prices planning only, 2 does quantity planning only and 3 whats to executed the AMDP planning function. If all these users work in parallel on the same data, using your 'reference data approach' user 3 would only get the prices and quantity values on DB and not the users session data of users 1, 2. This might lead to confusion since user 1 might say 'I planned a price of 10' (saved at t1), user two planned a quantity 100 (saved at t2 > t1) and user 3 executed the planning function at t3 with t1 < t3 < t2, then the revenue would probably not be 10 * 100 but 10 * (quantity at t3 on DB, might be <> 100).

Regards,

Gregor

Answers (3)

Answers (3)

al_223
Discoverer
0 Kudos

Hi sunnybt

I do also have similar requirement to calculate resutls which comes AGG level 1 and percentages afer in AGG level 2.

But when I wrote complete code, it still shows only data from AGG level 1, but not calculating with AGG level 2.

Please share which interfaces did you use.

0 Kudos

Hi Gregor. Thank you very much for your response. Let me rephrase a little and be more specific:

1 - Yes definitely depending on volume , what I mean is: will it cause performance issues compared to getting (the same) data through i_view?Is it very much different than that? Let say we get the data through referance table for only version = XXX, is it different then getting the same version XXX data through i_view in terms of performance?

2- What I mean here is : Let say the user is authorized to write only profit centre X.I am first pulling the data in referance table for all profit centres. Then calculating something and posting to only profit centre X. Will I recieve any issue before posting it? Because I pulled all data in the beginning although it is in the internal table only.

3- I would appriciate if you give an example on this point : The 'reference data' approach assumes stable data since you 'see' only data saved on DB and not other users session data

0 Kudos

Hi Gunes,

to read data from another aggregation level is just a special case to read 'reference data'; the method allows to read also the not yet saved user session data (of course only your user session). But in most cases 'reference data' is stable data, i.e. this does not change in the user session. In this case you may also read 'reference data' in you SQL Script implementation.

To your question:

1 This cannot answered without knowing the project setup data model, data volume etc. To answer this question is project business.

2 Data read in changes mode (described by the filter) requires change authorization all other data requires read authorization (the another aggregation level case or when a planning function reads reference data); in the SQL Script case it is up to the SQL Script implementation as this is a black bock for the planning system.

3 You cannot break the transaction data lock mechanism (at least I hope so) as transaction data locks are used for data read in change mode (described by filters); reference data is not locked.

It depends how you organize the planning process whether 'price' and 'quantity' is planned in parallel by different users or whether this is done one after the other. The 'reference data' approach assumes stable data since you 'see' only data saved on DB and not other users session data.

Regards,

Gregor