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

Converting IDoc XML to Flat File and Vice-Versa

$
0
0

One fine day, one of my friends(who is new to PI) came to me and asked if we can convert any Idoc xml to Idoc flat file in SAP PI. At that time, I was sure that it could be achieved by using ABAP mapping because through ABAP mapping I can access and use the Idoc metadata which is loaded in Idoc cache IDX2. However, I wasn't sure if we have any standard way or I would say better and easy way to do it.

 

Therefore, I have searched if we can convert Idoc xml to Idoc Flat file or vice-versa in SAP PI without using ABAP mapping. At that time, I came across following two new standard adapter modules available from SAP PI 7.11 that we can use when we work with Idocs. It fulfils above mentioned requirement.

 

  1. IDOCXmlToFlatConvertor – Converts Idoc xml file to Idoc flat text file
  2. IDOCFlatToXmlConvertor – Converts Idoc flat text file to Idoc xml file

 

In this blog, I will explain how to use IDOCXmlToFlatConvertor adapter module and what is the pre-requisite setting needs to be done for it.

 

  1. Create a RFC destination.
  2. Create a JCA Connection Factory in NWA.
  3. Add the Parameters in the Module Configuration of receiver Adapter (here File Adapter).

 

 

Create RFC Destination from NWA:


     Create the RFC destination from NWA pointing to the SAP system where Idoc metadata (structure) is available.

     Go to Configuration --> Infrastructure --> Destinations


    1. Create a new destination of type RFC Destination:

          Provide all the required details such as:

 

Step 1Hosting SystemSAP PI SID
Destination NameAny self explanatory Name
Destination TypeRFC Destination
Step 2Target HostHost Name/IP Address
System No.As per ECC system
System IDAs per ECC system

Step 3

AuthenticationTechnical User
LanguageEN
ClientAs per ECC system
UserUser in  ECC system
PasswordPassword

 

 

RFC Destination Capture.JPG

 

Create a JCA Connection Factory in NWA:

 

Go to Configuration Management > Infrastructure > Application Resources.

 

  • Choose All JCA Resources from the Show field.
  • Under the Resource Name column, choose SAPJavaResourceAdapter15.
  • Under Resource Details, select Dependent JCA Connection Factories and Copy & Add new JCA Connection Factory.
  • Enter the JNDI Name.
  • Select and set the Configuration Properties.

 

Provide all the required details such as:

 

SAPClient, User, Password, Language, Server, Port (System No.)

 

JRA Configuration Capture.JPG

 

Create a Receiver Channel (File Receiver):

 

Go to Module Tab of Communication Channel.

     Add Adapter module with following details:

 

    • Module Name as SAP_XI_IDOC/IDOCFlatToXmlConvertor before the CallSapAdapter Module.
    • Module Type as Module Type as Local Enterprise Bean.
    • Enter the Module Key


     Add Parameters to Module Configuration as follows:

 

 

Parameter Name
Parameter Value
SAPRelease640/700/710
SourceJRAJRA created in Step 2
TargetDestinationRFC Destination created in Step1

 

CC Adapter Module Tab Capture.JPG

 

 

We have executed scenario where an ORDERS05 Idoc was sent to from ECC to SAP PI. Idoc was converted to Idoc xml by Idoc adapter and sent to IE.

Idoc xml Capture.JPG

 

We have received Idoc flat file once Idoc xml is passed through File Receiver Channel that we have configured.

 

Flat File Capture.JPG

 

In the same way one can implement IDOCFlatToXmlConvertor adapter module to get Idoc xml from Idoc flat file. Following are SAP help references.

 

Adding IDOCXmlToFlatConvertor in the Module Processor –

 

http://help.sap.com/saphelp_nw73/helpdata/en/74/A45BC07E2043FB9B63295229178903/frameset.htm

http://help.sap.com/saphelp_nwpi711/helpdata/en/74/A45BC07E2043FB9B63295229178903/frameset.htm

 

 

Adding IDOCFlatToXmlConvertor in the Module Processor –

 

http://help.sap.com/saphelp_nw73/helpdata/en/b5/bd93642dd3410f90ebea702399fac4/content.htm

http://help.sap.com/saphelp_nwpi711/helpdata/en/b5/bd93642dd3410f90ebea702399fac4/frameset.htm


How to Configure AXIS Framework for Authentication Using the "wsse" Security Standard in SAP PI

$
0
0

How to Configure AXIS Framework for Authentication Using the "wsse" Security Standard in SAP PI 

Introduction

You might be required to consume an interface exposed as a web service from a provider system using the receiver SOAP Adapter (SOAP/HTTP) connection. The provided service is therefore consumed via the provided soap endpoint.

In order to consume a service which requires “wsse” standard for authentication, there exists different options for implementing this. But in this blog, the focus is on the configuration of the “wsse” standard using the axis framework.

In “wsse” standard, a WS-SecurityUsername Tokenenables an end-user identity to be passed over multiple hops before reaching the destination Web Service. The user identity is inserted into the message and is available for processing at each hop on its path. The client user name and password are encapsulated in a WS-Security<wsse:UsernameToken>.

   image1.jpg                   

Figure 1: Structure of SOAP message with “wsse” header

Create Communication Channel: To use this functionality, the Axis framework and all the necessary jar files must have been deployed on the PI system. Below are the steps necessary to implement security in the header of the message.


a)      Create a communication channel, under the parameter tab, choose the adapter SOAP and tick the receiver button;

b)      Choose the transport protocol as HTTP (Axis) and message protocol axis is automatically inserted in that field.

c)      Enter the appropriate URL, and under XI Paramter, tick the XI header option and if a SOAP Action is required, enter the value for it.

  1.jpg

Figure 2: Receiver SOAP Adapter with AXIS message protocol

Axis Framework Configuration:In order to configure the Axis framework, switch to the module tab on the communication channel and enter the parameters shown in the screen below in the order specified in the screen.

