on 06-03-2016 4:21 PM
Dear APO Gurus,
There is a simple macro to calculate forecast in values:
Forecast in Values = Forecast in PCs * Price
Now price is always maintained on the level of Material and sales org. It means forecast (in values) should be calculated on the aggregated level of characteristics "Material" and "Sales Org".
I know we can set the aggregation level (Material - Sales organization) in the DP background job to perform the macro calculation.
How I can create a default macro which always make calculation on the level of selected characteristics: (e.g.Material and Sales org). Planner may load the data on group level (many materials at once) in the data view, but default macro will make calculation always on the fixed aggregated level (Material - sales org)
I will appreciate if you can provide an example macro in macro bulider.
Thanks in advance and nice weekend.
Regards,
Mukesh
Hi Mukesh,
create a macro which pre-condtion is the check of the desired aggregation level.
Example in pseudo code:
IF agg_level ("Sales org" = 0 AND "Matnr" = 0)
Forecast in Values = Forecast in PCs * Price
ENDIF.
The whole thing works with agglevel but as well detailed level.
regards Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peter,
Thanks for your reply. In this solution, default macro will calculate the result (Forecast in Values) only when data is loaded on the detailed level of material and sales organization. Taking the example from following table, macro will work when planner will load the data for material P1 for sales org UK.
In the real world scenario, planner may load the forecast data for all materials together in the data view (P1+P2+ P3+P4 = 100PCs). In such case how to make sure default macro will make calculation on the detailed level of material and sales organization which gives result of Forecast in values = 300
Kind regards,
Mukesh
Hi Mukesh,
therefore I would use a background job to perform the calculation on the expected level instead of doing it online. Not sure how often the price changes but I would strongly assume that prices will not be loaded more often than once a day. Therefore a nightly recalculation after having loaded updated prices should be sufficient.
However you might also trigger a background job via userexit/badi macro in case you really want to perfrom this activity online or you use the drill_down and drill_up function to do the same. But you need to keep in mind that this kind of procedure impacts the dialogue usage and runtime.
regards Peter
Hello,
When necessary, you can use internal drill down/up macro function drill_down() / drill_up().
Best Regards,
Ada
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
4 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.