Skip to Content
0

Save file with a custom name while fetching data using BAPI_DOCUMENT_CHECKOUTVIEW2

Feb 12, 2017 at 12:53 PM

82

avatar image
Former Member

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
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Christoph Hopf
Feb 15, 2017 at 12:13 PM
0

Hi Wasim,

regarding this question I think that maybe the customizing "You cannot rename...." for a workstation application could be useful for you.

If this flag is set the origin filename should be used. As alternative option I can only think that the BADI implementation (e.g. DOCUMENT_STORAGE01) could be useful.

Christoph

Share
10 |10000 characters needed characters left characters exceeded