You are on page 1of 19

7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

Community

Ask a Question Write a Blog Post Login

CD Raju
May 16, 2017 4 minute read

Interface In between SAP and MULESOFT


Follow RSS feed Like

4 Likes 9,422 Views 9 Comments

Applies to
SAP ECC, MULESOFT.

Summary
In the New IT world the businesses has to be connected with Cloud application to run their business
meritoriously in a compatible mode with new generation devices like Mobiles, Tabs. MULESOFT is a state-of-
the-art middleware application in the current market to interact easily and e ectively with core business
applications like SAP.

This document is trying to illustrate how easily the interface can be built in between SAP to COUPA, and
Mulesoft as middleware. New IT world this kind of interface is commonly built in the business.

Created on
05th May 2017

Authors

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 1/19
7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

Authors Bio
Raju C D is a SAP Global speaker and Mentor and having 13+ years of experience as a SAP Consultant.
Currently working with Accenture Solutions Pvt. Ltd.

Adarsh swami is Mulesoft consultant and having 4 years of experience with Mulesoft product. Currently working
with Accenture Solutions Pvt. Ltd.

Table of Content
1. Introduction
2. Overview
3. SAP ECC objects creation
i. Create a RFC FM which sends data to COUPA
ii. Create a Z_table, to store the acknowledgement from COUPA
iii. Create an RFC FM which receives acknowledgement from COUPA
iv. Create a Z_program and call the RFC FM which sends data to COUPA with help of Mulesoft

4. Connecting Mulesoft and SAP using BAPI and IDOCs


i. Push Data from Mulesoft to SAP
ii. Push data from SAP to Mulesoft
1. SAP RFC Settings
2. Mulesoft Con guration
3. SAP connector settings

5. Sample Coupa API calls from Mulesoft

1. Introduction

This Document gives an in-detail approach to create an interface in between SAP and COUPA, with help of
MULESOFT middleware application. It has step by step activites to be done in both SAP and MULESOFT
applications. Technically Mulesoft integration is very stress-free comparatively with other middleware
applications to interact with could base applications.

  2.  Overview

Requirement:  SAP sends the data by running a report program to COUPA and    COUPA sends back
acknowledgement to SAP. COUPA is a cloud based P2P application.

Solution:

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 2/19
7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

1. Create an RFC FM which sends data to COUPA.


2. Create a Z_table, to store the acknowledgement from COUPA.
3. Create a RFC FM which receives acknowledgement from COUPA.
4. Create a Z_program and call the RFC FM which sends data to COUPA with help of Mulesoft.
5. Create RFC connection in between SAP and Mulesoft, usually this connection will be available when Mulesoft
was set up as Middleware in the systems environment.

3. SAP ECC objects creation

       3.1. Create a RFC FM which sends data to COUPA.

Before creating FM, need a Function group, so create function group rst.

Go to Tcode SE37 and choose the GOTO Menu to create Function Group.

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 3/19
7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 4/19
7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 5/19
7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 6/19
7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 7/19
7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

FUNCTION z_receive_ack_coupa.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(IM_ACK) TYPE ZCOUPA_ACK
*"----------------------------------------------------------------------
DATA: wa_zcoupa_ack TYPE zcoupa_ack.

IF NOT im_ack IS INITIAL.


SELECT SINGLE * FROM zcoupa_ack
INTO wa_zcoupa_ack
WHERE po_number EQ wa_zcoupa_ack-po_number
AND status EQ space.
IF sy-subrc EQ 0.
wa_zcoupa_ack-status = im_ack-status.
wa_zcoupa_ack-stat_desc = im_ack-stat_desc.

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 8/19
7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

MODIFY zcoupa_ack FROM wa_zcoupa_ack.


ENDIF.
ENDIF.

ENDFUNCTION.

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 9/19
7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

*&---------------------------------------------------------------------*
*& Report Z_SEND_PO_2_COUPA
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT z_send_po_2_coupa.
*Data Declaration
DATA: wa_ekko TYPE ekko,
it_ekpo TYPE STANDARD TABLE OF ekpo,
l_v_mulesoft TYPE rfcdest VALUE 'MULE100'. " Moulesoft Logical system
*Selction Screen
PARAMETERS p_ebeln TYPE ebeln.

START-OF-SELECTION.
*Fetch PO Header
SELECT SINGLE * FROM ekko INTO wa_ekko WHERE ebeln = p_ebeln.
IF sy-subrc EQ 0.
* Fetch PO Item
SELECT * FROM ekpo INTO TABLE it_ekpo WHERE ebeln = p_ebeln.
ELSE.

