|
The beauty & the beast: APEX & SAP
Niels de Bruijn
30-JUN-20151
|
MT AG
LEGAL STATUS AG (CORPORATION)
HEAD OFFICE RATINGEN, GERMANY
FOUNDING YEAR 1994
EMPLOYEES 180
HOLDING MT-IFS GMBH (RATINGEN), MT-IFS SARL (LUXEMBURG)
business by integration
BUSINESS
INTELLIGENCE SOLUTIONS
SOCIAL BUSINESS
SOLUTIONS
MOBILE
SOLUTIONS
APPLICATION
DEVELOPMENT
INTEGRATION
SERVICES
IT SYSTEM
SERVICES
|
About me
 Niels de Bruijn, Business Unit Manager APEX
 Born in 1977, married, three daughters
 Track record with APEX since its inception
 Responsible for all APEX activity at MT AG
 Sharing knowledge through https://apex.mt-ag.com
 Topic leader for APEX within DOAG
 Part of APEX content committee for Kscope
 Conference Lead for APEX connect
The beauty and the beast: APEX & SAP.3
||
Agenda
The beauty and the beast: APEX & SAP.4
1. Options to interact with SAP
2. Technical deep dive for synchronious solutions
3. Drink your own champagne
|
General options to interact with SAP
Goal
 Display and process data stored in SAP
Which front-end to use?
 SAP client
- Recommend only for power business users
 Custom webapp based on SAP UI5
- Complex and produces tons of Javascript (which makes it quite slow)
 Custom webapp based on either .Net, Java or APEX (PL/SQL)
The beauty and the beast: APEX & SAP.5
||
Agenda
The beauty and the beast: APEX & SAP.6
1. Options to interact with SAP
2. Technical deep dive for synchronious solutions
3. Drink your own champagne
|
Synchronious solutions
 Java Connector
 REST Web Services
 SOAP Web Services
The beauty and the beast: APEX & SAP.7
|
Java Connector
8
Architecture
Oracle
PL/SQL Function
Java Class
(Stub)
Java Class
(Skeleton)
SAP JCo
(JNI)
APEX
RFC
(XML)RMI
SAP
Functional
module
(BAPI/ABAP)
The beauty and the beast: APEX & SAP.
|
Java Connector
 SAP Java Connector (SAP JCo) has a RFC-Middleware, which is based on
JNI (Java Native Interface).
http://help.sap.com/saphelp_dm40/helpdata/de/09/a4a9e1d51d11d6b2c200508b5d5c51/content.htm
 Oracle can‘t support JNI in the database
http://docs.oracle.com/cd/B19306_01/java.102/b14187/chthree.htm#CACFCDJF
http://docs.oracle.com/cd/E23549_01/doc.1111/e14770/adapters_iway.htm#CEGHEJIF
 Work around: keep the Java interface in the database, but let the implementation
run outside the database
- Create a PL/SQL wrapper for the Java interface, so that APEX can call it
The beauty and the beast: APEX & SAP.9
|
Java Connector (example)
select extractvalue(x, '/BAPI_COMPANYCODE_GETDETAIL/COMPANYCODE_DETAIL/COMP_CODE') as compcode
, extractvalue(x, '/BAPI_COMPANYCODE_GETDETAIL/COMPANYCODE_DETAIL/COMP_NAME') as compname
, extractvalue(x, '/BAPI_COMPANYCODE_GETDETAIL/COMPANYCODE_DETAIL/CITY') as city
, extractvalue(x, '/BAPI_COMPANYCODE_GETDETAIL/COMPANYCODE_DETAIL/CURRENCY') as currency
from
( select xmltype
( call_JCo_bapi('BAPI_COMPANYCODE_GETDETAIL
‚,
'<BAPI_COMPANYCODE_GETDETAIL><COMPANYCODEID>1000</COMPANYCODEID></BAPI_COMPANYCODE_GETDETAIL>')
) as x
from dual
)
The beauty and the beast: APEX & SAP.10
 Functional Module BAPI_COMPANYCODE_GETDETAIL
 Parameter COMPANYCODEID => 1000
SQL:
Result:
|
Synchronious solutions
 Java Connector
 REST Web Services
 SOAP Web Services
