Block cancellation/creation of billing document on CLOSED posting period

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

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

Similar Messages

  • Block cancelling the cleared billing documents

    Hi Friends,
    Currently system is allowing to cancel the cleared billing document and business does want to do that, for example when F2 billing type document is cancelled then it is generating S1 type cancelled document.
    I think I can prevent this by config ( in VOFA for billing type F2 under section cancellation>Copying requirements> assign 29.
    And I need to do it for all billing types,
    Now my queries are:
    Do I need to do any config for cancelled billing type (S1)  as well ?
    Is there complication for doing that?
    Whether I would be able to cancel the uncleared billing document in this way?
    Or just I can proceed what I mentioned above.
    Regards
    Ashu

    So I do need to assign 29 in only billing document type F2;
    is there any change required for cancelled billing document type (S1)?
    Yes only in F2. Not in S1.
    So if accounting document of billing type is showing as
    cleared then only system will not allow to cancel it.
    Will it allow to cancel the billing document if accounting
    document ( of type F2) is showing as not cleared?
    Yes that will allow you to do so.
    Say, due some price change, you want to cancel an invoice with cleared accounting doc and you are using 29 in routine. Then in that case take use of Invoice correction request / credit memo request / debit memo request based on your business requirement.
    Thanks & Regards
    JP

  • How identify closed accounting period to restrict creation of billing document in sap

    Hi Experts,
    I have a requirement to identify the  closed  periods in sap based on this we need to restrict the creation of billing document .
    Actually we are working for  Brazil  client, there we have notafiscal   which created along with billing document.we are maintaining  periods monthly basis.
    When the periods are closed  accounting document not created and billing document is created  this is working fine . But over scenario along with billing document notafiscal number is also created which  is causing the problem. This notafiscal should not be created without a accounting  document.
    so my client wants to restrict creation of billing document also when these monthly periods are closed.
    Please suggest me a solution.
    Regards
    Ravi

    Helllo Ravinder,
    To check if a period is closed using the FM FI_PERIOD_CHECK.
    First calculate the period of the FI document date.
    DATA: GJAHR LIKE BKPF-GJAHR,
           MONAT LIKE BKPF-MONAT,
           POPER LIKE T009B-POPER.
    CALL FUNCTION 'FI_PERIOD_DETERMINE'
           EXPORTING
                I_BUDAT        = I_BUDAT
                I_BUKRS        = I_BUKRS
    *          I_PERIV        = ' '
    *          I_GJAHR        = 0000
    *          I_MONAT        = 00
    *          X_XMO16        = ' '
           IMPORTING
                E_GJAHR        = GJAHR
                E_MONAT        = MONAT
    *          e_poper        = 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.
    MOVE MONAT TO POPER.
            CALL FUNCTION 'FI_PERIOD_CHECK'
                 EXPORTING
                      I_BUKRS          =  I_BUKRS
    *                I_OPVAR          = ' '
                      I_GJAHR          =  I_GJAHR
                      I_KOART          = '+'
    *                i_konto          =
                      I_MONAT          = POPER
                 EXCEPTIONS
                      ERROR_PERIOD     = 1
                      ERROR_PERIOD_ACC = 2
                      OTHERS           = 3.
    ENDIF.
    Tutorial ABAP How to check that posting date belongs to closed period - ABAP Development - SCN Wiki
    I hope you help.

  • Error Message for the cancellation of paid billing document

    Hi,
    Can i create and error message for the cancellation of paid billing document? If yes, how can i create such.
    Overview:
    Accounting document is created upon creation of billing document. Upon payment, document cleared is the accounting document created. There are instances wherein accounting document was already cleared but our user is still able to reversed billing document. Now, i want to create an error message or user exist wherein, when a user will not be able to reverse the billing document if the accounting document attached to this billing document is already paid.
    Thank you and best regards.
    Rachelle

    Hi Rachel,
    You can make use of the exit (Include) MV45AFZZ. The corresponding form routine is FORM USEREXIT_SAVE_DOCUMENT_PREPARE.
    In this exit, For the given billing document ( which is going to be cancelled ), pick up the accouting document from BSEG tables.
    For this accouting document, Pass this to BSAD Table ( Customer clleared items) 
    If BSEG-BELNR = BSAD-BELNR and
      BSEG-Acc.Year = BSAD-Acc,year )..
    Then throw a error message and EXIT.
    So for all the cleared docments , user can not cancel the invoices.
    Regards,
    Sai

  • Backgorund job for automatic creation of billing document

    Dear All
    Could you advise me on how to set up a bacground job for automatic creation of billing document?
    Thanks and regards,
    Sylwia

    In standard, you cannot generate automatic billing but you can set date and time so that you can generate invoices at the specified time in bulk.  The TCode to achieve this is VF06.
    thanks
    G. Lakshmipathi

  • Bacground job for automatic creation of billing document

    Dear All
    Could you advise me on how to set up a bacground job for automatic creation of billing document?
    Thanks and regards,
    Sylwia
    Edited by: S. KOWALSKA on Jan 12, 2009 10:12 AM

    Dear Sylwia
    Please dont post the same question in multiple threads.  You are receiving feedback in the other forum.  Check this link
    [Backgorund job for automatic creation of billing document   |Backgorund job for automatic creation of billing document;
    thanks
    G. Lakshmipathi

  • Automatic creation of billing document

    Hi all,
    i want to automate creation of billing document for all the deliveries for which PGI done.
    i think we have to define a job which will call VF04.
    my question is when we do VF04 manually, we have to give selection criteria like sales org etc and then it displays the list of all the deliveries and then we have to select the deliveries manually and press collective billing/individual billing.
    so when the batch job calls the VF04, how will the batch job tells VF04 to select all deliveries and generate the invoices.
    regards
    sachin

    Hi Sonu,
    Go to VF04 and provide the inputs in the selection screen. Now save this as a variant.say ZZ_INV_DUELIST
    After saving the variant, find the program name of the tcode VF04. This can be found by going to System----Status in the menu. The resultant screen will have the program of the tcode VF04. Lets say it is BILLDUELIST
    Now go to SM36. Give some name for hte job name and click Step button
    Here you have to give the program name(BILLDUELIST) and the variant name(ZZ_INV_DUELIST). Here you can also configure whether the job should run immediately or in some schedules.
    Once this is done, you can create a delivery and then run this program in SM37. Now you can see the log of this program. It will tell you that the invoice is created
    Hope this helps

  • Automatic creation of billing documents

    Hi all,
    i want to automate creation of billing document for all the deliveries for which PGI done.
    i think we have to define a job which will call VF04.
    my question is when we do VF04 manually, we have to give selection criteria like sales org etc and then it displays the list of all the deliveries and then we have to select the deliveries and press collective billing/individual billing.
    so when the batch job calls the VF04, how all the deliveries are selected and the selection criteria taken into account by the batch job,
    regards
    sachin

    hi,
    thanks for the reply.
    my mian question was when the batch job calls the VF04 and the slection criteria is filled using variants, then the list of deliveries is called up by VF04. my question is how will the batch job select all the deliveries for invoice creation beause whn we run the VF04 witout bathc jb ,we need to select the deliveries for billing (either collective or individual)
    reards
    sachin

  • Re open the closed Posting Periods - Very Urgent

    Dear Experts,
    We have an urgent problem to solve.The company code currently we are configuring uses fiscal year (oct - Sept) and the other company codes in our client site uses (jan -Dec). So by mistake we closed posting periods using MMPV upto 2007 03 but it should be 2006 06(correct me if i am wrong).
    As we are still in baseline configuration we don't have any material document in the current company code. From this forum I got some solution to intialize the posting period using MMPI(which directed me to use SAP Note 487381).
    Now if I do MMPI with the directions mentioned in SAP Note 487381, will i face any problem now & in future.
    Please suggest me and help me as has become hurdle for the test process.
    Thanks in Advance...
    Nagesh Aswartha

    Hi Aswartha
    As you do not have any material documents , pl go ahead and initialize the periods. Should not be a problem.
    I normally do this to avoid errors:
    In MMPV, never give a period. Enter the current date(or first date of the month) in the date field and execute closing program.
    Best regards
    Ramki

  • Authorization for opening & Closing posting periods - OB52

    Hi,
    Is there any way to set authorization for opening & closing of posting periods in OB52?
    My scenario:
    I have 2 company codes - A & B assigned to 2 different posting period variant - say PPA & PPB.
    The user belonging to CoCd A should not be able to open/close posting period of CoCd B and vice versa.
    Is this possible through any authorization settings?
    Request your help on this.
    Regards,
    Sridevi

    Hi Sridevi
    Please go through the following:
    You can assign authorization groups for permitted posting periods. This means that, for example, some posting periods can only be opened for particular users within monthly or annual closing. You can only assign the authorization group at document header level and it only affects period 1. The authorization object is called F_BKPF_BUP (Accounting document: Authorizations for posting periods). Read the corresponding chapter on "User maintenance" in the "Assigning authorizations" topic.
    "User maintenance"
    Due to the modular authorization concept of the system, you can define authorization profiles which are tailored to the workplace of your employees. You can, for example, assign authorization to a workplace in the Accounts Receivable, Accounts Payable or General Ledger Accounting areas.
    By assigning authorizations you define which business-related objects your employees are allowed to process and which editing functions are allowed.
    In the following activities for authorization management, you must carry out the following for employees who are to work with the system:
    Assign authorizations
    The authorizations are assigned by specifying permitted values for the pre-defined objects.
    Define profiles
    In the SAP system, authorizations are grouped together in workplace profiles. Therefore one or more profiles must be allocated to the individual employee in the master record.
    I hope this helps.
    Regards
    Kavitha

  • How to open and closed posting period??

    Dear Gurus,
    Pls help me, how to open and closed posting period.when and how we used special period.
    Regrds
    Mahesh

    HI,
    Tcode is ob52
    here we generally provide the following details
    a/c type from a/c to a/c from period year to period year from period year to period
    +                                    1            2007   12         2007      13       2007   16
    + implies it applicable to all account types
    generally we can have maximum 4 special periods and total no of periods(normal+special) should not exceed 16
    generally we use special periods for year end adjustments like tax adjustments
    if it is useful assign me points

  • How to open a closed posting period?

    frnds
    Transaction MIRO
    i am trying to post invoice in one of the closed period, so it not allowing me to post and gives a message that postingperiod is not opened,
    can you please tell me how can i open closed posting period?
    Thanks

    Hi Mathew,
    For FI postings use OB52.  For opening MM postings use MMPI.
    Pls. read through the information regarding MMPI before you proceed further.
    Ram

  • Opening & Closing Posting Period

    At the time of  opening & Closing posting period ,we get two fields From Account and To Account. Can some body explain theuse of this two fields.Points will be assigned to all reply.

    Hi,
    It denotes the GL account number (From & to GL account number), to be opened or closed.
    Regards,
    Sridevi
    <i><b>* Pls. assign points, if useful</b></i>
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/sridevi+pattabiraman">me!</a>

  • How to open closed posting periods

    hi,
    can any open tell me how to open the closed posting periods to upload the inventory  , when we upload any inventory after opening the closed period will there be any effect on the G/L accounts as well.
    Thanks
    Regards,
    Murali

    Hi..
    Try OB52
    & MMPV..
    Consult with ur FICO consultant before making any changes...
    Reward if u FINDS THIS AS USEFUL...
    Regds
    MM

  • SD Billing - Avoid Cancellation Creation if Invoice has not been posted yet

    Dear all,
    I have noticed this problem in my company system.
    Problem descripion:
    - you creates an invoice and the system doesn't post it for any reason
    - then you create the cancel of the invoice, BEFORE forcing the posting of the invoice
    --> user creates Cancel, Cancel is not posted as well.
    --> from now it is impossible to post both invoices: if you try to post the Invoice after the cancel creation, the VF02 recongnise that a CANCEL exists and do not allow for the posting
    --> standard VFX3 doesn't signal this kind of not posted documents situation.
    Ok, The right procedure for thes user should be: create invoice, if not posted then try to understand why not posted, and not CANCEL it.
    But in this case VFK3 was not able to detect the invoice was not posted: it was not in the list.
    So the 2 ways must be:
    1) one possibility could be undestand in VFX3 could be enhanced: I checked in OSS but I didn't find anything.
    2) other possibility: add a further check in interface between SD and FI in order to check if original invoice is not posted to FI and in this case block the cancel creation, as instead standard SAP does.
    Could you please give me an idea on how it would be better proceed?
    Thank You very much.
    Raffaella

    Dear,
    thank you for your feedback.
    in VOFA the flag is not ticked.
    The problem was that In VFX3 no data were found for the specified document (with all "Inclomplete Due To" check box  flagged), even if invoice and relative cancel were already created, but not posted.
    When we tryied to to post them, via VF02 for example, the system didn't warned anything specific and, doing the posting via debug, we discovered that the posting was stopped because VBRK-RFBSK = E = "Billing Document Cancelled".
    So, forcing via debug that value = ' ', because of the urgency of Finance Office, we could invoice it and then do the same for its cancel.
    So at the moment it is not possible for me to reproduce the error in the system.
    The only workaround I can imagine, is to find a way to avoid cancel creation if invoice is not posted yet.
    Do you think this is feasible way?
    Thank You veyr much for your suggestions.
    KR
    Raffaella
    Edited by: Raffaella Sacchetto on Nov 29, 2010 3:43 PM

