on 05-11-2009 9:47 AM
Hí,
i wrote a java module this is reading the payload and the message header attributes.
Payload is ok. But i cannot read the message header attributes. I read the whole sap helping sites but i am still not finished and without any ideas.
I only need the messageID and some other attributes.
I am using Java 1.4 and NWDS 7.0.10
i am already tried to build something like this:
java.util.Map param2 = container.getTransformationParameters();
String MSGID = (String) param2.get (StreamTransformationConstants.MESSAGE_ID);
return MSGID;
...but what is about container i didnt get it. Maybe there are other solutions.
Hope i get a src code because i think i read all kinds of websites about these topic.
Sorry i am new in this area and maybe somebody can help me out here.
Thanks
Hi,
container is only used in mappings if you want
to get it form an adapter module:
obj = moduleData.getPrincipalData();
msg = (Message)obj;
msg.getMessageId();
you can the rest in the same way
Regards,
Michal Krawczyk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the really fast answer.
But i ve got still a question ..sorry maybe it is stupid but i hope you can help me.
obj = moduleData.getPrincipalData();
msg = (Message)obj;
msg.getMessageId();
Where can i get the "moduleData" ?
I am using :
process(
ModuleContext moduleContext,
ModuleData inputModuleData)
inputModuleData is my payload;
And the moduleContext are some special attributes there are set in the SAP view.
Do i have to set the moduleData also in the SAP view ...or how can i get it in my java class?
You see i am a bit lost sorry.
below piece of code is working for me:
java.util.Map map = container.getTransformationParameters();
String MSGID = (String)map.get(StreamTransformationConstants.MESSAGE_ID);
return MSGID;
I am using it in UDF in message mapping....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.