cancel
Showing results for 
Search instead for 
Did you mean: 

FM FI_PERIOD_CHECK doesn't return anything

ratana_pouy
Participant
0 Kudos

Hi,

i am using FM: FI_PERIOD_CHECK to check period in billing document. it doesn't return anything, even period is closed.

tcode: OB52

coding block in billing:

*- Check Billing Date period is closed or not
IF vbrk-fkdat is not initial.

clear :fis_year, period_month, posting_per.
*- First determine the Period.
CALL FUNCTION 'FI_PERIOD_DETERMINE'
EXPORTING
i_budat = vbrk-fkdat
i_bukrs = com_code
IMPORTING
e_gjahr = fis_year
e_monat = period_month
e_poper = posting_per.

CLEAR : fis_year1, per_month1.
fis_year1 = fis_year.
per_month1 = period_month.

*- Once period is determine check whether Period is open or not for 'D' - Customer Account
CALL FUNCTION 'FI_PERIOD_CHECK'
EXPORTING
i_bukrs = com_code "company code
i_gjahr = fis_year1 "Fiscal year
i_koart = 'D'
i_monat = per_month1 "Period
i_glvor = 'RFBU'
IMPORTING
e_oper = first_period "first posting period allowed (in interval 1)
exceptions
error_period = 1
error_period_acc = 2
invalid_input = 3
others = 4.

if sy-subrc <> 0.
message s001(00) with 'Not OK'.
else.
message s001(00) with 'OK'.
endif.

ENDIF.

Period 10 2023 is closed, user is trying to cancel document at period 10 2023, but FM of period check doesn't return any value.

Please kindly advise.

Thanks,

RTN

Accepted Solutions (0)

Answers (1)

Answers (1)

Lakshmipathi
Active Contributor
0 Kudos

It is not clear whether you want the system to prevent saving of cancellation billing document if an accounting document is generated ?

If so, you need to go with code change as recommended in SAP note 180756 which is for creation of billing document and posting an accounting document and you can take the inputs for vf11 also.