Posts

Showing posts with the label MM

Closing stock, standard cost and actual cost by company code: one HANA SQL query in DB02

Give it a company code and get the closing stock quantity, the standard cost value and the actual cost value for every material — per period, in one result set. Runs in DB02 → Diagnostics → SQL Editor as plain HANA SQL, not an ABAP report. Amounts come from the Material Ledger period tables. Verified on an S/4HANA sandbox: client 100, company code CC10, fiscal year 2026 period 007. 0. Before you start — valuation area wiring, and whether the physical table is still readable Case Company code ↔ valuation area ↔ plant — T001K / T001W What it does The starting point for pulling material data by company code. T001K links valuation area (BWKEY) to company code (BUKRS); T001W links plant (WERKS) to valuation area. MLBWA='X' means the Material Ledger is active for that valuation area. Watch out At plant-level valuation BWKEY = WERKS, so the join is 1:1. At company-code-level valuation one valuation area carries several plants and the join multiplies rows. Result 1 row (PT10) SEL...

Subcontracting vs external processing in S/4HANA: tell them apart by their postings

Both of these mean “someone outside does part of the work.” They are configured differently, they post differently, and picking the wrong one gives you a cost structure you cannot analyse later. The fastest way to keep them straight is not the definition — it is the accounting entry each one produces. What follows are the actual postings from two products made side by side in the same S/4HANA client: kimchi dumplings made by a subcontractor , and shrimp dumplings made in-house with one outsourced operation . Subcontracting: the vendor makes the product We buy the semi-finished product as work . We supply the raw materials, the subcontractor shapes them, and a single goods receipt settles the entire arrangement. That one document fires several OBYC account-determination keys at once: Posting at the subcontract goods receipt Amount OBYC key Dr 5080 raw material consumed — supplied to subcontractor 4,200 GBB · VBO Cr 1050...

GR/IR explained with real documents: why buying something posts nothing to your P&L

Buying 6,700 KRW of pork and wrappers produced four documents, two accounting entries, and zero effect on the profit and loss statement. That surprises people the first time they trace it, and the reason it works that way is the single most useful thing to understand about procurement in SAP. Below is the actual relay, with the real document numbers from a dumpling factory I built from an empty S/4HANA client. Four documents, but only two of them are accounting # Document What it claims Accounting entry 1 Requisition · ME51N EBAN 0199000553 “we want this” — internal only none 2 Purchase order · ME21N EKKO 4500006934 a promise to the vendor none 3 Goods receipt · MIGO 101 MSEG 5000006252 “it physically arrived” Dr 1050 raw material Cr 9010 GR/IR 4 Invoice receipt · MIRO RBKP 5100004739 “the vendor billed us” Dr 9010 GR/IR + input tax Cr 2...

Creating a Custom Movement Type in SAP — From OMJJ Through OBYC Account Determination to the FB03 Posting

This post walks through creating custom movement types, actually posting a goods issue with them, and verifying that the intended G/L account shows up in the accounting document. The order: copy a standard movement type in OMJJ to create ZZ1 (other goods issue) and ZZ2 (its reversal), wire up the account in OBYC , post with MIGO , and read the journal entry in FB03 . Environment: client 100, company code CC10. ※ Screens, menus, and settings may differ depending on your SAP release and system configuration. OMJJ — always copy, never create from scratch Movement types are created by copying an existing one; I used 202 (reversal of issue to cost center) as the source. The 11 folders in the Dialog Structure are the full bundle of settings that make up one movement type — of these, only two touch accounting directly: Account Grouping (the account modification key) and Update control (quantity/value updates). In the detail screen of ZZ2, the Internal Control block is greyed out be...