|Home • Trainings • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us|
Accessing Adapter-specific attributes
By Punit J, PI Competency Team, YASH Technologies
Use of Adapter-Specific
a business scenario a need could arise to access some adapter specific
parameters at runtime. There the value is either not known until runtime or
simply needs to be changed or accessed at runtime. Mapping runtime constants can
be used to get access to the java classes for adapter specific parameters.
The message header of an XI message
contains a header for adapter-specific message attributes that the sender
adapter can use to write additional information to the message header. This
enables sender adapters to write information that is not known until runtime to
The key for accessing the value of an adapter-specific
attribute comprises a namespace belonging to the adapter and an attribute name.
The adapter namespace comprises the namespace in the
Integration Repository in which the adapter
metadata for the adapter is saved and the name of the adapter
metadata object. The adapter namespaces for the adapters shipped by SAP
therefore have the following format: http://sap.com/xi/XI/System/<Adapter
Metadata Object Name of Adapter>.
The adapter metadata objects are located in the
namespace http://sap.com/xi/XI/System of software component SAP BASIS.
The classes for accessing the
adapter-specific attributes are part of the mapping API (package
Class used to create a key object
for an adapter-specific attribute. The key object comprises the adapter
namespace and the attribute name.
Class used to read, change, or
delete the value of an adapter-specific attribute. In a method, you use objects
of type DynamicConfigurationKey to access the attributes.
Let’s have a look at the simple scenario where sender will
put a file, having customer details, at a FTP server. The file can have
different names. The File needs to be moved to the other location, where
Target File Name = Customer Name from Source File + Source File Name
Create Data Type, Message Type and Message Interface for
Sender and Receiver service.
2. Create Message Mapping.
Here field ofile will have target file name.
GetTargetFile is a User-Defined function, which extracts the
file name at runtime. The sample code for the function is
Configuration on ID.
Sender Communication Channel.
Sender Communication Channel. This will pick all the XML files whose name starts
“FileName”, under adapter specific message attributes, is checked in the
communication channel, the source file name will be present in the header of the
Receiver Communication Channel.
Check the checkbox “Variable Substitution”. Value from
field “ofile” of message “MT_Output”
is copied into the variable “var”. This variable is used as File Name for
Configure the Receiver
Determination, Interface Determination, Sender agreement, Receiver agreement.
Testing the Scenario:
Following is input file, with name
Following is output file. Customer name ‘ABC’ is
concatenated to the input file name ‘yh296_Input_1.xml’.
Reference: Refer to the following link for
information on Classes and Methods
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM
©2006-2007 SAPTechnical.COM. All rights reserved.
product names are trademarks of their respective companies. SAPTechnical.COM
is in no way affiliated with SAP AG.
Graphic Design by Round the Bend Wizards