Quantcast
Channel: Process Integration (PI) & SOA Middleware
Viewing all 741 articles
Browse latest View live

Tool to update several communication channels in a change list in SAP PI

$
0
0

Background:

Recently in our landscape we had to set up several PI systems for different testing/quality purpose. Activating large number of channels manually is time consuming activity, Hence we created this tool to so that we can update the communication channels easily and quickly. This tool is easy to use and it uses simple excel sheet to get the communication channel details. It connects to PI system and calls the change list and communication channel services to retrieve and update channel details.

 

Prerequisites:

To use this tool following prerequisites have to be met

1) JDK 1.6 or later should be installed on your system.

2) The PI user should have two roles SAP_XI_API_DEVELOP_J2EE and SAP_XI_API_DISPLAY_J2EE assigned.

3) MS office excel 2007(xlsx only) or above is required.

 

Download Link:

Download the zip file from below link and extract it.

https://sourceforge.net/projects/sappichangelisteditor/files/latest/download

bin.jpg

 

How to use:

This tool should be used in three steps

 

1) GetChannels: In first step, we create an excelsheet lets say Channels.xlsx and place it in the same folder as the tool. The first sheet of the excelsheet has 5 details to be provided Target PI host,Target PI port, Changelistkey, Source PI host and Source PI Port. FirstSheet new.jpg

 

TargetPIHost: Host of the PI system which has the change list

TargetPIPort: Port of the PI system which has the change list

ChangeLisyKey: Change List key

SourcePIHost: Host of the PI system from which details of the channels have to be fetched

SourcePIPort: Port of the PI system from which details of the channels have to be fetched

 

Here source system will be your development system and target system will be your quality system to which the objects are transported from development.

 

Now open a command prompt, navigate to the folder where this tool is extracted and run GetChannels.bat file from the tool. Pass the name of the excelsheet to it. It asks for user and password to connect to PI system.

 

GetChannels.jpg

GetChannels.bat will retrieve the party,component and channel names in the change list from target system and write them in first sheet of the excelsheet. After successful execution of GetChannels.bat, excelsheet will look as shown below.

 

 

After GetChannels New.jpg

 

2) GetDetails:Now open the excelsheet and update the business system details for Source PI System in first sheet. You can get this information in SLD business system transport path. If the component is business component then you may simply copy it from Target PI System. Save and close the excelsheet.

Update Business System.jpg

Now run GetDetails.bat file in command prompt and pass the excelsheet name as parameter to it.

GetDetails.jpg

It will connect to source PI system and retrieve adapter-specific-attributes of all the channels in first sheet of excel and write them into second sheet of same excelsheet. Name of this sheet will be Channels. After successful execution of GetDetails.bat, the excelsheet will look as shown below.

After GetDetails.jpg

Only green colored cells value should be edited and rest should not be changed. These cells have cell comment which should not be changed because they are adapter-specific-attribute key. Update the details of non transportable attributes like folders,FTP host etc in the sheet. Red colored cell indicates that these are password values which must be filled manually, if required. It is easy to edit if similar channels are grouped by applying filter on adapter type, direction, transport protocol and message protocol. Save and close the excelsheet. You may want to save a copy of this excelsheet as backup at this point.

 

3) Update: Now run Update.dat file in command prompt and pass the excelsheet name as parameter to it. It will update the channels in target PI system changelist with the values of the excelsheet.

Update New.jpg

After successful execution of Update.bat, the changelist can be activated easily at once.

 

 

Assumptions:

1) The change list has atleast one channel in it.

2) The change list is assumed to be under same user as used in this tool. If not, first transfer the change list under that user and then use this tool.

3) The channels in the change list of target PI system are available in source PI system and not opened in edit mode in source system.

4) The business system/service of the channels in changelist are activated in target system or they are in the same change list or different change list under the same user used in the tool.

5) Only adapter-specific-attributes of the channels needs to be updated.

 

If you face any issue in using this tool, leave a comment below.


How to update a R3 table via portal – SOA Environment

$
0
0

How to update a R3 table via portal – SOA Environment?

 

 

Here I am trying to explain an interesting scenario. We need to update user information in R3 system via portal and 3rd party will get the confirmation about
posting status.

 

Let’s try to establish sync communication.

  1. User can fill information about his details.
  2. Get the Confirmation that data has been updated in
    R3 table.. User created


   Now idea is that..

 

   1. Create A RFC Enabled Funcation module form Se37..        
     Import parameter : Information provided by 3rd Party application

      Export parameter : Confirmation message.. User id had been created.

  2. Create a Service Defication for that service ( Se37 /or SPROXY or SE80)

  3. Expose that service in SOAMANGER

  4. Expose the service in Service Registry

  5. Test form WS Navigator tool and 3rd Party application

 


Create Custom table, where you want to update data : SE11


Ref : Fig 1 
 

Create RFC enable Function Module : ( Transaction Se37 –SAP R3)

 

Import Parameters :

Ref : Fig 2

 

Export Parameters :

Ref : Fig 3

 

 

Source Code

 

 

FUNCTION ZRFC_USER_CREATE.

 

 

*"----------------------------------------------------------------------

 

 

*"*"Local Interface:

 

 

*"  IMPORTING

 

 

*"     VALUE(NAME) TYPE  STRING

 

 

*"     VALUE(FNAME) TYPE  STRING

 

 

*"     VALUE(LNAME) TYPE  STRING

 

 

*"     VALUE(REGIO) TYPE  STRING

 

 

*"     VALUE(LAND1) TYPE  STRING

 

 

*"  EXPORTING

 

 

*"     VALUE(MSG) TYPE  STRING

 

 

*"----------------------------------------------------------------------

 

 

Data : it_user type standard table of ZUSER_HATI,

 

 

       wa_user type ZUSER_HATI.

 

 

 

 

 

Data : str1 type string.

 

 

 

 

 

 

 

 

if NAME is initial.

 

 

str1 = 'Please fill user name field'.

 

 

  1. endif.

 

 

 

 

 

select single * from ZUSER_HATI into wa_user where NAME = NAME.

 

 

if sy-subrc eq 0.

 

 

concatenate 'The user ' NAME ' has already exists. Please choose other
one' into str1.

 

 

 

 

 

  1. else.

 

 

clear : wa_user.

 

 

wa_user-NAME = NAME.

 

 

wa_user-fname = fname.

 

 

wa_user-lname = lname.

 

 

wa_user-regio = regio.

 

 

wa_user-land1 = land1.

 

 

 

 

 

insert ZUSER_HATI from wa_user.

 

 

if sy-subrc eq 0.

 

 

concatenate 'The user ' NAME ' created successfully.' into str1.

 

 

 

 

 

  1. else.

 

 

concatenate 'The user ' NAME ' is not created. Technical issue!' into
str1.

 

 

 

 

 

  1. endif.

 

 

 

 

 

  1. Endif.

 

 

MSG =  str1.

 

 

  1. ENDFUNCTION.

 

 

 

 

Now RFC Enabled Function Module ( also called RFC) has been create as SAP Service

Ref : Fig 4


Now we need to
create on Service Defination for this service which will be expose in SOAMANGER
further.


Goto : Utilitiesà More Utilities--> Create Web Service à From the Function Module

Ref : Fig 5

 

It will open Configutaion Wizard . Provide Service Defination name different so that 3rd
Party application may not confiuse while trying to consume service( writing
some custom code) . Press “Continue”

Ref : Fig 6


Press “Continue”

Ref : Fig 7


Choose as below setting

Ref : Fig 8


Press “Complete”. Now check this configuration tab like this :

Ref : Fig 9


Change the Authontication Level as “Low”

Ref : Fig 10


Trasnport Sceurity should be low

Ref : Fig 11

 


Now expose the service form SOAMANAGER..


Serach your service

Goto Configuration tab and create Button

Ref : Fig 12


Check Basic Authontication

Ref : Fig 13


Press Save Button .. End point URL has been created

Ref : Fig 14

 

Test the service


Open Web Service Navigator

Ref : Fig 15


First provide WS
Navigator credentials and then SOAMANAGER USER and PASS

Press Next

 

Fill the information and press Next

