Skip to Content
Author's profile photo rohini potham

External Control mode – To start/stop channels automatically

Hi Folks,

Requirement: Consider a scenario where the communication channel has to automatically start upon availability of data for once in every few months and we are not sure when the data comes in. Furthermore, the data is processed from an SFTP server and client requirement was to automate the process for this scenario.

So, once the data is sent from proxy to PI, it should automatically start the SFTP channel and after processing, the corresponding channel should be automatically stopped.

Background: In many PI interfaces, there is a provision to create ATP to directly pick the data provided we know the date when it has to be scheduled.

This blog concentrates on how to automate start/stop for processing data from SFTP server.

Scenario:

In this scenario, Proxy is triggered from ECC which will invoke XI adapter. The XI Header will contain target URL of XI receiver channel which is overridden by UDF in message mapping, which in turn will invoke respective SFTP channel. After processing, a new flow invoked for common XI channel to stop the respective SFTP sender channel and this is done using External control mechanism of Runtime Workbench.

A proxy will be triggered from SAP ECC whenever the data  has to be picked from SFTP server.

There are 2 flows in this scenario:

First flow: Proxy to XI (starts SFTP sender channel)

Second flow: SFTP to XI (stops SFTP sender channel)

Interface Designing in ESR:

Proxy structure:

Input

   –> InterfaceID

   –> Action

Based on particular ID, corresponding channel should start, process the file and stop the channel automatically.

InterfaceID Channel to be invoked
BONUSUPDATE SFTP_Sender_TNCompensation_Bonus
JOBUPDATE SFTP_Sender_TNCompensation
WAGEUPDATE SFTP_Sender_TNCompensation_Wage

Source structure:

SourceStructure.jpg

Target Structure:

SourceStructure.jpg

Operation Mapping1: To start particular SFTP channel

SourceStructure.jpg

Message Mapping1:

SourceStructure.jpg

Below is the java code to set target URL in XI receiver channel:

SourceStructure.jpg

Operation Mapping2:

To build the source structure using java mapping code  and then stop the channel (Parameters binded at runtime(java mapping) to identify particular SFTP channel that has to be stopped)

SourceStructure.jpg

Below screenshot shows the Parameters binded at runtime(graphical mapping) to create URL for stopping the corresponding channel

SourceStructure.jpg

Step 1 of Operation mapping (java mapping is used to build  source structure for second mapping to run

Attaching the .txt file that contains the java code.

Step 2 of Operation mapping: Graphical mapping is used to generate URL for invoking (start/stop) the channel based on “Action” field from Interface Determination.

SourceStructure.jpg

Configuring the Channels:


XI Sender Channel: Proxy sender channel is configured to trigger proxy from SAP ECC


SourceStructure.jpg


XI receiver channel: It is used to start or stop channel based on URL overridden in XI Header


SourceStructure.jpg

SFTP sender channel (InterfaceID=’JOBUPDATE’ and so it invokes “SFTP_Sender_TNCompensation” channel.

SourceStructure.jpg

Configuring the collaboration profile agreements:

Sender agreement1: For triggering proxy

SourceStructure.jpg

Sender agreement2: For invoking SFTP sender channel

SourceStructure.jpg

Receiver Determination 1:

SourceStructure.jpg

Receiver Determination 2:

SourceStructure.jpg

Interface Determination1: For starting SFTP sender channel

SourceStructure.jpg

Interface Determination2: For stopping SFTP sender channel

SourceStructure.jpg

Receiver Agreement1:

Header Mapping : Sender communication component should be changed to SuccessFactors else it will throw binding error as we are invoking channel for SuccessFactors component

SourceStructure.jpg

Receiver agreement2:

SourceStructure.jpg

Result:

On triggering the proxy, based on InterfaceID, the channel will be initiated, processed and stopped eventually.

Note: The SFTP sender channel should be kept in External Control Mode.

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Gopal KS
      Gopal KS

      Hi Rohini,

       

      Nice blog..

      Now in Sap po, we have option to schedule the channels and make it available for particular time using channel scheduling option.

      Regards,

      Gopal KS