Skip to Content
0
Former Member
Feb 12, 2017 at 12:53 PM

Save file with a custom name while fetching data using BAPI_DOCUMENT_CHECKOUTVIEW2

488 Views Last edit Feb 12, 2017 at 12:54 PM 2 rev

I am trying to download documents from SAP server to my application using SAP Connector 3.0. The file gets downloaded into the Folder that I set in "OriginalPath" property but the name of the file is always like "WQ1" (against my name in database). Is it possible to download / save files with a different name or even better open a save as Dialog?

Below is my source code.

 RfcRepository repo = destination.Repository;
 IRfcFunction documentList = repo.CreateFunction("BAPI_DOCUMENT_CHECKOUTVIEW2");
 documentList.Invoke(destination);
 
 documentList.SetValue("DOCUMENTTYPE", "TPK");
 documentList.SetValue("DOCUMENTNUMBER", "2100-Abc-T01-TPK");
 documentList.SetValue("DOCUMENTPART", "000");
 documentList.SetValue("DOCUMENTVERSION", "A0");
 documentList.SetValue("ORIGINALPATH", @"D:\Temp\");
 var documentData = documentList.GetTable("DOCUMENTFILES");
 documentList.Invoke(destination);//execute query