Ref : Fig 16

 

 

 

 

Check the export parametes Synchonous Communication. “The userbhati created successfully.”

Ref : Fig 17

 

Check the R3 table entry.

Ref : Fig 18

 


Please note ..
you can expose this service in service Registry. So that 3rd Party
application can directly consume this.

SAP PI 7.3 Features and Advantages.

$
0
0

SAP PI is an integration technology and platform to drive integrated business process across heterogeneous and highly dynamic landscapes. As the Integration technologies are rapidly changing SAP PI is also scaled up from XI 3.0 to SAP PI 7.0, SAP PI 7.1 and SAP PI 7.3. In this blog i am trying to highlight the PI 7.3’s features and Advantages over previous versions.

SAP PI Previous Versions’ Limitations:-

 

  • Could run only on dual stack as some adapters like IDOC,HTTP,WS-RM are still on ABAP stack.
  • AAE concept is introduced in PI 7.1 but with some limitations like:

            The sender and the receiver adapter must run on the same AAE

            Adapters that run on the Integration Engine(ABAP ) cannot  be used ( e. g. IDOC,HTTP and XI adapters)

            ABAP based mapping is not possible

            Only Simple Routing is possible , no payload based routing or message split.

  • Frequent time outs in case of large files processing .

SAP PI7.3 Features:

  • SAP Solution Manager based Centralized Monitoring, Single Stack ESB.
  • User Centric perspectives in the ESR.
  • Eclipse based standard editors for viewing the content of Enterprise Services Repository and Integration Directory.
  • Single stack ESB capabilities through Advanced Adapter Engine-Up to 60% less energy consumption-Easy maintenance: Quick installation and less Hardware requirements compared to double stack.
  • Advanced Adapter Engine Extended as AS Java only with own tools for design configuration and operations.
  • Local ES Repository and Integration Directory, SLD, NWA, Monitoring
  • IDOC and HTTP Adapters in AAE
  • Very Large(binary) file-to-file transfer
  • Interface and Mapping based message split on AAE
  • Time Out configuration per communication channel
  • Automated Transport for Schema Validation(XML validation has been redesigned)
  • User defined message search ,replacing TREX
  • JAVA based IDOC_AAE adapter supports ALEAUDIT(Application Acknowledgement)
  • ccBPM is replaced by SAP NW BPMN.BPMN is system centric process while ccBPM is an user centric process.The Model-driven development environment based on the BPMN-standard improves developer productivity for implementing System Centric Processes.System Centric Processes allow us to gain adaptability, increase reusability.System Centric Processes orchestrate stateful integration processes of systems, applications, and services across SAP and non-SAP environments.

 

  • New Add-On from SAP for PI 7.3x
      1)Secure Connectivity Add-On
          SFTP Adapter
          PGP module
      2) B2B Add-On
         OFTP ADAPTER
         AS2 ADAPTER
         X400 ADAPTER
         EDISEPERATOR
         EDI XML CONVERTER
         NRO
         CONTENT
         MAPPING TEMPLATES
         B2B CONTENT

       *For B2B (Business to Business) Add-On separte License is required.

expose a service

$
0
0

How to expose a service?

 

Let’s try to establish sync communication.

  1. User can fill information about his details.
  2. Get the Confirmation that data has been updated in
    R3 table.. User created

 

   Now idea is that..    1. Create A RFC Enabled Funcation module form Se37..        
     Import parameter : Information provided by 3rd Party application
      Export parameter : Confirmation message.. User id had been created.  2. Create a Service Defication for that service ( Se37 /or SPROXY or SE80)  3. Expose that service in SOAMANGER  4. Expose the service in Service Registry  5. Test form WS Navigator tool and 3rd Party application

Create Custom table, where you want to update data : SE11

Ref : Fig 1 
 
Create RFC enable Function Module : ( Transaction Se37 –SAP R3)Import Parameters :Ref : Fig 2 Export Parameters :Ref : Fig 3 Source Code   FUNCTION ZRFC_USER_CREATE.  *"----------------------------------------------------------------------  *"*"Local Interface:  *"  IMPORTING  *"     VALUE(NAME) TYPE  STRING  *"     VALUE(FNAME) TYPE  STRING  *"     VALUE(LNAME) TYPE  STRING  *"     VALUE(REGIO) TYPE  STRING  *"     VALUE(LAND1) TYPE  STRING  *"  EXPORTING  *"     VALUE(MSG) TYPE  STRING  *"----------------------------------------------------------------------  Data : it_user type standard table of ZUSER_HATI,         wa_user type ZUSER_HATI.    Data : str1 type string.      if NAME is initial.  str1 = 'Please fill user name field'. 

  1. endif.

    select single * from ZUSER_HATI into wa_user where NAME = NAME.  if sy-subrc eq 0.  concatenate 'The user ' NAME ' has already exists. Please choose other
one' into str1.
   

  1. else.

  clear : wa_user.  wa_user-NAME = NAME.  wa_user-fname = fname.  wa_user-lname = lname.  wa_user-regio = regio.  wa_user-land1 = land1.    insert ZUSER_HATI from wa_user.  if sy-subrc eq 0.  concatenate 'The user ' NAME ' created successfully.' into str1.   

  1. else.

  concatenate 'The user ' NAME ' is not created. Technical issue!' into
str1.
   

  1. endif.

   

  1. Endif.

  MSG =  str1. 

  1. ENDFUNCTION.

 

 

 

 

Now RFC Enabled Function Module ( also called RFC) has been create as SAP Service

Ref : Fig 4


Now we need to
create on Service Defination for this service which will be expose in SOAMANGER
further.


Goto : Utilitiesà More Utilities--> Create Web Service à From the Function Module

Ref : Fig 5

 

It will open Configutaion Wizard . Provide Service Defination name different so that 3rd
Party application may not confiuse while trying to consume service( writing
some custom code) . Press “Continue”

Ref : Fig 6


Press “Continue”

Ref : Fig 7


Choose as below setting

Ref : Fig 8


Press “Complete”. Now check this configuration tab like this :

Ref : Fig 9


Change the Authontication Level as “Low”

Ref : Fig 10


Trasnport Sceurity should be low

Ref : Fig 11

 


Now expose the service form SOAMANAGER..


Serach your service

Goto Configuration tab and create Button

Ref : Fig 12


Check Basic Authontication

Ref : Fig 13


Press Save Button .. End point URL has been created

Ref : Fig 14

 

Test the service


Open Web Service Navigator

Ref : Fig 15


First provide WS
Navigator credentials and then SOAMANAGER USER and PASS

Press Next

 

Fill the information and press Next

Ref : Fig 16

 

 

 

 

Check the export parametes Synchonous Communication. “The userbhati created successfully.”

Ref : Fig 17

 

Check the R3 table entry.

Ref : Fig 18

 


Please note ..
you can expose this service in service Registry. So that 3rd Party
application can directly consume this.

JDBC TO JDBC SYNCHRONOUS INTERFACE WITH RR BEANS AND WITHOUT BPM AND RFC LOOKUP

$
0
0


   This blog is regarding a synchronous scenario where we want to transfer bulk records from a database and push into SAP via a RFC and again get the response from SAP and update into the Database. But in SAP PI 7.1 we got an option to go with RFC Lookup to achieve this and to by-pass the BPM sync Async Bridge concept. But For Ex : we are having more number of DB inputs has to be given to the RFC as a request  and getting back some Response and to update again into the Database. But speaking for large no of inputs, RFC lookup is not the feasible approach to get with, as these increases the Design complexity and huge time consuming process. So with the help of Request Response Beans,which can be configured in Module Tab of an sender JDBC Adapter will solves the problem to achieve a synchronous scenario without BPM and without RFC lookup.

 

But when I searched on SDN, I got a link but it’s for File to File with this RR Beans but that needs some additional explanation for other scenarios also, So in our case(DB TO DB), I had created a Receiver JDBC channel only for getting the value from Sender Adapter and post the response back into the DB. Hope this approach is a not a new one, but unexplained briefly in SDN, so I believe it will be useful for developers as a good synchronous approach in the JDBC TO RFC synchronous scenario, as I had implemented this approach successfully and went Live and satisfied lot of Business users .Also I had highlighted the issues which I  had faced in my experience with this  and included the remedies also for that.

 

