Send SAP ERP Customer (DEBMAS) events to HCI

This article is part of a bigger one

Goals

Create everything around DEBMAS for sending update & creation events of Customers with help of IDOC to Hana Cloud Integration (HCI).

This time we are hitting SAP hard for a newbie like, great helps came from Bhavesh Kantilal's article.

Disclaimer: I'm not used to SAP terminology, I might doing some approximations in vocabulary, do not hesitate to comment if anything need to be corrected.

Extend our HCI Flow

In previous article, we've created a dummy flow for sending data to Azure. This flow can be easily extended for being triggered by idoc from SAP ERP.
* Replace Timer Start Event by Start Message and remove the Dummy Message block * Add a Sender and link it to Start Message, finally select IDOC type

and configure Connection

Declare HCI platform + certificate

Let's create a Logical System (LS) using bd54 transaction with a friendly name

when you save it, you might have to create a new workbench for further SAP transport.

HCI certificate has to be added using transaction STRUST, either you already have this certificate from part 1 or download it with firefox (easier).

First import certificate and click on Add to Certificate List

You should then see the certificate added to Certificate list of your system

Configure outbound settings for HCI

Destination platform (HCI) has to be declared with sm59 for creating a new HTTP Connections to External Server (G)

The bahavior of the form is weird for getting the Technical Settings tab to be displayed ... I've double click anywhere ... I don't know exactly the meaning of cxf, I suspect it's a mandatory prefix which is created when you create the endpoint in HCI. DEBMAS05 will be our endpoint name.

In previous sm59 we associated HCI certificate with DEFAULT SSL Client, let's activate it and choose this option.

and force the Login with User

Save & perform a connection test.
If nothing, except a small green bottom progress bar happened (no new dialog), it means that SAP isn't able to reach at all HCI (not even talking about SSL certificate or credentials). In my initial case, I've forgot to configure the HTTP proxy as SAP ERP server do not have direct access to internet and not Cloud Connector is configured yet.

If you get ICM_HTTP_SSL_PEER_CERT_UNTRUSTED, the SSL certificate you are using isn't correct or you choose the incorrect SSL client configured back in sm59 transaction.
If HCI could be reached, you should get an authentication dialog for HCI credentials. I had to force using my email account rather S account otherwise I was getting 401 error afterward.

If you get 401 Unauthorized wrong credentials :)

Finally, if you get an HTTP 500 result, you're done ! HCI at that point has no idea about your query, but you were able to reach HCI and authenticate

IDOC Configuration

Finally we switch to IDOC focus activities: an IDOC port associated to our HCI external system has to be created with we21.

  • Port : You can set whatever you want for the Port name (with test limitation).
  • RFC destination : what we've just created above
  • Do not forget to check SOAP Protocol (not per default)

A Partner Profile has to be created with we20 for associating a 'Logical System' with an IDOC port (X_DEBMAS05) and an outbound message type (DEBMAS)

Distribution Model

bd64 for creating new Model View in Distribution Model, beware that you are correctly choosing the sender, usually I'm far to be sure so I create a record for all :). Then choose as Receiver the HC destination platform. Finally choose DEBMAS for message type.

Active Change Pointers & Change DEBMAS pointer

With bd61 ensure that Change pointers activated - generally is checked

and specifically that DEBMAS is active with bd50

Preliminary tests

At that point, we are ready to perform some tests

  • Perform a Customer edit with vd02

  • With bd21 (creating Idoc Type from Change Pointers) and DEBMAS as message type you should get a dialog indicating that 1 master Idocs set up for message type DEBMAS
    and then a second one 1 communication Idoc(s) generated for message type DEBMAS

  • we02 allows you to check the status of generated Idocs, if you get a dialog with No Idocs selected with default we02 filter (idocs created today), you have already an issue, high probability that it's a missing change pointer.
Configure RBDMIDOC background job

bd21 & RBDMIDOC generate IDOC from message type with change pointers. Without these commands, nothing happens: a schedule of RBDMIDOC has to be setup and it's a little bit tricky.

sm36 for creating a new Background job * First define Start condition by choosing Immediate and then check Periodic Job and choose the period * In Step, choose ABAP program with name RBDMIDOC and the Variant we created in previous section (Test)

BEWARE (I've lost so many time here), the Step List Overview isn't saved at this point, you have to go back

and finally save

with sm37, you can track your job execution

and finally enjoy the result

Fabien Camous

Read more posts by this author.