on 03-24-2006 1:05 PM
Hi,
does anyone of you did some Message Mapping Java User Defined Function to convert an R/3 date format yyyy-mm-dd to julian date format? Or any idea how i could do it.
Any help would be appreciated.
Cheers,
Sven
See this posting (/message/2655755#2655755 [original link is broken]) for a possible solution.
Here's a quick adaptation from that posting using SAP date format (import java.util.* and java.text.*);
:
try
{
SimpleDateFormat datestamp = new SimpleDateFormat("yyyyMMdd");
Date baseDate = datestamp.parse("17000101");
Date sAPDate = datestamp.parse("20060324");
long dayDiff = (sAPDate.getTime() - baseDate.getTime()) / (1000 * 60 * 60 * 24);
System.out.println(dayDiff);
}
catch(Exception e)
{}
Tim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sven,
just search the google for any java class
that will do this conversion
import it as external archive and use it in the
message mapping
below you'll find an example but I don't know if this is what you're looking for
http://www.rgagnon.com/javadetails/java-0506.html
anyway the procedure is the same:
- get it from google
- import in XI as external archive
- use it in the message mapping
Regards,
michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you specify the format you need the date to be converted to (YYYYMMDD or YYMMDD or others) so that we can help you out with?
Is it that you need the date from source to be put into the target or are you directly generating the date ?
Did you try the date functions (currentDate) in message mapping ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.