Skip to Content
Technical Articles
Author's profile photo Vikram Kulkarni

Using Document Management as a Content Repository with SAP S/4HANA


The purpose of this blog is to describe the essential configuration steps required to manually set up the SAP S/4HANA attachment service working with Document Management as a content server within the system landscape that has been already installed.


    1. For this scenario to be successfully implemented, SAP Document Management Service, Integration Option is recommended. There is no support for SAP Document Management Service, Application Option, at this time. SAP S/4 HANA will always be the front end, and we do not support the SAP Document Management Service, Application option for onboarding the repository or allowing you to view any files.

    2. The free tier subscription will not work for this scenario. If you wish to try it out, please opt for the standard plan.

    3. The following scenario is applicable for SAP S/4 HANA on-premise releases of 1809, 1909, and 2020 onwards.

    4. There could be some issues in your client applications due to changes in the certificate. Please refer to this blog post Changing the SAP BTP Cloud Foundry Environment Root Certificate Authority and SAP Note 3327214 – Root Certificate Replacement in the SAP BTP, Cloud Foundry Environment.



  1. You must read and execute the following SAP Notes:-
    1. SAP Note – 2361898
    2. SAP Note – 3003350
    3. SAP Note – 3003412
    4. SAP Note – 3008650
    5. SAP Note – 3126655
    6. SAP Note – 3168437
    7. SAP Note – 3334586
  2. You’ve downloaded the SSL certificate of SAP BTP. For more information about the steps, refer to this knowledge base article KBA-2853519.
  3. Ensure the Root CA certificate of the SAP Cloud Foundry server is uploaded to “SSL client <client> SAP Default”. This certificate has to be uploaded to the ABAP back-end system using STRUST transactions.


Section 1. Repository Onboarding

In this section, you need to onboard the Document Management Repository.

The following steps must be executed to onboard a repository. You can ignore the steps if some of them have been already performed.

  1. You’ve created a subaccount and space. See Creating a Subaccount and Space.
  2. You’ve created a service instance and service key. See Creating a Service Instance.
  3. You’ve connected your own repository to Document Management Service, Integration Option instance.
    • To add your repository using a REST API, you must generate a JSON Web Token (JWT). Use the JWT as your authorization to make the onboarding REST API calls. See Generate a JSON Web Token.
    • Execute an onboarding repository API to onboard your repository into Document Management Service. See Add Your Repository Using the Onboarding API.
    • The displayName and externalId should start with ‘Z’ and it should be in upper case.
    • This name and externalId would be used as a content repository name in the SAP S/4HANA backend system.
    • You must pass the parameter isContentBridgeEnabled as true in your payload.
    • The externalId and isContentBridgeEnabled are mandatory during repository onboarding.

             Sample Payload