Processing Sequence

ModuleName:  AF_Adapters/axis/HandlerBean

Type: Local Enterprise Bean

ModuleKey: wssec

Module Configuration

Module Key

ParameterName

Parameter Value

wssec

action

UsernameToken

wssec

Handler.Type

java:com.sap.aii.adapter.axis.ra.handlers.security.WSDoAllSender

wssec

passwordType

PasswordText

wssec

pwd.password

<enter password>=<enter password>

wssec

user

<enter username>

image003.jpg

Figure 3: AXIS module configuration for “wsse”

Note: the parameters name and parameters value are case sensitive, so care should be taken they are entered as described above, if not the Adapter engine will throw up an error when the communication channel is monitored from the runtime workbench

 

References:  For further references, please check the FAQ note 1039369

Variable Substitution for Directory or File name.

$
0
0

Hi Folks,

 

 

Today I have used this feature ,variable substitution ,in receiver file adapter. Although many of you might have already used it but I
have used this for the first time and found it very useful. So here are few of my  closely knit thoughts on this feature
which may help someone who is not aware of this.

 

Basically variable substitution can be used by selecting enable the variable substitution checkmark in receiver file adapter communication
channel.

 

The variable substitution is helpful in cases where your requirement is like If you want to specify variables in the target directory
and file name scheme, they must be enclosed by % characters.

 

 

To use variable substitution, enable as shown in the screenshot.

Untitled.jpg

Provide the file name scheme as Customer_ %Var1%.xml where in Var1 is dynamic value taken from the message.

 

  x.jpg


Make entries under Variable Name and Reference in the table

 

 

The variables can refer to attributes of the message header or elements of the message payload

 

 

For referring  elements of the message payload:

2.png
Where firstrootnode is first rootnode, numerical 1 indicate it is rootnode1, secondrootnode is the secondroot node belonging to the main node or first node.

 

 

The parser searches for the first occurrence of the root element at the first level.

It then searches for the first occurrence of the node at the second level and for the second occurrence of node at the third level.

 

 

If the variable refers to an attribute of the message header, add the prefix message: to the name
of the variable under Reference

 

You can specify the following attributes of the message header:

 

 

sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace.

 

 

These are standard attributes. To refer party, service, interface, you have to use as above.

 

 

For ex: if you want to access
party in the receiver file name, then you define some variable and then ask
that variable to refer to sender_party for sender.

 

 

For var1 , you have to write as

3.png

To disable the check the adapter performs for the element data, set the Disable Security Checks indicator.

4.png

Otherwise, the adapter checks whether the element data contains characters that could lead to security risks
in the file system environment. The check includes the characters “/“, “\“, and “..“.

 

Hope this provides some information about variable substitution in receiver file adapter.

Thanks,

Regards,

Amarnath

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Yes it is possible to dynamically define the name of file in Multimapping……………..

$
0
0

This scenario is extension of my  old scenario  that is defined in my old blog in which I define the Receiver Determination based on the  file name Condition, use of Context object, Use of CP(contain pattern )in receiver determination, use of Dynamic Configuration, Use of ASMA etc..

In this I come to situation in which after defining the condition in receiver determination I have to split the source message to multiple files, earlier I just post the single file without splitting.

 

So for splitting the files I use Multimapping. Here structure is same for receiver side but I need to create multiple files based on some condition. But the problem is that earlier we are using dynamic configuration and using same it is creating the common file name for all file so I come to following solution. This solution is specific to my scenario and customize according to your need.

In this for dynamic name of the file I use variable substitution functionality in tricky way I pass the name of the file in the first occurrence of row field in payload itself and then retrieve that value in communication channel using variable substitution that give the name to a file as require and the I create another flow which read that file again and use FCC feature to remove the first row using Document offset…….

 

Caution:  In this blog I am not define how to split the file using udf in Multimapping

Let’s start with receiver determination Condition from where that scenario comes into picture:

In this I need to send the files to two systems based on the file name one is SAP and another is Oracle system. In Oracle system I need to filter the record so there I am using Multimapping.

 

 

My massages mapping is look like below: 

 

 

 

In mapping I use dynamic configuration code to get the source file name and pass that name to the first occurrence of the row field.

 

 

 

Here I am passing constant for testing in mapping like below

 

 

And the first record is come like that:

 

 

 

Now come to interface determination: in this occurrence or target message is 0 to unbounded

 

 

 

In receiver CC I am using variable substitution and define the file name as below:

 

 

FCC as below:

 

 

Variable substitution as below:

 

 

 

Using this I place the file with dynamic name that is defined in the first occurrence of the row. Now our task is to remove that value in the file. So for that I create another floe (file to file scenario without mapping). Using FCC option “document offset” I just remove the first row. As below:

 

 

Here also I set the ASMA parameters for the same file name at receiver side:

 

 

 

In receiver also I set the ASMA property and use same FCC parameter

 

 

 

All other configuration for that flow is simple without mapping just transferring file one folder to another and use of FCC is same define in my old blog.

 

 

  1. Hope You enjoyed this………………………J

Enumeration in PI 7.1

$
0
0

ENUMERATION in SAP PI 7.1

 

Issue:While consuming a Web service that is provided by SAP PI  7.1/7.0, external application program that consumes the web service need to get  the values for particular field restricted with list of values. 

For  example: For Country_Code field in outbound structure I need restricted 20  country codes (where my business is operative) and I want Country_Code field  value to be in CAPs. Like IND, USA, AUS etc… 

Consider  creation of a customer in External System, and it is using web service generated  by SAP PI, and updating customers in SAP ECC. The user must select only  restricted company code values or a reconciliation account provided in the drop  down as per their company. 

In  order to achieve this feature, PI 7.1/7.0 has provided us with data type  enumeration in XSD Editor while creating Data Types. 

Enumeration 

