Sap fi

From 5throck/ai-workspace-standards · View interactive version

Sap fi is an AI agent skill from the GitHub repository 5throck/ai-workspace-standards. Use when working on FI module tasks — journal entries, account determination, G/L, accounts payable/receivable, or financial reporting. Provides process flows, key table relationships, common query patterns, field notes, SAP quirks, and standard BAPIs for the FI module.

How to use this skill

Skill file

FI Analyst Context — Financial Accounting

Load this skill when activating the FI Analyst role. Provides deep domain knowledge for journal entries, account determination, and financial reporting.

Process Flow

FI Document Sources:
  ├── SD: VF01 Billing → FI Automatic Posting (VKOA Account Determination)
  ├── MM: MIGO GR/MIRO Invoice → FI Automatic Posting (OBYC Account Determination)
  ├── CO: Cost Allocation → FI Integrated Posting (ACDOCA)
  └── FI Direct: FB01/FB50/FB60/FB70

Closing Process:
  F.05 (Foreign Currency Valuation) → F-03 (Account Clearing) → F.07 (Balance Carryforward)

Key Table Relationships

BKPF (FI Document Header)
  └─► BSEG (FI Document Line Item)
        ├─► SKA1 (G/L Account Master)
        ├─► LFA1 (Vendor Master) ← BSEG.LIFNR
        └─► KNA1 (Customer Master) ← BSEG.KUNNR

ACDOCA (Universal Journal — S/4HANA)
  ├── Integration of all accounting areas (FI + CO + AA + ML)
  └─► BKPF (Back-reference to Document Header)

FAGLFLEXT (G/L Account Balance — New GL)
SKB1 (G/L Account Master — Company Code level)

Common Query Patterns

-- Document History Search for Specific Account
SELECT a~bukrs, a~belnr, a~budat, a~blart, b~hkont, b~dmbtr, b~shkzg
  FROM bkpf AS a JOIN bseg AS b ON a~bukrs = b~bukrs AND a~belnr = b~belnr AND a~gjahr = b~gjahr
  WHERE b~hkont = '<GL_ACCOUNT>' AND a~budat >= '20260101' AND a~budat <= '20260531'
  ORDER BY a~budat DESCENDING

-- Open Vendor Items (AP)
SELECT bukrs, belnr, budat, lifnr, dmbtr, waers, zfbdt, zterm
  FROM bseg
  WHERE koart = 'K' AND augbl = ' ' AND gjahr = '2026'
  ORDER BY zfbdt ASCENDING

-- Universal Journal Cost-Revenue Combination (S/4HANA)
SELECT rbukrs, racct, kostl, prctr, ksl, rhcur, budat
  FROM acdoca
  WHERE rbukrs = '1000' AND budat >= '20260501' AND budat <= '20260531'
  ORDER BY budat DESCENDING

-- G/L Account Balance (New GL)
SELECT rldnr, rbukrs, racct, ryear, drcrk, tslvt, tsl01, tsl02
  FROM faglflext
  WHERE rbukrs = '1000' AND ryear = '2026' AND racct = '<GL_ACCOUNT>'

Key Field Notes

| Table | Field | Description |

|-------|-------|-------------|

| BKPF | BLART | Document Type (SA, KR, DR, etc.) |

| BKPF | STBLG | Reversal Document Number (Original doc during reversal) |

| BSEG | SHKZG | Debit/Credit: S=Debit, H=Credit |

| BSEG | AUGBL | Clearing Document Number (When open items are cleared) |

| BSEG | ZFBDT | Baseline Date (For payment due date calculation) |

| ACDOCA | DRCRK | Debit/Credit: S=Debit, H=Credit |

| ACDOCA | KSL | Amount in Document Currency |

Account Determination

| Source | Table | Conditions |

|--------|-------|------------|

| SD Billing | VKOA | Account Determination Procedure, Account Key (ERL, ERS, MWS, etc.) |

| MM GR | T030 / OBYC | Transaction Key (BSX=Inventory, WRX=GR/IR, PRD=Price Difference) |

| MM Invoice | T030 | Transaction Key (KBS=Account Assignment, WRX Clearing) |

| Asset | ANKL | G/L Accounts by Asset Class |

SAP Quirks & Known Issues

Standard Customizing Tables

| Table | Purpose |

|-------|---------|

| T001 | Company Code |

| T009 | Fiscal Year Variant |

| T004 | Chart of Accounts |

| T043T | Payment Terms Text |

| TZUN | Tax Code |

| T001G | Company Code Groups |

Strategic BAPIs & APIs

Accounting Document Posting

BAPI: BAPI_ACC_DOCUMENT_POST

Document Simulation

BAPI: BAPI_ACC_DOCUMENT_CHECK

Document Reversal

BAPI: BAPI_ACC_DOCUMENT_REV_POST

Incoming Invoice (MIRO equivalent)

BAPI: BAPI_INCOMINGINVOICE_CREATE

Context

This skill provides the FI Analyst with comprehensive domain knowledge for the Financial Accounting module in SAP. It is loaded when the active task involves journal entries, G/L account management, accounts payable/receivable, financial reporting, or period-end closing. The skill covers document posting flows, integration with SD/MM/CO, and standard BAPIs for financial operations.

When to Use

Execution Steps

  1. Review the Process Flow section to understand FI document sources (SD, MM, CO, direct) and the closing process.
  2. Query key tables using the Key Table Relationships section — prefer BSID/BSAD/BSIS/BSAS views over direct BSEG joins for performance.
  3. Apply Common Query Patterns as starting templates — adjust for New GL vs Classic GL and S/4HANA ACDOCA availability.
  4. Check Account Determination tables (VKOA, T030, ANKL) when investigating automatic posting configuration.
  5. Review SAP Quirks & Known Issues for BSEG cluster performance, reversal document handling, and currency amount pitfalls.
  6. Leverage Strategic BAPIs & APIs for posting, simulation, reversal, or incoming invoice processing.

Output Format

Structured analysis output should include: company code, document type and date ranges, posting references (BELNR with BUKRS and GJAHR), debit/credit breakdowns, account determination mapping, and integration source tracing. Include variance highlights for reconciliation tasks.

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.