cancel
Showing results for 
Search instead for 
Did you mean: 

block cancellation/creation of billing document on CLOSED posting period

Former Member
0 Kudos

Hi Experts,

Currently, user is allowed to cancel/create backdated billing document where period already closed, but it does not release to accounting automatically, due to the period has been closed.

When account user found out that the accounting document is missing for the billing document, they have to re-open the period and manual release it to accounting, in order to generate the accounting document.

Therefore, we need the billing document to be blocked for cancellation/creation on CLOSED posting period.

Is there any settings in stardard SAP to block cancellation/creation of billing document on CLOSED posting period?

would appreciate your inputs.

Thanks and Regards,

N.C.Reddy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ready,

As such in standard there is no such funconality to avoid back dated cancel of invoices.

In order to avoid back dated or cancel of invoice or Referenced document cancel you can do it in copy control.

Take a help of an ABAPER tell them to write a new routine by taking a copy of original routien, so that existing functionality will work along with your additional condition.

In that routien you can put condition weather it is a back dated invoice or weather it is already referenced for some other document. If it is back dated put an error message saying that you are doing a back dated invoice cancel or itf it is a referenced invoice then also it should and cancel for that also put error message.

In run time you will get those fields tell abaper to put break point and

It is quite easy, check if not able to do let me know will tell the exact process.

Regards,

Nagesh

Former Member
0 Kudos

Hi Guys,

Thanks for your response.Now I have Cleared, but my key user still asking this question"why SAP standard unable to block the cancellation/creation of billing document in closed period?. What are the benefits for unable to do so?

Is there any document or note available on this.

Thanks and Regards,

Nooka

Former Member
0 Kudos

Hi,

We have blocked the creation / cancel of billing document in closed posting period through user exit.

Thanks and Regards,

N.C.Reddy

Answers (3)

Answers (3)

koolspy_ultimate
Active Contributor
0 Kudos

<thanks solved>

Edited by: koolspy on Jul 5, 2011 12:38 PM

Former Member
0 Kudos

issue closed

koolspy_ultimate
Active Contributor
0 Kudos

Hi i am facing the same issue for stopping the cancellation of billing documents,

So can you please let me know the detailed procedure for doing this requirement.

if possible please post the code here.

thanks in advace,

kool.

Former Member
0 Kudos

Hi ,

We have blocked cancellation/ creation of billing document through below user exit. Below is the progran code also.

-


***INCLUDE RV60AFZC.

************************************************************************

----


FORM USEREXIT_NUMBER_RANGE_INV_DATE USING US_RANGE_INTERN.

  • Example: Number range from TVFK like in standard

  • US_RANGE_INTERN = TVFK-NUMKI.

