Hi Russell
To enable usernametoken in ABAP you don't need to manually write the code in the program. In SOAMANAGER you can configure a logical port which is set to usernametoken authentication, you only need to enter the logon data there.
It's only possible to create such logical port using a WSDL file which has correct policy. You can also add manually the necessary policy, an example is described in note 1710478. To get the usernametoken policy, generate a binding for a service definition in SAP ABAP and copy-paste from the WSDL to your WSDL.
Cheers,
Attila