Skip to Content

In SAP NetWeaver Process Integration (PI) 7.1, there is support for using parameters in mapping programs.  In general, the ability to pass parameters to/from mapping programs gives them more flexibility and applicability by allowing for the transfer of values at configuration time (e.g. Integration Directory).  This is similar to the concept of using parameters for a program method or procedure.  Currently, parameterized mappings are supported for:

  • Message Mappings
  • Java Mappings
  • XSLT Mappings

Since at runtime time, all PI mappings are accessed via a corresponding operation mapping, parameter bindings must be created in order to connect the mapping program and operation mapping parameters. In addition, the actual parameter values can be set at configuration time by using a transformation step in an integration process or monitoring process.

Export Parameters – transfer values from mapping

  • Values can only be assigned to export parameters in user-defined functions
  • Values can only be passed using a transformation step and thus, can only be evaluated within integration processes or monitoring processes

Parameter Category

  • Simple Type – parameters in this category are used to transfer simple typed constants (i.e. xsd:string or xsd:integer) that can be used as import or export parameters.
  • Adapter – parameters in this category are used to transfer the channel name that is to be used for mapping lookups. An adapter type (e.g. JDBC, RFC) must in addition be selected.

The value set in the Message Mapping for Export parameter can be used in BPM.

Following are the steps to use an export parameter:

1)      Create a export parameter

In the signature tab of Message Mapping create a parameter with following options:

Category: Simple Type

Type: string

Parameter: Export

 

image

 

2)      Setting the value to this export parameter using UDF:

Using the following the populate the value of the export parameter.

 

public String demo(String v1, String v2, Container container) throws StreamTransformationException{

String out = “”;

 GlobalContainer gc = container.getGlobalContainer();

OutputParameters params= gc.getOutputParameters();

if(v1.equals(v2))

{

            if(params.exists(“exportParam”) == true)

             {

                        params.setString(“exportParam”, “Yes”);

                        out = “value exists!”;

            }

            else

             {

                 params.setString(“exportParam”, “No”);

                                    out = “value doesn’t exist!”;

            }

return out;

 }

else

{ params.setString(“exportParam”, “No”);

  return ” Check for errors “;

}

}

 

Calling the UDF:

 

 

image

BPM:

3)      Create 3 container elements:

  • ·         IN1:  Outbound Service Interface for receiver step.
  • ·         IN2: Inbound Service Interface for Sender Step.
  • ·         var1: for the export parameter set in Message Mapping.

 

image

 

4)      Receiver Step:

Select the IN1 as the Message

 image

5)      Transformation Step:

Select the Export, Source Message and Target Message.

 

image

6)      Switch Step:

For the condition of the switch step give (var1 = “No”)

 

image

7)      Branch 1 Send Step:

Select the Message as IN2

 

image

 

8)      Branch 2 Control Step:

To end the process, select the Action as Cancel Process

 

image

To report this post you need to login first.

2 Comments

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

  1. Baskar Gopalakrishnan
    Biswa,
          Good Work. I see one small problem in udf. For boolean dont check == true. You could omit that. How the var1 is referenced in bpm as exportParam? if we have two simple type export parameters then how do we handle it?

    Overall the blog is very neat. I enjoy reading it

    Baskar Gopal

    (0) 

Leave a Reply