Design:

 

Our scenario is as below :

 

JDBC---------RFC------------JDBC (Synchronous)



Import the RFC into ur scenario and that has request and response parameters.

 

         1) Create DT for source and target JDBC structure (DT_RRBEANS_S) & (DT_RRBEANS_T).

2) Create MT for source and target JDBC structure (MT_RRBEANS_S) & (MT_RRBEANS_T).

3) Create SI (SI_RRBEANS_S) for Sender O/B, Synchronous and import the above MT’s (request and response)

4) Create SI (SI_RRBEANS_T) for Receiver I/B, Synchronous and import the RFC request and response messages.

5) Create a OM ( OM _RRBEANS)  and import the above Service Interface’s  O/B and I/B in that and then We have to create Req and Response Mappings.

 

Mapping:

 

Request Mapping: (MM_RRBEANS_REQ)

 

The Source structure is Sender DB Structure and Target is  RFC request fields.

 

Response Mapping: (MM_RRBEANS_RES)

 

The source structure is RFC response fields and Target is  Receiver DB Structure.

 

 

Activate all ESR objects.

 

----------------------------------END OF ESR------------------------------------------

 

Configuration:

 

1) Create a Configuration Scenario. CS_RRBEANS

 

2) Here I am creating a Business Service (BSER_RRBEANS) for Sender and using a Business system (BS_RRBEANS) for RFC RECEIVER.

 

3) Assign the Sender interface (SI_RRBEANS_S ) created above in the Business service.

 

4) Create a sender JDBC communication channel (CC_RRBEANS_JDBC_S).

 

5) Create the Receiver RFC communication channel (CC_RRBEANS_RFC_T)

 

6) Then Create Sender Agreement, Interface determination, Receiver Determination & Receiver Agreement.

 

 

Note: Here Sender channel represents the JDBC channel and Receiver channel represents the RFC Channel and not JDBC. But our scenario is JDBC to JDBC , so we are doing a JDBC to RFC interface ,then getting the response and posting into a Database with the help of another Receiver Virtual JDBC adapter configured with the help of REQUEST/RESPONSE BEANS in sender JDBC.

 

7) Now create a another Receiver JDBC communication channel (CC_RRBEANS_JDBC_T). and re-use the above Business service for this communication channel and assign the Receiver interface (SI_RRBEANS_T) in this Business service.

 

8) Request/Response Beans configurations in Sender JDBC channel :

 

Generally for any Sender JDBC adapter Module tab will be displayed as below screen shot.


 

 

Now in the Sender JDBC channel (CC_RRBEANS_JDBC_S), click on the Module Tab as below:



 

In the processing sequence “callSapAdapter” is the default Module name. So in additional to that we have to provide the two module names.

 

  1)   AF_Modules/RequestResponseBean                  Local Enterprise Bean        1

  2)   callSapAdapter                                                        Local Enterprise Bean         2

  3)   AF_Modules/ResponseOnewayBean                   Local Enterprise Bean         3 .

 

 

Note: Whatever module key used in the processing sequence should be given in the Module configuration. For convenience I had followed 1,2 and 3.

 



Also the adapter namespace is nothing but the SAP standard namespace which you can find in all communication channels.



 

But in the blogs explained already shown above doesn’t contains the adapterNamespace and adapterType as they are not mandatory, but PI throws a CPA cache error and some unidentified error if we miss out the above two parameters .So I got stuck here and unable to test this interface and after some time I came to know to include these two module names to overcome this issue. PFB Module config values for better understanding.

 

Here in our scenario :

Module Key Parameter Name Parameter Value

1                                         passThrough                        true

3                                        receiverChannel                   CC_RRBEANS_JDBC_T

3                                        receiverService                     BSER_RRBEANS

3                                       adapterNamespace                 http://sap.com/xi/XI/System( SAP Std Namespace)

3                                       adapterType                            JDBC (Based on scenario)

 

 

Note : So include all 5 Module names as specified with correct format as above, as all of them are case-sensitive. Even a single letter mistake leads to an error. In the parameter name, receiverChannel & receiverService are very important. Here I had taken the single Business service (BSER_RRBEANS) for both JDBC channels. But we can use different Services also.\

 

ID PART IS COMPLETED.

 

Now if we test the Interface and check in the sxmb_moni ,we will see two messages and in RWB we can able to see in the Audit Log as below.


 

 

 

 

 

 

From the above logs,we can able to see how our configured module parameters working in our interface and the significance of the Third Receiver JDBC channel which is getting the data and posting into the Database. Hope this approach will best suits for JDBC synchronous interfaces where more number of fields are involved in the sender.


 


Step by step document for Exchange Rate update in SAP using Java Mapping

$
0
0

Introduction:

 

    Currency Exchange rate interface running for every 24hrs,

    Every 24hrs the sender channel picks the dummy sender XML file from FTP and then it takes the currency exchange rate through URL  then send it to PI and update in SAP table in daily process.


Objective:


                This document is describe the step by step process of maintain the exchange rate information in SAP system.


Process Flow:

 

 

 

 

System Details


Source

Source System File

Exchange rate URL

Target

Target System SAP

 

 

 


Source


Source System File – System Details     

 


IP

  1. 111.22.111.111

Folder

/PI/Test/Currency/

User Name

SAPPI

Password

SAP

 

Source System File – Structure

 


Source Exchange rate URL Details


http://themoneyconverter.com/rss-feed/USD/rss.xml

 

Source System ECC – Structure



Target


Target System SAP– System Details



System

DEV

IP

111.111.222.11

System Number

00

Client

100

Table Name

ZGTFI_FM_DCURR

 


Target System SAP- Structure


PI Configuration:


Step to create ESR Configurations


Step1

                Go to menu  object->New, select Namespace, it should start with urn:  and next word should be relevant to the interface project.



Step2

                Create data type and enter the name of the type and select namespace and software component version.



Step3

                Select Add symbol below and insert the elements and define the data type.


Step4

                Need to import the RFC, which is created in ECC side, right click the imported objects and select import of SAP Objects.


In below screen enter the ECC IP address, system number, user name and password, click next.

Select the correct RFC name and click finish.  It import the structure of the RFC like below screen.


Step5

                Create message type for source and target data type like below screen shorts.


Step6

                Create service interfaces like below screen shorts


Step7

                Create imported archive and select the correct jar file, which handle the java mapping of the URL.                                  


Step8

                Create the operation mapping and select the correct inbound and outbound service interface, in mapping program select the correct java mapping file.

 


Step to create ID Configurations:



Step1

                Create configuration scenario, in menu New -> object set the name as P_RSS_RFC for group the all ID objects.



Step2

                Create business component for source and target system and define the meaning full name like below.

Step3

                In business component select the service interface which is created in ESR.


Step4

                Create the dummy sender communication channel


Step5

                Create the receiver communication channel for RFC:



Step6

                Create interface determination and assign Operation mapping, which is created in ESR.


Step7

                Create receiver determination and link the source and target system.


Step8

                Create sender agreement and assign the sender file communication channel like below.


Step9

                Create receiver agreement and assign the receiver JDBC communication channel like below.


 


Step10

                So final configurations is look like below in configuration scenario.

 



Code Appendix for Java Mapping:


package com.sap.pi.httpcall;

import java.io.BufferedReader;

import java.io.File;

import java.io.FileOutputStream;

import java.io.IOException;

import java.io.InputStream;

import java.io.InputStreamReader;

import java.io.StringReader;

import java.net.MalformedURLException;

import java.net.URL;

import java.net.URLConnection;

import java.text.Format;

import java.text.SimpleDateFormat;

import java.util.ArrayList;

import java.util.Date;

 

import javax.xml.parsers.DocumentBuilder;

import javax.xml.parsers.DocumentBuilderFactory;

import javax.xml.parsers.ParserConfigurationException;

 

import org.w3c.dom.Document;

import org.w3c.dom.Element;

import org.w3c.dom.Node;

import org.w3c.dom.NodeList;

import org.xml.sax.InputSource;

import org.xml.sax.SAXException;

 

