Skip to Content
-1

How to get destop/pc time SAP ABAP

Jan 07 at 09:56 AM

55

avatar image

Hi,

I want to fetch the desktop/pc time into a variable.I used sy-uzeit,it is for application server time.But I need my desktop time using SAP ABAP.

Regards,

Shabbir

10 |10000 characters needed characters left characters exceeded
Former Member

Do you need time zone of desktop, too ?

0

Hi Tibor,

Thanks for reply.

It is not required time zone of desktop.I need only desktop/pc time.

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
avatar image
Former Member Jan 07 at 11:30 AM
2

An idea to do it, but you didn't explain yet, if you connect with

  • SAP GUI for Windows
  • SAP GUI for Java
  • SAP GUI for MacOS
  • ITS
  • Netweaver Business Client
  • SAP GUI runs on Terminal server
  • ...
METHOD desktop_datetime.

*   Alternative:
*   CL_GUI_HTML_VIEWER with SAPEVENT

    DATA:
      lt_clip     TYPE TABLE OF docs,
      lc_datetime TYPE string,
      li_length   TYPE i.

    CALL METHOD cl_gui_frontend_services=>execute
      EXPORTING
        application = 'cmd.exe'
        parameter   = '/c echo %date% %time% | clip'
        minimized   = 'X'
        synchronous = 'X'
      EXCEPTIONS
        OTHERS      = 1.
    CHECK sy-subrc EQ 0.

    CALL METHOD cl_gui_frontend_services=>clipboard_import
      IMPORTING
        data   = lt_clip
        length = li_length
      EXCEPTIONS
        OTHERS = 1.
    CHECK sy-subrc EQ 0.

    READ TABLE lt_clip INTO lc_datetime INDEX 1.
    CHECK sy-subrc EQ 0.

    WRITE: / lc_datetime.

  ENDMETHOD.
Share
10 |10000 characters needed characters left characters exceeded
Sandra Rossi Jan 07 at 01:04 PM
0

Maybe you'll prefer SY-DATLO and SY-TIMLO. It's the time based on the time zone in the SAP user's profile. It should be setup correctly of course.

Share
10 |10000 characters needed characters left characters exceeded