Skip to Content
author's profile photo Former Member
Former Member

convert to julian date

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Mar 24, 2006 at 01:19 PM

    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 ?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 24, 2006 at 01:20 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 24, 2006 at 03:14 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.