SAP Knowledge Base Article - Public

2892513 - How to set billing date equal to billing creation date via copy control - SAP S/4HANA Cloud

Symptom

In the app 'Create Billing Documents', in the billing settings, it is possible to switch on the option 'Set billing date and type before billing'

but you have the requirement to set the billing date equal to the billing creation date using copying control for billing documents.

Environment

SAP S/4HANA Cloud

Sales and Distribution (SD)

Resolution

1. In the custom logic of BAdI SD_BILL_DATA_TRANSFER, you can use the following custom logic to set the current date as the billing document date.

===================

* Example field manipulation of billing document header field:
* Here we're replacing the billing document date with the current date in time zone UTC.
GET TIME STAMP FIELD DATA(ts).
CONVERT TIME STAMP ts TIME ZONE 'UTC' INTO DATE bil_doc_res-billingdocumentdate.

===================

The example custom logic is also available in the BAdI example logic.

2. The following two configuration steps enable the system to call the desired BAdI implementation in the designated situations:

  • In the configuration step Define Custom Routines for Data Transfer to Billing Documents, you register a routine number and then assign it to an enhancement ID that identifies the BAdI implementation that you want this routine number to be mapped to. Key users can do this under Manage Your Solution -> Configure Your Solution -> Billing Enhancements -> Define Custom Routines for Data Transfer to Billing Documents. For more information, see the documentation of this configuration step.
    To facilitate this mapping, the filter value of the target BAdI implementation must be identical to the enhancement ID provided here. Key users can set this filter value in the Custom Fields and Logic app.

  • In the configuration steps of the configuration item Copying Control for Billing Documents, you must enter the routine number of the routine to be called for the designated combination of reference document type, target billing type, and item category. Key users can do this under Manage Your Solution -> Configure Your Solution -> Copying Control for Billing Documents. For more information, see the documentation of this configuration item."

Remark:

such a BAdI implementation has a general impact on the billing date setting. Not only the Fiori App “Create Billing Documents” but also the other ways and apps of billing are affected (scheduling, WebGUI, preliminary billing): the proposal or default billing date will be overwritten with such an implementation.

See Also

1)    SAP Help documentation - Copying Requirements for Sales Documents: https://help.sap.com/viewer/a376cd9ea00d476b96f18dea1247e6a5/latest/en-US/d309fa912946447ab9bca5a813c9515c.html

2)    Configuration help in ’Manage Your Solution’, ’Configure Your Solution’, Application Area: Sales, Sub Application Area: Sales Billing, Copying Control for Billing Documents, Configuration step IDs 102762, 102763, 102764

3)    BAdI documentation in the app ’Custom Fields and Logic’

4)    SAP S/4HANA Cloud Customer Community call:

       Slides: https://s4hanacloud.community.sap/groups/RjvRPABEvlRhA67WHjWxtM/documents/DSU7Zbu8Zg8FMScEotHPaJ/slide_viewer

 Recording: https://s4hanacloud.community.sap/groups/RjvRPABEvlRhA67WHjWxtM/documents/fWXQ9YoRktdfgHvcbeCKJc/video_viewer

Keywords

SD_BILL_DATA_TRANSFER, custom data transfer routine for billing documents, custom logic, enhancement implementation, VBRK-FKDAT, VTFL, VTFA, VTFF, VOFM, bil_doc_res-billingdocumentdate, bil_doc, bil_doc_item, bil_doc_res, SSCUI ID 102762, 102763, 102764, Copying Control Sales Document to Billing Document, Copying Control from Delivery Document to Billing Document, Copying Control from Billing Document to Billing Document, Create Billing Documents, SAP_SD_BC_BIL_DOC_PC, SAP_BR_BILLING_CLERK, VF01, VF04 , KBA , SD-BIL-IV , Processing Billing Documents , How To

Product

SAP S/4HANA Cloud all versions