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 -> ABAP
View previous topic :: View next topic  
Author Message
inna
Участник
Участник



Joined: 25 Mar 2008
Posts: 32

PostPosted: Wed Feb 25, 2009 2:54 pm    Post subject: День в году Reply with quote

Не подскажете: какая функция может вернуть порядковый номер дня в году? Embarassed Или нет такой?
Спасибо!
Back to top
View user's profile Send private message
ghost
Специалист
Специалист


Age: 37
Joined: 18 Jan 2008
Posts: 71
Location: Tashkent-Astana-Moscow

PostPosted: Wed Feb 25, 2009 3:07 pm    Post subject: Reply with quote

ну например ФМ 'FI_PSO_FULL_DAY_MONTH_YEAR_GET'
_________________
Пользователь не знает, чего он хочет, пока не увидит то, что он получил. (Э. Йодан)
Back to top
View user's profile Send private message Send e-mail Blog
Удав
Гуру
Гуру


Age: 48
Joined: 25 Jan 2008
Posts: 580
Location: Москва

PostPosted: Wed Feb 25, 2009 3:49 pm    Post subject: Reply with quote

Поищите здесь Wink
А вообще можно и по другому:
Code:

REPORT  z_calc_date.

PARAMETERS: p_date TYPE sy-datum DEFAULT sy-datum.

DATA: first_date TYPE sy-datum,
      days TYPE i.

START-OF-SELECTION.
  first_date = p_date.
  first_date+4(4) = '0101'.

  CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
    EXPORTING
      i_datum_bis                   = p_date
      i_datum_von                   = first_date
*     I_KZ_EXCL_VON                 = '0'
     i_kz_incl_bis                 = '1'
*     I_KZ_ULT_BIS                  = ' '
*     I_KZ_ULT_VON                  = ' '
*     I_STGMETH                     = '0'
*     I_SZBMETH                     = '1'
   IMPORTING
     e_tage                        = days
   EXCEPTIONS
     days_method_not_defined       = 1
     OTHERS                        = 2.
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
  WRITE: / p_date, '-', first_date, '=', days.

  WRITE: / 'Direct calc'.
  days = p_date - first_date.
  WRITE: / p_date, '-', first_date, '=', days.
[/code]
_________________
С уважением,
Удав.
Back to top
View user's profile Send private message
inna
Участник
Участник



Joined: 25 Mar 2008
Posts: 32

PostPosted: Wed Feb 25, 2009 5:02 pm    Post subject: Reply with quote

Спасибо! 'FI_PSO_FULL_DAY_MONTH_YEAR_GET' сработала, остальное не пробовала Smile
Back to top
View user's profile Send private message
DKiyanov
Участник
Участник


Age: 48
Joined: 12 Jan 2009
Posts: 17
Location: Хабаровск

PostPosted: Thu Feb 26, 2009 3:33 am    Post subject: Reply with quote

Можно и без ФМсов обойтись
ABAP прекрасно вычисляет разницу между датами
пример:
Code:

data: d type d.
d(4) = sy-datum(4).
d+4(4) = '0101'.
x = sy-datum - d.
write: / x.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP 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.