import com.sap.pi.dto.CurrencyStatus;

 

public class HttpCall {

 

              

                public static void main(String[] args) throws IOException {

                                System.out.println("coming");

                                HttpCall callUrl= new HttpCall();

                                callUrl.readUrl();

                }

              

                public ArrayList<CurrencyStatus> readUrl()

                {

                                ArrayList<CurrencyStatus> currencyArr = new ArrayList<CurrencyStatus>();

                                try

                                {

                                int len=0;

                                CurrencyStatus currency=null;                  

                                String content="",allContent="";

                                URL url= new URL("http://themoneyconverter.com/rss-feed/USD/rss.xml");

                                URLConnection connection = url.openConnection();

                                len=connection.getContentLength();

                                System.out.println("coming1  "+len);

                                if(len>0)

                                {

                                                BufferedReader  input = new BufferedReader(new InputStreamReader(connection.getInputStream()));

                                                while((content=input.readLine())!=null)

                                                {                                                             

                                                                allContent += content;

                                                }

                                                input.close();

                                                System.out.println(allContent);

                                                currencyArr = this.xmlToTable(allContent);

                                                System.out.println("Currency Arr length  "+currencyArr.size());

                                }else{

                                                System.out.println("Content not available");

                                }

                                }catch(IOException e)

                                {

                                                e.printStackTrace();

                                }

                                return currencyArr;

                }

              

                private ArrayList<CurrencyStatus> xmlToTable(String xmlValue)

                {

                                Document doc=null;

                                CurrencyStatus currency = null;

                                ArrayList<CurrencyStatus> currencyArr = new ArrayList<CurrencyStatus>();

                                try

                                {

                                                doc = this.strToDocument(xmlValue);

                                                NodeList nodeList =doc.getElementsByTagName("item");

                                                System.out.println("item node length"+nodeList.getLength());

                                                for(int i=0;i<nodeList.getLength();i++)

                                                {

                                                                currency = new CurrencyStatus();

                                                                Node node=nodeList.item(i);

                                                                if (node.getNodeType() == Node.ELEMENT_NODE) {

 

                                                                                //Get title element

                                                                                Element element = (Element) node;

                                                                                NodeList nodelist = element.getElementsByTagName("title");

                                                                                if(nodelist.getLength()>0)

                                                                                {

                                                                                                Element element1 = (Element) nodelist.item(0);                                                                                             

                                                                                                //System.out.print("title : " + element1.getChildNodes().item(0).getNodeValue());

                                                                                                currency.setTitle(element1.getChildNodes().item(0).getNodeValue());

                                                                                }

 

                                                                                //Get like element

                                                                                Element element2 = (Element) node;

                                                                                NodeList nodelist1 = element2.getElementsByTagName("link");

                                                                                if(nodelist1.getLength()>0)

                                                                                {

                                                                                                Element element3 = (Element) nodelist1.item(0);

                                                                                                currency.setLink(element3.getChildNodes().item(0).getNodeValue());

                                                                                                //System.out.print("    link : " + element3.getChildNodes().item(0).getNodeValue());

                                                                                }

 

                                                                                //Get guid element

                                                                                Element element4 = (Element) node;

                                                                                NodeList nodelist2 = element4.getElementsByTagName("guid");

                                                                                if(nodelist2.getLength()>0)

                                                                                {

                                                                                                Element element5 = (Element) nodelist2.item(0);

                                                                                                currency.setGuid(element5.getChildNodes().item(0).getNodeValue());

                                                                                                //System.out.print("   guid : " + element5.getChildNodes().item(0).getNodeValue());

                                                                                }

 

                                                                                //Get pubDate element

                                                                                Element element6 = (Element) node;

                                                                                NodeList nodelist3 = element6.getElementsByTagName("pubDate");

                                                                                if(nodelist3.getLength()>0)

                                                                                {

                                                                                                Element element7 = (Element) nodelist3.item(0);

                                                                                                //currency.setPubDate(element7.getChildNodes().item(0).getNodeValue());

                                                                                                Format formatter1 = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss Z");

                                                                                                Format formatter = new SimpleDateFormat("yyyyMMdd");

                                                                                                currency.setPubDate(formatter.format((Date)formatter1.parseObject(element7.getChildNodes().item(0).getNodeValue())));

                                                                                                

                                                                                                //System.out.print(" pubDate : " + element7.getChildNodes().item(0).getNodeValue());

                                                                                }

 

                                                                                //Get description element

                                                                                Element element8 = (Element) node;

                                                                                NodeList nodelist4 = element8.getElementsByTagName("description");

                                                                                if(nodelist4.getLength()>0)

                                                                                {

                                                                                                Element element9 = (Element) nodelist4.item(0);

                                                                                                currency.setDescription(element9.getChildNodes().item(0).getNodeValue());

                                                                                                //System.out.print("  description : " + element9.getChildNodes().item(0).getNodeValue());

                                                                                }

 

                                                                                //Get category element

                                                                                Element element10 = (Element) node;

                                                                                NodeList nodelist5 = element10.getElementsByTagName("category");

                                                                                if(nodelist5.getLength()>0)

                                                                                { 

                                                                                                Element element11 = (Element) nodelist5.item(0);

                                                                                                currency.setCategory(element11.getChildNodes().item(0).getNodeValue());

                                                                                                //System.out.println("   category : " + element11.getChildNodes().item(0).getNodeValue());

                                                                                }

                                                                                currencyArr.add(currency);

                                                                }                                                             

                                                }

                                }catch(Exception e)

                                {

                                                System.out.println(e.getMessage());

                                }

                                return currencyArr;

                }

              

                public Document strToDocument(String xmlVal)

                {

                                Document doc=null;                      

                                try

                                {

                                                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

                                    DocumentBuilder builder = factory.newDocumentBuilder();

                                    InputSource is = new InputSource(new StringReader(xmlVal));

                                    doc = builder.parse(is);                                            

                                }catch(IOException e)

                                {

                                                e.printStackTrace();

                                } catch (SAXException e) {

                                                e.printStackTrace();

                                } catch (ParserConfigurationException e) {

                                                e.printStackTrace();

                                }

                                return doc;

                }

 

}

 

 

 

package com.sap.pi.httpcall;

 

import java.util.ArrayList;

 

import com.sap.aii.mapping.api.AbstractTransformation;

import com.sap.aii.mapping.api.StreamTransformationException;

import com.sap.aii.mapping.api.TransformationInput;

import com.sap.aii.mapping.api.TransformationOutput;

import com.sap.pi.dto.CurrencyStatus;

 

public class HttpCallMapping extends AbstractTransformation {

 

                /**

                 * @param args

                 */         

                @Override

                public void transform(TransformationInput in, TransformationOutput out)

                                                throws StreamTransformationException {

                                ArrayList<CurrencyStatus> currencyArr = new ArrayList<CurrencyStatus>();

                                StringBuilder xmlValue = new StringBuilder();

                                String rate = "";

                                try

                                {

                                getTrace().addInfo("JAVA Mapping is Initiated");

                                HttpCall call = new HttpCall();

                                currencyArr = call.readUrl();

                                xmlValue.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns0:ZGTFI_FM_CURR xmlns:ns0=\"urn:sap-com:document:sap:rfc:functions\"> <GT_TCURR>");

                                for (CurrencyStatus currencyStatus : currencyArr) {

                                                xmlValue.append("<item>");

                                                xmlValue.append("<KURST>M</KURST>");

                                                xmlValue.append("<FCURR>"+currencyStatus.getTitle().substring(4,currencyStatus.getTitle().length())+"</FCURR>");

                                                xmlValue.append("<TCURR>"+currencyStatus.getTitle().substring(0,3)+"</TCURR>");

                                                xmlValue.append("<GDATU>"+currencyStatus.getPubDate()+"</GDATU>");

                                                rate = currencyStatus.getDescription().substring(currencyStatus.getDescription().indexOf("= ")+1,currencyStatus.getDescription().length());

                                                rate =rate.trim().substring(0,rate.trim().indexOf(" "));

                                                //this code should remove

                                                if(rate.length()>9)

                                                {

                                                                rate = rate.substring(0,4);

                                                }

                                                xmlValue.append("<UKURS>"+rate+"</UKURS>");

                                                //xmlValue.append("<description>"+currencyStatus.getDescription()+"</description>");

                                                xmlValue.append("<FFACT>1</FFACT>");

                                                xmlValue.append("<TFACT>1</TFACT>");

                                                xmlValue.append("</item>");

                                }

                                xmlValue.append("</GT_TCURR></ns0:ZGTFI_FM_CURR>");

                                out.getOutputPayload().getOutputStream().write(xmlValue.toString().getBytes("UTF-8"));

                                }catch(Exception e)