The beauty and the beast: APEX & SAP.11
|
SAP
REST Web Services mit SAP
The beauty and the beast: APEX & SAP.12
Architecture using SAP Netweaver Gateway
PL/SQL
(APEX_WEB_SERVICE)
APEX HTTP
request Functional
module
(BAPI/ABAP)
Oracle
SAP Netweaver
Gateway
RFC
(XML)
JSON/XML
REST
Web
Service
Disadvantage:
SAP Netweaver Gateway needs to be licensed separately if SAP doesn’t
provide a REST based interface.
|
SAP
REST Web Services based on Microsoft
The beauty and the beast: APEX & SAP.13
Architecture using Microsoft ASP .Net WebAPI
PL/SQL
(APEX_WEB_SERVICE)
APEX HTTP
request Functional
module
(BAPI/ABAP)
Oracle
MS ASP .Net
WebAPI
RFC
(XML)
JSON/XML
REST
Web
Service
MS ASP .Net WebAPI can be used without additional cost, but requires
Windows Server
Additional information:
http://www.asp.net/web-api
|
REST Web Services based on Microsoft
The beauty and the beast: APEX & SAP.14
Example code snippet in C# using Microsoft ASP .Net WebAPI to call a SOAP Web Service
|
Synchronious solutions
 Java Connector
 REST Web Services
 SOAP Web Services
The beauty and the beast: APEX & SAP.15
|
SAP
SOAP Web Services
The beauty and the beast: APEX & SAP.16
Architecture with SOAP Web Services
PL/SQL
(APEX_WEB_SERVICE)
APEX XML
über HTTPS
Functional
module
(BAPI)
SOAP
Web
Service
Oracle
RFC
(XML)
Remarks:
• A technical SAP user can be used for authentication (ie. Basic Auth over HTTPS)
• Package APEX_WEB_SERVICE used as a wrapper for UTL_HTTP
• Users‘ context is forwarded using an input parameter (ie. employee no.)
|
SOAP Web Services
 1. Make ABAP module as SOAP web service available
- Available „per click“, starting with SAP NetWeaver 7.0 SP14
- See:
http://www.outsystems.com/NetworkForums/Public.Download_Attachment.asp
x?AttachmentId=1426
- Test the web service using SoapUI
 2. Register the web service in APEX, so it can be consumed
 3. Create your form or report that utilizes the web service
The beauty and the beast: APEX & SAP.17
Overview of implementation steps
|
1. Test functional module in SAP (implemented with ABAP)
The beauty and the beast: APEX & SAP.
Create SOAP Web Service
22
|
2. Enable functional module to be called through RFC
The beauty and the beast: APEX & SAP.
Create SOAP Web Service
23
|
3. Create a SOAP Web Service & get the WSDL through SOAMANAGER
The beauty and the beast: APEX & SAP.
Create SOAP Web Service
24
| The beauty and the beast: APEX & SAP.
Test SOAP web service using SoapUI
26
| The beauty and the beast: APEX & SAP.
Test SOAP web service using SoapUI
27
||
Agenda
The beauty and the beast: APEX & SAP.23
1. Options to interact with SAP
2. Technical deep dive for synchronious solutions
3. Drink your own champagne
|
HR Self Service @ MT AG
 All employees need an approval when taking days off
 The number of days left is tracked within SAP CA-TS
 No REST based Web Services provided by default
 SAP client not suitable as most customer sites only allow connections with port
80 or 443
 An APEX app was built to replace the current solution
 SAP was integrated using SAP web services and the package
APEX_WEB_SERVICE
 New feature: approval process can be done using a mobile device
The beauty and the beast: APEX & SAP.24
|
HR Self Service @ MT AG
The beauty and the beast: APEX & SAP.25
|
HR Self Service @ MT AG
The beauty and the beast: APEX & SAP.26
|
HR Self Service @ MT AG
The beauty and the beast: APEX & SAP.27
|
HR Self Service @ MT AG
The beauty and the beast: APEX & SAP.28
|
Telefon:
Telefax:
E-Mail:
www.mt-ag.com
Enjoy Kscope!
Business Unit Manager APEX
+49 2102 309 61 0
+49 2102 309 61 101
niels.de.bruijn@mt-ag.com
Niels de Bruijn