Definition: The most abstract definition of an enumeration of a  set is an exact listing of all of its elements (perhaps with repetition). 

  1. W.r.t  SAP PI, enumeration restricts the value range to a set of individual areas .The  values must be separated by blanks or commas in the XSD Editor. 

Implementation of enumeration in PI: 

We  Implement Enumeration in “Data type” level under Details column in the XSD  editor or simply press the button provided in the XSD Editor. Data type  enumeration is given below. 

  1. Data Type FiledàDetails à   enumeration.  

At  the corresponding field level select the details column wherein enter the  required enumerated values separated by a space or a comma as below. 



1.png
 
  
  2.png
 

  

Once    we consume web service generated on this data type Company_Code field will shows    a drop down list that holds enumerated values i.e. the restricted values are    displayed as follows:   


3.png
  

Here  we have used Microsoft InfoPath as  Web Client. 

4.png

  

drop down list is appeared with all restricted filed values for  selection by using Enumeration in SAP PI 7.1

Handling Referenced XSDs in SAP PI

$
0
0
Handling Referenced XSDs in SAP PI
This objective of this guide snippet is to provide a detailed implementation of handling referenced XSDs in SAP PI.
Issue: When we get the XSD nested structure / zipped file, we would need to reference the main XSD to its nested sub structures to use their corresponding fields in the main object.
  1.PNG
  
Above screenshot refers to the main document (zip file) given by the client
The References are as below:
"IAXSAPVendVendTable_IAXSAPVendVendTableServiceupdate_main_v4"references "entityKeyList"
and
"IAXSAPVendVendTable_IAXSAPVendVendTableService.update_v4"
Again entityKeyListreferences entityKey
2.PNG
Above screenshot refers to its referenced structure within in the zipped file.
 
3.PNG
Above screenshot refers to the main document:
“IAXSAPVendVendTable_IAXSAPVendVendTableService update_main_v4”
which has the reference of “entityKeyList” and “IAXSAPVendVendTable_IAXSAPVendVendTableService.update_v4” files.

Again XSD structure “entityKeyList” has a
referenced structure “entityKey” as shown in the screenshot below.

4.PNG
   Below steps depict the creation of necessary objects in ESR:


Step 1: First create the Orphan substructures which doesn’t have any referenced structure.


Create an external definition   : “VendorUpdate_entityKey”
5.PNG
While importing the XSD substructure, ensure you give the imported file name in the “Source” field.


Step2: Now create the parent /referenced object   “VendorUpdate_entityKeyList” as shown below:
6.PNG

 

In the referenced tab, please give the referenced XSD file name (in this case it is entityKey.xsd)



Note: As, we need this XSD to be referred in the main document, copy the file name under “Source”



Step 3: Create external definition VendorUpdate_V4, our second orphan XSD by importing

 

IAXSAPVendVendTable_IAXSAPVendVendTableService.update_v4.xsd file from folder location which is referenced by the main XSD structure.

 

7.PNG

 

Copy the same name and paste in the Source i.e. IAXSAPVendVendTable_IAXSAPVendVendTableService.update_v4.xsd
as per the referred screenshot below.

 

Step 4 :

Now import the main XSD using an external definition (parent node) named VendorUpdate_Main_V4 and import the corresponding zipped file referred in screenshot 1.

   

The referenced XSD substructures are referred in the below screenshot.

 

9.PNG

Now we can view the referenced structures and their corresponding fields below.

10.PNG

All the corresponding referenced fields now appear.

Finding com.sap.guid.IGUID (or any other class) on the PI Server

$
0
0

I have had a really hard time finding the jar file containing the interface com.sap.guid.IGUID...

After googling for about 3 hours I finally decided to utilize Java itself to find this class.

 

After all it's quite easy...

 

I was following the How To... Create Modules for the JEE Adapter Engine How-To Guide, so I already had some code running on PI...

 

All I had to do was add this code into the process method (after the audit variable had been initialized!):

 

public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData) throws ModuleException {     ...     try {          Class c = Class.forName("com.sap.guid.IGUID");          URL loc = c.getProtectionDomain().getCodeSource().getLocation();          audit.addAuditLogEntry(key, AuditLogStatus.SUCCESS, c + " found at " + loc);     } catch (Exception e) {          audit.addAuditLogEntry(key, AuditLogStatus.ERROR, "Class com.sap.guid.IGUID not found");     }     ...
}

 

Then I just ran the example and looked into the RWB Message-Monitoring to find the filesystem location where the class was located.

 

It turned out that com.sap.guid.IGUID was located at /usr/sap/<sid>/<instance>/j2ee/cluster/bin/core_lib/sap.com~tc~bl~guidgenerator~impl.jar


From here on it's just a simple step to a universal "Where-Is-My-Jarfile" Adapter Module, but that's something I'll leave to you :-)

 

Greez, Markus

How to implement complex xpath logic in Interface determination

$
0
0

Hi Team,

 

I have a requirement like based on the combination of different source values i need to map to different target structures.

i have to implement condition in interface determination.

 

First Input

2055

2057

2058

 

Second Input

2067

2068

 

Third Input

01

02

03

 

Here the combination of first and third inputs then i have to map to target1 structure

eg:

2055 01 then map to target1

2057 02 then map to target1

 

the combination of second and third inputs then i have to map to target2 structure

eg:

2067 01 then map to target1

2068 02 then map to target1

 

kindly help me to develop this logic.

 

Thanks & Regards

Swathi


Hidden Tools functionality with ESR/ID JNLP files

$
0
0

In this blog, I will explore you with all the features that were covered till now in my blog series (check References) as “XI hidden tools” along with some new features with a very simple approach using ESR/ID jnlp files. All that we need to do is modify jnlp files. To understand jnlp formats, please check official java site.

 

Highlights

 

  • Enabling debugging/developer mode
  • Passing user credentials via JNLP file (new)
  • Enabling exporting of mappings as XIM files in PI7.3
  • Referring your local workstation jars/PI server(s) jars and even combination of both in JNLP file (new)
  • Changing ESR/ID application names with your own custom names (new)
  • Enabling XSLT and abap mappings, without changing exchange profile (new)
  • Enable/disable single sign-on (new)
  • Changing the heap memory for the ESR/ID clients

 

