cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieving documents from content server using jco

Former Member
0 Kudos

Hi,

I am trying to retrieve files from SAP Content Server. My application is running on SAP J2ee engine. The documents are referenced on a R/3 system. I'm using JCO to interface with SAP.

My files are *.doc, *.ppt, *.pdf, *.jpg or *.gif.

I found a way to do this but it requires to launch a sapgui in order to transfert the files to the j2ee engine's host. I am calling a BAPI with JCO which retrieves the file. This is too slow!

Do you have any other idea or did you have same problem ?

Regards

Mert Solak

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Do you have any examples of how to retrieve the url for this, I have done the above also to no avail here is my code snippet

client = JCOConnectionUtil.getConnection(userProfile, request);

JCO.Function rfc = createRFC("BAPI_DOCUMENT_CHECKOUTVIEW2", client);

JCO.ParameterList tableList = rfc.getTableParameterList();

JCO.ParameterList exportList = rfc.getExportParameterList();

rfc.getImportParameterList().setValue(docType, "DOCUMENTTYPE");

rfc.getImportParameterList().setValue(docNum, "DOCUMENTNUMBER");

rfc.getImportParameterList().setValue(docVer, "DOCUMENTVERSION");

rfc.getImportParameterList().setValue(docPart, "DOCUMENTPART");

rfc.getImportParameterList().setValue("c:
temp
", "ORIGINALPATH");

rfc.getImportParameterList().setValue("1", "GETSTRUCTURE");

rfc.getImportParameterList().setValue("X", "GETCOMPONENTS");

rfc.getImportParameterList().setValue("X", "GETHEADER");

JCO.setMiddlewareProperty("jco.middleware.allow_start_of_programs","ftp;sapftp;sapftpa;sapkprotp;http;saphttp;saphttpa");

client.setSapGui(2);

client.execute(rfc);

And it doesn't work Any help would be greatly appreciated

AB
Contributor
0 Kudos

The SAP HTTP content server interface is an HTTP based interface. A careful reading of the SAP HTTP Content Server interface specification will explain how you can interact with the content server using HTTP URLS.

When the R/3 DMS uses Knowledge Provider (KPRO), then the R/3 DMS delegates the interaction with the content repository to KPRO. KPRO provides URLs to interact with the Content Server, which in turn interacts with the Content repository.

To solve your problem, you request from the R/3 system a URL to access to your R/3 DMS document. With the URL you can fetch the document and do with it what you will.

Hope this helps!

Regards

Andrew

Former Member
0 Kudos

Hi Benny,

The documents are stored in SAP Content server. And they are referenced in a R/3 system.

We want to retrieve these files.

We use the bapi "BAPI_DOCUMENT_CHECKOUTVIEW2" to retrieve the documents.

But this BAPI needs to use SAPGUI to transfert the file.

JCO API permits to do that by :

private static com.sap.mw.jco.JCO.Client client = null;

...

com.sap.mw.jco.JCO.setMiddlewareProperty("jco.middleware.allow_start_of_programs",

"ftp;sapftp;sapftpa;sapkprotp;http;saphttp;saphttpa");

...

client.setSapGui(2);

But it takes 25 secondes to retrieve a file of 2k!

The file is referenced in R3 system. So, The bapi checks the R3 system.

Gets the file location and use a saphttp or sapftp via sapgui to transfert the file.

Is it more clear?

best regards

Mert

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Mert,

ok, got it more clearly now. This seems to me to be more a problem of KM and how to access the content server?

Are you able to retrieve the reference from the R/3 system?

Regards,

Benny

Former Member
0 Kudos

Thanks Benny,

I can get the references. And the files also. But the problem is that it is very slow

I think the fact that we must launch sapgui is slowing the game. What I am looking is to find another way faster than this.

Best regards

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

Well, that is what I'm talking about - you should look around in KM if there is another way. I'm really not a specialist for it, but there could be an API. Their forum is next door - assuming that content server is KM stuff...

Regards,

Benny

darren_hague
Contributor
0 Kudos

Content Server and KM are not the same thing, unfortunately. This is quite confusing. It would be great if SAP could come out with some kind of overall statement about their different content storage systems, and how to make them work together, and/or make them accessible from Java, Portal, ABAP, etc.

Having a content server repository for KM would be a good start, but I don't think it's as simple as a hierarchical folder system - I think Content Server docs may be attached to R/3 entities in some way...

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

>

> I found a way to do this but it requires to launch a

> sapgui in order to transfert the files to the j2ee

> engine's host. I am calling a BAPI with JCO which

> retrieves the file. This is too slow!

I don't really get this. Either you call sapgui <b>or</b> you use BAPI's. I don't know how to do it both in the same action....

And from where do you retrieve that stuff?

Regards,

Benny