Do not try this at home – performance improvement in the LIME engine
Disclaimer – this post is about changes in the customer namespace, which maybe belong in the standard and it is not a good idea to develop them in a customer project.
But, as we know, necessity is the mother of invention…
Recently within a customer project the customer was experiencing performance issues with the standard /scwm/pi_upload transaction.
The load of a .CSV file would end in a short dump, saying that the current work process was out of memory. And the system limit per WP was around 8G.
The file itself was not big, but even reducing it to a small number of lines, around 20-30, would not help solve the issue.
After some debugging, i observed that the culprit was the internal table /LIME/PI_DOC_ALL-T_EXIST, that was growing exorbitantly big over time.
The where-used list on this table showed that it was used only in a few places, namely in the program /LIME/LPI_COREPI1 and in the class /SCWM/CL_IM_PI_OP_CORE. In all of these places, it seemed that the logic was only considering entries where data-hu_item-huident was not initial.
So i came up with the idea to reduce this table, and get rid of the entries where the field huident is empty.
The structure /LIME/PI_DOC_ALL was extended
Also i created an enhancement implementation ZSCM_EI_ADD_ITEM_PROP_AND_BOOK.
Changed the include /LIME/LPI_COREPI1, and added an enhancement point ENHANCEMENT 1 ZSCM_EI_ADD_ITEM_PROP_AND_BOOK.
After the table had been reduced, i needed to adjust also the logic that reads it.
As the logic to be changed fell in the midddle of the method /SCWM/CL_IM_PI_OP_CORE-> /LIME/IF_EX_PI_OPERAT_CORE~CREATE_DIFFERENCE, i created an overwrite exit of /SCWM/CL_IM_PI_OP_CORE-> /LIME/IF_EX_PI_OPERAT_CORE~CREATE_DIFFERENCE,
created a new class zcl_ewm_im_pi_op_core as a copy and friend of /SCWM/CL_IM_PI_OP_CORE.
In the overwrite exit i would call the zcl_ewm_im_pi_op_core-> /LIME/IF_EX_PI_OPERAT_CORE~CREATE_DIFFERENCE implementation, which can then access all protected data and logic of the productive class instance.
And in the zcl_ewm_im_pi_op_core-> /LIME/IF_EX_PI_OPERAT_CORE~CREATE_DIFFERENCE implementation the following lines were added
For the given scenario, this helped get the process running and coming to a successful end. Again, i am not encouraging such interventions, and hope SAP will deliver an improvement here. Also, there could be potential side effects, this is fully acknowledged.
As for the system SP level, it looked like that:
What is also to be mentioned, is that the bin being counted is particularly large in terms of items. It more or less plays the role of a PSA.
Thanks for reading, and if you have had experience with such modelling, or you know a better approach without programming, please share the insights.