Procedure

 

  • Open XI/PI main page http://<xihost>:<port>/dir/start/index.jsp (or) http://<xihost>:<port>/rep
  • save ESR/IR and ID links as jnlp files to your local workstation
  • To edit/view, open jnlp file with any text editor with XML syntax highlighting feature e.g., Editplus
  • To enable debugging/developer mode & to pass the user credentials, add the below highlighted tags under “application-desc” node

 

<application-desc main-class="com.sap.aii.ibrep.gui.appl.ApplicationImpl">

          <argument>webstart</argument>

          <argument>-u</argument>

          <argument>username</argument>

          <argument>password</argument>

</application-desc>

 

 

<!--<jar href="repository/com.sap.xpi.ib.mt.gui.lib.jar" download="lazy" part="part-109"/> -->

 

And then add below property for option a)

<jar href="http://<PI7.1hostname>:<PORT>/rep/repository/com.sap.xpi.ib.mt.gui.lib.jar" download="lazy" part="part-109"/>

or below property for option b)

<jar href="file:///C:/<DIR-PATH>/com.sap.xpi.ib.mt.gui.lib.jar" download="lazy" part="part-109"/>

 

  • To enable you own names for ESR/ID swing applications, change

<property name="jnlp.SAPMYNAME" value="Your own Text"/>


e.g,. with <property name="jnlp.SAPMYNAME" value="Welcome to XI"/>

ESR_forced_Title.JPG

  • To enable abap XSLT and abap mappings (without requesting BASIS team to change exchange profile )

<property name="jnlp.com.sap.aii.repository.mapping.additionaltypes" value="R3_ABAP|Abapclass;R3_XSLT|XSL (ABAPEngine)"/>

  • To enable/disable single sign-on, use true/false for the below property

<property name="jnlp.com.sap.aii.ib.core.sso.enabled" value="false"/>

  • Changing the heap memory for the ESR/ID clients

 

<j2se version="1.6+" initial-heap-size="32m" max-heap-size="512m"/>

<property name="jnlp.com.sap.aii.ib.client.jnlp.j2se.initialheapsize" value="32m"/>

<property name="jnlp.com.sap.aii.ib.client.jnlp.j2se.maxheapsize" value="512m"/>


  • Finally double click the modified jnlp file to be opened with default java web start application or force it with required javaw.exe java version

 

I strongly recommend above procedure only for development XI stacks. Please share your valuable feedback

 

Thanks,

Praveen Gujjeti

 

References

 

http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/01/09/hidden-tools-in-xipi-bat-file-to-launch-esrid-frameworks

http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/03/01/hidden-tools-in-sap-xipi--part-ii

http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/01/25/trick-to-export-pi73-mappings-as-a-xim-file

Module PayloadGZipBean: Zip and Unzip Payloads using gzip

$
0
0

Here you'll find a module I wrote to zip and unzip messages using gzip. I hope you find it useful:

 


 

PayloadGZipBean

 

 

package com.integrations.adapter.module;

 

import java.io.ByteArrayInputStream;

import java.io.ByteArrayOutputStream;

import java.io.IOException;

import java.io.InputStream;

import java.io.OutputStream;

import java.rmi.RemoteException;

import java.util.zip.GZIPInputStream;

import java.util.zip.GZIPOutputStream;

 

import javax.ejb.EJBException;

import javax.ejb.SessionBean;

import javax.ejb.SessionContext;

import javax.ejb.TimedObject;

import javax.ejb.Timer;

 

import com.sap.aii.af.lib.mp.module.ModuleContext;

import com.sap.aii.af.lib.mp.module.ModuleData;

import com.sap.aii.af.lib.mp.module.ModuleException;

import com.sap.aii.af.service.auditlog.Audit;

import com.sap.engine.interfaces.messaging.api.Message;

import com.sap.engine.interfaces.messaging.api.MessageKey;

import com.sap.engine.interfaces.messaging.api.auditlog.AuditLogStatus;

/**

* @author Roger Allué i Vall

*

*/

public class PayloadGZipBean implements SessionBean, TimedObject {

    private static final String C_PARAM_MODE         = "zip.mode";

    private static final String C_MODE_ZIP           = "zip";

    private static final String C_MODE_UNZIP         = "unzip";

    private static final int    C_BUFFER_SIZE        = 8192;

    private static MessageKey amk;

    /* (non-Javadoc)

     * @see javax.ejb.SessionBean#ejbActivate()

     */

    @Override

    public void ejbActivate() throws EJBException, RemoteException {

        // TODO Auto-generated method stub

    }

    /* (non-Javadoc)

     * @see javax.ejb.SessionBean#ejbPassivate()

     */

    @Override

    public void ejbPassivate() throws EJBException, RemoteException {

        // TODO Auto-generated method stub

    }

    /* (non-Javadoc)

     * @see javax.ejb.SessionBean#ejbRemove()

     */

    @Override

    public void ejbRemove() throws EJBException, RemoteException {

        // TODO Auto-generated method stub

    }

    /* (non-Javadoc)

     * @see javax.ejb.SessionBean#setSessionContext(javax.ejb.SessionContext)

     */

    @Override

    public void setSessionContext(SessionContext arg0) throws EJBException,

            RemoteException {

        // TODO Auto-generated method stub

    }

    /* (non-Javadoc)

     * @see javax.ejb.TimedObject#ejbTimeout(javax.ejb.Timer)

     */

    @Override

    public void ejbTimeout(Timer arg0) {

        // TODO Auto-generated method stub

    }

    public void ejbCreate() throws javax.ejb.CreateException {

    }

