{"audience":"Billing teams, sales operations, accounts receivable and SD consultants.","authorization_objects":[{"note":"Billing creation authorization by billing type","object":"V_VBRK_FKA"},{"note":"Billing authorization by sales organization","object":"V_VBRK_VKO"},{"note":"Authorization to send email","object":"S_OC_SEND"}],"components":[],"countries":[],"effort_days_max":7,"effort_days_min":5,"effort_size":"M","faq":[{"a":"No. Standard copy control decides which deliveries combine into one invoice. The program only filters which deliveries go to billing, so one faulty delivery does not hold up the whole group.","q":"Does it change the invoice split rules?"},{"a":"Once the reason is fixed on the order or in master data, the delivery is billed automatically in the next run. An authorized user can skip a specific check once for a single delivery; that decision is written to the log.","q":"How are held deliveries released?"},{"a":"Yes. BAPI_BILLINGDOC_CREATEMULTIPLE is supported on S/4HANA as well; the billing status is read from LIPS instead of VBUP. It also works alongside the Fiori billing apps.","q":"Can it be used on S/4HANA?"}],"features":[{"code":"background","label":"Runs as a background job","note":""},{"code":"test_run","label":"Test mode (check without posting)","note":""},{"code":"log","label":"Line-by-line result and error log","note":""},{"code":"email","label":"Send the result by email","note":"The hold list is sent to the billing team after every run."},{"code":"alv","label":"ALV list (sort, filter, subtotals)","note":"The hold list can also be displayed as an ALV with drilldown to the delivery."}],"functions":[{"name":"BAPI_BILLINGDOC_CREATEMULTIPLE","role":"Bills the deliveries that passed the checks; also supports a test run"},{"name":"BAPI_TRANSACTION_COMMIT","role":"Saves the invoices created permanently"},{"name":"SO_DOCUMENT_SEND_API1","role":"Emails the hold list to the billing team"}],"gap":"VF04 processes the billing due list and VF06 runs it in the background with a variant. Neither applies business rules outside standard copy control: customers who require a customer PO number, payment terms or incoterms that differ from master data and goods issue dates outside the period are billed anyway and then cancelled and re-billed. A job that checks these rules before billing and reports the held items is needed.","id":"sd-scheduled-billing-with-checks","industries":[],"input_columns":[],"kind":"program","language":"en","lastmod":"2026-11-17","logic":"1. Deliveries in the selection are read: goods-issued (WADAT_IST filled) items whose billing status is open or partially processed (VBUP-FKSTA in ECC, LIPS-FKSTA in S/4HANA).\n2. For each delivery the order data is read and the checks run: the customer PO number (VBKD-BSTKD) must be filled for customers who require it, the payment terms (VBKD-ZTERM) and incoterms (VBKD-INCO1) on the order must match the customer's sales area data (KNVV), there must be no billing block on the order (VBAK-FAKSK) or the customer (KNVV-FAKSD), and the goods issue date must be in an open period. Which rule applies to which customer is kept in a small rule table maintained by the business.\n3. Deliveries that pass are billed with BAPI_BILLINGDOC_CREATEMULTIPLE; in test mode the same BAPI is called as a test run and no invoice is created.\n4. Deliveries that fail are written to a hold list with the reason; the list is emailed to the billing team with SO_DOCUMENT_SEND_API1.\n5. Invoices created (VBRK, VBRP) and their values are listed in the job log; once the reason is fixed, the delivery is retried automatically in the next run.","module":"SD","object_type":"batch_job","output_columns":[{"calculated":false,"formula":"","label":"Delivery","source_field":"VBELN","source_table":"LIKP"},{"calculated":false,"formula":"","label":"Ship-to","source_field":"KUNNR","source_table":"LIKP"},{"calculated":false,"formula":"","label":"Customer name","source_field":"NAME1","source_table":"KNA1"},{"calculated":false,"formula":"","label":"Goods issue date","source_field":"WADAT_IST","source_table":"LIKP"},{"calculated":true,"formula":"Sum of LIPS-NETWR of the delivery","label":"Delivery value","source_field":null,"source_table":null},{"calculated":false,"formula":"","label":"Billing document","source_field":"VBELN","source_table":"VBRK"},{"calculated":false,"formula":"","label":"Invoice value","source_field":"NETWR","source_table":"VBRK"},{"calculated":true,"formula":"Billed, test OK, on hold or error","label":"Result","source_field":null,"source_table":null},{"calculated":true,"formula":"Text of the first failed check or the BAPI error message","label":"Reason","source_field":null,"source_table":null}],"parameters":[{"example":"1000","kind":"select_option","label":"Sales organization","name":"S_VKORG","ref_field":"VBAK-VKORG","required":true},{"example":"1000","kind":"select_option","label":"Shipping point","name":"S_VSTEL","ref_field":"LIKP-VSTEL","required":false},{"example":"200100","kind":"select_option","label":"Ship-to party","name":"S_KUNNR","ref_field":"LIKP-KUNNR","required":false},{"example":"01.11.2026 – 17.11.2026","kind":"select_option","label":"Goods issue date range","name":"S_GIDAT","ref_field":"LIKP-WADAT_IST","required":true},{"example":"17.11.2026","kind":"parameter","label":"Billing date (blank = goods issue date)","name":"P_FKDAT","ref_field":"VBRK-FKDAT","required":false},{"example":"faturalama@ornek-sirket.com.tr","kind":"parameter","label":"Email address for the hold list","name":"P_MAIL","ref_field":"","required":false},{"example":"X","kind":"checkbox","label":"Test mode (check without creating invoices)","name":"P_TEST","ref_field":"","required":false}],"part_of":[],"performance":"Schedule the job once or a few times a day with separate variants per shipping point or sales organization. Call the BAPI in packages (for example 200 deliveries); deliveries that combine into one invoice must stay in the same package.","process":"O2C","quote_url":"https://nekuhub.com/en/request-a-quote/?report=sd-scheduled-billing-with-checks","related":["sd-billing-not-posted-to-accounting","sd-order-delivery-invoice-status"],"releases":[],"source":"custom","standard_alternatives":[{"note":"Processes the billing due list; does not apply customer-specific pre-checks.","tcode":"VF04"},{"note":"Runs billing in the background; produces no hold list or reason email.","tcode":"VF06"}],"summary":"A custom background job that bills goods-issued, unbilled deliveries at set times and runs customer-specific checks before billing. Deliveries that fail a check are not billed; they go to a hold list with the reason and the billing team is notified by email.","tables":[{"access":"read","join_on":"","role":"Deliveries to bill and goods issue date","table":"LIKP","variant":"both"},{"access":"read","join_on":"LIPS-VBELN = LIKP-VBELN","role":"Delivery item, value and reference order","table":"LIPS","variant":"both"},{"access":"read","join_on":"VBUP-VBELN = LIPS-VBELN AND VBUP-POSNR = LIPS-POSNR","role":"Item billing status in ECC","table":"VBUP","variant":"ecc"},{"access":"read","join_on":"VBAK-VBELN = LIPS-VGBEL","role":"Order header and billing block","table":"VBAK","variant":"both"},{"access":"read","join_on":"VBKD-VBELN = LIPS-VGBEL","role":"Customer PO number, payment terms and incoterms","table":"VBKD","variant":"both"},{"access":"read","join_on":"KNVV-KUNNR = VBAK-KUNNR AND KNVV-VKORG = VBAK-VKORG AND KNVV-VTWEG = VBAK-VTWEG AND KNVV-SPART = VBAK-SPART","role":"Customer sales area data: payment terms, incoterms, billing block","table":"KNVV","variant":"both"},{"access":"write","join_on":"","role":"Billing headers created","table":"VBRK","variant":"both"},{"access":"write","join_on":"","role":"Billing items created","table":"VBRP","variant":"both"},{"access":"read","join_on":"KNA1-KUNNR = LIKP-KUNNR","role":"Customer name","table":"KNA1","variant":"both"}],"title":"Scheduled Billing Job with Pre-Billing Checks and Hold List","url":"https://nekuhub.com/en/programs/scheduled-billing-job-with-pre-billing-checks/","vendor_id":"nekudos"}