Skip to Content

A customer exit is a way to extend the functionality of the ApplicationIntegration service by creating a custom code. A Customer Exit is provided to make retrieval of parameters more dynamic. The customer exit permits you to plug in a custom provider for parameter retrieval. In this way you can code any algorithm for dynamic parameter retrieval and plug it into the Application Integrator.

For example, we need for two different users get two different WDJ applications.

Parameters:

Ø  User – Teacher

•               System alias   – TWDSYS

•               WD Namespace – sap.com/teacher_iview

•               WD application – TeacherApp

Ø  User – Student

•               System alias   – SWDSYS

•               WD Namespace – sap.com/student_iview

•               WD application – StudentApp

Let’s see how to reach this custom functionality by using Application Integration Customer Exit.

First, create Portal application and add Customer Exit service to portalapp.xml:

<?xml version=”1.0″ encoding=”ISO-8859-1″?>

<application>

    <registry>

    <entry path=”/com.sap.portal.appintegrator/customer_exits/parameter_provider/my_customer_exit” name=”MyCustomerExit” type=”service”/>

    </registry>

  <application-config>

<property name=”SharingReference” value=”com.sap.portal.appintegrator”/>

</application-config>

  <components/>

  <services>

    <service name=”MyCustomerExit”>

      <service-config>

        <property name=”className” value=”MyCustomerExit”/>

        <property name=”startup” value=”true”/>

      </service-config>

    </service>

  </services>

</application>

Then, create interface and implementation class:

The Interface file:

import com.sapportals.portal.prt.service.IService;

public interface IMyCustomerExit extends IService  {

    public static final String KEY = “MyCustomerExit”;

}

The implementation class:

Here you must override getParameter method and add your custom code logic.

import com.sapportals.portal.appintegrator.parameter.ICustomerParameterProvider;

import com.sapportals.portal.prt.component.IPortalComponentRequest;

import com.sapportals.portal.prt.service.IServiceContext;

public class MyCustomerExit implements IMyCustomerExit, ICustomerParameterProvider

{

    @ Override

    public String getParameter( IPortalComponentRequest request, String id ) throws Throwable  {

        if ( “System”.equals( id ) ) {

            return getSystem( request, id );

        }

        if ( “WebDynproApplication”.equals( id ) ) {

            return getApplication( request, id );

        }

        if ( “WebDynproNamespace”.equals( id ) ) {

            return getNameSpace( request, id );

        }

        return null;

    }

   

    private String getSystem( IPortalComponentRequest request, String id ) {

        String userID = request.getUser().getLogonUid();

        if ( “Student”.equals( userID ) ) {

            return “SWDSYS”;

        }

        if ( “Teacher”.equals( userID ) ) {

            return “TWDSYS”;

        }

        return “SAP_LocalSystem”;

    }

private String getApplication( IPortalComponentRequest request, String id )

….

After code compilation and deployment we should anable Customer Exit service and check some configurations in NWA.

Step 1 – Turn on the Customer Exit service.

1.       Navigate to “<host>:<port>/nwa” -> “Start & Stop” -> “Java Applications”.

2.       Open the service “Applications” -> “com.sap.portal.appintegrator” -> “Services” -> “Portal Service Configuration”.

3.       Set the property “Use_CustomerExit_ParameterProvider” to true, press save and restart the service.

Step 2 – Verify that the Customer Exit Service appear in the dropdown list of the Portal Application.

1.       Navigate to “<host>:<port>/nwa” -> “Start & Stop” -> “Java Applications”.

2.       From the list of application find your customer exit application.

3.       Verify that the status of the service is “Started”.

Step 3 – Verify that the Customer Exit application deployed on the portal.

1.       Navigate to “<host>:<port>/irj/irj” -> “PortalRegistryBrowser” -> “Go”.

2.       Verify that the customer exit is registered.

Step 4 – Add the Customer Exit name in the iView property “Customer Exits for ‘ParameterProvider”.

1.       The value should be identical to the one displayed in the registered applications view. /wp-content/uploads/2013/02/4_188885.jpg

After all verifications and configurations the Customer Exit should work on your portal.

To report this post you need to login first.

1 Comment

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

Leave a Reply