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

Does anyone have a code sample to generate the current time/server time?

SQL server has a standard server function that can generate the current time/server time with GETDATE() which is the datetime when the method/function is called. Is there a similar function in ABSL? What I am trying to do is similar to in standard BOs, where each standard BO has a concept of a Created On/Changed On feature that tracks when the BO is created and when it was last changed, as well as who created the BO and changed the BO with Created By/Changed By. I did not see this as an out of box feature with custom BOs so would like to track when/who the BO is changed as when it was created via ABSL.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Dec 09, 2013 at 08:22 AM

    Hello,

    the following function from the ABSL namespace is probably what you are looking for:

    var dt = Context.GetCurrentSystemDateTime();

    Regards

    -- Reinhold

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 10, 2013 at 02:04 AM

    Hi Rei Kasai,

    And this would give you the current User's Identity UUID -

    UserUUID = Context.GetCurrentIdentityUUID();

    In the other post I had mentioned how to get the User as well. But its better to store UUID is my feeling.

    But I feel it would be really great if SAP releases out a standard way( probably a How to Guide) for realizing this requirement as this is quite common and I think such common requirements should be done in a standard way.

    we were discussing the same requirement a week back in our project as well.

    We have not yet realized, in case you did do paste some code to save the time for all.

    Regards

    Vinod

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 18, 2013 at 07:12 AM

    Hi Rei,

    Did you finally manage to finish this task on Created On/Changed On and Created By/Changed By?

    If yes can you paste the code to use as a template to finish this for custom Objects ?

    Regards

    Vinod

    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.