Maybe you are looking for

  • Using Time Machine to back up to a Windows 2003 Server

    I am trying to set up my Time Machine to back up to a windows 2003 server share. I have found some hacks on how to do so, however i am not successful. What I have done so far: TMShowUnsupportedNetworkVolumes 1 in terminal, which got TM to see my shar

  • Ntoskrnl.exe 100% disk usage windows 8.0 and 8.1

    This is a bug report. I hope Microsoft will take it seriously as it took me a whole day and much stress to track it down. Basically my problem was the same as this: http://slopjong.de/2013/04/23/extremely-high-disk-activity-with-windows-8-and-how-to-

  • AMD Radeon HD 6750M, Early 2011 MBP, 10.9.4 Problems

    Hello, Ever since 10.9.3 update I have a serious problem with my Early 2011 MBP with AMD Radeon HD 6750M card. First my configuration: MBP 2.2 GHz Intel Core i7 (Macbook Pro 8,2) 16 GB RAM 512 GB Sandisk SSD and 750 Stock HDD AMD Radeon HD 6750M and

  • Packagemaker - Installing Office 2008 and Updates

    Hiya, Is there anyway using PackageMaker to install Office 2008 and the 2 updates automatically?

  • Fx:Model works with mx datagrid but not spark ??

    Using the Lynda example,... the Mx DataGrid works but the Spark does not???? Model is new to Flex 4, shouldn't it work with spark?   <fx:Declarations>     <fx:Model id="productModel" source="data/products.xml"/>   </fx:Declarations>   <mx:DataGrid da