on 09-19-2008 10:19 AM
Hi,
The condition is,
Source Fields (Time)
PICKUP_TIME
DELKEY_TEXT_WE
Target Field(Date/Time)
EarliestTime
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 position 6 until 13
into: EarliestTime.
Please help me on this...like how to implement UDF
Thanks & Regards,
Y.Raj.
u can try:
// UDF <input parameters: String picktime, String DELKEYTEXT
String EarliestTime="";
if(!picktime.equals("00:00:00")){
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
try{
Date newDt = sdf.parse(picktime);
newDt.setMinutes(newDt.getMinutes()-30);
EarliestTime = sdf.format(newDt);
}catch(Exception e){
}
return EarliestTime;
}else{
return DELKEYTEXT.substring(6,13);
}
Regards
Ritu...
Edited by: Ritu Sinha on Sep 19, 2008 12:06 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ritu Sinha,
I has used the UDF which u given earlier is giving one error.
that is, based on the ELSE condition here,
if map value from DELKEYTEXT pos. 6 until 13 into: EarliestTime
if i give DELKEYTEXT value = ravi then receiver side is giving this following error.
The message is: Exception:[java.lang.StringIndexOutOfBoundsException] in class
Note : if i give morethan 16 chars. mapping is working fine
Please suggest me here how can i resolve this..
Thanks & Regards,
Y.Raj.
Hi,
Just make a small change in udf
// UDF <input parameters: String picktime, String DELKEYTEXT
String EarliestTime="";
if(!picktime.equals("000000"))
{
SimpleDateFormat sdf = new SimpleDateFormat("HHmmss");
SimpleDateFormat sdf1= new SimpleDateFormat("HH:mm:ss");
try{
Date newDt = sdf.parse(picktime);
newDt.setMinutes(newDt.getMinutes()-30);
EarliestTime = sdf1.format(newDt);
}catch(Exception e){
}
return EarliestTime;
}else{
if(DELKEY_TEXT_Z5.length() > 5)
{
return DELKEY_TEXT_Z5.substring(5,13);
}
else
{
return DELKEY_TEXT_Z5;
}
}
changes are in bold
Edited by: malini balasubramaniam on Oct 20, 2008 3:36 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ritu Sinha,
A small requirement has been changed here.
the input for picktime has time format: hhmmss instead of hh:mm:ss.
but, the result is the same i need to get it.
ie., hh:mm:ss
Please suggest me here
Thanks & 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,
I have tried with that...but, am getting the blank.
Please find the code below here which am using UDF
String EarliestTime="";
if(!PICK_TIME.equals("000000")){
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
try{
Date newDt = sdf.parse(PICK_TIME);
newDt.setMinutes(newDt.getMinutes()-30);
EarliestTime = sdf.format(newDt);
}catch(Exception e){
}
return EarliestTime;
}else
{
if(DELKEY_TEXT_Z5.length() > 5)
{
return DELKEY_TEXT_Z5.substring(5,13);
}
else
{
return DELKEY_TEXT_Z5;
}
}
Thanks & Regards,
Y.Raj.
This is becoz the Delkey is less than 13 characters.
what is ur requirement in this case?
shud it display ravi as such..
Then make a check on the length of delkey time(in else part of the same udf)
else{
if(DELKEYTEXT.length() > 13)
{
return DELKEYTEXT.substring(6,13);
}
else
{
return DELKEYTEXT;
}
}
Edited by: malini balasubramaniam on Sep 30, 2008 9:31 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please help me on this..
condition :
if map value from DELKEYTEXT pos. 6 until 13 into: EarliestTime
if i give DELKEYTEXT value = ravi then receiver side is giving this following error.
The message is: Exception:[java.lang.StringIndexOutOfBoundsException] in class
Note : if i give morethan 16 chars. mapping is working fine.
Thanks & Regards,
Y.Raj.
Edited by: YeswanthRaj Kumar on Sep 30, 2008 9:10 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have replied to this in ur previous post. Pls check it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
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.