on 09-18-2008 3:44 PM
Hi,
Could you please suggest me here as i need to map based on these below conditions.
PICKUP_TIME -
>EarliestTime
conditions are:
IF PICKUP_TIME is not equal to 00:00:00 then read value from: PICKUP_TIME and reduce this by 30 min.
Please give me the solution as i need ASAP.
Thanks & Regards,
Y.Raj.
Hi Malini Balasubramaniam,
As i has used the UDF for Ritu Sinha's (the another blog) and i tested...looks its fine.
But, when i check your code it seems like a Generic where am using this same UDF and i let you know once i test the same code which you have provided here and as well as i could close this blog.
Thanks for your help and valuable response to me.
Regards,
Y.Raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thank you all contributors here and especially Mrs. Malini..
Regards,
Y.Raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create a UDF where you capture the pickup time and check these conditions.
Else, u need to use standard functions and reduce your pickup time -30 .
Check for standard mathematical functios or accomplish it in UDF.
Regards,
Krish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>>IF PICKUP_TIME is not equal to 00:00:00 then read value from: PICKUP_TIME and reduce this by 30 min.
what does mean by >>reduce this by 30 min.
You mean, reduce the time by 30min (that is coming in PICKUP_TIME) and map it to target field EarliestTime?
thanks
farooq
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Farooq,
Here am giving you the IDOC field names which i need to map to Receiver and the conditions are,
Source Fields (Time)
PICKUP_TIME
DELKEY_TEXT_WE
Target Field(Date/Time)
EarliestTime
Conditon is : IF PICKUP_TIME is not equal to 00:00:00 then Read value from: PICKUP_TIME and reduce this by 30 min. and place the result into: EarliestTime. Else
if map value from DELKEY_TEXT_WE pos. 6 until 13 into: EarliestTime.
This is the condition i need to check in Mapping.
Could you please suggest me how can i manage this.
Thanks & Regards,
Y.Raj.
Edited by: YeswanthRaj Kumar on Sep 19, 2008 8:14 AM
Hi,
try using the following mapping
pickup_time -------\
equalsS-->not--->if --->earliest time
Constant[00.00.00]---/ then<----UDF<----pickup_time
Under imports use java.util.*;java.text.*;
public String time_cal(String a,Container container)
{
long sec = (long)1000.0 * 30 * 60;
String parts[] = a.split(":");
long sec1 =(long) ((Integer.parseInt(parts[0]) * 3600 * 1000.0) + (Integer.parseInt(parts[1]) * 60 * 1000.0) + (Integer.parseInt(parts[2]) * 1000.0));
long second = sec1 - sec;
DateFormat time = new SimpleDateFormat("HH:mm:ss");
java.util.Date today = new java.util.Date(second);
String result = time.format(today);
return result;
}
Edited by: malini balasubramaniam on Sep 19, 2008 3:34 PM
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
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.