How to Auto Create Stock Entery without the need of Work Order?

I have a need to auto create a Stock Entry from WH1 to WIP or WH1 to WH2.

But when I try to create a Stock Entry programmatically I keep getting error the Work Order number is required.

I want to make a Stock Entry without Work Order. If I manually create a Stock Entry then it does not ask for Work Order and I am able to create a Stock Entry.

How to Auto Create Stock Entery without the need of Work Order number?

Regards,