LDB-PNP Variant behavior (Background job ) on INITIALIZATION Event.
Iu2019ve written code on initialization event to pre-select employees based on Employee status (active) and created PNPINDEX.
Problem: This program move to prod in June, user created the variant as u201Ccurrent yearu201D and employee status u201CACTIVEu201D. Guess what, this program ran for month of June, July, August and September and always come up with 100 recordsu2019. I found it really strange, after doing research I came to know that when user created the variant first time, it created the pre-populate list of employees and always run for it. Since this job run it background.
I knew from HR ABAP class, you always pre-select the employees to make program more efficient and Iu2019ve seen this coding routine habit at almost every project.
I commented my code and now it is running fine. But my question from the folks out there who know the value of pre-select. What approach we should follow if we hit by the above scenario? Comment the code (the way I did) or re-save the variant every time, which is not good practice from user stands point. So what else?
I would populate the PNPINDEX in the START-OF-SELECTION instead..