Hi Raj,
If in OBY6, no company ID is defined for company codes, they are NOT affiliated companies and the opposite.
Please check also via OBA7 (document type), if the field "Enter trading partner" is flagged
If yes -> you need to use a transaction type (AO74) which post to affiliatedcompany
If no -> you need to use a transaction type which does NOT post to affiliated
Best regards Bernhard