    public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData) throws ModuleException {

        Message msg;

        ByteArrayInputStream  payloadIn;

        ByteArrayOutputStream payloadOut;

        try {

            msg = (Message) inputModuleData.getPrincipalData();           

            amk               = new MessageKey(msg.getMessageId(), msg.getMessageDirection());

            addInfo("PayloadGZipBean Begin...");

            addInfo("Payload initialization");

            payloadIn = new ByteArrayInputStream(msg.getDocument().getContent());       

            payloadOut = new ByteArrayOutputStream();

            addInfo("Getting " + C_PARAM_MODE + " from parameters");           

            String mode            = moduleContext.getContextData(C_PARAM_MODE);

            if (mode!=null && mode.equals(C_MODE_ZIP)){

                addInfo("zip.mode from parameters");

                addInfo(C_PARAM_MODE + " found: " + C_MODE_ZIP);               

                compress(payloadIn,payloadOut);   

                addInfo("PayloadGZipBean: Payload successfully zipped");

            }else if (mode!=null && mode.equals(C_MODE_UNZIP)){

                addInfo(C_PARAM_MODE + " found: " + C_MODE_UNZIP);

                uncompress(payloadIn,payloadOut);

                addInfo("PayloadGZipBean: Payload successfully unzipped");

            }else{

            }

             msg.getDocument().setContent(payloadOut.toByteArray());        

             inputModuleData.setPrincipalData(msg);

        }

        catch (Exception e) {

            ModuleException me = new ModuleException(e);

            throw me;

            }

        addInfo("PayloadGZipBean End...");       

        return inputModuleData;

    }

    private void compress(InputStream in, OutputStream out) throws ModuleException{           

        try {           

        GZIPOutputStream goutstream = new GZIPOutputStream(out);                   

        byte[] buf = new byte[C_BUFFER_SIZE];

         int len;        

            while ((len = in.read(buf)) > 0)

            {

                 goutstream.write(buf, 0, len);

            }

        } catch (IOException e) {

            addError("Compress: Exception found!");

            ModuleException me = new ModuleException(e);

            throw me;

        }       

    }

    private void uncompress(InputStream in, OutputStream out) throws ModuleException{

        try {

        GZIPInputStream ginstream = new GZIPInputStream(in);                   

        byte[] buf = new byte[C_BUFFER_SIZE];

         int len;

         while ((len = ginstream.read(buf)) > 0)

        {

           out.write(buf, 0, len);

        }

        } catch (IOException e) {

            addError("Uncompress: Exception found!");

            ModuleException me = new ModuleException(e);

            throw me;

        }

    }

    private void addInfo (String msg){

        try{

        Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,msg);

        }

        catch (Exception e){

            Audit.addAuditLogEntry(amk, AuditLogStatus.ERROR,"Error a l'obrir el fitxer!");

        }

        }

    private void addWarning (String msg){

        try{

        Audit.addAuditLogEntry(amk, AuditLogStatus.WARNING,msg);

        }

        catch (Exception e){

            Audit.addAuditLogEntry(amk, AuditLogStatus.ERROR,"Error a l'obrir el fitxer!");

        }

        }

    private void addError (String msg){

        try{

        Audit.addAuditLogEntry(amk, AuditLogStatus.ERROR,msg);

        }

        catch (Exception e){

            Audit.addAuditLogEntry(amk, AuditLogStatus.ERROR,"Error a l'obrir el fitxer!");

        }

        }   

}


 



Regards!

No Authorization-Test Configuration in ID

$
0
0

Hello,

 

I have created customized role from standard PI Role(SAP_XI_CONFIGURATOR_J2EE) and assigned to user.


But when the user trying to execute "Test Configuration" in Integration Directory is getting"No authorization to test the confirguration".After that i have removed Z roles and assigned Standard SAP roles then its working fine


Please let me know,if any one knows.

 

Regards,

Venkat.

HOW TO DELAY (USE WAIT STEP) MESSAGE IN SAP PI WITHOUT ccBPM

$
0
0

In one of my projects, I had a requirement in which IDOCs are to be sent to external 3rd party application, via SAP PI. This external 3rd party application is a cloud system in which these IDOCs are received through a web service. Two IDOCs are to be sent at the same time, but we want the second IDOC to arrive 30seconds after the first one. The option is for PI to delay the second message for 30seconds before proecessing it. Before this time, the wait step in ccBPM would have been an option.

However, as part of the architectural landscape that accommodates java only scenarios, the use of ccBPM is being phased out in integration scenarios, since ccBPM is not available in Java Only installations. Finding alternatives on how to delay message processing in SAP PI is the focus of this write-up. This piece explains how to delay a message in PI during the implementation of graphical message mapping. The steps required are described below;

     1) Create a UDF: The UDF to be created has a single input with a java method show in the screen below; the time delay as shown below is 30,000 (30,000milliseconds=30seconds) and the java method to catch any exception. You can set your own time delay duration for the message in your UDF.

image002.jpg

     2) Use the UDF in the mapping: To use the UDF in the mapping, it should be mapped to the top most element in the root node of the target message in the message mapping. This is shown below;

timedelay blog.jpg

With the mapping and the use of the UDF in the screenshot above, the message will be delayed for 30seconds before it is mapped and passed to the target node, while the first message would have been delivered and processed in the target system before the arrival of the second message.

Global Survey for SAP NetWeaver Process Integration 2013

$
0
0

IFG global Survey 2013 for SAP NetWeaver PI

As in previous years, the Global Special Interest Group for Process Integration conducts its annual survey for SAP NetWeaver PI.

 

Focus of the survey is to collect the latest state of the positioning, use and organization of SAP NetWeaver PI and SAP integration in companies all around the globe. Target group are employees from companies using SAP NetWeaver PI as an integration platform.

 

As in the past, the survey results will enable the IFG to better address the needs of PI users and serve as an important basis for the discussion with SAP. In 2012 over 250 people participated in the survey which helped SAP to develop and validate their product strategy and focus for future functional enhancements.

 

