Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member284719
Participant
16,221
In this blog post, I will describe the steps required to connect Document Management Service, Application Option running on cloud foundry to on-premise DMS repository.

Before proceeding, if you do not already have DMS setup, follow the steps mentioned in this blog post by Jens Koster to configure DMS.

PART I : Setting up Cloud Connector


For information on installing cloud connector, see this documentation .

Once your cloud connector is up and running, follow the below steps.

Step 1: Connect Cloud Connector with cloud foundry subaccount



  1. Go to your cloud foundry subaccount and click on the “information” icon on subaccount tile. Copy the subaccount id.

  2. Now, use this subaccount id in cloud connector subaccount configuration. Go to cloud connector administration UI and click on "Add Subaccount".

  3. Enter Region Host. CF regions host are the cf.<region>.hana.ondemand.com ones. Example: cf.eu10.hana.ondemand.com for Europe (Frankfurt) – AWS.

  4. Enter your Cloud Platform Email Id and password and save the configuration. Optionally, enter location id..


Step 2: Connect Cloud Connector with ABAP system



  1. Go To Cloud To On-Premise in cloud connector UI under your subaccount and click on plus ( + ) sign.

  2. Choose ABAP System as backend type and click on Next.

  3. Choose HTTPS as protocol and click on Next.

  4. Enter the internal Host and Port of your ABAP system. To find out the internal host and port of your ABAP system, Go To transaction SMICM in backend ABAP system -> Click on services -> Copy the Host and Port for HTTPS protocol.

  5. Enter the virtual host and port. Click on Next.NOTE: For Document Management Service, the internal host and virtual host should be same in order for the integration to work.

  6. Choose Principal Type as None. Click on Next.

  7. Choose Virtual host in request. Click on Next.

  8. Click on Finish


Step 3: Allow access to ABAP resources



  1. In the Access Control tab of Cloud Connector, under the Resources section, click on plus (+) sign.

  2. Provide the URL path /sap/bc/mcm/json.

  3. Select Access Policy as path and all sub paths.

  4. Click on Save.


 

PART II : Connecting Repository to Associated ABAP class



  1. Go to backend ABAP system.

  2. Use transaction SM30.

  3. Enter CMISD_SERVICE in the Table/View.

  4. Choose Maintain.

  5. Choose New Entries.

  6. Edit the fields as described in the following table:











    REPOSITORY_ID CLASS_NAME


     

    Enter a name for the repository


     

    Enter CL_CV_DC_SERVER_FACTORY


  7. Save your changes.


 

PART III : Setting up Destination



  1. Go to your Cloud Foundry subaccount -> Destinations.

  2. Click on New Destination.

  3. Provide a destination name.

  4. In URL, Enter http://<host>:<port>/sap/bc/mcm/json/<repositoryId> . Here host and port are the same as configured in cloud connector in previous steps. The repositoryId is the name configured in PART II.

  5. Select Proxy Type as OnPremise.

  6. Select Authentication as BasicAuthentication and Enter your ABAP system user and password.

  7. Click on Save.


 

Your DMS repository is now ready to be consumed in Document Management Service.

 

PART IV : Onboarding DMS repository via Document Management Service, Application Option


Pre-requisite : Follow the steps mentioned in this documentation to do initial configuration of Document Management Service, Application Option.

Steps to onboard DMS repository:

  1. Go to Admin url, https://<your-document_management-endpoint>/admin.html

  2. Click on Plus sign(+) to add repository.

  3. Provide any Display Name.

  4. Provide repository Id used in PART II, Step 5.

  5. Provide the name of destination created in PART III.

  6. Click on Add. After successful onboard, you should see a message ‘Repository Added’.


 

Now, you can access your repository at https://<your-document_management-endpoint>/web.html

 

Basic Troubleshooting:

  • Getting Access denied error while accessing application at endpoint, /web.htmlResolution : Check your Role Collection that you created in PART III during the initial configuration of Application Option. Make sure you have the following roles added to your role collection:SDM_AdminSDMWeb_AdminSDM_UserSDMWeb_UserToken_Exchange

  • Getting 403 Forbidden error while accessing repositoryResolution: After you have onboarded the repository, if trying to access the repository by clicking on the repository tile gives you 403 forbidden error, this means that the cloud connector host is not configured properly.Check the ABAP system host for HTTPS protocol as described in PART I, Step 2 ( 4 ) from SMICM transaction.Now check the host configured in your Cloud Connector. Both hosts should be same.

24 Comments
0 Kudos
Thank you Rupali for the such detailed document!

Are there any system requirements for the back-end? I found out that on our system CL_CV_DC_SERVER_FACTORY does not exist. That's why probably the final step was not successful.

