Hi Tanveer,
May be you can check the below points and try to get a solution .
FM - /SAPSLL/LC_DOCUMENT_CHECK , inside this there is a call for FM /SAPSLL/LC_LEGAL_REG_CHECK . Inside the second FM you could see a perform for license determination .
Probably you can see the perform and frame a logic for deriving the license determination .
I dont think there is direct way to get the licenses using the customer number .
/SAPSLL/LC_DOCUMENT_CHECK this FM is used for the custom documents validations .
Regards,
Ratheesh BS