The survey contains 23 general questions and 9 questions about this year’s special topic 'B2B and EDI'. Apart from minor adjustments, the general questions stay the same each year, so that the survey can also show changes in the use and positioning of PI over the years.

 

The global PI survey for 2013 can be found at the following URL:
http://www.surveymonkey.com/s/RN8DRJF

 

Time Schedule

  • May 6th 2013: Official start of survey
  • August 24th 2013: End of survey
  • September/October 2013: Publication of results within the SAP user groups and on SAP SCN

 

Recent Blogs

An extract of the results of the previous surveys can be found in the following blogs:

 


For more background about our interest group see our central blog International Focus Group for SAP NetWeaver Process Integration.

 

Your active participation is important for us and SAP! Target is to beat our record of 400 participants from 2011.

 

Questions and feedback are welcome.

POV: FEH or AIF or Custom Error Handling

$
0
0

Any typical SAP implementation landscape, has a  multitude of 3rd Party or Legacy Systems. Business Operations mandate interface between the 3rd party systems and SAP.  In such a situation, errors on interfaces are inevitable due to multiple point of failures.  The diagram below depicts such failure points

 

5-3-2013 9-59-22 AM.png

 

The following is a brief description of the various POF.

 

Term

Definition

Functional Errors

Errors that occur as a result of incorrect business data

Technical Errors

Errors that occur as a result of technical capability not operating as anticipated

Trigger

An event that will kick-off a Business process in SAP

Extract

Moving data from the source system to PI

Load

Moving data from the PI to the target system

Process

Logic used within the SAP system to process the data

Transformation

Mapping data from source to destination

POF

Point of Failure

 

The errors on the Point of Failures (  Trigger/Extract/Load/Transformation) can be handled via multiple robust techniques, such as CCMS/Alert Monitoring in PI etc.

 

 

 

This blog focuses on the Point of Failure “PROCESS”. This is a step during interface processing when data is processed locally in the SAP system.  There are error situations e.g.  Locking Business Objects like Business Partners, Purchase Orders etc. or Missing Configuration etc. which could lead to failures in the transactions being processed.

In most cases these errors need to be resolved locally on the target system, without a restart from the source. 

 

 

What I have seen as Typical Requirements for such situations are :

 

  1. A generic/plug-able framework required. This should be reusable across all interfaces
  2. Ability to display errors in a consistent manner. This should easily be understood by business users
  3. Ability to  re-process errors, in some cases automatically as well
  4. Ability to support multiple inbound communication protocols like IDOCs and Proxies.

 

Given these,  the next question is to determine a technology which can meet the above requirement.  There are multiple technologies available from SAP to support this some examples are FEH (  Forward Error Handler), AIF ( Application Interface Framework), along with custom solutions which can be built. 

 

Let us start with a brief description of such technologies.

 

Forward Error Handler:

 


 

Forward Error handler is a technology available in the ABAP Runtime, based on SAP's ECH ( Error and Conflict Handler Framework).  This leverages the SAP Post processing office.  It has support only for Asynchronous messages with an integration pattern involving inbound ABAP Proxies.

Error monitoring and display is done within the post processing office ( transactions /SAPPO/PPO2 and /SAPPO/PPO). 

 

More Details can be found on help.sap.com at

http://help.sap.com/saphelp_nw73/helpdata/en/cd/798aa3c7754c61b2f2d50ea7b66aac/content.htm

 

 

 

Application Interface Framework:

 


SAP AIF or Application Interface Framework is a robust tool from SAP, which supports Interface development and error handling.  It has support for both IDOC and Proxy based integration pattern.  It has support mainly for Async messages. Error monitoring can is handled via the transaction /AIF/ERR etc.

 

More Details can be found at

http://help.sap.com/aif

 

 

Custom Error Handling Framework:

 

In many cases, custom error handling frameworks are build using the robust SAP IDoc Monitoring technology.  In case of proxy based integration pattern, custom error idocs are generated, with a structure similar to the inbound proxy from within the inbound proxy code.  These Idocs can capture locking error as well as transient configuration errors.  The error monitor is the default transactions like WE02/WE05 etc. and reprocessing can happen via transactions like BD87.

 

 

In my opinion the frameworks above can be compared as below, based on the given parameters.

 

Parameters

FEH

AIF

Custom Framework

Licensing Cost

No additional Cost

Has additional Licensing cost

Minor custom development cost

Interface Pattern-Synchronous

No

No

No

Interface Pattern- Asynchronous

Yes

Yes

Yes

Support for ABAP Proxies

Yes

Yes

Yes

Support for IDOCs

No

Yes

Yes

Error Monitoring

Yes – Via Post Processing office

Yes – via /AIF/ERR

Yes – via standard Idoc tools

Development Effort

None

None

Yes – to build reusable classes for generating IDOCs from proxies

Usability/Navigation

Mostly Technical Perspective - XML payload like representation, difficult for business users to comprehend

Mostly Technical Perspective

Uses standard IDOC transactions like WE02/WE05/BD87,  business users habituated with this

Start-up Configuration

minor

Major – including setup and installation

minor

Payload Manipulation

Yes – via PPO

Yes

Yes – via IDOC transactions

Error Reprocessing

Yes – Manual and Auto

Yes – Manual and Auto

Yes – Manual and Auto

 

 

In my opinion, the choice of the framework should be tied to one of the above parameters.  Just as an example of a few business case examples:

 

Custom frameworks can be used when:

 

  • Cases in which cost, business user usability is important.
  • Majority interface patterns are IDOC Based and do not require additional transformations at the target.
  • Configuration/Installation time needs to be reduced.

 

FEH can be used when:

 

  • In case of Integration patterns heavily using SAP Enterprise services

 

AIF can be used when:

 

  • When cost and configuration is not a factor
  • Target side mapping( post PI mapping ) is required.
  • Patterns need to support both IDOCs and Proxies.

 

 