                                {

                                                getTrace().addWarning("Error in Mapping ", e);

                                }

                              

                }

 

}




Different from other blog:


      From URL through AXIS adapter


Michal's PI tips: Exchange Rates from an XML file on a web page - REST, AXIS


 

Best Regards,

Monikandan.

Working with cXML

$
0
0

Introduction:

cXML (commerce eXtensible Markup Language) is a protocol, created by Ariba in 1999, intended for communication of business documents between procurement applications, e-commerce hubs and suppliers. cXML is based on XML and provides formal XML schemas for standard business transactions, allowing programs to modify and validate documents without prior knowledge of their form. Each cXML document is constructed based on XML Document Type Definitions (DTDs). Acting as templates, DTDs define the content model of a cXML document, for example, the valid order and nesting of elements, and the data types of attributes.

You can find more information on cXML at www.cxml.org

How to obtain the cXML DTD:

All the versions of cXML DTD’s are present in the cxml.org website. Please see the table below for details:

Document

DTD

Basic cXML documents

http://xml.cXML.org/schemas/cXML/<version>/cXML.dtd

Confirmation and Ship Notice

http://xml.cXML.org/schemas/cXML/<version>/Fulfill.dtd

Invoice

http://xml.cXML.org/schemas/cXML/<version>/InvoiceDetail.dtd

Type Definition

http://xml.cXML.org/schemas/cXML/<version>/Catalog.dtd

Payment Remittance

http://xml.cXML.org/schemas/cXML/<version>/PaymentRemittance.dtd

 

Example:

I need version 1.2.011 in my project, so to get all the details I need to use the URL’s below:

Document

DTD

Basic cXML documents

http://xml.cXML.org/schemas/cXML/1.2.011/cXML.dtd

Confirmation and Ship Notice

http://xml.cXML.org/schemas/cXML/1.2.011/Fulfill.dtd

Invoice

http://xml.cXML.org/schemas/cXML/1.2.011/InvoiceDetail.dtd

Type Definition

http://xml.cXML.org/schemas/cXML/1.2.011/Catalog.dtd

Payment Remittance

http://xml.cXML.org/schemas/cXML/1.2.011/PaymentRemittance.dtd

 

Use any tools to convert the DTD into an XSD

In SAP PI, Import the XSD as an External Definition in the required namespace. I have imported it as cXML_1_2_011

Image 1.png

Image 2.png

When choosing the message in message mapping, choose cXML.

Disable nodes that you are not using in the mapping.

Image 3.png

 

 

When selection the Operation Interface choose cXML

 

Image 4.png

Image 5.png

 

The rest of the steps for building the interface are the same…

References:

  1. www.cxml.org

AXIS receiver channel - module configuration

$
0
0

Please pay attention when setting up the AXIS receiver communication channel in the Integration Builder tool, regarding the order of the modules in the module processor.

Adding Modules in the Axis SOAP Adapter:

 

  • Own modules
  • AFAdapterBean (boundary)
  • HandlerBean (Axis)
  • HandlerBean (own handler)
  • HandlerBean (Axis, pivot handler)
  • HandlerBean (own handler)
  • HandlerBean (Axis)
  • AFAdapterBean (boundary)
  • Own modules

 

If the order is different, you might experience some errors as discribed in the following Knowledge Base Articles:


SAP PI – RabbitMQ AMQP 0-9-1 integration

$
0
0

The Advantco AMQP adapter for SAP Netweaver now supports integration with RabbitMQ. This cheatsheet explains how to configure the AMQP channels to send or to receive messages to/from RabbitMQ. To integrate with RabbitMQ thru SAP PI, select AMQP 0-9-1 as Message Protocol.


pic 2.jpg


For AMQP 0-9-1, follows the following queue/topic syntax:


1. For sender adapter: Assume that the adapter consumes messages from queue Q: In AMQP 0-9-1, to identify a queue, we need declare a binding from an exchange to that queue. There is no other way to directly use the queue name only. So: - If you already have had a direct exchange E that binds to queue Q with routing key K, then you can enter direct://E/K/Q into the Queue/Topic field. General syntax is direct://// - Or you can simply enter the queue name (Q) into the Queue/Topic field, then the adapter automatically creates a binding from the built-in direct exchange amq.direct to queue Q using the queue name as routing key.


pic 3.jpg


2. For receiver adapter: Assume that the adapter publishes messages to queue Q: In AMQP 0-9-1, messages must be directly published to exchanges; the messages are then routed to target queue via routing key. So please enter the following into the Queue/Topic field: - If you want to publish messages to direct exchange E that binds to queue Q with routing key K:direct://E/K - If you want to publish messages to topic exchange E that binds to queue Q with routing key K:topic://E/K - If you want to publish messages to fanout or headers exchange E that binds to queue Q: fanout://E headers://E


pic 4.jpg


You can refer to http://www.rabbitmq.com/tutorials/amqp-concepts.html for explanations of exchange concepts.

Making SAP PI Monitoring easy

$
0
0

This blog lists some of the enhancements that we have implemented to make SAP PI monitoring as easy as possible. The goal is to provide a monitoring tool that first level support staff would be able to use to guarantee that daily operations are running smoothly properly.

 

1. Interface related errors displayed in a central screen with all relevant information for troubleshooting purposes. Support user does not need to logon into different systems to monitor interfaces thru SAP PI.

         pic 1.png

 

Predefined Payload for most important fields. These predefined fields can be included in the alert email.

pic 2.png

 

Access to BD87 to retrieve IDOC payload and status information. The tool will displayed outbound and inbound IDOC errors on the ECC back-end systems. From the PI Monitor, the user can reprocess failed IDOCS or proxies on the ECC back-end systems.

pic 3.png

 

2. Simple alert setup for different kind as process exceptions. Alerts can be set on interface level or on interface group level.

pic 4.png

 

Alerting in case interface did not run as expected for a define time interval. This is a very useful feature to alert business in case critical files are missing.

pic 5.png

 

Alerting in case interface performance is degrading.

pic 6.png

 

Alerting can be prioritized or suppressed, for example, temporal web service call errors do not need to generate unnecessary alert every time.

pic 7.png

 

Alerting in case a job is cancelled as these jobs may be critical for triggering a specific interface.

pic 8.png

 

Alerting for ABAP and JAVA queues. The JAVA queue monitoring is very helpful to send our alerts when channels are hanging with “DELIVERING” status.

pic 9.png

 

3. Allow business users to monitor their own processes. Business objects information could be configured to display in the PI Monitoring tool. Associated transaction can be linked to a business object.

pic 10.png

 

Summary: Monitoring SAP PI interfaces is a time consuming and complex task, this Advantco PI Monitor tool tries to hide some of these complexities and to automated manual tasks.

"PutPayloadValueBean" - not only for Synchronous Communications !!

$
0
0

With PI 7.3 SAP has introduced new modules GetPayloadValueBean, PutPayloadValueBean and RemovePayloadValueBean. The modules usage is recently described by Beena ThekdiInsert value from Request message to Response message using GetPayloadValueBean and PutPayloadValueBean

The focus of this blog is to explain some new use cases of PutPayloadValueBean. As per SAP help: Adding PutPayloadValueBean in the Module Processor - Adding Modules to the Module Processor - SAP Library


"Use PutPayloadValueBean to enrich the message with values from a module context. You can use this module in combination with GetPayloadValueBean to enrich a response message with information from the request. Normally you use GetPayloadValueBean to extract values from a message, then execute an adapter module (example, synchronous SOAP call) and finally use PutPayloadValueBean to enrich the response with stored values"

 

 

