Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Archivelink API - get size information

matteo_montalto
Contributor
0 Kudos

Hi all gurus,

I'm looking for a *smart* way to obtain the size information (in bytes) of a file stored on an external repository by means of Archivelink.

This is the scenario: the configuration of the ERP has been done without any problem and once a document has been archived by means of Archivelink, all the table entries in TOA01, DRAW, DRAT, DRAD etc... have been populated.

Unfortunately, I can't see in these entries any information regarding the file size of an archived document; I was then looking for a way to obtain the information by means of Archivelink APIs, but so far, no success.
A trivial way to obtain the result is to download the archived content as XSTRING and then get the size information using XSTRLEN( ). But this will lead to severe performance loss as the document could be really huge; moreover, I have to perform such operation on a set of archived documents.

I've seen that the DRAW table contains some fields such as FILELEN and FILELEN1, but in my scenario, these fields are always empty.

Any suggestion is really appreciated.

Thanks!

M.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Matteo,

You could check the DBSTATT* tables? Field OCCBL.

e.g if your database is ORACLE the table name is DBSTATTORA or if it is DB6 then it is DBSTATTDB6 and so on.

It does not give only the XTRING size, rather all the size including size for other fields in tables like TOA01 but should serve you to analyze as compare to XSTRING sizes the other sizes are negligible.

Or you can run DB02 or DBACOCKPIT transaction also to see it in real.

Please note. This DBASTATT* tables are not updated automatically for ORACLE database. You have to run program RSANAORA periodically to update the statistics.

Hope it helps.

R

9 REPLIES 9

Former Member
0 Kudos

Hi Matteo,

You could check the DBSTATT* tables? Field OCCBL.

e.g if your database is ORACLE the table name is DBSTATTORA or if it is DB6 then it is DBSTATTDB6 and so on.

It does not give only the XTRING size, rather all the size including size for other fields in tables like TOA01 but should serve you to analyze as compare to XSTRING sizes the other sizes are negligible.

Or you can run DB02 or DBACOCKPIT transaction also to see it in real.

Please note. This DBASTATT* tables are not updated automatically for ORACLE database. You have to run program RSANAORA periodically to update the statistics.

Hope it helps.

R

0 Kudos

Hello Rudra,

unfortunately, none of the tables DBSTATT* are filled in our systems...

Let's clarify a bit the requirement: we're using archivelink to store on an ext. repository ( Filenet IS through an IBM connector) the documents we bind to an inforecord by means of transaction CV01N/CV02N.

After the archiving phase:

- files are stored in Filenet IS; no originals are stored in SAP;

- we need to know exactly the XSTRING size of the uploaded files, in order to retrieve them by means of a custom report. In fact, we lately retrieve the contents from another SAP (SRM) system and in order to use the FM  SCMS_BINARY_TO_XSTRING (and convert the binary file into an xstring)... we need to know the exact XSTRING size.

It seems a deadlock; to get the file in XSTRING format, you need to know a priori the XSTRING size; otherwise, you can't convert the binary file to an xstring. 😛

0 Kudos

Hi again,

Oh well I see...

I am not an expert of Filenet. But there could be some webserices/API available that you could use to retrieve file information. Speak to some Filenet expert.

R

0 Kudos

As far as I've seen, the only FM that can provide information regarding file length (and binlength, eventually) is ARCHIV_GET_TABLE; however, even though the ARCHIVOBJECT and BINARCHIVOBJECT tables parameters are "optional", I've seen in the code that in case LENGTH is requested, they perform a call to  ARCHIVOBJECT_GET_TABLE... and this is quite performance-critical.

Tomas_Buryanek
Active Contributor
0 Kudos

Try investigate function SO_DOCUMENT_READ_API1 and its documentation.

It returns document_data-size and binary content among others... But there is also parameter FILTER and in it NO_CONTENT:


Default = ' '.

If this flag is set ('X'), the contents (table OBJECT_CONTENT), the

specific header data (table OBJECT_HEADER) and the processing

parameters (table OBJECT_PARA and OBJECT_PARB) of the document are

also read.

Not sure if it will return document_data-size with this FILTER NO_CONTENT set... but maybe you can find some usefull code inside this function.

-- Tomas --

0 Kudos

Hi Tomas and thanks for your help,

unfortunately it seems that SO_DOCUMENt_READ_API1 doesn't fit my requirement; I tried to guess how to fill the parameters but no matter what I pass, that FM returns always a "Document ID does not exist" error. 

I tried debugging a bit and found that a query on the SOFD table is the reason of the error.

I then looked at SOFD contents, finding out that there's no entry in that table related to my files.


Inforecord operativity creates entries in TOA01, DRAW, DRAT and linkage tables such as DRAD.

Thanks anyway for your support,

BR,

M.

Juwin
Active Contributor
0 Kudos

Please check this link: Function: info - SAP Content Server HTTP 4.5 Interface - SAP Library

This information is specific to SAP's Content server.

Can you please tell me, which backend are you using for Archivelink? There should be something similar to the above method, in your system as well.

Thanks,

Juwin

0 Kudos

Hi Juwin,

I configured some backends to connect through Archivelink to an external repository (Filenet IS, by means of an IBM's connector); versions vary from 4.6C to ECC6Ehp6.

As far as I've seen from the document, I could use an HTTP function "info" to retrieve size of a specific content; however, I didn't understand how this work. I mean, I should build an URL to be invoked ?

Juwin
Active Contributor
0 Kudos

You should be able to use these function modules:

*Get the absolute URL

call function 'SCMS_URL_GENERATE'

  exporting

    command      = 'info'

    contrep      = 'ZI'

    docid        = lv_docid

  importing

    absolute_uri = lv_absurl.

And then HTTP2_GET, to call the URL and get results.

Example: SCMS_HTTP_ADMIN_SERVER_INFO

Thanks,

Juwin