on 05-23-2008 10:26 AM
Hey everyone!
I'm looking for a way to create an array function in XI.
For instance, I have a 'FixValues' function defined, which I want to map to multiple 'FixValues' depending on the output of the Main 'FixValues' function:
For example,
Main 'FixValues'
01 : AA
02 : BB
03 : CC
then, IF
Main = 'AA'
001 : XYZ
002 : WER
003 : KLM
Main = 'BB'
001 : UIO
002 : POI
003 : JHG
Main = 'CC'
001 : WED
002 : THU
003 : FRI
Would anyone know how to make this possible?
Thanks in advance!
Glenn
Hi Glenn,
From
JavaDoc:
getFunction
public JCO.Function getFunction()
Creates a function object from the template and returns it
Returns:
the function created from the template
So, you can reuse function template to create multiple fuctions.
or
work around with an ArrayList to put multiple functions in it.
Then pass an Object[] got from toArray method of arraylist to my helper execute call.
Then loop and cast each Object back to Function and then execute it.
Reward points if this helps
Regards
Pragathi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
a UDF could look like this:
public String valueMapping(String firstValue,String secondValue,Container container){
if(firstValue.equals("AA")) {
if(secondValue.equals("001")) return "XYZ";
if(secondValue.equals("002")) return "WER";
if(secondValue.equals("003")) return "KLM";
}
if(firstValue.equals("BB")) {
if(secondValue.equals("001")) return "UIO";
if(secondValue.equals("002")) return "POI";
if(secondValue.equals("003")) return "JHG";
}
if(firstValue.equals("CC)) {
if(secondValue.equals("001")) return "WED";
if(secondValue.equals("002")) return "THU";
if(secondValue.equals("003")) return "FRI";
}
//default value
return "";
}
Regards
Patrick
HI Glenn,
As per patrick you can hardcode the concatenated values(as input ) in fix values table...
There is no need of concatenate function separately...
Glenn, please correct me if wrong.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello everyone,
Thanks for all your suggestions!
I've thought about using IF conditions together with the FixValue function, however, I will have 78 entries in the main FixValue function so this may not be a practical approach.
I'll try your other suggestions and award points after my testing. in the meantime, please feel free to provide more solutions.
Many, many thanks!
Glenn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
U can write the UDF to solve this problem.
If( main==00)
{
assign values;
}
else if(main==01)
{
Assign values;
}
Reward points if helpful.
Regards,
Soumya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Glenn,
Please reward points if it helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you could use 4 Fix Value functions.
First one is used for your main value.
Then you can check the output with equalsS and pass the result to an if function and use one of the 3 other Fix Value functions.
Regards
Patrick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
you can use Boolean functions (IF with Else and IF without Else) for the same.
For comparing the value of Main use Text Function (equalsS) for the same.
use IF without Else :
In Equals pass two values 1. Value of Main
2. Constant (AA)
In Then Pass fix values of you requirement.
Extend this condition with using other if with else.
Regards,
Sandeep Kaushik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glenn,
You mean to say you need to maintain 3 sets of values instead of usual 2 sets(key and value), if so upto my knowledge you can not use Fix Values to achieve this. Use tables in R/3 and create a RFC lookup to chieve this requirement.
Regards,
Jaishankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.