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.
SAP S/4HANA Cloud
Sales and Distribution (SD)
- In the custom logic of BAdI SD_BIL_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.
- 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.
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.
1) SAP Help - Copying Requirements for Sales Documents
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’
SD_BIL_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