on 10-31-2008 4:34 PM
Hi Experts,
My Scenario is:
Pick the file from the Directory, Based on the file name, get the Q information from R/3 system and place the file into MQ.
My Question is : How can I get the file name?, any one please guide me..
Thanks for your help,
Thanks,
SR
use Adapter specific attributes.
http://help.sap.com/saphelp_nw04/helpdata/en/c8/98e7d5c1620642973565ea3dd319d1/frameset.htm
you can access the constants by using the method getTransformationParameters() of the container object or by using the method getParameters() of the GlobalContainer object.
Details.
http://help.sap.com/saphelp_nw04s/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the sender file adapter, you need to tick the check box ( Adapter-Specific Attributes ). This will add the adapter specific attributes ( filename, directory and so on) to the header of the message. Then, you can write the code to access in the UDF.
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create(
u201Chttp://sap.com/xi/XI/System/Fileu201D,
u201CFileNameu201D);
String filename = conf.get(key);
SR,
You don't need to have the File name inside your file. There is the concept called ASMA -Adapter Specific Message Attributes, if you select this attribute in your sender comm.channel, your file name will be grabbed and stored in XI headers. By using the above code provided by Anand, you can read it from the header.
Hope it's clear!
raj.
HI SR
You need to enable the Adapter-Specific Message Attributes
enable the FileName under this. Enabling this will allow to have this parameter as XI header
You can check this value is generated or not using SXMB_MONI -> Inbound message -> SOAP header -> Dynamic Configuration.
This will be captured under http://sap.com/xi/XI/System/File name = FIleNameu201D
Now code given by Anand above will allow you to use this FileName in mapping. Based on this you can check R/3 system for relevant file.
Hope this make you confortable with filename concept
Thanks
Gaurav
For Adapter Specific message attributes access, UDF is enough. Module is not required.
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
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.