View previous topic :: View next topic
Author
Message
inna Участник Joined: 25 Mar 2008 Posts: 32
Posted: Wed Feb 25, 2009 2:54 pm Post subject: День в году
Не подскажете: какая функция может вернуть порядковый номер дня в году? Или нет такой?
Спасибо!
Back to top
ghost Специалист Age: 37 Joined: 18 Jan 2008 Posts: 71 Location: Tashkent-Astana-Moscow
Posted: Wed Feb 25, 2009 3:07 pm Post subject:
ну например ФМ 'FI_PSO_FULL_DAY_MONTH_YEAR_GET ' _________________ Пользователь не знает, чего он хочет, пока не увидит то, что он получил. (Э. Йодан)
Back to top
Удав Гуру Age: 48 Joined: 25 Jan 2008 Posts: 580 Location: Москва
Posted: Wed Feb 25, 2009 3:49 pm Post subject:
Поищите здесь
А вообще можно и по другому:
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
inna Участник Joined: 25 Mar 2008 Posts: 32
Posted: Wed Feb 25, 2009 5:02 pm Post subject:
Спасибо! 'FI_PSO_FULL_DAY_MONTH_YEAR_GET' сработала, остальное не пробовала
Back to top
DKiyanov Участник Age: 48 Joined: 12 Jan 2009 Posts: 17 Location: Хабаровск
Posted: Thu Feb 26, 2009 3:33 am Post subject:
Можно и без ФМсов обойтись
ABAP прекрасно вычисляет разницу между датами
пример:
Code:
data: d type d.
d(4) = sy-datum(4).
d+4(4) = '0101'.
x = sy-datum - d.
write: / x.
Back to top
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.