Professional Documents
Culture Documents
Scheduling File Adapter Part - I
Scheduling File Adapter Part - I
This document may discuss sample coding or other information that does not include SAP official interfaces
and therefore is not supported by SAP. Changes made based on this information are not supported and can
be overwritten during an upgrade.
SAP will not be held liable for any damages caused by using or misusing the information, code or methods
suggested in this document, and anyone using these methods does so at his/her own risk.
SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of
this technical article or code sample, including any liability resulting from incompatibility between the content
within this document and the materials and services offered by SAP. You agree that you will not hold, or seek
to hold, SAP responsible or liable with respect to the content of this document.
Table of Contents
Applies To.........................................................................................................................................3
Summary ..........................................................................................................................................3
5. Define an Integration Scenario with simple Receive and Send Steps ...................................11
Author Bio.......................................................................................................................................12
Applies To
The scenario depicted in this document Schedules a File Adapter at specified intervals of time, might be a day
or some hours. The same functionality can also be extended for scheduling IDoc, Plain HTTP Adapter and etc
with some additional configurations.
Summary
The scenario doesn’t involve any ABAP proxy call or a batch file running at the backend. This is modeled
using the basic File Adapter and BPM Concepts. This document speaks of configuration steps of Repository
and soon, the sequel would bring those of Directory.
Scheduler
Scheduler
Details_OUT (Inbound)
BPM_Message (Abstract)
BPM_To_Receiver
BPM_To_Receiver
Scheduler Scenario
Scenario Files should be transmitted at 12 PM everyday.
Deviation The files will be transmitted anytime between the mentioned Time (say 12 PM) and the Poll
Interval specified in the Adapter configuration, depending on the Adapter activation time.
Example Say the Poll Interval is 30 min, the file will be transmitted between 12 PM and 12.30 PM.
Explanation
The Poll Interval value is considered as the tolerance with in which the file will be transmitted to
Receiver System. Maintaining this allows the developer to activate the File Adapter irrespective of time. For
example as stated below, take a scenario where in file has to be sent at 12 PM. Suppose I have configured
and activated my sender File Adapter with Poll Interval as 30 min at 9.34 AM. As the Poll Interval is 30 min,
there will be a subsequent polling at 12.04 PM, when the ‘getTimer’ function returns ‘true’ and the file will be
transmitted to the Receiver.
Create/Import a Data Type say Details, representing the structure of the File to be transferred and build the
message type.
Enhance the above structure by adding an extra field say ‘Timer’ which will contain value ‘true’ or ‘false’
basing on the time during runtime.
Basing on the value of ‘Timer’, the File will be routed to the Receiver System.
The same message type is used create the Outbound and Inbound interfaces, say Details_IN and
Details_OUT respectively.
All the fields of Target Message (Scheduler in this case) except ‘Timer’ are mapped to the respective ones of
the Source Message (Details). The field ‘Timer’ is mapped to a User defined function say, ‘getTimer’ (as
shown in the next fig.). The function returns either ‘true’ or ‘false’ basing on the Time conditions maintained.
The program specified below, contains logic for 12 PM schedule. This can be modified as per the
requirement.
In the above program, the condition should be in such a way, that ‘hours’ should be equal to the time at
which File has to be scheduled and ‘minutes’ less than the Poll Interval specified in the Adapter
Configuration.
Possibilities:
With the above settings, there will be subsequent polling (6th poll) at 12.00 PM, and since the
specified condition becomes true, ‘true’ will be associated to the field ‘Timer’.
With the above settings, there will be subsequent polling (5th poll) at 12.00 PM, and since the
specified condition becomes true, ‘true’ will be associated to the field ‘Timer’.
Case 3: File Adapter activated at 9.04 AM with Poll Interval as 30 min (any time other than 9 & 9.30 AM)
With the above settings, there will be subsequent polling (6th poll) at 12.04 PM, and since the
specified condition becomes true, ‘true’ will be associated to the field ‘Timer’.
Map all the respective fields of Source to the Target message and do not map the ‘Timer’ filed to any one of
the Target Fields.
Points of Consideration
1. The file gets transmitted only when the value of field ‘Timer’ is ‘true’.
2. Specifically the ‘hours’, is dependent on the date format (12/24 Clock) of the system.
3. It is assumed, all the other required objects, Message Interfaces and Interface Mappings will be
configured accordingly.
Author Bio
Sreenivas Bandi has 2 years of IT experience. His skill set mainly includes EAI, J2EE and e-
Matrix besides SAP Netweaver. He has been working on SAP XI for the past 6 months and
currently associated with SAP Labs India.