Although, in SAP help it is described that PutPayloadValueBean can be used in combination with GetPayloadValueBean in case of synchronous communication interfaces, we can still use this module in asynchronous communications with below explained use cases

 

 

Case 1: Pass some static value "PutThisValue" to xml field /ns0:root/field. The trick is to use double quotes "" to treat it as a string rather than as a variable from module context

 

ModuleTypeModule Key
AF_Modules/GetPayloadValueBeanLocal Enterprise BeanPayload
Module KeyParameter NameParameter Value
Payloadput:/ns0:root/field"PutThisValue"
Payloadxmlnsxmlns:ns0 = "http://yourxmlnamespaces"

 

 

 

Case 2: Pass some static value but with xml fields "<Name>Praveen Gujjeti</Name><Company>IBM</Company>" to xml field /ns0:root/field. This way we can enrich basic xml structure at module level using this module

 

ModuleTypeModule Key
AF_Modules/GetPayloadValueBeanLocal Enterprise BeanPayload
Module KeyParameter NameParameter Value
Payloadput:/ns0:root/field"<Name>Praveen Gujjeti</Name><Company>IBM</Company>"
Payloadxmlnsxmlns:ns0 = "http://yourxmlnamespaces"

 

Check results yourself

Hope this information help for your integration requirements

 

 

 

- Praveen Gujjeti

Troubleshooting adapter module JCo RFC calls

$
0
0

Many a times we have adapter modules ( AM ) which in turn do a RFC call to ABAP stack of the XI system to retrieve information. This can be handy to make a generic AM that can be plugged in for multiple interfaces.

As an example, if we already have a text file with idoc data in plain text format, the adapter module can be used to convert this data into idoc format. The ABAP stack FM can be created to inquire idoc metadata information in IDX2 and use it to create the idoc structure.

 

 

1.png       


The different steps are as follows:

1.This step shows the data being processed in the module chain. It’s represented in hex format for the message. So, if we have a text file with content “hello” -               the message will be “68 65 6c 6c 6f”.

 

2.The message is entering the module chain. It can be after reading the file for a sender FTP adapter if this is the first module or after another module call e.g. for code page conversion.


 

2.png

 

 

 

 

3.As part of the adapter module processing, a RFC call is made using Java Connector ( JCo ) with the message and other parameters. These will be adapter module parameters.

 

4.The returned message is idoc data in hex format of the XML stream.

 

 

5.The message is leaving the adapter module.

 

6.The data is in hex  for the idoc. To make it simple, if the idoc data is “<hello>” the message here is “3c 68 65 6c 6c 6f 3e”.

 


In the above diagram, the module parameters are sent to the RFC function module in text format though the message data will be hex.

 

 

3.png

 

Link: http://help.sap.com/saphelp_nw04/helpdata/en/9a/20e23d44d48e5be10000000a114084/content.htm

 

With all the above theoretical knowledge, let’s create a simple Java program that can aid in troubleshooting.Pre-requisite Libraries to be added to our project:


1. Google Guava :

Get it from here - http://code.google.com/p/guava-libraries/


2. JCO libs

Get it from service marketplace.


3. Create a jar with the property file: I’ve provided a sample property file. It has the details to make us connect to the host, authenticate



Files to be created:


1. Props.properties : to store connection / authentication details so that it’s easy to change the target instead of hardcoding the values in the program.


2. PropHelper.java : Helper class to read properties file.


3. simulateRFCBean: This is the main class – it’s used for reading the file and making the JCo RFC call.

 


The steps will be:

 

1.Check the function module for parameters of type IMPORT (or ask your friendly ABAP colleague about the function module.)

 

4.png

This FM requires two parameters:

SOURCE (the message sent as hexadecimal stream).

SNDPRN (This is a just normal text)

The names won’t have to necessarily match as within the module, we map parameter ‘partner’ to ‘SNDPRN’ for the RFC call.

 

 

 

2.Map the data types to Java using the table mentioned above.

 

Looking at the function module and the data mapping, we’ll need to

 

a) Convert the file contents to a hexadecimal string ( byte array in Java )

b) Send the sending system as a string ( String in Java )

 

3.With the above information, it’s straight forward to create the Java program.

a)Read the JCO properties – PropHelper.java is a helper class to help read these properties instead of hardcoding in the program.

 

b)Read the file to be checked and convert to byte array.

byte[] fileData = Files.toByteArray(new File("C://temp//bad3.txt"));

 

-      Do the necessary JCO Set up, set the parameters to be supplied for the RFC call


       function.getImportParameterList().setValue("SOURCE",fileData);

       function.getImportParameterList().setValue("SNDPRN","TESTSENDER"); 

and finally, make the call.

    

       function.execute(destination)

 

 

Now with the set up done, we’re able to replicate the error scenario.

 

The issue on the communication channel log indicated.

5.png

 

Using this program, we’re able to replicate the failure.

 

6.png

 

For debugging on ABAP, an external break-point needs to be set up in the called function module.

 

7.png

 

Some of the error scenarios we encountered:

  • Bad data – new line appearing in the message.
  • IDX2 configuration missing for the unique message combination - existing for the basic type and an extension.


However, once we’re able to simulate the failure and debug the issue, finding the resolution is much easier.

 

Sourcde code link : https://github.com/viksingh/SimulateRFCCalls

Filtering records in PI message mapping based on a condition

$
0
0

Hi,

 

I recently had a requirement where I had to filter a set of records based on a condition. Lets take an example,

Input recrods:

InvoiceNumber     SystmeID     Supplier     Amount

123                     A1               SUPP1     100

1234                   A1               SUPP2      200

1345                   A1               SUPP3      300

1323                   A2               SUPP3      500

1236                   A2               SUPP1      400

 

From the above records(input message) I had to filter all records were Supplier is 'SUPP3' and that to where SystemID is 'A2'. So, the output of the mapping should be:

Output records:

InvoiceNumber     SystmeID     Supplier     Amount

123                     A1               SUPP1     100

1234                   A1               SUPP2      200

1345                   A1               SUPP3      300

1236                   A2               SUPP1      400

 

 

Input and Output Message structure:

MT_INVOICE

     row    

          InvoiceNumber

          SystemID

          Supplier

          Amount

 

Solution:

This can be handled in PI message mapping using standard functions as given below.

Logic: Dont create the 'row' node if it satisfies given condition ( SystemID = 'A2' and Supplier = 'SUPP3')

Node Function to be used 'CreateIf'.

 

Note: Message Mapping screen shot attached.

Remove duplicate records in message mapping

$
0
0

Issue Statement: If there are duplicate records(identified by key field) in a message, send only one record to target system.

 

Input & Output Message Structure:

 

MT_Vendor

     row

          SupplierNumber

          Field1

          Field2

          ....

          ....

 

Logic: Create 'row' node only once for duplicate records. Suppress the other duplicate records.

 

Solution: Create a simple UDF, to suppress the subsequent duplicate records. I got the UDF code from SDN, when I was implementing the logic for a project

 

Message mapping:

 

Duplicate_Mapping.png

 

UDF_Signature.png

 

 

UDF Code:

 

for (int i = 0; i < input.length; i++) {

    int found = 0;

    for (int j = 0; j < i; j++) {

       if (input[i].equals(input[j]))

{

          found = 1;

          break;

      }

    }

    if (found > 0) result.addSuppress();

    else result.addValue(input[i]);

}

Remove line feed (or) CRLF from text fields

$
0
0

Issue Statement: Remove line feed/CRLF from text fields.

 

Issue:If the input text field has line feed/CRLF, then data gets shifted to subsequent fields in mapping, hence creating wrong target data.

 

Logic: Remove line feed/CRLF from the text

 

Solution: Create a simple UDF to remove line feed/CRLF

 

UDF Signature:

 

UDF_Signature.png

 

UDF Code:

String Input_Text1 = null;

String Input_Text2 = null;

Input_Text1 = Input_Text.replaceAll("\\n", "");

Input_Text2 = Input_Text1.replaceAll("\\r", "");

return Input_Text2;

 

Note: I am not a great Java coder . You can use a single String field instead of using two String fields, as I did.


