on 08-08-2012 11:55 PM
Hi ,
I have a scenario where ther are multiple mapping in my Opertion mapping.
can we set global variables in XSLT mapping. If so how ? Do global variables availables in all the mappings ?
Thanks ,
Prem.
>Do global variables available in all mapping?
global variables can be used in multiple udf calls in a sequence . But it won't be available in different mapping type like xslt or message mapping. They are executed in different containers. You can store file name in jdbc table and use it 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.
Hi Prem,
Sriram's blog Effective XSL : for Multimapping, getting Source filenames in Legacy-Legacy scenarios is describing the solution. You use a Java function inside XSL to store a value in Dynamic Configuration. Unfortunately the screenshots are gone here, this is a pity, a lot of good knowledge is lost with the new scn design.
Regards,
Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>OK , Understood that Global Variable can't be available in different mapping programmings ( from Bhaskar's Reply)
What I meant was if you do different type of mappings like Java mapping followed by abap mapping followed by message mapping then it won't be possible to retrieve inside different mapping because they are executed in different containers. If you use sequence of UDFs then sure global variable is available for all the consecutive UDFs. Again Udo pointed above clearly to create a java function in XSLT mapping. Inside java function use/call the dynamic configuration class and set the values. Then in your second mapping (message mapping) use a UDF and retrieve the value from the dynamic configuration logic. This way you don't need to rely on global variables.
Hi Bhaskar,
Sorry if my Question is simple..but I am unable to proceed..
>>>call the dynamic configuration class and set the values. Then in your second mapping (message mapping) use a UDF and retrieve the value
I have set the file name value to the variable "YYY" . How to retrieve this into message mapping UDF ?
<xsl:variable name="dynamic-conf" select="map:get($inputparam, 'DynamicConfiguration')"/>
<xsl:variable name="dynamic-key"
select="key:create('http://sap.com/xi/XI/System/File','FileName')"/>
<xsl:variable name="YYY" select="dyn:get($dynamic-conf, $dynamic-key)"/>
>I have set the file name value to the variable "YYY" . How to retrieve this into message mapping UDF ?
You already set filename. Search SCN for dynamic configuration related coding. There are plenty available. You need to write simple java coding in UDF.You can use get method by passing the key to retrieve value from the DynamicConfiguration object. Please refer this class and available methods.
http://help.sap.com/javadocs/NW04S/SPS09/pi/com/sap/aii/mapping/api/DynamicConfiguration.html
Sorry I am confused. I don't If I am clear or not ...
As you said a variable can't be extarcted into another mapping .....
1. I got my source file name into the variable "YYY" in my XSLT Mapping ( 1st mapping)
2. I need to get this into my third mapping (Variable YYY value) ..... this variable is not a dynamic configuration object ...what is the need of writing the java udf to retrive DynamicConfiguration object ?
>>" get method by passing the key to retrieve value from the DynamicConfiguration object"
Please note that the source file name holds good only upto first mapping . The second mapping is actually a Java SOAP lookup where i have to extract the SOAP XML and have to write to some other folder ..in this scenario I am writting the target file with the source file name fetched during my first mapping..
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.