Skip to Content
author's profile photo Former Member
Former Member

Save file with a custom name while fetching data using BAPI_DOCUMENT_CHECKOUTVIEW2

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.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
Add comment
10|10000 characters needed characters exceeded

1 Answer

  • Posted on Feb 15, 2017 at 12:13 PM

    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.


    Add comment
    10|10000 characters needed characters exceeded