Connecting with Non-SAP system using IDoc Adapter without any changes to SLD

$
0
0

Below content explains you

  1. How to configure a pass through interface in PI
  2. How to connect to Non-SAP system using IDoc adapter in PI

 

Data flow:

 

In this scenario, we are sending IDoc data from SAP system to Non-SAP system via SAP PI using IDoc adapter at the receiver end. To receive IDoc

 

message from SAP system, we don't need any adapter.

image 1.jpg

 

Pre-Requisites:

1. Non-SAP system should be able to implement IDOC_INBOUND_ASYNCHRONOUS function module to read the IDoc message.

How to implement this at Non-SAP system is out of context for this document.

 

 

Objects needed in PI:

  1. Business Service for Non-SAP system
  2. Business System for SAP system (Imported from SLD)
  3. Receiver determination
  4. Interface determination
  5. Receiver agreement
  6. IDoc channel
  7. Configuration Scenario (optional)
  8. IDoc (optional if you know the message type, extension and IDoc type) No other respository objects needed.

 

 

  1. Business Service for Non-SAP system

[Other blogs/threads in SCN explains you the scenario by using the Business system for Non-SAP system. Here without making any changes to SLD for representing Non-SAP system and importing business system into ID, replicated the same scenario.]

 

            Create Business Service

            Change to edit mode

Go to Communication Component --> Adapter specific identifiers

Add Logical system to identify Business Service uniquely. [No need to create LS in system, just define here a unique LS. In general, for SAP systems, we give LS in SLD and when we import B.System for SAP system LS will copied to here automatically. Since it is B.Service, we are inputting manually. If you try to give any existing LS, you'll get an error and can't save the object.]

 

image 2.jpg

 

Adding Logical System is mandatory, otherwise you'll get below error during run-time.

"Receiver service XXXXXX cannot be converted into an ALE logical system".

image 3.jpg

               2. Business System

   

Import Business System for SAP system from SLD.

 

image 4.jpg

3.   Receiver determination

 

Create Receiver determination object

 

      image 5.jpg

image 6.jpg

          4.     Interface determination

   

Since it is a pass-through interface, we can just use sender interface as receiving interface. For this, no need to create objects. We can just copy paste the name of interface i.e. IDoc name here. (In general for building pass through interfaces, we can give some dummy names also)

 

image 7.jpg

          5. Receiver Agreement

 

Create Receiver agreement with dummy interface or same as sender interface for pass-through scenario.

 

image 8.jpg

               6. IDoc channel (as a receiver adapter)

 

            Create IDoc channel for Non-SAP system.

RFC Destination - This is to connect with Non-SAP system. Create a working RFC connection for Non-SAP system and use here.

Port - To load IDoc metadata. You can manually copy metadata from SAP system to a dummy port and give that here.

 

image 9.jpg

 

 

Testing the interface:

 

Message sent from SAP

 

image 10.jpg

 

Message in PI

 

 

image 11.jpg

 

 

 

 

Message at Non-SAP system

 

image 12.jpg

 

 

Please write to me if need any more details on this blog content or any further help on this scenario.

 

Thanks

Sasidhar Gupta

Problem with Cache while activating WS-RM receiver Agreement

$
0
0

I recently involved in WS integration for CRM with third party web services using WS-RM. The scenario is CRM is sending synchronous request to PI from Proxy using WS, PI receive the message, transform the message and call the third party web service. With WS-RM configuration the same user who triggers the request from CRM web UI will pass to target web service (with Security Assertion Markup Language (SAML)) and web service will invoked with the same
credential.

 

Scenario

 

PROXY to Web Service

 

  1. Synchronous scenario

  Sync scenario.JPG

  1. Asynchronous scenario

  Async scenario.JPG

Error while activating the receiver agreement: Cache issue while updating the Integration server (ABAP Cache) Problem while updating a receiver agreement with object ID XXXXXXXXXXXXXXXX. :Exception: Uninstantiated object

"subject sidl interface" inmethod

IF_SRT_WSP_CONFIG_SIDL_XI~CREATE_CLNT_CTX_FROM_WSD of class CL_SRT_WSP_CONFIG_SIDL  screen1.pngscreen2.pngscreen3.png  Possible root cause of the issue 

  1. Receiver interface namespace is not correct
  2. Receiver interface name is not correct
  3. Receiver interface operation name is not correct

 

Resolution: In WS scenarios we need to define the inbound interfacing objects, according to the WSDL. We need to check the target WSDL and find the receiver object details.

   

For example: If the WSDL is like

 

<wsdl:definitions
targetNamespace="
http://HOST/<product>/<service>/<version>">

 

The receiver interface namespace should be the target namespace in WSDL.

 

The receiver interface name should be the target service name and operation name should also be same.

 

After fixing this issue you can able to activate the receiver agreement in ID.

 

Hope this is help !!!

Integrating SFDC with ECC using SAP PI 7.31

$
0
0

SFDC is an on-demand CRM tool, based on Cloud Computing Concept. Cloud computing, is used to describe a variety of different types of computing concepts that involve a large number of computers connected through Internet. SFDC CRM is preferred as it is less expensive, supports easy upgrades, better Service Delivery and it is easier to customize. Integration of ECC and SFDC CRM required because it offers high reliability, high performance,
high security.

In our project requirement client has decided to use SFDC CRM solution. SAP PI is used as a Middleware to perform the ECC and SFDC integration. Multiple data integration was implemented:Product Master, Invoices, Vendor Master, Customer Master, Vendor Contract etc.


SFDC Inbound integration: In case of data needs to send from SFDC to ECC, the integration is similar to any other SOAP to ECC interface.

SFDC Outbound integration: In case of data is to be posted to SFDC from ECC, the integration is based on two way communication using Java Mapping, soap look up.

In this blog, the focus is on SFDC outbound integration.Let us first see how this entire process works using SOAP UI :


First step is to have 2 wsdl files, login wsdl and other data wsdl. Here we will see Product Master Data post. WSDL files can either be downloaded from SFDC site with valid credentials or client should provide you.

  1. First Create a project in SOAP UI, Call the login request, Set Login Credentials, Check target URL and execute it.

Login Request.jpg

   2. Response received from SFDC contains, server URL and session ID, which is required to embed in SOAP envelope while making the product master data call to SFDC.

Login Response.jpg

     3.Product Master Call: create a project in SOAP UI, call the Product Master Upsert request,set the Session ID, check target URL and execute.

Product Master Request.jpg

     4. If the data is posted successfully to SFDC CRM, the response received is true. Otherwise, there can be other response messages depending upon the error encountered like false or INVALID_SESSION_ID.

Response.jpg

 

Implementation Details (using PI 7.31) 

PI as middleware to send login request to SFDC, receive session ID and the preform required data update/insert call to SFDC system. Steps involved are:

ESR:

Import IDoc definition

Import Product Master WSDL provided by Salesforce as External Definition

Create Message Mapping with IDoc and Product Master external definition

Develop Java Mapping for

Login request Call using SOAP Look Up feature

Receive Session ID in Login response

Build SOAP Envelope around target message with the session id

Import the java mapping as Imported Archive

Create Operation Mapping - Use JAVA mapping subsequent to the IDoc to Product message mapping  as shown below:

OM.jpg

Operation mapping test can be performed to see how the SOAP envelope is added:

Step 1 Graphical mapping result:

MM1.jpg

Step 1 to 2 result :

MM2.jpg

For the SOAP Look up, one SOAP Receiver Login Channel is required.Here set the target url as that of login request url and set the SOAP Action as login. The Login SOAP receiver channel should be linked with a receiver agreement to make a call to SFDC system. Dummy Iflow should be created with
Login SOAP receiver channel and dummy interface.

CC1.jpg

Second SOAP Receiver channel is required to perform Product Master Data post call. Set the Target URL and SOAP Action, Check ‘Do not Use SOAP Envelope’ as we are building it dynamically using JAVA mapping and set the module MessageTransformBean with parameter Content Type : text/xml.

CC2.jpg

The runtime monitoring for SFDC interfaces is performed exactly similar to other interfaces, using channel and message monitoring.

 

Important Points while developing the SFDC interface:

