Now a days we can see that there are a lot of requirements regarding to implement our Big Data, ERP interoperability or Data Warehousing needs, and some companies use SAP PI independent if it is or not a best practice. So for this reason i share some interesting topics:
- One Trick: Implement just one service outbound interface, without inbound interfaces in Synchronous way,
- Share just one datatype and messagetype,
- Implement an ICO including just your outbound interface, forcing the configuration without requiring the inbound interface,
- Request Information from Teradata via Macro, but with this you can get different tips in order to implement other SQL Logics like if you were working with SQL Server, MySQL, etc…
- Here you can find interesting information about Teradata and SAP Architecture Proposal: ftp://ftp.ucg.com/boston/2008%20BI%20&%20Netweaver%20Portal__Dynamic%20Items%20Report/Teradata_partner-SAP%20NetWeaver-EB4699.pdf
A. What Teradata is?:
- URL: http://www.teradata.com/
- If you need the jdbc driver you can find different versions: Teradata JDBC Driver | Teradata Developer Exchange
- Normally you can use the 14.10.00.42 version (This was used in this test) or the new Teradata JDBC Driver 15.10.00.14 version, all depending the version of your Teradata and maybe another recommendations from your experts…
- If you have doubts, each driver has its reference guide: Teradata JDBC Driver Reference | Teradata Developer Exchange
- And one of the important doubts are How to install Teradata Drivers? and what is the driver connection path to be used?: Teradata JDBC Driver
- The important tip for driver deployment in SAP PI, is that you must to install it via BASIS Team directly in Operating System of the PI server (not in netweaver, please refer a SAP note to deploy drivers, if this guide not apply for you: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/8000cffc-6b92-2d10-3493-f2ac1399242f?overridelayout=true), but verifying that the both following Teradata Jars are correctly deployed (if not you will get a lot of errors in the Communication Channels, even verify that your configuration is correct):
- terajdbc4.jar
- tdgssconfig.jar
B. After that, you will be able to implement different SAP PI Integrations using SQL Best Practices:
- Document Formats for the Receiver JDBC Adapter Document Formats for the Receiver JDBC Adapter - SAP XI: Runtime - SAP Library
- Best Practices with Receiver JDBC Adapter Document Formats Best Practices with Receiver JDBC Adapter Document Formats
- As a extra commentary, we will see how to integrate macros via SQL_QUERY Structure, because when i tested via EXECUTE i got an incompatibility issue indicating that a Macro is not a Stored Procedure.
C. SAP PI Configuration:
1. Enterprise Service Repository:
You can implement just ONE Service Interface Outbound simulating the Inbound service interface, just if Metadata (Data Types) are equals…
We implement the structure to request the information via Macro and from the client test (sender) we will add the data requeried, and will be delivered the same structure to the receiver:
For the response we create the next structure, just adding that we need to include “_response” after the name of the above DT_name, now called DT_name_response.
2. Integration Directory:
Now we can implement a classic interface or an ICO (Integrated Configuration) as bellow, and the important logic here is that the Service Interface Outbound must to be configured in the Receiver Interfaces following the “trick”. This is because we have the same structure in the sender and the receiver metadata.
We can implement a SOAP Sender Communication Channel, to play with SOAPUI and to confirm the functionality.
And the important configuration is the JDBC Receiver, to connect to Teradata via JDBC Driver and the important parameters.
- JDBC Driver: com.teradata.jdbc.TeraDriver
- Connection: jdbc:teradata://IP_NUMER/DATABASE=NAME,PORT=1025,CHARSET=UTF8
- Username & Password
- Maximum Concurrency: 15
- Advanced Mode: you can set number of retries of database transaction on SQL Error a default transaction isolation Level and you can set Disconnect from Database After Processing Each Message.
D. Teradata Structures:
The SQL Macro Sentence that execute the macro, will be:
EXEC MACRO_TERADATA_NAME (3, '2017-03-03');
And the Macro maybe call a select statement, with some structure like this, that will return in our example the rows that match with Id=3 and Date=2017-03-03:
Table: Structure to be called by MACRO_TERADATA_NAME | ||
Id | Date | Amount |
3 | 2017-03-03 |
|
3 | 2017-03-03 |
|
3 | 2017-03-03 |
|
2 | 2017-03-03 |
|
1 | 2017-03-03 |
|
E. Test via SOAPUI to SAP PI SOAP to SAP PI JDBC Teradata driver in Synchronous Mode.
Now we can request the following information:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="HERE YOUR NAMESPACE"> <soapenv:Header/> <soapenv:Body> <urn:MT_Teradata> <SAPStandard4SQL> <Macro action="SQL_QUERY"> <access>EXEC MACRO_TERADATA_NAME (3, '2017-03-03');</access> </Macro> </SAPStandard4SQL> </urn:MT_Teradata> </soapenv:Body></soapenv:Envelope>
In SOAPUI we confirmed that we consumed the web service, requesting the EXEC Statement and we received the response whit the 3 rows that matched:
And we will receive something like this:
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP:Header/> <SOAP:Body> <urn:MT_Teradata_response xmlns:urn="USE HERE URE NAMESPACE"> <SAPStandard4SQL_response> <row> <Id>3</Id> <Date>2017-03-03</Date> <Amount>100000.0000</Amount> </row> <row> <Id>3</Id> <Date>2017-03-03</Date> <Amount>200000.0000</Amount> </row> <row> <Id>3</Id> <Date>2017-03-03</Date> <Amount>300000.0000</Amount> </row> </SAPStandard4SQL_response> </urn:MT_Teradata_response> </SOAP:Body></SOAP:Envelope>
With this we can confirm the easy way to integrate Teradata and SAP PI in other ways...
Thank you!,
Azael