cancel
Showing results for 
Search instead for 
Did you mean: 

Add an accounting document to an SD sales flow

MuriloMachado
Explorer
0 Kudos
196

Hello!

I would like some help, we need to make an accounting entry referring to a document billed by SD, but it will be a manual entry, I would like to know if there is the possibility of adding this entry to the SD flow, in VF...
Is there a more Standard way possible, and if it's just Z, how would I do it?


------------------------------------------------------------------------------------------------------------------------------------

PT BR

Ola!

Gostaria de uma ajuda, precisamos fazer um lançamento contábil referente a um documento faturado por SD, mas será um lançamente manual, gostaria de saber se existe a possibilidade de adicionar esse lançamento no fluxo de SD, na VF...
Existe algum modo mais Standard possível, e se for somente Z, como eu faria?



View Entire Topic
mathurifico
Explorer

You're welcome! Yes, that's correct—if you want to add an accounting document after the billing process in a way that it integrates with the SD billing flow, it would typically require a custom solution (Z logic). Here's an outline of how you could approach it:


Custom Z Logic for Accounting Document Posting:

  1. Identify Trigger Point:

    • Use the SD Billing Document Save Event (e.g., during VF01 or VF02).
    • You can implement your logic using a user exit, BAdI, or an enhancement point. A commonly used user exit is USEREXIT_SAVE_DOCUMENT in the program RV60AFZZ.
  2. Develop Custom Logic for Posting Accounting Document:

    • Use a BAPI like BAPI_ACC_DOCUMENT_POST to create the additional accounting document.
    • Pass the required details (e.g., company code, GL accounts, amounts, cost center, etc.) derived from the billing document.
  3. Link the Billing Document to the Custom Accounting Entry:

    • Store the relationship between the billing document and the manually posted accounting document in a custom table. This ensures traceability and reporting consistency.
  4. Testing and Validation:

    • Test the integration to ensure that the accounting document is posted correctly and aligns with the billing document flow.
    • Verify that no duplicate postings occur.

Example Scenario:

If you want to create an additional journal entry (e.g., for a provision or adjustment) after the billing process, you could:

  • Fetch details like billing document number, customer, amount, and relevant GL accounts during the save event.
  • Call BAPI_ACC_DOCUMENT_POST to post the accounting document programmatically.
  • Link the billing document number (VBELN) with the accounting document number (BELNR) in a custom table.

Alternative Approach:

If you do not want to directly interfere with the SD flow:

  • Schedule a background job or develop a custom report to identify newly created billing documents and post the additional accounting entries in a batch process.

Final Note:

While Z-development is necessary for posting a completely separate accounting document, it is still advisable to explore standard options (e.g., adjustments using VF11 or corrections in FI) to minimize customizations.