on 05-18-2006 2:11 PM
Hi,
i I have a scenarion where i have to set some parameter in the COntainer from the Java Mapping.
How can i get a reference to the current Container object from my Java Mapping . While using user defined function this object is already avaliable as a parameter and we do not have to create it .But in java mapping how do i get the current container object.
regards
Nilesh Taunk.
Why would you use a container class? When you have your own Java code for mapping, you can store your parameters anywhere.
Let me know more about this.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI stefan,
Basically i am calling a method on a generic component which which has been imported as a jar in the imported archive and that method has container as a parameter .
Therefore i require the container object which can be passed as a parameter to the method.
The Basic idea is to set a parameter first in the globalContainer then pass a reference of that container to the generic component so that it can retrieve the parameter from the container and modify it .
So is possible to pass the container object from The Java mapping.
regards
Nilesh Taunk.
When I have understood right, the class provides a methods with a parameter of type com.sap.aii.mappingtool.tf3.rt.Container and expects any values to be filled inside an instance of that class?
Container and GlobalContainer are interfaces. In a graphical mapping the instance of the GlobalContainer is the mapping class itself (you can see this with a user defined function).
To achieve your goal you need to spend a lot of effort and have to know the internal code of the Mapping Tool. I think you better add methods to the generic component to enable it to be called from a Java Mapping.
Regards
Stefan
Hi Nilesh,
ASFAIK this is not possible as when you use the Java Mapping, the only parameters that is sent to the EXECUTE method of your Mapping prgram is the INPUTSTREAM which is nothing but the source message of your mapping.
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nilesh,
sorry.. I think this is actually possible.
In the setParameter()
public static AbstractTrace trace;
public void setParameter(Map param) {
map = param;
trace =
(AbstractTrace) param.get(
StreamTransformationConstants.MAPPING_TRACE);
}
Likewise, in this method setParameter, you can get and set Container objects.
I have shown how to use the TRACE .
Sorry for the confusion
Regards,
Bhavesh
HI Bhavesh thanks for the prompt reply but in my scanario i am setting a parameter of my own
can i implement it this way.
com.sap.aii.mappingtool.tf3.rt.Container C1 = new Container();
U can include aii_mt_rt.jar in ur classpath in NWDS for accessing the COntainer class.
and then C1.getGlobalContainer().setParameter("MY_PARAMETER",20);
I am not sure will this work or not ..
Can you please comment on this.
regards
Nilesh Taunk.
Nilesh,
Just check this link,
http://help.sap.com/saphelp_nw04/helpdata/en/75/8e0f8f3b0c2e4ea5f8d8f9faa9461a/content.htm
You can use the MAP object of the <b>setParameter()</b> to get and set GLOBAL CONTAINER elements.
Hope this is what you want,
Regards,
Bhavesh
Nilesh,
private Map mymap
public void setParameter(Map param) {
mymap = param;
mymap.put("MY_PARAMETER",20);
}
Now , you can use this <b>mymap.get("MY_PARAMETER")</b> to get the value any where in the class
Though I ve not tried it ,think it should work.
We used the TRACE object described earlier to write TRACE statemtents into XI log from JAVA mapping.
Regards,
Bhavesh
HI,
Just check this link also - Runtime environment on Java Mapping..getting and Runtime constants
http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
Thanks,
Moorthy
User | Count |
---|---|
87 | |
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.