How to read order details from the liveCache with FM /SAPAPO/OM_ORDER_GET_DATA
Very often when analyzing issues in APO I find it useful to read order details from the liveCache.
We can see from the order data stored in the liveCache when it was created, whether it was already transferred to ECC, what is the net processing times (in seconds) of the modes of the activities and, of course, compare all that information to the interactive screens we use all the time, be it Master Data (like PDS display) or application-specific (like Product View or a Planning Book).
One way to do this is by executing Function Module /SAPAPO/OM_ORDER_GET_DATA, as described below:
1) Get the OrderID number of the order.
At the Product View, execute ok-code GT_IO and then copy the value of the field Internal Order corresponding to the order you want to get the details on:
Another way would be to open the Order View (/SAPAPO/RRP2) for the order, then enable the debugger with ok-code /h and press enter twice to open the debugger. Then, copy the orderid from field GT_ORDERS-ORDERID
2) Get the GUID of the Planning Version
(you can skip this step if you are reading order data from the Active Version / Planning Version 000).
This can be done in transaction /SAPAPO/OM16. There, specify the name of the Model and the name of the Planning Version and execute. Then, copy the value of field Guid of Planning Vers.
3) Execute in transaction SE37 the Function Module /SAPAPO/OM_ORDER_GET_DATA.
At the selection screen of the transaction, specify the Function Module and click in Test/Execute button (F8)
On Test Function Module screen, set the indicator Uppercase/Lowercase
In the Details View of Import Parameter IS_GEN_PARAMS, specify the GUID of the Planning Version (always 000 for the Active version)
Press Back button. Then, in the Details View of IT_ORDER, specify the OrderID
Press back button and then execute the Function Module. Then, click on Save button in the popup and check the results:
4) Analyze the data
- You can check, for example, the date and time this order was created in APO, in export parameter ET_ORDERS, field CREATION_TIME (all dates are displayed in UTC, exactly as stored in the liveCache).
- If you are in a scenario with alternative sequences, you can see in ET_MODES, field NET_PROC_TIME, what is the net processing time of that mode, in seconds - the number of working seconds needed to execute the activity, as calculated during PDS/PPM explosion.
- For dynamic setup activities, the REM_PROC_TIME and/or NET_PROC_TIME may be 0. That's because the net duration of sequence-dependent setup is calculated dynamically, from the setup matrix.
- You can see the time-continuous and the bucket capacity requirement for each of the modes in ET_CAP_REQS.
- In the example above, you can see this order was not sent over to ECC yet as ET_ORDMAPS is empty.
- If there are activity relationships in the order, they will be shown in ET_INTERN_CONSTRAINTS.
- Many other informations can be checked, if required, and then compared to the values displayed in interactive transaction (like the /SAPAPO/RRP3 or /SAPAPO/SDP94).