I'm writing a call to retrieve a document (PDF, XLS, DOC, TXT....pretty much any file) from a document management system hooked up to our SAP system. Based on some old DCOM Connector code, I was told the bapi to use is the one in the subject line above.
To call this BAPI, i follow these steps in C#:
1. Connect to SAP
2. Call Bapi_Document_Getactversion to get the correct version number stored in SAP of the document i'm looking for.
3. Call Bapi_Document_Getdetail2 to get the details of the file i'm looking for.
4. Call Bapi_Document_Checkoutview2 by sending all the relevant information including where to retrieve the file to on my local workstation.
Steps 1, 2 and 3 all work. Step 4 either fails with no messages (by looking at the BAPIRET2 return table) if i have my connection property set to SAPGui = 1 or 2. If i don't specify the SAPGui property of the connection, i get the following error returned in BAPIRET2:
"RFC partner does not allow to start any program"
Has anyone used Bapi_Document_Checkoutview2 successfully (or even Bapi_Document_Checkoutview or Bapi_Document_Checkoutviewx)? I can post some code if needed. I've been stumped on this for 2 days now.
Any help appreciated.
Thanks!
H