Synchronizing SAP CRM data to external systems via SAP PI

$
0
0

Overview:

      

     The data exchange between CRM Middleware and external systems (non-SAP) is performed via XIF adapter. In outbound process, creating or changing a data object, a mBDoc is created and transferred to CRM Middleware. External receivers for the mBDoc are determined within CRM Middleware and are transferred to XIF adapter together with mBDoc. SAP PI provides a client proxy structure in SAP CRM to send the data to PI, from there it will send to the appropriate receiver. The data in mBDoc is converted in the XIF adapter into a PI client proxy structure. Series of interface function modules are maintained for each BDoc type in CRMXIF_BDOCIFtable in CRM. CRMXIF_<IF_TYPE>_MAPSEND (i.e CRM_XIF_IBASE_MAPSEND) function module calls the appropriate interface function module to deliver data to appropriate channel (PI, XML, IDoc....etc). Each interface function module maintains certain naming conventions CRMXIF_<IF_TYPE>_IDOC_SEND, CRMXIF_<IF_TYPE>_XML_SEND and CRMXIF_<IF_TYPE>_XI_SEND based on their method of communication. Standard SAP system does not provide PI interface function modules for all BDoc types. This blog is going to shed some light on how to enable PI integration through some customizing and custom development.

                                                                

                                                                                Blog_Pic1.JPG

 

Implementation steps to setup PI integration through XIF adapter:

Note: IBASE BDoc type has been chosen in the following steps as an example, however, the same steps will be applicable for any BDoc type.

 

  1. Tcode: SBDM (OR) Architecture and Technology ® Middleware® Development® Meta Object Modeling® BDoc Modeler
  •      Choose Goto® Site Type Mapping.

                                                                                              Blog_Pic6.JPG

The Maintain Table Views: Initial Screen appears.

  • Choose Maintain.

The Determine Work Area: Entry dialog box appears.

  • Enter the name of the BDoc type.

The View for BDoc type/Site type mappings: Overview screen appears. To map a BDoc type to a site type, the BDoc type must be active.

  • Choose New Entries.

                                                                 Blog_Pic2.JPG

  • In the Site Type ID field, enter the site type ID.

Choose Save.

    2. Copy CRMXIF_IBASE_XML_SEND to ZCRMXIF_IBASE_PI_SEND, add appropriate code to convert BDoc structure to PI proxy structure and call the PI proxy.

    3. Copy CRMXIF_IBASE_MAPSEND to ZCRMXIF_IBASE_MAPSEND, add additional condition to call the ZCRMXIF_IBASE_PI_SEND FM for PI

 

 

                                                                 Blog_Pic3.JPG    

     4. Change the standard (pertains to CRM_IBASE_MESS BDoc type) CRMXIF_IBASE_MAPSEND with custom ZCRMXIF_IBASE_MAPSEND FM in the  CRMXIF_BDOCIF table.

                                                  Blog_Pic4.JPG

                                       

 



Logging for each pipeline step in the Integrated Configuration Object (ICO) without going to NWA

$
0
0

In most of the integration scenarios, in order to debug, we do depend on the logging of different versions of the source message that eventually gets transformed to the target message by going through the different pipeline steps. If we have the ABAP stack presence in our PI version (7.1 or 7.3 or whatever), we get to know what is happening to the source message at each pipeline step by checking the SXMB_MONI transaction. But, what if we are on Single stack of PI (This blog is based on PI 7.3 EHP1 SP05)?

 

We can still evaluate the same transformations/versions of the source message by setting few options in the Integrated Configuration Object (ICO). This doesn't require and settings to be made to the property xiadapter.logger.conf in the NWA

 

While you create the ICO object, perform the following steps.

 

Go to Advanced Settings tab where you find a set of options for two classifications called Staging and Logging (point of interest at the moment). Under Logging, the default values for logging of the pipeline steps is None. Change them to the suitable option (Log / Log on error / Log without payload / Log on error without payload).

 

ScreenShot-1.jpg

 

In this specific case, the option Log is being chosen for the two steps MS and AM.

MS - Receiver Determination (version of the message will be logged after this step).

AM - Mapping (version of the message will be logged after this step).

 

ScreenShot-2.jpg

 

Once the above settings are made, you can view the payload of the message after each of the respective steps as below.

In the below screenshot, the message ID is '19d51dc6-a1f6-11e2-c659-000001ffb7ce'.

 

ScreenShot-3.jpg

 

For the specified message, we can view the different versions of the message as shown below.

 

ScreenShot-4.jpg

 

Reference :http://help.sap.com/saphelp_nw73ehp1/helpdata/en/7a/c83c3c90b74c1f9a00d761496e28ea/content.htm?frameset=/en/48/b2e0036b156ff4e10000000a42189b/frameset.htm

 


Create your own Automatic Message Restart job on PI Java Stack (PI 7.3 EHP1)

$
0
0

So far, till we arrived at Java Single stack of PI, we have the luxury of scheduling most of the house keeping jobs on ABAP stack. One of the most important of those jobs is automatic message restarting. Let's see how we can create our own Automatic Message Restart Job in PI (This blog is based on PI 7.3 EHP1, SP05).

To begin with, the default jobs that were provided on the AAE are

  1. Default Version Archive Job
  2. Default Delete Job
  3. Default Recover Job

Screenshot-1.jpg

Let's consider a message that got failed (deliberately though) in the receiver file adapter. The message Id is 'f1042b3f-b580-11e2-a376-000001ffb7ce'.

 

Screenshot-2.jpg

Now, it's time to create our own message restarting job. Go to Configuration and Monitoring Home -> Adapter Engine -> Background Job Processing Monitor -> Create Job . You will get the below screen.

 

Screenshot-3_1.jpg

 

In the Job Details tab, select the job type as Restart and fill the other attributes. The job name is given to be MyMsgRestartJob in this case. Move on to the Parameters tab.

 

Screenshot-4_1.jpg

 

