Object Dependency assignment – “No authorization to edit the alternative”

We have a custom program that calls the function module CP_BD_DIRECT_INPUT_PLAN_EXT to assign object dependencies to routing operations.  Recently, this program failed with the error “No authorization to edit the alternative” (C\ 017).

I discovered that this error is raised by the function module CP_DI_IMPORT_KNOWLEDGE.  It compares the change master being used for the object dependency assignment to the change master on the operation to which the dependency is being assigned.  If a different change master is being used for the OD assignment, but it has the same effective date as the change master on the operation, then this error is raised.