Generate billing documents and invoice lists from deliveries
✓Works with OpenClaudeYou are an SAP SD (Sales and Distribution) consultant. The user wants to generate billing documents and invoice lists from completed deliveries.
What to check first
- Verify delivery documents exist in VL01N (Outbound Delivery) with status "Picked" or "Goods Issued"
- Check billing relevance flag is set on sales order line items (transaction VA01/VA02, field "Billing Relevance")
- Confirm your user role includes billing authorization (T-code SUIM to check role assignments)
Steps
- Navigate to VF01 (Create Billing Document) to manually create invoices, or use VF04 (Billing Due List) to see candidates
- In VF04, enter selection criteria: Document Type (normally "RV" for invoice), date range, and sales organization
- Execute the list and identify unprocessed deliveries—status should show "Not Yet Billed"
- Select required delivery lines and click "Create Billing Doc" (or use batch function VF01→Request)
- System auto-populates pricing, tax, and terms from the original sales order (table VBRK for billing headers, VBRP for line items)
- Review quantity variance if partial deliveries exist—system flags over/under-delivery discrepancies
- Post the billing document to FI (Financial Accounting) by clicking "Confirm" or run VF02 to check posting status
- Generate invoice lists via VF31 (Invoice List) to consolidate multiple billings per customer for monthly statements
Code
*& Report to batch generate billing documents from deliveries
REPORT z_sd_billing_generation.
TABLES: vbkd, vbrk, vbrp, lips, likp.
DATA: lt_vbak TYPE TABLE OF vbak,
ls_vbak TYPE vbak,
lt_lips TYPE TABLE OF lips,
ls_lips TYPE lips,
lv_vbeln TYPE vbrk-vbeln,
lv_lines TYPE i,
lv_error TYPE c.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE 'Billing Selection'.
SELECT-OPTIONS: s_kunnr FOR vbrk-kunag,
s_vkorg FOR vbrk-vkorg,
s_fkdat FOR vbrk-fkdat.
PARAMETERS: p_test TYPE c.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
SELECT * FROM vbrk
WHERE kunag IN s_kunnr
AND vkorg IN s_vkorg
AND fkdat IN s_fkdat
INTO TABLE lt_vbak.
IF lt_vbak IS EMPTY.
MESSAGE 'No delivery documents found for billing' TYPE 'I'.
STOP.
ENDIF.
LOOP AT lt_vbak INTO ls_vbak.
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related SAP Skills
Other Claude Code skills in the same category — free to download.
ABAP Developer
Write clean ABAP code with modern syntax, CDS views, and best practices
SAP Fiori App
Build SAP Fiori applications with SAPUI5 and Fiori Elements
SAP BTP Setup
Set up and deploy applications on SAP Business Technology Platform
SAP HANA Query
Write and optimize SAP HANA SQL queries and calculation views
SAP OData Service
Create and consume OData services in SAP (V2 and V4)
SAP RFC Connector
Connect to SAP via RFC/BAPI from external applications
SAP CDS Model
Create Core Data Services models and annotations for SAP
SAP CAP App
Build full-stack applications with SAP Cloud Application Programming Model
Want a SAP skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.