Thank you!

Yulia.
former_member284719
Participant
0 Kudos
 

Hi Yulia,

This class is present in S/4HANA on-premise 1809 release onwards( SAP_BASIS 753 release onwards ). What is the release of your system? You can also try with class CL_MDOC_CMIS_DMS_INT which is an older implementation but there are some features of SAP Document Management which won't work with this implementation.

Thanks,

Rupali
0 Kudos
Thank you, Rupali!

SAP_BASIS 752 and S/4HANA on-premise 1709.

I tried to use CL_MDOC_CMIS_DMS_INT but getting a message "Failed to add a repository". Does it matter if it's a trial account, not a real one? Cloud connector looks good, but I cant check the destination, getting a message "Could not check at the moment. Please try again later"

I was able to connect a real (not trial) account Document center (not Document management) to the same system using CL_MDOC_CMIS_DMS_INT. But can't make it work with the trial one. So I believe the problem is on the cloud side.

Thank you!

Yulia.

 
former_member284719
Participant
0 Kudos
Hi Yulia,

It looks your system doesn't have SCMIS_HTTP package and /sap/bc/mcm/json SICF service.

Currently this package is present in S/4HANA on-premis 1709 SP06 onwards. Please check your SP release. If you are on lower SP, consider upgrading the SP.

If the package is present and it's only SICF service that is missing, you can create it manually in transaction SICF by following below steps:

STEP 1: Go to transaction SICF. SICf Services window will open.


STEP 2: In Service Name, enter 'SAP' and click on 'Execute' button at the bottom right corner of the screen.

STEP 3: Select 'bc' node under default_host/sap


STEP 4: Right click on bc node and select 'New Subelement'. Enter 'mcm' in the 'Name of New Service Element' text box. Click on Input button at the bottom right corner of window.


STEP 5: Enter some description for the service and click on 'Store' button at the bottom of the screen. Save it as a local object. Now an 'mcm' node would have been created under default_host/sap.


STEP 6: Right click on mcm node and select 'New Subelement'. Give the name of new service element as 'json' and click on 'Input' button.


STEP 7: Go to 'Handler List' tab and enter class 'CL_CMIS_REST' in the Handler List.


STEP 8(Optional) : Optionally, you can enter Client Id in Logon Data tab to override the default client. If Client Id is specified, the requests will go to that particular client.


STEP 9: Click on Store button.
STEP 10: Now Right click on the json node and select 'Activate Service'.

 

Thanks,

Rupali
chunyang_xu
Advisor
Advisor
0 Kudos

Hi Rupali,

Thanks a lot for your detailed document!

I faced the “Failed to add a repository” issue too, in my case I followed your instructions exactly. I'm using CF trial and my on-premise system is S4HANA 2020.

I can see the dms service details in browser via URL

https://<host>:<port>/sap/bc/mcm/json/<my_dms_id>, and in my cloud connector monitor page I can see resource request on /sap/bc/mcm/json/<my_dms_id>, which means the cloud connector works fine.

Any idea what is wrong?

Thanks a lot!

Chunyang

chunyang_xu
Advisor
Advisor
0 Kudos
Update:

network response shows "unauthorized". The request reached Clould Connector but not trigger the breakpoint I set in class CL_CV_DC_SERVER_FACTORY.
former_member284719
Participant
0 Kudos
Hi Chunyang,

Are you getting 401 unauthorized or 403 forbidden error? unauthorized would mean that the credentials configured in destinations in cloud foundry are not valid.

Forbidden error could be because of missing Role, SDM_Admin or incorrect cloud connector configuration. Check the role first.

If that is correct, try putting breakpoint in class cl_cmi_rest_get~handle_request() and onboard repository. If the request doesn't come here, that means there is some problem in cloud connector configuration and the request is not even reaching backend system.

In cloud connector, please make sure that the virtual host and internal host are same. Also, once cross check the host name with https host name in transaction smicm->services. The same host name should be configured in cloud connector.

Thanks,

Rupali
chunyang_xu
Advisor
Advisor
0 Kudos
Hi Rupali,

Thanks for your reply!

SDM_Admin-> OK. / Cloud connector -> host name ok.

 

It is strange that I'm getting a 500 server error, however the message is Unauthorized.

Today I did a SMICM trace in my on-premise system and  find out that on-premise gives a 401 unauthorized error to my request.  Not sure why in Document management application the response is 500 instead of 401. But at least the request reached On-premise but rejected.

I'm not an expert in reading the SMICM trace but the following looks like the root cause?