"repository": {
"displayName": "<OAC0 repository name>",
"externalId":"<OAC0 repository name>",
<You can add other parameters for onboarding the repository, like repositoryType, Description, etc.,>



Section 2. SAP S/4HANA Back-end Configuration

In this section, you learn the back-end system configurations by following the steps.

  1. Create an OAuth Client Profile

    1. Start the object navigator (transaction SE80).
    2. Choose Development Object in the drop-down list.
    3. To create a development object in the SAP namespace, choose to Create OAuth 2.0 Client Profile in the context menu of the object name.
    4. Enter the object name in the Client Profile field.
    5. Choose the type of service provider as HANA_CLOUD_PLATFORM.
    6. Save your changes.
  2. Create an OAuth Client Configuration

    SAP Document Management uses OAuth Authentication. Hence, OAuth client configuration must be done in the SAP S/4HANA backend system.

    1. Go to transaction OA2C_CONFIG.
    2. Click ‘Create’.
    3. Choose OAuth Profile created in section 3.1.
    4. Enter the configuration name of your choice.
    5. Enter ‘Client Id’ from the service key created in section 1.
    6. Click ‘OK’.
    7. Enter ‘Client Secret’ from the service key created in section 1.2.
    8. Choose Selected Grant Type as Client Credentials.
    9. Enter Authentication Endpoint. It is the “uaa”: “url” parameter in the service key created in section 1.2 without ‘https’.
    10. Enter Token Endpoint. It is the “uaa”: “url” parameter in the service key with ‘/oauth/token’ as a suffix without ‘https’.
    11. Enter the Proxy Host: and Proxy Port: if applicable.
    12. Click ‘Save’.
  3. Create an RFC destination for Document Management

    1. Go to the transaction, SM59, and create a Type G destination.
    2. Enter host:  “ecmservice”:”url” copied from service key created in section 1.2 without ‘https’.
    3. Enter path prefix as ‘/browser’.
    4. In the Port b field, enter the “HTTPS” port of the ABAP system.ABAP%20System
    5. Enter the Proxy Host: and Proxy Service: if applicable.
    6. Go to Logon & Security Tab.
    7. Select ‘Do not use a user’ in Logon Procedure.Logon%20Procedure
    8. In Security Options, choose SSL Active radio button and select the certificate from the dropdown.Security%20Options
    9. Save the RFC destination.
  4. Create Content Repository in OAC0

    1. Go to transaction OAC0.
    2. Click on ‘Create’.
    3. Give the content repository name the same as the value of the ‘externalId’ parameter given during the onboarding repository in Section 1.3 (#2).
    4. Enter Document Area.
    5. Select Storage Type as ‘CMIS Content Server’.
    6. Enter the RFC destination created in the previous Part.
    7. Select the ‘Is OAuth’ checkbox.
    8. Save the configuration
    9. Enter the OAuth Profile name.
    10. Save the configuration.
    11. Do the connection test and check if the connection test is successful in the repository.
    12. Click the Send RFC info button and it should display “Certificate was sent”.
  5. Create Secondary Types and Folders

    1. Execute Transaction SE38
    2. Enter Report Name ‘CMIS_REPOSITORY_SETUP’
    3. Execute report

      RFC_DEST = RFC destination of the repository created in SM59CMIS_REP = Content Repository Name created in OAC0
  6. Create Storage Category in OACT

    1. Go to transaction OACT.
    2. Click ‘New Entry‘.
    3. Enter a Category Name.
    4. Enter Document Area.
    5. Enter the Content Repository Name created in the previous Part.
    6. Save Storage Category.
  7. Activate Storage Category

    1. Go to transaction SPRO.
    2. Click on SAP Reference IMG to display the IMG Activities.
    3. Go to Cross Application Components → Document Management → Additional Settings- Simplification → Attachment Service- Storage Repository Activation
    4. Choose ‘Create New Entries’.
    5. Enter the Storage Category created in OACT in the previous part and mark it as active by selecting the checkbox.
    6. Save the configuration.

Congratulations. You have successfully completed the Attachment Service integration with Document Management.


I hope you can benefit from the steps presented in this blog post. In case of questions or feedback, please feel free to comment on this blog.

















Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo raviteja paluri
      raviteja paluri

      Great Information Vikram, keep up the good work.

      Author's profile photo Marion DUPIN
      Marion DUPIN

      Hello Vikram,

      Thanks a lot for your blog, it's really clear. I follow the exact steps and everything seems OK. Now it's not clear for me, how can I test if documents are sent from my S/4HANA system to my Cloud repository ?

      Thanks for your help.

      Best regards,

      Author's profile photo Vikram Kulkarni
      Vikram Kulkarni
      Blog Post Author

      Hi Marion DUPIN,

      Thanks for your feedback.

      With reference to your concern, I understand that you would like to test documents sent from SAP S/4 HANA to cloud repository, you can try my suggestion below.

      1. Try using our Integration option API to check whether the document is created from postman.
      2. You can also test it by using CMIS workbench.

      I hope this suffice your concern.

      Vikram Kulkarni

      Author's profile photo Marion DUPIN
      Marion DUPIN

      Yes thanks !

      Author's profile photo Yogendra Ahuja
      Yogendra Ahuja

      Hi Vikram,

      while onboarding, I am getting below error. Could you please suggest.

      message": "Error in OnBoarding Repository: Error reading Admin Credentials from destination: Doc_service

      I am using Document Management repositiry available on my Neo Account.


      Author's profile photo Asma Siddiqa
      Asma Siddiqa

      Hello Yogendra,

      The above mentioned scenario would work only with a Cloud Foundry based "Document Management" solution, where you could use this storage instead of SAP Content Server.

      Please do not connect to the repository from your Neo account.

      Best Regards,



      Author's profile photo Yogendra Ahuja
      Yogendra Ahuja

      Hi Asma,

      Since repository from Neo Environment is also CMIS, I was wondering why this is not supported.

      Also, can we use any other open source storage which is CMIS, instead of SAP Content server?





      Author's profile photo Rupali Sharma
      Rupali Sharma

      Hi Yogendra,

      What is your destination's authentication type? You need to provide your credentials in the destination. If the credentials are correct, you should be able to onboard your repository.

      But if you are trying to connect to Neo Document Service repository from CF, in order to connect to document service repository we also require the repository key, repo unique name and account information which cannot be passed via destination. In this case, you can either create a proxy bridge api or try migrating your Neo DS repository data to CF Document management as mentioned in this help document

      Hope this helps.



      Author's profile photo Aashwin Jain
      Aashwin Jain

      hello Rupali,

      I too am working on the Document service to connect it with the SAP S/4 HANA systems , but not able to onboard the document repository, My first concern is to set up the destination for the Document service repository, that I have created in the Neo Platform. I am getting several errors there.

      I am not sure if the proxy bridge would help or not, It would be great if I can get some help from SAP or if you can help in this!



      Aashwin Jain

      Author's profile photo Gokhan Yilmazturk
      Gokhan Yilmazturk

      Hi Vikram,

      First of all, great blog, very informative.

      Is there an option for other way around ? Would that be possible to use SCP DM Integration option and use S4HANA for repository ?

      I came up with this document, but honestly couldn't find any technical document explaining how.

      Best regards,


      Author's profile photo Asma Siddiqa
      Asma Siddiqa

      Hello Gokhan,

      Yes, this option is possible. You could use Document Management integration option and connect to S/4 HANA DMS repository.

      You could take a look at this help documentation.

      Best Regards,


      Author's profile photo Gokhan Yilmazturk
      Gokhan Yilmazturk

      Hello Asma,

      Thank you for sharing the details. The help documentation lacks some of the information like; how the destination should be created  (any specific property to add etc.) or what are the activities we need to carry out on ERP side. Is there any technical document that gives more details that you aware of ?

      Best Regards,


      Author's profile photo Rupali Sharma
      Rupali Sharma

      Hi Gokhan,

      You can check this blog

      Though this blog is about application option, not integration option, the steps on ERP side and the steps to create destination on BTP end are common for both. you can follow till step PART III : Setting up Destination as it is.




      Author's profile photo Matthias Hayk
      Matthias Hayk

      Hello Vikram,
      very good and nice assistence for using document management option service on cloud foundry.

      But i have one problem when following the guide.
      In SM59 (when testing the connection) and OAC0 (when testing communication in repository definition), i always get a short-dump in CL_CMIS_Client. Any idea whats wrong?

      I can use and access the repository when using DMO-Application Option on BTP.

      kind regards


      Screenshot of Shortdump

      Author's profile photo Evgeni Vekua
      Evgeni Vekua

      Hi Matthias, just by chance have you managed to get reply or fix on this error?

      I am getting the same.

      Best regards,


      Author's profile photo Rupali Sharma
      Rupali Sharma

      Hi Evgeni,

      There are some things you can check:

      1. As already mentioned by Matthias, cross-check your client id and secret from BTP service instance.
      2. check if the token endpoint and Auth endpoint are correct. The format should be
        (i) for Token endpoint : <uaa-url>/oauth/token
        and (ii) for Auth endpoint, <uaa-url>
        NOTE: do not put "https" in the url as it is appended by default
      3. Lastly, make sure there is only one configuration with the given Profile name in oa2c_config.

      Do a connection test from OAC0( not sm59 ).

      Regarding the dump, you can implement SAP Note 3084606 to get rid of the dump.



      Author's profile photo Matthias Hayk
      Matthias Hayk

      Hi Evgeni,

      at least my problem was in oauth-configuration on s/4-hana with transaction oac2_config. i dont know exactly why, but after checking everything once again i found, that the keys on btp for the service where different/others than the one i entered in oac2_config after initial configuration. After correcting the clientsecret and clientid it worked.

      kind regards

      Author's profile photo Boudhayan Dev
      Boudhayan Dev



      Good blog.

      Are you aware of Java examples ?

      Scenario I am interest in - A Java microservice deployed on Cloud foundry that would use Document Management Service to persist documents.

      Any leads would be really helpful.

      Author's profile photo Matthias Hayk
      Matthias Hayk

      Hi Vikram and communtiy-members,

      after cleared the above connection problems with OAuth2, we have another serious issue with the DMI-Option.

      We are trying archive documents from our S/4-Hana (2020, onpremise) by using the DMI-Service on SAP-BTP and an attached CMIS-Connector with an Archive-System behind.

      Connection test from OAC0 to repository works fine now. But trying to archive a document with Transaction CV03N with KPRO results in Error. "Could not connect to repository with id e7f4b408-451b-xxxx-yyyy-709db76d5b7b. Error checking proxy type for destination: cmisrep", where "cmisrep" seems to be the destination name of the cmis-connector and the id is the generated id of the repository in DMI-Service on BTP during onBoarding.

      I debuged a little and found out, that when saving documents a query to DMI-Service and the CMIS-Connector is made. I catched the type of request and its parameter.

      After this i constructed a call in postman. This makes the scenario more easy.

      So now after getting the JWT-Token and sending the request with the JWT-Token in the BearerToken as Authorization.

      The request looks like POST:"https://<dmi-service-endpoint-url/browser/<repname>" where <repname> is the name of the repository-definition in BTP DMI-Service onboarding.

      Addtionaly the body of the post-request contains form-data and the key-values: cmisaction=query,statement=select cmis:objectId from cmis:folder where cmis:name = 'DMS_PCD1'

      And interestingly when sending the same error as recorded in SLG1 is returned from BTP-DMI-Service:

      {    "exception": "connection",    "message": "Could not connect to repository with id e7f4b408-xxx-yyyy-b5b7-709db76d5b7b. Error checking proxy type for destination: cmisrep"}

      We also subscribed to BTP-DM Application Option. With DMA we can connect our external CMIS-Connector with our Archive-System behind it successfully. So that works fine.

      We dont really know now, why the proxytype for the destination (which is the destination configured in BTP-Cockpit) and which is the same destination we use for DM-Application Option does not work with DM-Integration. The proxyType of the destination is "onPremise" because it is available onPremise behind our cloud connector.

      Any help would be welcome. We now invested already two days for this investigations but running out of options.

      best regards


      Author's profile photo Jose Luis Sanchez Lopez
      Jose Luis Sanchez Lopez



      Excelent blog,Thank you.

      I configure all steps and work fine, but when I create an attachment in VA02, I review the table " SOFFPHF" I view my document created and the field PH_CLASS give the name of the table: SOFFPHIO and if consult the table view my document with category standar DMS_C1_ST no with my new category created before.

      Someone know hoy change the standard category to zcategory for documents save in SAP DMS in BTP service?


      Author's profile photo Hans Verreydt
      Hans Verreydt

      Hi Vikram Kulkarni ,


      Thanks for your blog!

      As this is only for attachments, I presume, Is this also possible for documents generated from the NACE (Outputs, mailing, ...)? (for example for Sales order, Invoices, ...

      In the past, we used ArchiveLink with a Content Server, is this the same when we use SAP BTP DMS?

      Many thanks!


      Author's profile photo Geert van den Heuvel
      Geert van den Heuvel

      Hi Vikram Kulkarni!

      Many thanks for the fantastic blog!

      I followed all the steps but in OAC0 i keep getting a "<Repository> does not exist"

      Content repository ZINVOICE does not exist

      Message no. CMS106

      I have successfully onboarded the repository with the API with the exact same name.

      Also when i try to test the RFC connection, i get a NIECONN REFUSED -10 on the URL

      Could it be that 443 is blocked somehow towards the URL?

      We are using a S/4HANA system in SAP RISE Private Cloud Edition.




      Author's profile photo Former Member
      Former Member

      Hello Geert,


      We are also getting the same error. Could you provide the solution if its solved.



      Pradeep vasa

      Author's profile photo Geert van den Heuvel
      Geert van den Heuvel

      Hello Pradeep,

      Yes we managed to solve it! It was solved by maintaining proxy settings in the RFC connection:

      proxy details in SM59 under HTTP Proxy Options, proxy host, and service. There we filled in the relevant proxy host and port for our use case.

      Also we activated the use of the proxy in transaction SICF.


      Author's profile photo Alexandre Giguere
      Alexandre Giguere

      thanks for this blog, 1 thing to clarify


      how does it work when you copy an instance, by example when the basis copy the production instance over the quality/test instance ?



      Author's profile photo Praveen Vinjamuri
      Praveen Vinjamuri

      Hello Vikram Kulkarni !


      Thank you for a very detailed blog. Just wondering if this feature is now enabled and supported with BTP DMS, Application Option. As application option comes with a nice UI to admin and users, it would be more plug and play. I am looking to use BTP DMS as a content server for S/4 Hana and use BTP DMS UI as well as S/4 hana as a frontend for users to access documents. Can you please throw some light here.

      Author's profile photo Iliyas Maner
      Iliyas Maner

      Hi Vikram


      How to attched GOS docuent in BTP DMS, i triyed  in SKPRO08 transection add "SOFFPHIO" class. for Gos attachment  but it is not working, is there any other way to store all GOS attacement to DMS


      iliyas maner


      Author's profile photo Jahir Diaz
      Jahir Diaz

      Hi Vikram Kulkarni .

      Is this implementation option compatible for GUI App, SAP GOS or Fiori Transactions App?

      I have done all the configuration, it works correctly with the standard fiori applications, but when I enter a GUI App (Example me22n) through the launchpad when loading a document it creates the folder of the purchase order but it does not create the attached file.

      Please help me to solve this problem.


      Author's profile photo prameel kumar
      prameel kumar

      Hi Vikram,

      We are on S4 Hana 2021, does the same config applies to us ? because the sap notes which you mentioned as pre-req is not applicable and I'm stuck in Section2 SAP S/4 Hana backend configuration while creating development object.



      Author's profile photo Varun Biswas
      Varun Biswas

      Thank you, this is great. There should be a detailed SAP note about this. This blog is excellent, but some things traditionally have been clearly maintained as an SAP Note. In addition, this blog has been officially referred to by SAP teams for troubleshooting and setting up DMS as an S4 backend.



      Author's profile photo JOHNNY MUNOZ

      Hi Vikram Kulkarni

      Excellent blog!!

      Is it possible to connect with SAP ECC 618 too?

      Best regards,


      Author's profile photo Ponnusamy Palanisamy
      Ponnusamy Palanisamy

      Hi Vikram,

      Thanks for blog.  I am stuck in executing the report - CMIS_REPOSITORY_SETUP, getting the below error


      id of queryable property is longer than 50 characters: sapbo:SupplierPurchasingOrganization:PurchasingOrganization - repository: 5c493b80007e


      id of queryable property is longer than 50 characters: sapbo:FldLogsShptCtnCertificate:FldLogsCertificateNumber - repository: 5c493b80007e65b


      I followed the SAP Note - 3350327 - CMIS_REPOSITORY_SETUP end with error "number of all new queryable properties exceeds 50"

      But still the same error.