*{ INSERT KPDK904773 1

*Block creation or cancellation of billing doc in closed period

DATA : gv_gjahr TYPE bkpf-gjahr,

gv_monat TYPE bkpf-monat,

gv_poper TYPE t009b-poper,

gv_bukrs TYPE t001-bukrs,

lv_gjahr TYPE t001b-frye1,

lv_monat TYPE t001b-frpe1,

gv_oper TYPE t001b-frpe1.

CLEAR : gv_gjahr, gv_monat, gv_poper, gv_bukrs.

gv_bukrs = vbrk-bukrs.

IF NOT likp-wadat_ist IS INITIAL.

*- First determine the Period of the Actual GI date.

CALL FUNCTION 'FI_PERIOD_DETERMINE'

EXPORTING

i_budat = likp-wadat_ist

i_bukrs = gv_bukrs

IMPORTING

E_GJAHR = gv_gjahr

E_MONAT = gv_monat

E_POPER = gv_poper

EXCEPTIONS

FISCAL_YEAR = 1

PERIOD = 2

PERIOD_VERSION = 3

POSTING_PERIOD = 4

SPECIAL_PERIOD = 5

VERSION = 6

POSTING_DATE = 7

OTHERS = 8.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ELSE.

CLEAR : lv_gjahr, lv_monat.

lv_gjahr = gv_gjahr.

lv_monat = gv_monat.

*- Once period is determine check whether Period is open or not for 'D' - Customer Account

CALL FUNCTION 'FI_PERIOD_CHECK'

EXPORTING

I_BUKRS = gv_bukrs

i_gjahr = lv_gjahr

i_koart = 'D'

i_monat = lv_monat

IMPORTING

E_OPER = gv_oper

EXCEPTIONS

ERROR_PERIOD = 1

ERROR_PERIOD_ACC = 2

INVALID_INPUT = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ELSE.

*- Once period is determine check whether Period is open or not for 'S' - All G/L Accounts

CALL FUNCTION 'FI_PERIOD_CHECK'

EXPORTING

I_BUKRS = gv_bukrs

i_gjahr = lv_gjahr

i_koart = 'S'

i_monat = lv_monat

IMPORTING

E_OPER = gv_oper

EXCEPTIONS

ERROR_PERIOD = 1

ERROR_PERIOD_ACC = 2

INVALID_INPUT = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

*- Check Billing Date period is closed or not

IF kom-fkdat is not initial.

clear : gv_gjahr, gv_monat, gv_poper.

*- First determine the Period of the Actual GI date.

CALL FUNCTION 'FI_PERIOD_DETERMINE'

EXPORTING

i_budat = kom-fkdat

i_bukrs = gv_bukrs

IMPORTING

E_GJAHR = gv_gjahr

E_MONAT = gv_monat

E_POPER = gv_poper

EXCEPTIONS

FISCAL_YEAR = 1

PERIOD = 2

PERIOD_VERSION = 3

POSTING_PERIOD = 4

SPECIAL_PERIOD = 5

VERSION = 6

POSTING_DATE = 7

OTHERS = 8.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ELSE.

CLEAR : lv_gjahr, lv_monat.

lv_gjahr = gv_gjahr.

lv_monat = gv_monat.

*- Once period is determine check whether Period is open or not for 'D' - Customer Account

CALL FUNCTION 'FI_PERIOD_CHECK'

EXPORTING

I_BUKRS = gv_bukrs

i_gjahr = lv_gjahr

i_koart = 'D'

i_monat = lv_monat

IMPORTING

E_OPER = gv_oper

EXCEPTIONS

ERROR_PERIOD = 1

ERROR_PERIOD_ACC = 2

INVALID_INPUT = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ELSE.

*- Once period is determine check whether Period is open or not for 'S' - All G/L Accounts

CALL FUNCTION 'FI_PERIOD_CHECK'

EXPORTING

I_BUKRS = gv_bukrs

i_gjahr = lv_gjahr

i_koart = 'S'

i_monat = lv_monat

IMPORTING

E_OPER = gv_oper

EXCEPTIONS

ERROR_PERIOD = 1

ERROR_PERIOD_ACC = 2

INVALID_INPUT = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ELSE.

  • IF kom-fkdat4(2) <> likp-wadat_ist4(2).

*

  • ENDIF.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

*} INSERT

ENDFORM.

----


  • FORM USEREXIT_FILL_VBRK_VBRP *

----


  • This userexit can be used to fill fields in VBRK and VBRP *

  • Be aware, that at this time the work areas KUAGV KURGV *

  • KUWEV and KUREV are not filled. *

  • This form is called from FORM VBRK_VBRP_FUELLEN. *

----


FORM USEREXIT_FILL_VBRK_VBRP.

  • Example: change Tax country

  • VBRK-LANDTX = T001-LAND1.

ENDFORM.

*eject

koolspy_ultimate
Active Contributor
0 Kudos

thanks for your reply but

i have one more doubt


  FORM USEREXIT_NUMBER_RANGE_INV_DATE 
*       This userexit can be used to determine the numberranges for   *
*       the internal document number. This userexit can be used when  *
*       the number_ranger should impact the invoice date via table    *
*       TVFKD.                                                        *
*       If this userexit is active the USEREXIT_NUMBER_RANGE is not   *
*       processed anymore, that means this userexit has priority.     *
*       US_RANGE_INTERN - internal number range                       *
*       This form is called from form LV60AU02 and LV60AU11 

now what about this?

koolspy_ultimate
Active Contributor
0 Kudos

thanks Mr. nooka reddy

<solved>

koolspy_ultimate
Active Contributor
0 Kudos

hello mr.nooka reddy the code which you have sent me is working good.

but there is a problem in that.

i.e if i create a document today and when cancelling if i give previous date then also the bill is getting cancelled.

If you know any details regarding about this , then please let me know.

thanks in advance,

kool.

koolspy_ultimate
Active Contributor
0 Kudos

any updates on this please?

koolspy_ultimate
Active Contributor
0 Kudos

<Thanks . solved it myself>

Edited by: koolspy on Jul 6, 2011 4:32 PM

former_member183879
Active Contributor
0 Kudos

Hi

As such, there is no standard functionality to prevent the billing document creation on a backdate as billing date. However you can enable by means of an enhancement to enforce this control.

You may look at the user exits in include RV60AFZZ to ensure that the billing date is either today's date or any date afterthat and cannot be the date where the posting periods are already closed. This is the only way to control this process.