on 04-12-2007 7:01 PM
hi,
my requirement is in the source i have a field(record type-'L' or 'M'). if i get the record type as 'L' , i have to sum all the fields relating to 'L' , if its 'M' then i have to sum all the fields relating to 'M' & give it to target . can any one suggest me any function in graphical mapping which satisfies my reqt or is it better to go for user-defined function(UDF) . plz suggest if its UDF can u send me the source code for it.
rgds
chaithanya
Hi,
You want to add integer values or decimal values? and
record type always either only "L" or only "M"?
cheers,
Jag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chaithanya,
Have you got the solution for this,if not could you please send source and target structures.so that we can send you exact UDF code which will be suitable for your scenario.
cheers,
Jag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi jagadish,
my source fields would be an item fields related to record type 'L' or 'M', so first i should check the condition if its from 'M' or 'L' then i should send the related values with sum of all to target field .
my source file is
000472612420070216WRFCCLGBP 001360000000000445.2320070208
000472612420070216WRFCCLGBP 001360000000000604.0920070209
000472612420070216WRFCCLGBP 001360000000000923.9820070210
000472612420070216WRFCCLGBP 001360000000000438.2820070211
000472612420070216WRFCCLGBP 001360000000000311.7220070212
000472612420070216WRFCCLGBP 001360000000000356.9720070213
000472612420070216WRFCCLGBP 001360000000000202.6720070214
so i should sumup the last values of the file & should give to target if its 'L', if its 'M' then i should sum to related values & give it to target, if u can can send me the UDF code which i have to built that would be great.
rgds
chaithanya
hi kishore,
yes it can be 6 & can change at times , but its an FI issue . so i will be having credit & debit lines based on the (WRFCCL)- identifier i should sum up the value . first i should check the condition is it 'L' or 'M' then i should sum up all the values it can be 6 or n it varies.
rgds
chaithanya
Hi,
I had a similar requirement, to sum credit and debit totals.
I used both partly graphical mapping with a simple custom function.
In the graphical mapping, I used it to check if it is D or C and then called a custom function to add the values.
Code for the custom function:
public void customSum(String[] a,ResultList result,Container container){
BigDecimal sum = new BigDecimal(0);
for ( int i = 0; i < a.length; i++)
{
sum = sum.add(new BigDecimal(a<i>));
}
result.addValue(sum);
}
You may have tweak the code a bit. I have this code in a custom package and I stripped of all the unneccasary stuff and gave you the main part of the method.
Hope this helps,
Sumant.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi sumant,
thnks for the response but i should check the value D or C in the custom function(user-defined function) itself. my requirement is i will be getting 6 value at a time first then i should check whether its D or C & then sum up all values . should i code in the UDF itself . plz revert me back.
rgds
chaithanya
hi sumant,
plz do go thru my source file
my source fields would be an item fields related to record type 'L' or 'M', so first i should check the condition if its from 'M' or 'L' then i should send the related values with sum of all to target field .
my source file is
000472612420070216WRFCCLGBP 001360000000000445.2320070208
000472612420070216WRFCCLGBP 001360000000000604.0920070209
000472612420070216WRFCCLGBP 001360000000000923.9820070210
000472612420070216WRFCCLGBP 001360000000000438.2820070211
000472612420070216WRFCCLGBP 001360000000000311.7220070212
000472612420070216WRFCCLGBP 001360000000000356.9720070213
000472612420070216WRFCCLGBP 001360000000000202.6720070214
so i should sumup the last values of the file & should give to target if its 'L', if its 'M' then i should sum to related values & give it to target, if u can can send me the UDF code which i have to built that would be great.
rgds
chaithanya
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.