cancel
Showing results for 
Search instead for 
Did you mean: 

Using attributes from AdapterSpecificMessage in 'Variable Substution"

Former Member
0 Kudos

Hi all,

Is there any possibility of acceding to an atribute determined dynamically during mapping from Variable Substitution in a receiver FTP communication channel?

This is the scenario:

Inside mapping, we are determining a folder and storing it under header variable 'directory'. If I use 'Adapter Specific Message Attributes" directory, it works ok and writes the file into the appropiate folder.

The thing is we need for development to store that file under the same structure but under another extra folder:

If in QA it's /out/file, in DEV it should be /DEV/out/file .

I was trying to do this this way:

target directory = /DEV/%var1%

Variable Substitution

var1 = message:directory

And obviously, it's not working. Do anybody know any way to access to that value from Variable Substitution?

Thanks in advance, Iñaki.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

What I want to know is, the same way we are accessing to any of the XML fields via "payload:Node,1,Field,1" and to and attribute of the message header, using the prefix "message:", is there any chance of accessing to a variable that I've created using dynamic configuration during mapping?

former_member200962
Active Contributor
0 Kudos
java.util.Map map = container.getTransformationParameters();
String MSGID = (String)map.get(StreamTransformationConstants.MESSAGE_ID);
return MSGID;

Could not make it out what exactly you are asking for.....if you want ot access the Message Header variables then using the above code you can do so....just write which value you wan to access..check this link to know the message header fields:

http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/content.htm

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>he thing is we need for development to store that file under the same structure but under another extra folder:

use this code:

String systemName = (String) System.getProperty("SAPSYSTEMNAME");

if(systemName.equals("devsystem"))

{

dev path

}

and some other for quality

Regards,

Michal Krawczyk

Former Member
0 Kudos

Thanks for the quick response Michal, but I think that is not going to be useful as in QA we may also need to use both folders depending on the kind of test. That's why I wanted to be able to switch from one to the other via communication channel config.

Thanks anyway.

former_member200962
Active Contributor
0 Kudos
but I think that is not going to be useful as in QA we may also need to use both folders depending 
on the kind of test

can we not specify the condition that you want in the if statement...alongwith systemname.equals()..

what is the test that you are talking about?

Regards,

Abhishek.

Edited by: abhishek salvi on Jun 5, 2009 2:44 PM