Hi,
Use CRM_DOCFLOW_READ_OW FM to read parent document. Pass current document GUID to the FM and get parent document. after you get parent document again call the same FM with parent GUID then get the parent document GUID for that document. You have repeat this till you get ORDER GUID.
objkey_a will have parent document guid.
Regards,
Deepika.