cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate URL for Content Server documents?

0 Kudos
6,039

Hi  Gurus,

I have a requirement  here: I didn't find related stuff in Google.

1.  How to generate URL for Content Server documents?

2.  How to access those documents with change mode and update documents through Sales Force?

Kindly share your ideas and experience to achieve for the same.Can anyone help me with this? It would be much appreciated!

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member561828
Participant

Regarding URL for Content Server documents, we use FMs:

CVAPI_DOC_GETDETAIL

and

SDOK_PHIO_GET_URL_FOR_GET

With CVAPI_DOC_GETDETAIL, pass DIR information and retrieve PH_OBJID's (1 for each file)

Pass PH_OBJID to SDOK_PHIO_GET_URL_FOR_GET as OBJID with CLASS = DMS_PCD1

Retrieve URL from URLS

We use this method extensively for easy read access to DMS document from external systems.

Former Member
0 Kudos

Hi Richard Thomas,

Using the FM - SDOK_PHIO_GET_URL_FOR_GET, I am able to generate the URL.

But the problem here is that the file is not getting opened automatically in adobe reader, rather i have to save it explicitly as .PDF.

Please suggest on how to acheive it.

Thank you,

Regards,

Santhosh

former_member561828
Participant
0 Kudos

I assume the file extension is correct ie .pdf

That being the case, you should configure your browser to display the file automatically.  In Chromo that is performed with either of the options shown:

Former Member
0 Kudos

Thank you for your valuable time.

The file extension is correct.

The downloaded file am getting is either like the below one or '.DLL' file.

Please help me.

thank you,

Regards,

Santhosh

SSB
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello,

There are 2 URLs which are returned from this Function module can you please try both of them ? I think URL which contains 'get' should give you a file

Regards

Former Member
0 Kudos

Hi Sagar,

Thanks for the inputs.

The above file in screen shot is got from the url that contains 'get'.

But the problem here is it is not able to recognize the file format.

Is there anything else should be done other than this before using this function module to generate the URL?

thank you,

Regards,

Santhosh

SSB
Product and Topic Expert
Product and Topic Expert
0 Kudos

Can you Check the URL ? Does it have a file name ? Also can you try using another URL 'docGet' ?

Former Member
0 Kudos

Both the URL doesn't contain the actual file name.

In both the URL , the file name is  'contentserver.dll' .

SSB
Product and Topic Expert
Product and Topic Expert
0 Kudos

Can  you check the contents of the downloaded file with notepad ? May be you are not using correct details while calling the function module

Former Member
0 Kudos

If i change the file type and open in pdf i am able to view the file properly.

These are the parameters that i pass in this function module,

Import parameters                           Value

OBJECT_ID                                   ZBC_TEST  E47FB1024A2765F184EC0219BF9CC668

REQUESTED_COMPONENTS      1 Entry (This is the file name that i pass here)

CLIENT                                          818

Please tell me if i need to pass any other parameter.

Thank you,

Regards,

Santhosh

SSB
Product and Topic Expert
Product and Topic Expert
0 Kudos

Okie.. In that Case I strongly feel that file is not saved correctly and some details of the file are missing.  May be file name is not correct at the content server Or Issue with MIME Type.

0 Kudos

Hi Richard.

Thanks for your insights, they've been very useful! There's only one thing I haven't been able to solve so far and maybe you can help me, is that the URL generates a download of the file but without the file extension (when the save windows opens, the file name is without any extension like ".pdf"), so the If the user doesn't know the exact file format and adds the extension to the file, he won't be able to open it.

Thanks!

Former Member
0 Kudos
0 Kudos

Hi Reddy,

Use   CVAPI_DOC_CHECKOUTVIEW to get the URL for the files attached to a DIR.

Ensure   pf_content_provide as 'URL'.

sample code:

        CALL FUNCTION 'CVAPI_DOC_CHECKOUTVIEW'
      EXPORTING
        pf_dokar           = <ls_buffer>-documenttype
        pf_doknr           = <ls_buffer>-documentnumber
        pf_dokvr           = <ls_buffer>-documentversion
        pf_doktl           = <ls_buffer>-documentpart
        pf_content_provide = 'URL'
      IMPORTING
        psx_message        = ls_msg
      TABLES
        pt_files           = lt_files.

Regards,

Hari

0 Kudos

Hi HariPrakash,

    Thanks for  your quick response.

    I tried this FM "CVAPI_DOC_CHECKOUTVIEW" . As per the discussion, I have given all the parameters but  it's not  creating URL. Can  you please suggest  how to get URL.

Please find the below snap for your better understand.

Thanks & Regards

Lokesh

0 Kudos

Hi Reddy,

You can try the MF : C_DESK_DOC_GET_URL, it will give you  the URL from the document data (DOKAR, DOKNR, DOKVR, DOKTL)

Regards

Nathalie

0 Kudos

Hi,
It's possible to generate the URL file in PHP based in the DOKNR, DOKAR, DOKVR, DOKTL and file name?

My goal is download some files from SAP BOM in a PHP app, it's possible?

Regards,
Fernando Pinto