In the drop down list, there are two options. Select MAX-RESTART and fill the parameter with the appropriate value.

 

Screenshot-5_1.jpg

 

Move on to the Rules tab.

 

Screenshot-99_1.jpg

 

Create a Rule Definition. This rule definition has various options. Few of them are Sender Component, Receiver Component, Interface, Interface Namespace etc. Based on the above combinations, you can create your own rule. This job restarts only those messages that are in NDLV state and that meet the rule created in this step.

 

Screenshot-6_1.jpg

 

Save and Activate the Job.

 

Screenshot-7.jpg

 

Now that our job is active, it will be executed in the next one hour (as per scheduled earlier). But, in order not to wait till the next run and at the same time to prove that the job works fine, we will execute the job manually by hitting the button Execute Now in the above image.

Execute the job and check the message log of the same message that we considered in the beginning.

 

Screenshot-8_1.jpg

 

Observe the time that we had executed our message restart job and the log version that shows that the "Message restart triggered by restart job: MyMsgRestartJob".

 

Go ahead and create your own jobs...

List of all the Business Systems that are connected using iFlow (PI 7.3 EHP1, SP06)

$
0
0

I came across a question from my customer on how to get the list of all my business systems that are connected using iFlow on the fly.

 

I answered that it’s not at all a problem as I can provide you all the details in an Excel while I handover all the interfaces.

 

As the customer was intelligent, another simple question came up his mind. What happens when I create another iFlow between two new business systems? Do I need to update the excel file that you give me? And what happens if I lose the Excel? 

 

As usual, the customer wants more….

 

Fortunately, came across a feature that’s been provided by SAP (when working on Process Orchestration SP6). This feature (PI Landscape) in NWDS enables to list down all the business systems that got integrated through iFlow and thereby, can quickly get to the details of the iFlow. Some settings need to be done though.

Open NWDS -> Window -> Preferences -> PI Tools Configuration -> Personalize. Set the option ‘Enable content indexing for object references in search and system landscape’.

 

Screenshot-1.jpg

 

Move on to the option ‘Tool-Specific’ which is next to ‘Personalize’ and specify the path for the ‘search index file’ that got created in the above case.

 

Screenshot-2.jpg

 

Done with the pre-requisites. Let’s move on to the main show.

 

Go to Window -> Show View -> PI Landscape.

 

Screenshot-3.jpg

 

Surprisingly that happened to be the information what customer was looking for.

 

Screenshot-4.jpg

..........

 

But, he is the Customer at the end of the day......Started demanding more......

 

Customer : Now, how can I get this information captured in an Excel sheet ?

 

..........

 

To be continued....

Undeploy components using the SAP NetWeaver Development Studio (NWDS)

$
0
0

Why this blog?


In the past, I encountered a problem to undeploy certain components from my SAP PI system.
Using the JSPM, this was not feasible and therefore, I used the NWDS.

This short blog contains all the relevant details to do the undeployment.

Scope and context


First step is to start up the NWDS and make sure it is connected to you SAP PI system

Use the Window menu --> preferences. Go to SAP AS Java and make sure the parameters are filled in correctly.

 

In the bottom left corner, there is an icon to switch to views fast:

button.jpg

 

 

 

 

Type in Undeploy and you will find the Undeploy View. Once all the deployed components are received from the server, a complete list will appear on the left hand side of the screen.

 

Right-click on the component you want to undeploy and choose Add to Undeploy List.

 

Questions or remarks?

 

If you have a (technical) question, feel free to send me an e-mail on dimitri.sannen@thevaluechain.be or post your thought or question.

Error in implementing WS-Security Username token standard in soap receiver axis adapter

$
0
0

Hi,

 

I am implementing a scenario to call from PI, a webservice with WS-Security username token standard,along with message encryption and signature.

 

  • Username Token          Base64( SHA1 (Username+Password + Nonce + Time stamp))
  • Username 4 digit code used for the consumer application as set up in Planning IT.
  • Password Password for consumer application as set up by HP on the server
  • Nonce Random number generated for each request by the application server
  • Time stamp      Time stamp for each request

 

I have deployed and am using the axis protocol of soap adapter and configured the modules as shown in attached screen.

It is almost same . But it gives me the below error when I use password Digest.Parameters.jpg

PasswordDigest.JPG

 

 

 

Error While Sending Message: Additional error text from response: com.sap.engine.interfaces.messaging.api.exception.MessagingException: security.wssecurity.WSSContextImpl.s02: com.ibm.websphere.security.WSSecurityException: Exception org.apache.axis2.AxisFault: CWWSS6521E: The Login failed because of an exception: javax.security.auth.login.LoginException: http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest was supplied, but only http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText is supported. ocurred while running action: com.ibm.ws.wssecurity.handler.WSSecurityConsumerHandler$1@4d774d77

 

 

When I used PasswordText instead of PasswordDigest (Rest all is same), I get the below error,even though I have added it as UsernameToken Timestamp

Password Digest.JPG

 

Error While Sending Message: Additional error text from response: com.sap.engine.interfaces.messaging.api.exception.MessagingException: security.wssecurity.WSSContextImpl.s02: com.ibm.websphere.security.WSSecurityException: Exception org.apache.axis2.AxisFault: CWWSS6521E: The Login failed because of an exception: javax.security.auth.login.LoginException: CWWSS5327E: A null value is not allowed for the created time of the time stamp. The Application Server expected the wsu:Created element. ocurred while running action: com.ibm.ws.wssecurity.handler.WSSecurityConsumerHandler$1@7d5e7d5e

 

I needed security configuration for encryption and signature as well  for encoding the username token. I have deployed the public provider in trusted CAs and private key pair in the default  key store.But I have still not configured the encryption modules as I wanted to get through this username token issue in the first place.

 

Please also find attached the security xml the provider is expecting.

 

Could you please help me here?

 

Regards,

Mahesh

Viewing all 741 articles
Browse latest View live


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