PI development and quality server connects to Sandbox URL of Salesforce.com, whereas production server connects to different SFDC URL. Make sure to change the URL in Communication Channel post production transport.

 

For the Sandbox and production SFDC systems, the login credentials would differ. Make sure to update the user id and password in java mapping before transporting the objects to Production.

 

The SOAP action parameter defined in adapters is case sensitive. Make sure to specify the actions correctly.

 

If the Data is not successfully getting posted to SFDC, in such cases SOAP receiver adapter returns a generic 500 HTTP_EXCEPTION error.To debug the issue, copy the payload and trigger the data from SOAP UI to see the exact error description.

 

Here are some frequent issues which encounters error:

Invalid Session ID, Incorrect target address URL , Incorrect Login credentials ,Incorrect module configuration (sequence, parameter) in channel, Missing dummy Iflow for login request, Date format or data formants mismatch between PI and SFDC.

 

Java Mapping Reference llink : http://wiki.scn.sap.com/wiki/display/XI/SFDC+Integration+using+PI+7.1+-+How+to+add+SOAP+Envelope+in+Java+Mapping?original_fqdn=wiki.sdn.sap.com

Supporting a custom SAP PI Adapter

$
0
0

I want to share what’s been happening to me this few weeks, by the way I am a working on connecting SAP PI with Swift Alliance Access which uses a SOAP protocol that is not compatible with PI. The main reason is that the SOAP client has to ask for a session, get the message, process it, deliver the session and then close the session.

I have to develop the adapter because it would be the most stable solution. ccBPM could help but we had to many messages volume to be stabile. Monitoring with the ccBPM would not be easy either.

 

Some of the insights of its development process because we still develop it. I feel like New in The Matrix. I can bend the rules of the universe, or at least in PI.  I have to admit the process is a lot more challenging in the other hand in the custom adapter you can almost bend the universe and figure out how to move it and things as working as expected to be and that’s very helpful on some perspective because you are limitless to help make a better integration. The bad side would be the more durations you make the more complicated the product to develop and maintain them.

 

Some of the learnings I got for developing a customer adapter for previous clients. There I had a hard time figuring out how to develop the adapter framework, how to deploy the adapter, how to make RAR, SDA to make sure that this where deployable. So the second adapter you got this framework and start working on it and use it time after time. Starting from the sample adapter and then setup I got from my previous clients about developing costumer adapter. I was able to get a new adapter running in a couple days developing on a test system so I can assure that it is working smoothly. I work on it sometime getting the system up and running so we could be able to deploy, test the solution and quality testing and figure out if the process is correct and see if we can modify or fixed some bugs with the system because you have the flexibility so why not use it to make sure the PI development becomes as simple as possible and make it easy to anyone so that’s the things we are dealing with lately. In the beginning you can connect and make it work easily and then afterward you have all these fixes and correction making sure tiny bits work as they're supposed to be.

 

This video talks about my thoughts on the adapter support.

 

One of the big issues I have with this is supported. How can I leave the code in a good shape, to the client can maintain it the way he needs.

 

What support issues have you had when developing your adapter.

  • Is it just you want to just new functionality?
  • Is it bugged that occurs because of new use cases? One issue I experience on a previous project was with the MQ adapter. When I wanted to test if the MQ connection worked it left an open connection on the MQ server. I have to remove this.

 

So I need your ideas about this one "Do you see a lot of requiring support for extending the functionality of a custom build adapter?" If you have some ideas about this please share them in the comment section below and I we will discuss it further.

HANA Cloud Integration versus SAP PO

$
0
0

SAP HANA Cloud Integration (HCI) is a relatively new SAP cloud product. HCI is marketed primarily as Software-as-a-service. Standard integration content is delivered by SAP to integrate SuccessFactors, Ariba, SAP Financial Services and SAP Cloud for Customer with on-premise systems such as SAP ECC and SAP CRM. Within short notice, the HCI platform will also be released for development of custom integration scenarios (expected Q1 2014). The release of the platform for developments immediately raises the comparison with SAP Process Orchestration(PO). How does HCI compare with SAP PO?

 

Software-as-a-service

HCI is not the first product for which SAP provides standard integration content. The integration content offered by SAP for HCI can be viewed at www.saphanacloudintegration.com. SAP offers a lot of standard integration capabilities and content for e.g. SAP PO. For HCI however, not only standard content but also the management and monitoring of this integration content is offered by SAP. SAP is therefore responsible for the hosting, configuration and monitoring of integration scenarios. This involves a new service offering for which interaction with SAP customers is very important. It relieves the customer of hosting, configuration and monitoring of the integration environment. A huge difference with SAP PO where standard content offered must be hosted, configured, managed and monitored by the customer themselves.

 

Platform-as-a-service

The HCI platform will be released soon for custom integration developments. The HCI platform does not need to be managed and maintained. The monitoring of integration scenarios which are developed on HCI are though the responsibility of the customer. HCI offers a multi-tenant platform, making the separation between business units over separate tenants possible, a frequent struggle among customers within SAP PO because of the single-tenancy. Software updates will take place continuously, this is called a "rolling software update". The business down-time with upgrades and releases is near-zero with HCI. Within SAP PO upgrades and releases of the software means downtime for the business. With the latest releases this down-time is also reduced to near zero.

HCI currently offers a few connectivity options: SOAP, sFTP and IDOC. Authentication methods within HCI are certificate based. The capabilities are limited compared to SAP PO. HCI is a cloud product, therefore the vast majority of possible scenarios will be covered with the current capabilities of HCI. HCI is still undergoig strong developments and on short notice there will be a lot of new functionalities. HCI will become more mature and a broader integration product. The roadmap of HCI can be found here: SAP HANA Cloud Integration - Roadmap

 

Migration

There is no migration path from SAP PO to HCI. HCI is not natural growth path of an SAP PI server. HCI must be seen as a complete new product and not as the successor of SAP PO. It is though possible to reuse objects from SAP PI HCI. This concerns the java message service definitions and mappings.

 

Integration Scenarios

The integration capabilities of SAP PO are extensive, almost all scenarios can be supported. SAP PO supports A2A, B2B, mobile and many other scenarios and SAP PO has proven itself in these areas. As well fast user interaction as bulk processing scenarios can be implemented with ease within SAP PO. However, HCI is a new product with( still ) limited capabilities. HCI will be favourable for scenarios where volumes are not too large and no business logic or business rules are concerned. When Business Process logic is needed, SAP PO will be favourable.

 

With HCI implementation times of integration scenarios will be very low because of the cloud structure HCI. There are no initial installation guides and server configurations when HCI will be implemented. One just requests a server access by SAP and developments can start immediately. This is one af the advantages of a cloud product. The development of scenarios for HCI within Eclipse is very easy and is template based. This saves the developer a lot of time and will prevent a lot of common mistakes. An overview of HCI functionalities and how to develop your first scenario, take a look at SAP HANA Cloud Integration – SAP Help Portal Page.

For a quick overview of the differences between SAP PO and SAP HCI, I have taken a comparison from the roadmap slides which were presented at the TechEd by Udo Paltzer. This will give you a quick overview of the differences between SAP PO and SAP HCI.

 

 

 

SAP HCI or SAP PO?

Having made the comparison between SAP PO and SAP HCI we can try to answer the question; which product to use and when? Therefore I will try to answer the next few questions. These answers cannot be generalized or used without knowing the context of each integration scenario and must therefore be interpreted with care.

 

  • You are not using PO, implementing a SAP Cloud Product and want to integrate with on-premise SAP systems?
    Try to use the standard content of SAP HCI when available.
  • You are already using SAP PO, implementing a SAP Cloud Product and want to integrate with on-premise SAP systems?
    Try to use the standard content of SAP HCI when available.
  • You are using non-SAP middleware and implementing a SAP Cloud Product and want to integrate with on-premise SAP systems?
    Try to use the standard content of SAP HCI when available.
  • You need to develop custom integration scenarios?
    Consider SAP HCI. Evaluate the pros and cons of SAP HCI versus SAP PO.

 

What do you think of the comparison between SAP PO and SAP HCI. Please let me know by responding to this blog.

 

Best regards,

 

Fons



Viewing all 741 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>