on 08-13-2008 6:17 AM
Hi,
I want to define a structure, where in I want to pass additional information or metadata apart from the actual pay load.
Additional information is Message Id and File Name. My structure should look like this
<?xml version="1.0"?>
<message id=u201DmessageIDu201D>
<header>
<filename>D:\\inputfile.txt</filename>
</header>
<body>
FileContent(here goes the payload)
</body>
</message>
Any Inputs would be appreciated.
Regards,
Varun
Use the Mapping Runtime Constants for fetching the Message ID.
check this :
http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/frameset.htm
String headerField;
java.util.Map map;
// get runtime constant map
map = container.getTransformationParameters();
// get value of header field by using variable key
headerField = (String) map.get(key);
For example, to read the message ID from the message header, the variable key must have the value MessageId and not MESSAGE_ID.
Are you using the File Adapter on the Sender Side.
regards
Ganga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for your replies.
Do I need to define the Header and Body in the structure. If I define, does this not come under Payload of the Message.
Yes I am Using File Adapter as Sender and Receiver.
Regards,
Varun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>>Do I need to define the Header and Body in the structure
If you require the structure to have Header and Body tag create it in the Data Type.
>>If I define, does this not come under Payload of the Message.
No Doubt. It will come in the payload. What ever is mapped to the target structure will be there in the payload.
>>Yes I am Using File Adapter as Sender and Receiver.
Enable the option Adapter Specific message attribute and filename in sender CC.
Thanks
SaNv...
1. Use this UDF to retrieve the file name
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String ourSourceFileName = conf.get(key);
return ourSourceFileName;
Map this to the target field.
2. Use this to get the Messages ID.
map = container.getTransformationParameters();
String Mid = (String) map.get(MessageId);
return Mid;
Thanks
SaNv...
Edited by: Sãnthosh Kûmãr V on Aug 13, 2008 10:52 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.