on 05-18-2016 12:40 PM
Hi Experts,
I am getting a file with 2 details like header and transaction.
Header
EmpCode EmpAcc EmpTotalAmount
Details:
EmpName Empsalary
EmpName EmpSalary
Sometimes the files comes only with one emp details and sometimes it comes with 10..15 emp details.
My requirement is to calculate the empsalary amount and map it to the header Emptotalamount field.
How can I achieve the requirement, because the details of the employee comes only when I duplicate the mapping and gives the values of the souce side.
Regards,
Shaik
Hi Shaik,
Try this mapping:
Empsalary -> mapWithDefault:0 -> removeContext -> sum -> EmpTotalAmount.
sum can be found on the Statistic function in message mapping.
Regards,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark,
Your answer is correct but am getting my data as Ex: 4000,50 instead of decimal am getting , the mapping is failed when i am using sum.
Input data is header level 4000,50
Employee salary is getting like 2000,00
Employee1 salary is getting like 2000,50 , is not calculating in the sum i tried using format number also.
How can we achieve it please
Regards,
Shaik
Hi Bernabe,
Ex: Input data is salary1000,00
Here i have to take only 1000,00 I used substring for the value and i have to sum this value to Footer node employee salary(used Removecontext).
Empsalary->substring(7..0)->removecontext->sum-->formatnumber,##->Empsalary
But it wont works replacestring is throwing error.
Regards,
Shaik
Hello Shaik,
Can you please show us the graphical representation of sender and receiver structures from ESR message mapping
As per my understanding..we can use UDF for the EmpSal (sender field) to the EmpTotalSal (receiver filed).
int totalSal=0;
for(int i=0;i<var1.length;i++)
{
totalSal=totalSal+Integer.parseInt(var1[i]);
}
result.addValue(totalSal);
If this is not the case then give us one scenario with some sample data and also graphical structure of the sender and receiver(from MM).
Thanks
Pavan
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 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.