Hi Prashant,
This is not possible to change the value of the global variable of a base codeunit if you don't have the right event to subscribe.
You are subscribing the event OnAfterApplyItemLedgEntry, which is not having the property Yes for GlobalVarAccess.
Also you are not advised to modify the property manually which will not working properlly and you don't have the rights to change the event property in the extensions.
Tero Hassinen has given the right answer, as per best of my knowledge.

Regards
Mohit Malik