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: 
VikramKulkarni
Product and Topic Expert
Product and Topic Expert
52,258

Introduction

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.


Disclaimer:

  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, SAP Note 3327214 - Root Certificate Replacement in the SAP BTP, Cloud Foundry Environment, and BTP Trust Store: Collection of TLS Server Root CA certificates used by SAP BTP

 

Prerequisite

  1. You must read and execute the following SAP Notes:-
    1. SAP Note - 2361898
    2. SAP Note - 3035517
    3. SAP Note - 3003350
    4. SAP Note - 3003412
    5. SAP Note - 3008650
    6. SAP Note - 3126655
    7. SAP Note - 3168437
    8. 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 onboarded a repository into the Document Management Service, Integration Option instance.
    1. To onboard a repository using a REST API, you must generate a JSON Web Token (JWT). Use the JWT for authorization when making the onboarding REST API calls. See Generate a JSON Web Token.
    2. See Generate a JSON Web Token.
    3. Execute an onboarding repository API to onboard repository into Document Management Service. See Add Your Repository Using the Onboarding API.
    4. The displayName and externalId should start with ‘Z’ and it should be in upper case.
    5. This name and externalId would be used as a content repository name in the SAP S/4HANA backend system.
    6. You must pass the parameter isContentBridgeEnabled as true in your payload.
    7. The externalId and isContentBridgeEnabled are mandatory during repository onboarding.


Sample Payload

{

"repository": {

"displayName": "<OAC0 repository name>",

"externalId":"<OAC0 repository name>",

"isContentBridgeEnabled":"true",

<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.
      VikramKulkarni_0-1706616604192.png

    7. Go to the Administration tab and choose the No authorization check option. 
      Blog_Image.png
  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’.
      VikramKulkarni_1-1706616670136.png

    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'.

      VikramKulkarni_2-1706616714371.png
  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.

      VikramKulkarni_3-1706616922813.png

    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.VikramKulkarni_4-1706616988471.png
    8. In Security Options, choose SSL Active radio button and select the certificate from the dropdown.

       

      VikramKulkarni_5-1706617036688.png
    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.

      VikramKulkarni_6-1706617132239.png
    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.

      Inputs:-
      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.

      VikramKulkarni_7-1706617310989.png

       

       

  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.

      VikramKulkarni_8-1706617454780.png


      "
      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.


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

35 Comments
ravitejapaluri
Discoverer
0 Kudos
Great Information Vikram, keep up the good work.
mariondupin
Explorer
0 Kudos

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,
Marion

VikramKulkarni
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi mariondupin,

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.

Regards,
Vikram Kulkarni
mariondupin
Explorer
0 Kudos
Yes thanks !
Yogendra_Ahuja
Explorer
0 Kudos
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.

Thanks
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,

Asma

 
0 Kudos
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,

Gokhan
0 Kudos
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,

Asma
0 Kudos
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,

Gokhan
Yogendra_Ahuja
Explorer
0 Kudos
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?

 

Thanks,

Yogendra

 
former_member284719
Participant
0 Kudos

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.

Thanks,

Rupali

former_member284719
Participant
0 Kudos
Hi Gokhan,

You can check this blog https://blogs.sap.com/2020/08/14/connect-sap-document-management-application-option-to-dms/

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.

Thanks,

Rupali

 
haykma
Participant
0 Kudos

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
Matthias

Screenshot of Shortdump

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

I am getting the same.

Best regards,

Evgeni,
haykma
Participant
0 Kudos
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
Matthias
former_member284719
Participant
0 Kudos

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.

Thanks,

Rupali

boudhayan-dev
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi,

 

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.
haykma
Participant
0 Kudos


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

Matthias
S0012623908
Explorer
0 Kudos

Hi.

 

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?

Regards

verreydthans
Participant
0 Kudos
Hi vkulkarni ,

 

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!

Regards,
Hans
Geert
Explorer
0 Kudos
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 api-sdm-di.cfapps.eu10.hana.ondemand.com 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.

Regards

Geert

 
pradeepvasa99
Discoverer
Hello Geert,

 

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

 

Thanks,

Pradeep vasa
Geert
Explorer
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.

Geert
AlexGiguere
Contributor
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 ?

 

thanks
pvinjamuri
Explorer
Hello vkulkarni !

 

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.
former_member160032
Discoverer
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

Regards

iliyas maner

 
jahir2595
Explorer
Hi vkulkarni .

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.

Regards,
Jahir.
prameel_kumar
Explorer
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.

thanks

Prameel
varunbiswas
Explorer
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.

 

 
johnnymunoz
Explorer
0 Kudos
Hi vkulkarni

Excellent blog!!

Is it possible to connect with SAP ECC 618 too?

Best regards,

Johnny
aashwinjain
Member
0 Kudos
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!

 

Thanks,

Aashwin Jain
former_member601719
Discoverer
0 Kudos
Hi Vikram,

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

sapbo:SupplierPurchasingOrganization

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

sapbo:FldLogsShptCtnCertificate

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.

 

Regards

Ponnusamy
mdenhartog
Discoverer
0 Kudos

So if I understand correctly the only issue by using the application option is that you can't set the parameters ExternalId and isContentBridgeEnabled? That would seem like a very easy fix. 

Anyways, after creating the repository using your guide, I was however able to add this repository in the application option too to view the documents.

Just make sure that in the destination created in BTP when onboarding the repository, make sure the URL is your 'uri' from the service key with /browser behind it. In some accounts it was a ' dummy url' and in other accounts it did not create it and had to do it manually.  

Then in the application option, add a new external repository, use the ID you used for the onboarding and the destination from BTP and voila: now you can easily view the content of your repository integration option using the application option. 

 
nellur
Discoverer
0 Kudos

Hi Vikram,

Thank you for this blog so helpful and informative.

I would like to know from BAS tool if we can read the data of the file that is placed in the repository of DMS in HANA cloud.

Thanks,

Mamatha

 

helloKittyCatSweet
Associate
Associate
0 Kudos

Hi Vikram,

I try to connect a local third-party repository followed CMIS Protocol with BTP DMS, a step which I have finished, and I need to change the repository's backend from its origin one to S4/HANA system.

When executing the fifth step, I fail to get a successful report and the errors are like that:  "sapbo:SourcingProjectQuotation
Not supported!
sapbo:SourcingProjectQuotationItem
Not supported!

Type is unsupported in query: sapbo:BusinessObjectType
An error occurred while updating the properties into SAP tables".

I have searched for a long time and still don't get any proper answer. I wonder if you could give any help for me. Thank you in advance.😄

Best wishes,

Kitty