Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Please help me on to write UDF

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.

replied

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

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question