SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Определение следующих даты и времени



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Programming Techniques | Приемы программирования -> Calendar
View previous topic :: View next topic  
Author Message
John Doe
Модератор
Модератор


Age: 46
Joined: 05 Nov 2007
Posts: 725
Location: КраснАдар

PostPosted: Wed Dec 17, 2008 10:58 pm    Post subject: Определение следующих даты и времени Reply with quote

Цель: определить следующие дату и время от текущих, спустя заданное количество часов/минут.

Реализация: использование ФМ TSTR_CALC_TIME.

Пример:
Code:
TYPE-POOLS: TSTR.

DATA: next_date TYPE sy-datum,
      next_time TYPE sy-uzeit.

PARAMETERS: pa_date TYPE sy-datum DEFAULT sy-datum,
            pa_time TYPE sy-uzeit DEFAULT sy-uzeit,
            pa_flow TYPE tstr_duration DEFAULT '120000'.

START-OF-SELECTION.
  CALL FUNCTION 'TSTR_CALC_TIME'
    EXPORTING
      iv_begin_datelocal_req   = pa_date
      iv_begin_timelocal_req   = pa_time
      iv_duration              = pa_flow
    IMPORTING
      ev_end_datelocal         = next_date
      ev_end_timelocal         = next_time
    EXCEPTIONS
      fatal_error              = 1
      time_invalid             = 2
      time_missing             = 3
      tstream_not_loadable     = 4
      tstream_generation_error = 5
      parameter_error          = 6
      unspecified_error        = 7
      OTHERS                   = 8.
  IF sy-subrc <> 0.
    MESSAGE 'Error' TYPE 'A'.
  ENDIF.

END-OF-SELECTION.
  WRITE: next_date, next_time.
Back to top
View user's profile Send private message Blog
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Programming Techniques | Приемы программирования -> Calendar All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.