MESSAGE 'Enter Correct PO Number' TYPE 'E'.


ENDIF.

IF NOT wa_ekko IS INITIAL.


CHECK l_v_mulesoft IS NOT INITIAL.

**Also check if the RFC destination is active,


**if not dont send the destination back
**this is to avoid system resulting in runtime error if connection fails

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 10/19
7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

CALL FUNCTION 'RFC_PING'


DESTINATION l_v_mulesoft
EXCEPTIONS
system_failure = 1
communication_failure = 2
OTHERS = 99.
IF sy-subrc EQ 0.
* RFC FM to send PO details to COUPA system.
CALL FUNCTION 'Z_SEND_2_COUPA'
DESTINATION l_v_mulesoft
EXPORTING
im_ekko = wa_ekko
TABLES
im_ekpo = it_ekpo.

ELSE.
MESSAGE 'RFC Error' TYPE 'E'.
ENDIF.

ENDIF.

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 11/19
7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 12/19
7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

    

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 13/19
7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 14/19
7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 15/19
7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

Alert Moderator

Assigned tags

ABAP Development | NW ABAP Remote Function Call (RFC) | SAP Cloud for Financials | SAP Mentors | coupa |

View more...

Related Blog Posts

ABAP Package Concept Part 2 Package Interfaces of Development Packages


By Tobias Trapp , Dec 10, 2011
Tag(Marker) Interface in ABAP and Java
By Jerry Wang , Apr 25, 2017
SAP HANA as Secondary Database
By Former Member , Nov 07, 2014

Related Questions

Interface between SAP and Excel


By Former Member , Oct 03, 2005
Interfaces
By Former Member , Jun 11, 2008
Interface between SAP and External System
By Former Member , Mar 23, 2006

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 16/19
7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

9 Comments

You must be Logged on to comment or reply to a post.

Former Member

May 22, 2017 at 11:09 am

Nice article on SAP and Mule soft Interface – Looking for more such article

Like(1)

CD Raju | Post author

May 22, 2017 at 1:25 pm

Thanks Naveen.. Sure, I will post..

Like(0)

sri kiran

May 24, 2017 at 1:05 pm

Raju & Adarsh ,

Appreciative E ort .

Its Informative about upcoming Technologies , and Narration is good but I think some more explanation
required i.e, in layman’s perspective.

Like(0)

CD Raju | Post author

May 26, 2017 at 12:30 pm

Hi Kiran,

Thanks for reading the Blog, I tried  maximum to mention the minor step also in the blog.

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 17/19
7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

May I know at which step you are missing?

Like(0)

Sri Bhooshanan

July 7, 2017 at 3:05 am

Raju,

Any thoughts on MuleSoft vs. SAP PI for integration? We will be integrating SAP with non-SAP systems and
need to decide on a middleware product.

Best,

Sri

Like(0)

Patrick Weber

July 7, 2017 at 7:57 am

Thanks for sharing Raju. One suggestion: you might want to level the details provided for the various steps in
your tutorial. For instance, you are explaining in much detail how to create function groups and functions but
only mention very brie y the RFC destination to be created without giving the name that is used in your code.
To somebody experienced in this area, that will be obvious but other parts of the blog suggest that the target
audience you had in mind are novices.

Keep up the good work and have a nice weekend ahead!

Regards,
Patrick

Like(1)

CD Raju | Post author

July 11, 2017 at 4:39 pm

Yes I agree your point 🙂 ,  Thanks for reading my blog..

Like(0)

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 18/19
7/22/2020 Interface In between SAP and MULESOFT | SAP Blogs

Ganesan Vandaloor

June 18, 2018 at 1:11 pm

hi raju ,

I have one question in SAP and Mulesoft , please provide your contact number , so that it is very easy to discuss
and solve my integration problems . please provide .

Like(0)

COMPASS GROUP INC

June 3, 2019 at 4:14 pm

Hello Raju ,

Can you please let me know if it is possible to use mule soft SAP connector to S4 HANA system .

Thanks

Like(0)

Find us on

Privacy Terms of Use

Legal Disclosure Copyright

Trademark Cookie Preferences

Newsletter Support

https://blogs.sap.com/2017/05/16/interface-in-between-sap-and-mulesoft/ 19/19

You might also like