I_RO_SAFTStockMovementLine
Stock Movement Line Items
I_RO_SAFTStockMovementLine is a Composite CDS View (Dimension) that provides data about "Stock Movement Line Items" in SAP S/4HANA. It reads from 4 data sources (I_GLAccountLineItemRawData, I_CompanyCode, I_RO_SAFTDocumentTypeMap, I_RO_SAFTMaterialDocumentItem) and exposes 21 fields with key fields AccountingDocument, CompanyCode, FiscalYear, LedgerGLLineItem, MaterialDocumentLine. It has 12 associations to related views.
Data Sources (4)
| Source | Alias | Join Type |
|---|---|---|
| I_GLAccountLineItemRawData | _Acdoca | from |
| I_CompanyCode | _CompanyCode | inner |
| I_RO_SAFTDocumentTypeMap | _DocumentMap | inner |
| I_RO_SAFTMaterialDocumentItem | _Matdoc | inner |
Parameters (2)
| Name | Type | Default |
|---|---|---|
| P_Ledger | fagl_rldnr | |
| P_AlternativeGLAccountIsUsed | boolean |
Associations (12)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_ProductUnitsOfMeasure | _ProductUom | _Matdoc.Product = _ProductUom.Product and _Matdoc.AlternativeUnit = _ProductUom.AlternativeUnit |
| [0..1] | I_RO_SAFTUnitOfMeasureMap | _Uom | _Matdoc.AlternativeUnit = _Uom.SourceUnitOfMeasure |
| [0..*] | I_RO_BusinessPartnerTaxType | _DCustomer | _DCustomer.BusinessPartner = _Acdoca.Customer and _DCustomer.BusinessPartnerIsSAFTRelevant = 'X' and _DCustomer.TaxType = '6' and _DCustomer.FinancialAccountType = 'D' and _DCustomer.ValidFrom <= $session.system_date and _DCustomer.ValidTo >= $session.system_date and _DCustomer.VATRegistration is not initial |
| [0..*] | I_RO_BusinessPartnerTaxType | _KSupplier | _KSupplier.BusinessPartner = _Acdoca.Supplier and _KSupplier.BusinessPartnerIsSAFTRelevant = 'X' and _KSupplier.TaxType = '6' and _KSupplier.FinancialAccountType = 'K' and _KSupplier.ValidFrom <= $session.system_date and _KSupplier.ValidTo >= $session.system_date and _KSupplier.VATRegistration is not initial |
| [0..1] | I_GLAccountInCompanyCode | _GLAccount | _GLAccount.CompanyCode = _Acdoca.CompanyCode and _GLAccount.GLAccount = _Acdoca.GLAccount |
| [0..1] | I_RO_SAFTMvtTypeTableEntry | _MovementType1 | _MovementType1.GoodsMovementType = _Matdoc.GoodsMovementType and _MovementType1.Plant = _Acdoca.Plant and _MovementType1.TargetGLAccount = _Acdoca.GLAccount and _MovementType1.AccountingDocumentType = _Acdoca.AccountingDocumentType and _MovementType1.DebitCreditCode = _Acdoca.DebitCreditCode |
| [0..1] | I_RO_SAFTMvtTypeTableEntry | _MovementType2 | _MovementType2.GoodsMovementType = _Matdoc.GoodsMovementType and _MovementType2.Plant = _Acdoca.Plant and _MovementType2.TargetGLAccount = _Acdoca.GLAccount and _MovementType2.AccountingDocumentType = _Acdoca.AccountingDocumentType and _MovementType2.DebitCreditCode = '' |
| [0..1] | I_RO_SAFTMvtTypeTableEntry | _MovementType3 | _MovementType3.GoodsMovementType = _Matdoc.GoodsMovementType and _MovementType3.Plant = _Acdoca.Plant and _MovementType3.TargetGLAccount = _Acdoca.GLAccount and _MovementType3.AccountingDocumentType = '' and _MovementType3.DebitCreditCode = '' |
| [0..1] | I_RO_SAFTMvtTypeTableEntry | _MovementType4 | _MovementType4.GoodsMovementType = _Matdoc.GoodsMovementType and _MovementType4.Plant = _Acdoca.Plant and _MovementType4.TargetGLAccount = _Acdoca.GLAccount and _MovementType4.AccountingDocumentType = '' and _MovementType4.DebitCreditCode = _Acdoca.DebitCreditCode |
| [0..1] | I_RO_SAFTMvtTypeTableEntry | _MovementType5 | _MovementType5.GoodsMovementType = _Matdoc.GoodsMovementType and _MovementType5.Plant = _Acdoca.Plant and _MovementType5.TargetGLAccount = '' and _MovementType5.AccountingDocumentType = _Acdoca.AccountingDocumentType and _MovementType5.DebitCreditCode = _Acdoca.DebitCreditCode |
| [0..1] | I_RO_SAFTMvtTypeTableEntry | _MovementType6 | _MovementType6.GoodsMovementType = _Matdoc.GoodsMovementType and _MovementType6.Plant = _Acdoca.Plant and _MovementType6.TargetGLAccount = '' and _MovementType6.AccountingDocumentType = '' and _MovementType6.DebitCreditCode = '' |
| [0..1] | I_RO_SAFTMvtTypeTableEntry | _MovementType7 | _MovementType7.GoodsMovementType = _Matdoc.GoodsMovementType and _MovementType7.Plant = '' and _MovementType7.TargetGLAccount = '' and _MovementType7.AccountingDocumentType = '' and _MovementType7.DebitCreditCode = '' |
Annotations (12)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | IROSAFTSTKMVTITM | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #MANDATORY | view | |
| VDM.viewType | #COMPOSITE | view | |
| ObjectModel.usageType.sizeCategory | #XXL | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| Analytics.dataCategory | #DIMENSION | view | |
| Analytics.internalName | #LOCAL | view | |
| Metadata.allowExtensions | true | view | |
| EndUserText.label | Stock Movement Line Items | view |
Fields (21)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | AccountingDocument | I_GLAccountLineItemRawData | AccountingDocument | Journal Entry |
| KEY | CompanyCode | I_GLAccountLineItemRawData | CompanyCode | Receiver Company Code |
| KEY | FiscalYear | I_GLAccountLineItemRawData | FiscalYear | G/L Fiscal Year |
| KEY | LedgerGLLineItem | I_GLAccountLineItemRawData | LedgerGLLineItem | Journal Entry Item |
| KEY | MaterialDocumentLine | I_RO_SAFTMaterialDocumentItem | MaterialDocumentLine | Line ID |
| Product | I_GLAccountLineItemRawData | Product | Product Sold | |
| Plant | I_GLAccountLineItemRawData | Plant | Valuation Area | |
| DebitCreditCode | I_GLAccountLineItemRawData | DebitCreditCode | Single-Character Flag | |
| AccountingDocumentType | I_GLAccountLineItemRawData | AccountingDocumentType | Journal Entry Type | |
| Quantity | I_GLAccountLineItemRawData | Quantity | Value | |
| PostingDate | I_GLAccountLineItemRawData | PostingDate | Posting Date for GR | |
| DocumentDate | I_GLAccountLineItemRawData | DocumentDate | Journal Entry Date | |
| CompanyCodeCurrency | I_GLAccountLineItemRawData | CompanyCodeCurrency | Local Currency | |
| TransactionAmountInLocalCrcy | I_GLAccountLineItemRawData | AmountInCompanyCodeCurrency | Local Crcy Amt | |
| AccountingDocCreatedByUser | I_GLAccountLineItemRawData | AccountingDocCreatedByUser | User which created overhead document | |
| GoodsMovementType | I_RO_SAFTMaterialDocumentItem | GoodsMovementType | Movement Type | |
| Batch | I_RO_SAFTMaterialDocumentItem | Batch | Lot No. | |
| MaterialDocumentItemText | I_RO_SAFTMaterialDocumentItem | MaterialDocumentItemText | Text | |
| SourceUnitOfMeasureFactor | _Uom | SourceUnitOfMeasureFactor | ||
| ChartOfAccountsendasChartOfAccounts | ||||
| GLAccountendassaknrasTargetGLAccount |
Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.
-- Derived SQL interpretation of CDS view I_RO_SAFTStockMovementLine.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: IROSAFTSTKMVTITM
-- Parameters: P_Ledger : fagl_rldnr, P_AlternativeGLAccountIsUsed : boolean
CREATE VIEW I_RO_SAFTStockMovementLine AS
SELECT
_Acdoca.AccountingDocument AS AccountingDocument,
_Acdoca.CompanyCode AS CompanyCode,
_Acdoca.FiscalYear AS FiscalYear,
_Acdoca.LedgerGLLineItem AS LedgerGLLineItem,
_Matdoc.MaterialDocumentLine AS MaterialDocumentLine,
_Acdoca.Product AS Product,
_Acdoca.Plant AS Plant,
_Acdoca.DebitCreditCode AS DebitCreditCode,
_Acdoca.AccountingDocumentType AS AccountingDocumentType,
_Acdoca.Quantity AS Quantity,
_Acdoca.PostingDate AS PostingDate,
_Acdoca.DocumentDate AS DocumentDate,
_Acdoca.CompanyCodeCurrency AS CompanyCodeCurrency,
_Acdoca.AmountInCompanyCodeCurrency AS TransactionAmountInLocalCrcy,
_Acdoca.AccountingDocCreatedByUser AS AccountingDocCreatedByUser,
_Matdoc.GoodsMovementType AS GoodsMovementType,
_Matdoc.Batch AS Batch,
_Matdoc.MaterialDocumentItemText AS MaterialDocumentItemText,
_Uom.SourceUnitOfMeasureFactor AS SourceUnitOfMeasureFactor,
case $parameters.P_AlternativeGLAccountIsUsed when 'X' then _Acdoca.CountryChartOfAccounts else _Acdoca.ChartOfAccounts end as ChartOfAccounts AS ChartOfAccountsendasChartOfAccounts,
cast( case $parameters.P_AlternativeGLAccountIsUsed when 'X' then _GLAccount.AlternativeGLAccount else _Acdoca.GLAccount end as saknr ) as TargetGLAccount AS GLAccountendassaknrasTargetGLAccount
FROM I_GLAccountLineItemRawData AS _Acdoca
INNER JOIN I_RO_SAFTMaterialDocumentItem AS _Matdoc ON /* join condition not captured in parsed metadata */
INNER JOIN I_CompanyCode AS _CompanyCode ON /* join condition not captured in parsed metadata */
INNER JOIN I_RO_SAFTDocumentTypeMap AS _DocumentMap ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_ProductUnitsOfMeasure AS _ProductUom ON _Matdoc.Product = _ProductUom.Product AND _Matdoc.AlternativeUnit = _ProductUom.AlternativeUnit -- association [0..1]
LEFT OUTER JOIN I_RO_SAFTUnitOfMeasureMap AS _Uom ON _Matdoc.AlternativeUnit = _Uom.SourceUnitOfMeasure -- association [0..1]
LEFT OUTER JOIN I_RO_BusinessPartnerTaxType AS _DCustomer ON _DCustomer.BusinessPartner = _Acdoca.Customer AND _DCustomer.BusinessPartnerIsSAFTRelevant = 'X' AND _DCustomer.TaxType = '6' AND _DCustomer.FinancialAccountType = 'D' AND _DCustomer.ValidFrom <= $session.system_date AND _DCustomer.ValidTo >= $session.system_date AND _DCustomer.VATRegistration is not initial -- association [0..*]
LEFT OUTER JOIN I_RO_BusinessPartnerTaxType AS _KSupplier ON _KSupplier.BusinessPartner = _Acdoca.Supplier AND _KSupplier.BusinessPartnerIsSAFTRelevant = 'X' AND _KSupplier.TaxType = '6' AND _KSupplier.FinancialAccountType = 'K' AND _KSupplier.ValidFrom <= $session.system_date AND _KSupplier.ValidTo >= $session.system_date AND _KSupplier.VATRegistration is not initial -- association [0..*]
LEFT OUTER JOIN I_GLAccountInCompanyCode AS _GLAccount ON _GLAccount.CompanyCode = _Acdoca.CompanyCode AND _GLAccount.GLAccount = _Acdoca.GLAccount -- association [0..1]
LEFT OUTER JOIN I_RO_SAFTMvtTypeTableEntry AS _MovementType1 ON _MovementType1.GoodsMovementType = _Matdoc.GoodsMovementType AND _MovementType1.Plant = _Acdoca.Plant AND _MovementType1.TargetGLAccount = _Acdoca.GLAccount AND _MovementType1.AccountingDocumentType = _Acdoca.AccountingDocumentType AND _MovementType1.DebitCreditCode = _Acdoca.DebitCreditCode -- association [0..1]
LEFT OUTER JOIN I_RO_SAFTMvtTypeTableEntry AS _MovementType2 ON _MovementType2.GoodsMovementType = _Matdoc.GoodsMovementType AND _MovementType2.Plant = _Acdoca.Plant AND _MovementType2.TargetGLAccount = _Acdoca.GLAccount AND _MovementType2.AccountingDocumentType = _Acdoca.AccountingDocumentType AND _MovementType2.DebitCreditCode = '' -- association [0..1]
LEFT OUTER JOIN I_RO_SAFTMvtTypeTableEntry AS _MovementType3 ON _MovementType3.GoodsMovementType = _Matdoc.GoodsMovementType AND _MovementType3.Plant = _Acdoca.Plant AND _MovementType3.TargetGLAccount = _Acdoca.GLAccount AND _MovementType3.AccountingDocumentType = '' AND _MovementType3.DebitCreditCode = '' -- association [0..1]
LEFT OUTER JOIN I_RO_SAFTMvtTypeTableEntry AS _MovementType4 ON _MovementType4.GoodsMovementType = _Matdoc.GoodsMovementType AND _MovementType4.Plant = _Acdoca.Plant AND _MovementType4.TargetGLAccount = _Acdoca.GLAccount AND _MovementType4.AccountingDocumentType = '' AND _MovementType4.DebitCreditCode = _Acdoca.DebitCreditCode -- association [0..1]
LEFT OUTER JOIN I_RO_SAFTMvtTypeTableEntry AS _MovementType5 ON _MovementType5.GoodsMovementType = _Matdoc.GoodsMovementType AND _MovementType5.Plant = _Acdoca.Plant AND _MovementType5.TargetGLAccount = '' AND _MovementType5.AccountingDocumentType = _Acdoca.AccountingDocumentType AND _MovementType5.DebitCreditCode = _Acdoca.DebitCreditCode -- association [0..1]
LEFT OUTER JOIN I_RO_SAFTMvtTypeTableEntry AS _MovementType6 ON _MovementType6.GoodsMovementType = _Matdoc.GoodsMovementType AND _MovementType6.Plant = _Acdoca.Plant AND _MovementType6.TargetGLAccount = '' AND _MovementType6.AccountingDocumentType = '' AND _MovementType6.DebitCreditCode = '' -- association [0..1]
LEFT OUTER JOIN I_RO_SAFTMvtTypeTableEntry AS _MovementType7 ON _MovementType7.GoodsMovementType = _Matdoc.GoodsMovementType AND _MovementType7.Plant = '' AND _MovementType7.TargetGLAccount = '' AND _MovementType7.AccountingDocumentType = '' AND _MovementType7.DebitCreditCode = '' -- association [0..1]
;
Learn More
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- CDS View Annotations — A Complete Guide
- What Is a CDS View in SAP S/4HANA?
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA
- BSEG to ACDOCA: The Universal Journal Migration
- Business Partner Migration: KNA1/LFA1 to BUT000
- Material Document Migration: MSEG/MKPF to MATDOC
- How to Find the Right CDS View for an SAP Table
- BW Extractor to CDS View Migration Guide
- S/4HANA CDS View Deprecation: What You Need to Know
- ABAP CDS View Tutorial — From Basics to Real-World Examples
- RAP and CDS Views — Building Transactional Apps in SAP S/4HANA
- Sales Document Status Migration: VBUP/VBUK Removal in S/4HANA
- CO Tables in S/4HANA: COEP, COBK, COSS, COSP to ACDOCA