cancel
Showing results for 
Search instead for 
Did you mean: 

Download Document using Bapi_Document_Checkoutviewx

Former Member
0 Kudos

Hi!

I try to download a document using Bapi_Document_Checkoutviewx.

I am able to get a list of documents, get details of a single document, but when I try to download it, I am a litle bit confused about the use of the bapi_Document_Checkoutviewx.

All combinations will return emtpy collections and there is neither an exception or an error in the BAPIRet.

Is anyone able to give me some information about using the BAPI?

I use the code in a winform application without SAP GUI installed, but I copied the sapftp.exe and saphttp.exe to system32 folder.

Thx & Regards,

Benjamin

SAPDms sapdms = new SAPDms(sapcn);

int foundrows;

sapplm.BAPIRET2 return0;

sapplm.BAPI_DOC_SELNRTable docnumberselection = new BAPI_DOC_SELNRTable();

sapplm.BAPI_DOC_DRAWTable documentlist = new BAPI_DOC_DRAWTable();

sapdms.Bapi_Document_Getlist(

"",

"",

"",

"",

"",

"",

"",

"",

"",

"",

"",

"",

10,

"",

"",

"",

"",

out foundrows,

out return0,

ref docnumberselection,

ref documentlist);

RfcAllowStartProgram(0);

BAPI_DOC_DRAW2 documentData = new BAPI_DOC_DRAW2();

BAPIRET2 ref0 = new BAPIRET2();

BAPI_CHARACTERISTIC_VALUESTable charValues = new BAPI_CHARACTERISTIC_VALUESTable();

BAPI_CLASS_ALLOCATIONTable classAlloc = new BAPI_CLASS_ALLOCATIONTable();

BAPI_DOC_COMPTable comp = new BAPI_DOC_COMPTable();

BAPI_DOC_DRATTable documentDesc = new BAPI_DOC_DRATTable();

BAPI_DOC_FILES2Table docFiles = new BAPI_DOC_FILES2Table();

BAPI_DOC_STRUCTURETable docStruct = new BAPI_DOC_STRUCTURETable();

BAPI_DOC_TEXTTable longtxt = new BAPI_DOC_TEXTTable();

BAPI_DOC_DRADTable objectLinks = new BAPI_DOC_DRADTable();

BAPI_DOC_DRAPTable statuslog = new BAPI_DOC_DRAPTable();

BAPI_DOC_STRUCTURETable whereusedlist = new BAPI_DOC_STRUCTURETable();

sapdms.Bapi_Document_Getdetail2(

documentlist[0].Documentnumber,

documentlist[0].Documentpart,

documentlist[0].Documenttype,

documentlist[0].Documentversion,

"X","","","","","","","","","","",

out documentData,

out ref0,

ref charValues,

ref classAlloc,

ref comp,

ref documentDesc,

ref docFiles,

ref docStruct,

ref longtxt,

ref objectLinks,

ref statuslog,

ref whereusedlist);

sapplm.BAPIRET2 ret0;

sapplm.BAPI_DOC_COMPTable components = new BAPI_DOC_COMPTable();

sapplm.BAPI_DOC_FILES2Table documentIn = new BAPI_DOC_FILES2Table();

sapplm.BAPI_DOC_FILES2Table documentOut = new BAPI_DOC_FILES2Table();

sapplm.BAPI_DOC_DRAW2Table documents = new BAPI_DOC_DRAW2Table();

sapplm.BAPI_DOC_APPLICATIONSTable wsapp = new BAPI_DOC_APPLICATIONSTable();

documentOut.Add( docFiles[0] );

documentIn.Add( docFiles[0] );

sapdms.Bapi_Document_Checkoutviewx(

"",

"",

"",

out ret0,

ref components,

ref documentIn,

ref documentOut,

ref documents,

ref wsapp);

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello,

how did you solve your problem? I got the same

Former Member
0 Kudos

I'm having the same problem.

I've validated my inpute args but when I call the checkoutx bapi, I get the following return message from the bapiReturn

"I::001 RFC partner does not allow to start any program".