Hello Jin,
you can create your own SAP server application, look here for an example.
Inside your SAP server application you can expose the functions to create an object, to call a method or to set and get a property, to use this functionalities with SAP background processes.
For that offers FreeBASIC an external library called disphelper. You can wrap this functions in your SAP server application and voila your Problem should be solved.
Cheers
Stefan