I'm new to SAP generally and RFC/BAPIs specifically and I'm also not an ABAP Developer, so I apologize in advance if I'm using the wrong terminology, however, it seems like the people in this forum have the right knowledge that I need to accomplish what I'm trying to achieve.
We are creating Employee Travel / Trip objects using BAPIs and would like to attach receipt documents to it. While with the SAP Windows client there's a GOS button that allows you to link documents to business objects, in this case a Trip, using BAPIs / RFC /FMs I cannot figure out how to link a document to the Trip object.
I was able to create a document in (I believe DMS) using BAPI_DOCUMENT_CREATE2 but this doesn't allow me to upload the file binary as far as I understand, unless I user the GUI_UPLOAD or connect to GOS.
I was also able to create the file using BDS FM (BDS_BUSINESSDOCUMENT_GET_TAB) and upload the file successfully. I'm able to set the classname and classtype in a flexible way. The document is created and can be found through the business document navigator app of SAP. However, I can't seem to find a way to link it to the Trip as an attachment.
I understand from reading a few forum threads (mainly in SCN) that I probably need to do is create a link using OBJECT_LINKS. However, everything I've tried in order to create the link has failed.
For instance, I know that the Trip object type is BUS2089 and that typically I should use ARCHIV_CONNECTION_INSERT to link the document, but apparently I'm missing something with the types of objects I'm using and can't make it work.
Notes:
1. I'm using .NET connector named ERPConnect - but that shouldn't matter as I'm able to run any RFC enabled function successfully.
2. Other then uploading a doc into BDS, I couldn't find remote functions to allow me to upload to other locations such as DMS etc. So I figured that my best shot is to link the document created under BDS into the Trip as an attachment.
Any help in understanding how this thing works and how to link my document would be appreciated.
Thanks!
Itzik