The_Beauty_And_The_Beast_APEX_and_SAP

  • 1.
    | The beauty &the beast: APEX & SAP Niels de Bruijn 30-JUN-20151
  • 2.
    | MT AG LEGAL STATUSAG (CORPORATION) HEAD OFFICE RATINGEN, GERMANY FOUNDING YEAR 1994 EMPLOYEES 180 HOLDING MT-IFS GMBH (RATINGEN), MT-IFS SARL (LUXEMBURG) business by integration BUSINESS INTELLIGENCE SOLUTIONS SOCIAL BUSINESS SOLUTIONS MOBILE SOLUTIONS APPLICATION DEVELOPMENT INTEGRATION SERVICES IT SYSTEM SERVICES
  • 3.
    | About me  Nielsde Bruijn, Business Unit Manager APEX  Born in 1977, married, three daughters  Track record with APEX since its inception  Responsible for all APEX activity at MT AG  Sharing knowledge through https://apex.mt-ag.com  Topic leader for APEX within DOAG  Part of APEX content committee for Kscope  Conference Lead for APEX connect The beauty and the beast: APEX & SAP.3
  • 4.
    || Agenda The beauty andthe beast: APEX & SAP.4 1. Options to interact with SAP 2. Technical deep dive for synchronious solutions 3. Drink your own champagne
  • 5.
    | General options tointeract with SAP Goal  Display and process data stored in SAP Which front-end to use?  SAP client - Recommend only for power business users  Custom webapp based on SAP UI5 - Complex and produces tons of Javascript (which makes it quite slow)  Custom webapp based on either .Net, Java or APEX (PL/SQL) The beauty and the beast: APEX & SAP.5
  • 6.
    || Agenda The beauty andthe beast: APEX & SAP.6 1. Options to interact with SAP 2. Technical deep dive for synchronious solutions 3. Drink your own champagne
  • 7.
    | Synchronious solutions  JavaConnector  REST Web Services  SOAP Web Services The beauty and the beast: APEX & SAP.7
  • 8.
    | Java Connector 8 Architecture Oracle PL/SQL Function JavaClass (Stub) Java Class (Skeleton) SAP JCo (JNI) APEX RFC (XML)RMI SAP Functional module (BAPI/ABAP) The beauty and the beast: APEX & SAP.
  • 9.
    | Java Connector  SAPJava Connector (SAP JCo) has a RFC-Middleware, which is based on JNI (Java Native Interface). http://help.sap.com/saphelp_dm40/helpdata/de/09/a4a9e1d51d11d6b2c200508b5d5c51/content.htm  Oracle can‘t support JNI in the database http://docs.oracle.com/cd/B19306_01/java.102/b14187/chthree.htm#CACFCDJF http://docs.oracle.com/cd/E23549_01/doc.1111/e14770/adapters_iway.htm#CEGHEJIF  Work around: keep the Java interface in the database, but let the implementation run outside the database - Create a PL/SQL wrapper for the Java interface, so that APEX can call it The beauty and the beast: APEX & SAP.9
  • 10.
    | Java Connector (example) selectextractvalue(x, '/BAPI_COMPANYCODE_GETDETAIL/COMPANYCODE_DETAIL/COMP_CODE') as compcode , extractvalue(x, '/BAPI_COMPANYCODE_GETDETAIL/COMPANYCODE_DETAIL/COMP_NAME') as compname , extractvalue(x, '/BAPI_COMPANYCODE_GETDETAIL/COMPANYCODE_DETAIL/CITY') as city , extractvalue(x, '/BAPI_COMPANYCODE_GETDETAIL/COMPANYCODE_DETAIL/CURRENCY') as currency from ( select xmltype ( call_JCo_bapi('BAPI_COMPANYCODE_GETDETAIL ‚, '<BAPI_COMPANYCODE_GETDETAIL><COMPANYCODEID>1000</COMPANYCODEID></BAPI_COMPANYCODE_GETDETAIL>') ) as x from dual ) The beauty and the beast: APEX & SAP.10  Functional Module BAPI_COMPANYCODE_GETDETAIL  Parameter COMPANYCODEID => 1000 SQL: Result:
  • 11.
    | Synchronious solutions  JavaConnector  REST Web Services  SOAP Web Services The beauty and the beast: APEX & SAP.11
  • 12.
    | SAP REST Web Servicesmit SAP The beauty and the beast: APEX & SAP.12 Architecture using SAP Netweaver Gateway PL/SQL (APEX_WEB_SERVICE) APEX HTTP request Functional module (BAPI/ABAP) Oracle SAP Netweaver Gateway RFC (XML) JSON/XML REST Web Service Disadvantage: SAP Netweaver Gateway needs to be licensed separately if SAP doesn’t provide a REST based interface.
  • 13.
    | SAP REST Web Servicesbased on Microsoft The beauty and the beast: APEX & SAP.13 Architecture using Microsoft ASP .Net WebAPI PL/SQL (APEX_WEB_SERVICE) APEX HTTP request Functional module (BAPI/ABAP) Oracle MS ASP .Net WebAPI RFC (XML) JSON/XML REST Web Service MS ASP .Net WebAPI can be used without additional cost, but requires Windows Server Additional information: http://www.asp.net/web-api
  • 14.
    | REST Web Servicesbased on Microsoft The beauty and the beast: APEX & SAP.14 Example code snippet in C# using Microsoft ASP .Net WebAPI to call a SOAP Web Service
  • 15.
    | Synchronious solutions  JavaConnector  REST Web Services  SOAP Web Services The beauty and the beast: APEX & SAP.15
  • 16.
    | SAP SOAP Web Services Thebeauty and the beast: APEX & SAP.16 Architecture with SOAP Web Services PL/SQL (APEX_WEB_SERVICE) APEX XML über HTTPS Functional module (BAPI) SOAP Web Service Oracle RFC (XML) Remarks: • A technical SAP user can be used for authentication (ie. Basic Auth over HTTPS) • Package APEX_WEB_SERVICE used as a wrapper for UTL_HTTP • Users‘ context is forwarded using an input parameter (ie. employee no.)
  • 17.
    | SOAP Web Services 1. Make ABAP module as SOAP web service available - Available „per click“, starting with SAP NetWeaver 7.0 SP14 - See: http://www.outsystems.com/NetworkForums/Public.Download_Attachment.asp x?AttachmentId=1426 - Test the web service using SoapUI  2. Register the web service in APEX, so it can be consumed  3. Create your form or report that utilizes the web service The beauty and the beast: APEX & SAP.17 Overview of implementation steps
  • 18.
    | 1. Test functionalmodule in SAP (implemented with ABAP) The beauty and the beast: APEX & SAP. Create SOAP Web Service 22
  • 19.
    | 2. Enable functionalmodule to be called through RFC The beauty and the beast: APEX & SAP. Create SOAP Web Service 23
  • 20.
    | 3. Create aSOAP Web Service & get the WSDL through SOAMANAGER The beauty and the beast: APEX & SAP. Create SOAP Web Service 24
  • 21.
    | The beautyand the beast: APEX & SAP. Test SOAP web service using SoapUI 26
  • 22.
    | The beautyand the beast: APEX & SAP. Test SOAP web service using SoapUI 27
  • 23.
    || Agenda The beauty andthe beast: APEX & SAP.23 1. Options to interact with SAP 2. Technical deep dive for synchronious solutions 3. Drink your own champagne
  • 24.
    | HR Self Service@ MT AG  All employees need an approval when taking days off  The number of days left is tracked within SAP CA-TS  No REST based Web Services provided by default  SAP client not suitable as most customer sites only allow connections with port 80 or 443  An APEX app was built to replace the current solution  SAP was integrated using SAP web services and the package APEX_WEB_SERVICE  New feature: approval process can be done using a mobile device The beauty and the beast: APEX & SAP.24
  • 25.
    | HR Self Service@ MT AG The beauty and the beast: APEX & SAP.25
  • 26.
    | HR Self Service@ MT AG The beauty and the beast: APEX & SAP.26
  • 27.
    | HR Self Service@ MT AG The beauty and the beast: APEX & SAP.27
  • 28.
    | HR Self Service@ MT AG The beauty and the beast: APEX & SAP.28
  • 29.
    | Telefon: Telefax: E-Mail: www.mt-ag.com Enjoy Kscope! Business UnitManager APEX +49 2102 309 61 0 +49 2102 309 61 101 niels.de.bruijn@mt-ag.com Niels de Bruijn