Obviously, this is not ABAP objects related question. You should move it to ABAP development.
KOMK fields are generally fields from the Document header data like VBRK, Ship-to Party data. There is a user exit USEREXIT_PRICING_PREPARE_TKOMK in the program RV60AFZZ. Put a breakpoint in the user exit. While creating the billing document is would stop at that point. Navigate to the Call Stack and to previous programs and see how KOMK is getting fields.
Regards,
Naimesh Patel