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

To get the time period ie AM or PM

Hai,

sy-uzeit gives the time in hhmmss but how can i know that whether the time is AM or PM

Please help.

Neeraj

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Nov 20, 2007 at 06:44 PM

    Hi,

    Please try FM HRVE_CONVERT_TIME.

    You need to specify

    TYPE_TIME 'A'

    INPUT TIME

    INPUT_AM_PM 'AM' or 'PM'

    -


    TYPE_TIME A

    INPUT_TIME 13:00:00

    INPUT_AM_PM AM

    Export parameters Value

    OUTPUT_TIME 01:00:00

    OUTPUT_AM_PM PM

    Regards,

    Ferry Lianto

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 20, 2007 at 06:48 PM

    Check the simple program :

    data : data(2) type c,

    hour(2) type c.

    data time(8) type c.

    time = sy-uzeit.

    hour = time+0(2).

    if hour < 12.

    data = 'AM'.

    elseif sy-uzeit > 12.

    data = 'PM'.

    endif.

    write data.

    Thanks

    Seshu

    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.