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
stefan
Участник
Участник



Joined: 14 Feb 2008
Posts: 19

PostPosted: Mon Jun 02, 2008 3:59 pm    Post subject: Получение периода финансового года по дате Reply with quote

Здравствуйте!
Столкнулся с проблемой в программе, вызанной тем, что для получения периода финансового года использовался месяц из sy-datum.
Для нашей системы это оказалось неправильно, в декабре существует два периода 12 и 13. Существуйет ли универсальная функция для получения периода по дате для выбранного компани кода?
Пожалуйста, дайте пример.
Back to top
View user's profile Send private message
John Doe
Модератор
Модератор


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

PostPosted: Mon Jun 02, 2008 4:11 pm    Post subject: Reply with quote

Попробуйте использовать ФМ BAPI_COMPANYCODE_GET_PERIOD. Точной уверенности правда нет...
Back to top
View user's profile Send private message Blog
vga
Мастер
Мастер


Age: 150
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Tue Jun 03, 2008 10:08 am    Post subject: Reply with quote

Code:
PARAMETERS pbukrs LIKE BSEG-BUKRS OBLIGATORY MEMORY ID BUK.
PARAMETERS pdate LIKE SYST-DATUM OBLIGATORY DEFAULT SY-DATUM.

DATA: g_poper LIKE T009B-POPER,
       g_periv LIKE T001-periv.

    g_poper = pdate+4(2).

    SELECT SINGLE periv FROM T001 INTO g_periv
      WHERE BUKRS = PBUKRS.

    IF SY-SUBRC IS INITIAL.
      CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
        EXPORTING
          I_DATE  = pdate
          I_PERIV = g_periv       "Version der Periodenermittlung
        IMPORTING
          E_BUPER  = g_poper
        EXCEPTIONS
          INPUT_FALSE    = 1
          T009_NOTFOUND  = 1
          T009B_NOTFOUND = 1.
    ENDIF.
Back to top
View user's profile Send private message Blog Visit poster's website
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.