Hi Raj,
As a possible alternative to the mentioned BAPI, please have a look at the OSS note 488765 - Do-it-yourself EWB programming.
It's a very interesting note, with a sample program that illustrates some use cases.
Basically, the function modules in the Engineering Workbench (EWB, transaction CEWB) are available for routing and BoM processing.
For instance, the following FM's will allow routing creation, change, copy and deletion:
CP_CL_S_OPR_CREATE | Creation |
CP_CL_S_OPR_CHANGE | Change |
CP_CL_S_OPR_COPY | Copying |
CP_CC_S_DELETE_BY_OPR Deletion. |
In case of any doubt, just let me know. I have used this approach several times in the past, and proved to be always working properly.
I do hope this could be of some help.
Thanks and bye,
Flavio