Fianlly i managed it to add a URL to GOS in my abap program
i used the following FMs
CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
CALL FUNCTION 'SO_OBJECT_INSERT'
CALL FUNCTION 'BINARY_RELATION_CREATE'
So what i do is running an abap report in a batch job which adds me the necessary urls.
Now i need to now how i can check for duplicates in the gos. In particular check if this link is already there or not?