[Thr 139914449528576] HttpCertIsReverseProxyTrustworthy: client did not sent any cert ->intermediate not trustworthy

However, I have already uploaded global root CA to my destination. Will keep investigating, if you have any idea please let me know thanks a lot!!

Chunyang
chunyang_xu
Advisor
Advisor
0 Kudos
My issue is resolved after adding client ID to the mcm->json->logon tab. As described by Rupali in her reply to Yulia Sidorova:

STEP 8(Optional) : Optionally, you can enter Client Id in Logon Data tab to override the default client. If Client Id is specified, the requests will go to that particular client.
dwaynedesylvia
Product and Topic Expert
Product and Topic Expert
0 Kudos
Thanks for the great blog.  Will this approach work for an ECC system?
former_member284719
Participant
0 Kudos
Hi Dwayne,

Yes, this approach will work for an ECC system if the DMS classes are present in that system.

Thanks,

Rupali
frank_lange
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi,

i checked it also for ECC and S/4, but at least it is difficult to maintain the client for the service.

My question is it also possible to maintain the sap client-id it in Cloud Connector ?

Regards,

Frank
0 Kudos
Hi.

I'm using S/4HANA 1909 on-premise and I'd like to connect DMS to Document Management. Document Management will be my repository and not DMS. I think S/4HANA Cloud uses the same scenario.

Nowadays, I'm using SCP Document Service as a repository and DMS connected to it.

Is it possible using Document Management? Is there any documentation explaining the set up?

Regards,

Guilherme
haykma
Participant
0 Kudos
Hi Rupali,

thanks for this nice blog.

I try to connect to a S4 1809 Backend. But it does not have an Abap-Class CL_CMIS_RES mentioned in Step 7 above.

Any ideas?

kind regards

Matthias
rajivkane17
Discoverer
0 Kudos
Hi Rupali,

I have followed all your steps mentioned here and subscribed to "Document management application" and created an external repository /destination to my on-premise 1909 S4H content category/repository. Connection check is working ok. I am able to see documents earlier created and saved to this content category in Document management application folder and also if I use "copy" function in Document management application- a new document is created in document management application folder with document number /document type (as specified by me) and same details (document number / document type and others) are reflected in S4H also. But if I  try to create document using  Create>document > upload file  or create > document > From Template , I get message "file xxx is uploaded successfully" but document number/document type or file does not appear in SAP Document application folder or in backend (S4H 1909) system. It just "vanishes". I do not see any entry in SMICM , SLG1, ST22 or SM21. Cloud connector log does show that it is "accessed" at this time. Please guide on how to resolve this error.

Thanks,

Rajiv Kane
former_member284719
Participant
0 Kudos

It's a bit late but this blog explains the scenario you are looking for:

https://blogs.sap.com/2020/12/31/using-document-management-as-a-content-repository-with-sap-s-4-hana...

former_member284719
Participant
0 Kudos
You need to implement SAP Note 2856741
gregorw
SAP Mentor
SAP Mentor
0 Kudos
Hi Frank,

one would hope that the additional parameter sap-client from the destination would be respected.

Best Regards
Gregor
gregorw
SAP Mentor
SAP Mentor
0 Kudos
Dear Rupali,

do I get it right that when I follow Connecting PLM / DMS to SAP Document Center by jens.koster and then the steps you've described I would use a Content Server connected to my S/4HANA system as the final storage of the documents. The S/4HANA System with the ABAP CMIS reachable via /sap/bc/mcm/json acts as a CMIS Server speaking the CMIS Browser Binding standard?

You describe here the usage together with the Document Management Service, Application Option. Would it be also be possible to use this with the Document Management Service, Integration Option?

Best Regards
Gregor
ManjunathGudisi
Product and Topic Expert
Product and Topic Expert
0 Kudos
yes, use this API https://api.sap.com/api/AdminAPI/resource to onboard external repositories such as s/4hana on-prem DMS.

 

pvinjamuri
Explorer
thank you! manjunath.gudisi . Do you know if I can add share point as an external repository. Also, can you point me to any blog on the topics - if you are aware
gregorw
SAP Mentor
SAP Mentor
Based on my research it seems that Microsoft doesn't support CMIS with Sharepoint Online in Office365.
pvinjamuri
Explorer

Thanks gregor.wolf . I found the same information that share point online does not support CMIS.

atharnaved
Newcomer
0 Kudos
Hello Rupali,

 

I followed your Blog, and completed the configuration, at last I got below error while adding external repository.

"Error in OnBoarding Repository: Parsing exception: Unexpected token END OF FILE at position 0."

Please help here if I missed anything.

 

Thanks and Regards,

Athar Naved