Importing Order API Authentication and Reference Data

Objective

After completing this lesson, you will be able to prepare and Import SAP S/4HANA Cloud Customizing ImpEx

Prepare the ImpEx Files

The SAP-prepared OAuth_for_Order.impex file automatically creates the OAuth 2.0 Configuration, for example, client ID, client secret, token URL, and so on, for Sales Order Replication from SAP Commerce Cloud to SAP S/4HANA Cloud.

Here's how to configure the OAuth 2.0 API authorization for the sales order replication:

  1. Go to SAP Note 2726058, and download the ImpEx file OAuth_for_Order.impex attached to it.SAP for Me note page showing attachments for note 2726058 with the OAuth_for_Order.impex file row highlighted.
  2. In the ImpEx file, replace the values between the angle brackets, and remove the brackets.

    Macros in ImpEx File

    FieldValue
    <OAuthClientID>clientid retrieved from service key in Unit 3 Configuring SAP Cloud Integration(section SAP Business Technology Platform (SAP BTP) Cockpit Settings)
    <OAuthUrl>tokenurl retrieved from service key in Unit 3 Configuring SAP Cloud Integration(section SAP Business Technology Platform (SAP BTP) Cockpit Settings)
    <OAuthClientSecret>clientsecret retrieved from service key in Unit 3 Configuring SAP Cloud Integration(section SAP Business Technology Platform (SAP BTP) Cockpit Settings)
    <EndpointUrl>Log on to your SAP Cloud Integration, navigate to Overview Manage Integration Content, and copy endpoint URLs (exclude version at the end of URL, for example, v=1) from the iFlow: Replicate-Orders-From-SAP-Commerce-Cloud-To-SAP-S4HANACE
    VersionLog on to your SAP Cloud Integration, navigate to Overview Manage Integration Content, and copy version (at the end of URL, for example, v=1) from the endpoint URLs from the iFlow: Replicate-Orders-From-SAP-Commerce-Cloud-To-SAP-S4HANACE
    Code editor screenshot showing impex NSERT_UPDATE statements for OAuth client credentials and endpoints, with client ID/secret and endpoint lines highlighted.
  3. Save the ImpEx file.
  4. To import the ImpEx file, access the SAP Commerce Cloud Hybris Administration Console (HAC) at <https://api.XXXXXXXXXX-XXXXXXXXX-XX-public.model-t.cc.commerce.ondemand.com/hac> or via the SAP Commerce Cloud Portal and log on as an administrator.
  5. Go to the Console tab, and choose ImpEx Import.
  6. Go to the Import script tab, locate the ImpEx file prepared in the previous steps, and check that the Legacy Mode has been enabled by default.Hybris Administration Console Impex Import page showing the Import script tab with OAuth_for_Order_final selected and the Legacy mode checkbox checked.
  7. Choose Import File.

    A confirmation message (Import finished successfully) under the HAC tabs is displayed once the import is successfully processed.

    Note

    Rather than using the Import script tab to import the ImpEx file, you can use the Import Content tab (the first tab) instead. Using this tab, you would copy and paste the ImpEx codes/lines from the ImpEx file into the text area to execute the ImpEx scripts.Hybris Administration Console Impex Import page showing a highlighted Import finished successfully success message.
  8. To verify the OAuth 2.0 configuration items are imported into SAP Commerce Cloud, login to the Backoffice and navigate to SystemOAuthOAuth Clients in the Administration Cockpit. You’ll find the new OAuth client created with the ID given in the OAuth_for_Order.impex file as the value of the first Macro $OAuthClientID.SAP Administration Cockpit OAuth Clients page showing the imported element as a highlighted OAuth client ID row and the OAuth Clients menu item selected.

Import SAP S/4HANA Cloud Customizing ImpEx

To make sure that data type values (customizing data) from SAP S/4HANA Cloud are available and mapped in SAP Commerce Cloud, you need to import the data type values from the ImpEx file prepared in SAP Note 2726058.

Before importing the ImpEx file to SAP Commerce Cloud, delete all titles (Mr., Ms., and so on) in the SAP Commerce Cloud Backoffice. The correct titles will come from SAP S/4HANA Cloud as part of the import.

Here are the steps to import an ImpEx file of data type values (customizing data) to SAP Commerce Cloud:

  1. Access SAP Commerce Cloud Backoffice at <https://backoffice.XXXXXXXXXX-XXXXXXXXX-XX-public.model-t.cc.commerce.ondemand.com/backoffice> and log on as an administrator.
  2. Navigate to UserTitles.
  3. From the search result list, select all the titles, and choose the Delete action icon.SAP Commerce Backoffice Administration Cockpit Titles page showing several title entries (Dr., Rev., Miss, Ms., Mr., Mrs.) selected with the delete button highlighted.
  4. Go to SAP Note 2726058, and download the attached customizing.impex file.SAP for Me note 2726058 page showing an attachments list with Customization.impex highlighted.
  5. To import the ImpEx file, go to the Hybris Administration Console (HAC), and log on as an administrator.
  6. Go to the Console tab, and choose ImpEx Import.
  7. Go to the Import script tab, and locate the customizing ImpEx file downloaded from SAP Note 2726058. Check the boxes to turn on Legacy Mode and Enable code execution.Hybris Administration Console ImpEx Import page showing the Import script tab with file customizing.impex selected and the Legacy mode and Enable code execution checkboxes checked.
  8. Choose Import file.

    Hint

    Rather than using the Import script tab to import the ImpEx file, you can use the Import content tab instead. Using this tab, you would copy and paste the ImpEx codes/lines from the ImpEx file into the content text area.Hybris Administration Console ImpEx Import page showing the customizing Impex script in the Import content tab and settings with Legacy mode and Enable code execution checked.
  9. To verify that the items are imported in SAP Commerce Cloud, log on to the Backoffice, and navigate to UserTitles. You’ll find the new Title items are imported. In the same way, you can verify the same for Language, Currency, Unit, Country, Region, Vendor, Warehouse, OrgUnit, and Address, and so on.SAP Administration Cockpit Titles page showing two imported title entries (Mr. and Ms.) with the Titles menu highlighted.