Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI / FM to find next open period

former_member184588
Active Participant
0 Kudos

Hi,

I need to park vendor invoices. Sometimes the period is closed. Then I need to get the next open period. Is there some functionality like that?

So far I found: BAPI_COMPANYCODE_GET_PERIOD and FI_PERIOD_DETERMINE but nothing to get the next open period?

Thanks, Vanessa

3 REPLIES 3

former_member585060
Active Contributor
0 Kudos

Hi,

Try with "ACEPS_OPEN_PERIOD_DETERMINE".

Thanks & Regards

Bala Krishna

raymond_giuseppi
Active Contributor
0 Kudos

If DATE_TO_PERIOD_CONVERT  gives a closed period, use of LAST_DAY_IN_PERIOD_GET, ADD 1 to date and DATE_TO_PERIOD_CONVERT you should get next period.

Raymond,

Regards

Former Member
0 Kudos

Hi,

call function 'MR_PERIOD_DETERMINE'
    exporting
      i_bukrs                = 'UM'
      i_budat                = dat_ord
    exceptions
      invalid_posting_period = 1
      marv_no_entry          = 2
      others                 = 3.

  if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
               with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.