R_TrdgDocReltdDocInfoBasic
Related Document Information
R_TrdgDocReltdDocInfoBasic is a Basic CDS View that provides data about "Related Document Information" in SAP S/4HANA. It reads from 1 data source (wbgt) and exposes 73 fields with key field TrdgReltdDocumentUUID. It has 11 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| wbgt | wbgt | from |
Associations (11)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | R_TrdgDocDrctnOfGdsCshFlw | _TrdgDocDrctnOfGdsCshFlw | $projection.TrdgDocDrctnOfGdsCshFlw = _TrdgDocDrctnOfGdsCshFlw.TrdgDocDrctnOfGdsCshFlw |
| [0..1] | R_TrdgDocReltdDocDeltnCat | _TrdgDocReltdDocDeltnCat | $projection.TrdgDocReltdDocDeltnCat = _TrdgDocReltdDocDeltnCat.TrdgDocReltdDocDeltnCat |
| [0..1] | R_TrdgDocDiffInvcStatus | _TrdgDocDiffInvcStatus | $projection.TrdgDocDiffInvcStatus = _TrdgDocDiffInvcStatus.TrdgDocDiffInvcStatus |
| [0..1] | R_TrdgReltdDocCategory | _TrdgReltdDocCategory | $projection.TrdgReltdDocCategory = _TrdgReltdDocCategory.TrdgReltdDocCategory |
| [0..1] | R_TrdgDocItemIsComplete | _TrdgDocItemIsComplete | $projection.TrdgDocItemIsComplete = _TrdgDocItemIsComplete.TrdgDocItemIsComplete |
| [0..1] | R_TrdgDocDeltnIsRlvt | _TrdgDocDeltnIsRlvt | $projection.TrdgDocDeltnIsRlvt = _TrdgDocDeltnIsRlvt.TrdgDocDeltnIsRlvt |
| [0..1] | R_TrdgDocProcCompltnCat | _TrdgDocProcCompltnCat | $projection.TrdgDocProcCompltnCat = _TrdgDocProcCompltnCat.TrdgDocProcCompltnCat |
| [0..1] | R_TrdgDocReltdSideCat | _TrdgDocReltdSideCat | $projection.TrdgDocReltdSideCat = _TrdgDocReltdSideCat.TrdgDocReltdSideCat |
| [0..1] | R_TrdgDocReltdDocValnCat | _TrdgDocReltdDocValnCat | $projection.TrdgDocReltdDocValnCat = _TrdgDocReltdDocValnCat.TrdgDocReltdDocValnCat |
| [0..1] | R_TradingProcessErrorFlag | _TradingProcessErrorFlag | $projection.TradingProcessErrorFlag = _TradingProcessErrorFlag.TradingProcessErrorFlag |
| [0..1] | I_Currency | _Currency | $projection.TrdgDocReltdDocCurrency = _Currency.Currency |
Annotations (12)
| Name | Value | Level | Field |
|---|---|---|---|
| EndUserText.label | Related Document Information | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| VDM.viewType | #BASIC | view | |
| VDM.lifecycle.contract.type | #SAP_INTERNAL_API | view | |
| AccessControl.authorizationCheck | #PRIVILEGED_ONLY | view | |
| ObjectModel.compositionRoot | false | view | |
| ObjectModel.representativeKey | TrdgReltdDocumentUUID | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| Analytics.dataExtraction.enabled | false | view | |
| Analytics.internalName | #LOCAL | view |
Fields (73)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | TrdgReltdDocumentUUID | ruuid | SM Doc Rel UUID | |
| TrdgReltdDocCategory | VAT Document Type | |||
| TrdgDocRelatedDocument | vbeln | SD Sched. Agmt | ||
| TrdgDocReltdDocumentItem | WBS Element | |||
| TrdgDocReltdDocumentYear | gjahr | Settlement Year | ||
| TradingDocument | tkonn | Trading Contract | ||
| TradingDocumentItem | Item Number | |||
| CreatedByUser | ernam | User Name | ||
| CreationDate | erdat | Entered On | ||
| TradingProcessVariantType | tew_type | TEW Type | ||
| TrdgDocBusinessScenario | scenario | VAT Scenario | ||
| TradingProcessBusinessStep | business_step | Step | ||
| TrdgDocExternalIdentifier | tkonn_ex | Ext. Identifier | ||
| TrdgDocItemIsComplete | complete | Totals status | ||
| TradingProcessErrorFlag | error_tew | Doc.Creat.Error | ||
| TradingProcessPreviousStep | Previous Step | |||
| TradingProcessSourceStep | Previous Step | |||
| TrdgDocSlsQuantityUnit | pod_uom | Sales Unit | ||
| TrdgDocReltdBilledQuantity | pod_quan | Invoiced Qty | ||
| TrdgDocPurgQuantityUnit | pur_uom | Order Unit | ||
| PurchasingDocumentOrderQty | pur_quan | PO Quantity | ||
| TrdgDocDgtlSgntrProcID | guid | UUID 22 char. | ||
| TradingProcessVariantMode | tew_mode | Mode | ||
| TrdgDocReltdDocDeltnCat | del_flag | Deletion Ind. | ||
| TrdgDocDeltnIsRlvt | rel_flag | Deletion | ||
| TrdgDocProcCompltnCat | send_compl | Send Completion | ||
| TrdgDocRlvtPrecdgDocType | Document Type | |||
| TrdgDocReltdPrecdgDocument | pred_doc_nr | Pred. Gen. Doc. | ||
| TrdgDocReltdPrecdgDocYear | pred_doc_year | Pred. Gen. Doc. Year | ||
| TrdgDocReltdPrecdgDocCoCode | pred_doc_bukrs | Pred.Gen.Doc.CoCode | ||
| TrdgDocReltdPrecdgItem | Item Number | |||
| TrdgDocReltdSideCat | Side | |||
| Product | matnr | Vehicle Model | ||
| ProductGroup | matkl | Product Sold Group | ||
| Plant | werks | Receiving Plant | ||
| StorageLocation | lgort | Sublocation | ||
| Batch | charg | Chargeable Proc. | ||
| TrdgDocReltdDocUoM | unit_doc | Current Doc UoM | ||
| TrdgDocReltdDocQuantity | Qty Curr. Doc. | |||
| TrdgDocQtnDnmntr | umz | Qty Conv. | ||
| TrdgDocQtyNmrtr | umn | Qty Conv. Denomin. | ||
| TrdgDocReltdDocCurrency | curr_val | Currency | ||
| TrdgDocReltdDocItemAmount | value | Value from table | ||
| TrdgDocReltdDocValnCat | val_type | Value type | ||
| TrdgDocReltdDocItemTaxAmt | tax_val | Taxable Value | ||
| TrdgDocReltdDocExchangeRate | Exchange Rate | |||
| TrdgDocReltdDocStkAmt | value_cost | Stock Value | ||
| TrdgDocReltdDocumentDate | av_date | Date | ||
| TrdgDocReltdDocHasRetItm | ret_item | Returns Item | ||
| TrdgDocReltdDocItmValnType | bwtar | Valuation Type | ||
| TrdgDocDrctnOfGdsCshFlw | move_type_code | +/- Sign | ||
| TrdgDocPrcgPaytEvtGrpValue | group_code | PPE Group | ||
| TrdgDocReltdDocItmTotExpnAmt | exp_sum | Expenses Total | ||
| TrdgDocItmExpenseTaxAmount | tax_exp_sum | Expenses Tax | ||
| TrdgDocPurgExpnAmt | exp_rp | Purch. Expns (rcv) | ||
| TrdgDocNonRcovblPurgExpnAmt | exp_nrp | Purch. Expenses (nr) | ||
| TrdgDocRcovblSlsExpnAmt | exp_rs | Sales Expenses (rc) | ||
| TrdgDocNonRcovblSlsExpnAmt | exp_nrs | Sales Expenses (nr) | ||
| TrdgDocReltdDocExpnExchRate | Exchange Rate | |||
| TrdgDocReltdDocExpnCurrency | Currency | |||
| TrdgDocHasShdwContr | has_shadow_tc | has shadow TC | ||
| TrdgDocDiffInvcStatus | di_status | Status | ||
| _TrdgDocDrctnOfGdsCshFlw | _TrdgDocDrctnOfGdsCshFlw | |||
| _TrdgDocReltdDocDeltnCat | _TrdgDocReltdDocDeltnCat | |||
| _TrdgDocDiffInvcStatus | _TrdgDocDiffInvcStatus | |||
| _TrdgReltdDocCategory | _TrdgReltdDocCategory | |||
| _TrdgDocItemIsComplete | _TrdgDocItemIsComplete | |||
| _TrdgDocDeltnIsRlvt | _TrdgDocDeltnIsRlvt | |||
| _TrdgDocProcCompltnCat | _TrdgDocProcCompltnCat | |||
| _TrdgDocReltdSideCat | _TrdgDocReltdSideCat | |||
| _TrdgDocReltdDocValnCat | _TrdgDocReltdDocValnCat | |||
| _TradingProcessErrorFlag | _TradingProcessErrorFlag | |||
| _Currency | _Currency |
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 R_TrdgDocReltdDocInfoBasic.
-- 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.
CREATE VIEW R_TrdgDocReltdDocInfoBasic AS
SELECT
ruuid AS TrdgReltdDocumentUUID,
cast(doc_type as wb2_reltd_doc_cat preserving type ) AS TrdgReltdDocCategory,
vbeln AS TrdgDocRelatedDocument,
cast(posnr as wb2_reltd_doc_itm preserving type ) AS TrdgDocReltdDocumentItem,
gjahr AS TrdgDocReltdDocumentYear,
tkonn AS TradingDocument,
cast(tposn as wb2_document_itm preserving type ) AS TradingDocumentItem,
ernam AS CreatedByUser,
erdat AS CreationDate,
tew_type AS TradingProcessVariantType,
scenario AS TrdgDocBusinessScenario,
business_step AS TradingProcessBusinessStep,
tkonn_ex AS TrdgDocExternalIdentifier,
complete AS TrdgDocItemIsComplete,
error_tew AS TradingProcessErrorFlag,
cast(pre_step as wb2_procg_pre_step preserving type ) AS TradingProcessPreviousStep,
cast(original_step as wb2_proc_src_step preserving type ) AS TradingProcessSourceStep,
pod_uom AS TrdgDocSlsQuantityUnit,
pod_quan AS TrdgDocReltdBilledQuantity,
pur_uom AS TrdgDocPurgQuantityUnit,
pur_quan AS PurchasingDocumentOrderQty,
guid AS TrdgDocDgtlSgntrProcID,
tew_mode AS TradingProcessVariantMode,
del_flag AS TrdgDocReltdDocDeltnCat,
rel_flag AS TrdgDocDeltnIsRlvt,
send_compl AS TrdgDocProcCompltnCat,
cast(pred_doc_type as wb2_doc_type preserving type ) AS TrdgDocRlvtPrecdgDocType,
pred_doc_nr AS TrdgDocReltdPrecdgDocument,
pred_doc_year AS TrdgDocReltdPrecdgDocYear,
pred_doc_bukrs AS TrdgDocReltdPrecdgDocCoCode,
cast(pred_item as wb2_reltd_precdg_item preserving type ) AS TrdgDocReltdPrecdgItem,
cast( side as wb2_doc_side preserving type ) AS TrdgDocReltdSideCat,
matnr AS Product,
matkl AS ProductGroup,
werks AS Plant,
lgort AS StorageLocation,
charg AS Batch,
unit_doc AS TrdgDocReltdDocUoM,
cast(own_quan as wb2_quantity_doc preserving type ) AS TrdgDocReltdDocQuantity,
umz AS TrdgDocQtnDnmntr,
umn AS TrdgDocQtyNmrtr,
curr_val AS TrdgDocReltdDocCurrency,
value AS TrdgDocReltdDocItemAmount,
val_type AS TrdgDocReltdDocValnCat,
tax_val AS TrdgDocReltdDocItemTaxAmt,
cast(rate_val as wb2_exch_rate_no_cnext preserving type ) AS TrdgDocReltdDocExchangeRate,
value_cost AS TrdgDocReltdDocStkAmt,
av_date AS TrdgDocReltdDocumentDate,
ret_item AS TrdgDocReltdDocHasRetItm,
bwtar AS TrdgDocReltdDocItmValnType,
move_type_code AS TrdgDocDrctnOfGdsCshFlw,
group_code AS TrdgDocPrcgPaytEvtGrpValue,
exp_sum AS TrdgDocReltdDocItmTotExpnAmt,
tax_exp_sum AS TrdgDocItmExpenseTaxAmount,
exp_rp AS TrdgDocPurgExpnAmt,
exp_nrp AS TrdgDocNonRcovblPurgExpnAmt,
exp_rs AS TrdgDocRcovblSlsExpnAmt,
exp_nrs AS TrdgDocNonRcovblSlsExpnAmt,
cast(rate_exp as wb2_expn_exch_rate_no_cnext preserving type ) AS TrdgDocReltdDocExpnExchRate,
cast(curr_exp as wb2_reltd_doc_expn_curr preserving type ) AS TrdgDocReltdDocExpnCurrency,
has_shadow_tc AS TrdgDocHasShdwContr,
di_status AS TrdgDocDiffInvcStatus
FROM wbgt
LEFT OUTER JOIN R_TrdgDocDrctnOfGdsCshFlw AS _TrdgDocDrctnOfGdsCshFlw ON TrdgDocDrctnOfGdsCshFlw = _TrdgDocDrctnOfGdsCshFlw.TrdgDocDrctnOfGdsCshFlw -- association [0..1]
LEFT OUTER JOIN R_TrdgDocReltdDocDeltnCat AS _TrdgDocReltdDocDeltnCat ON TrdgDocReltdDocDeltnCat = _TrdgDocReltdDocDeltnCat.TrdgDocReltdDocDeltnCat -- association [0..1]
LEFT OUTER JOIN R_TrdgDocDiffInvcStatus AS _TrdgDocDiffInvcStatus ON TrdgDocDiffInvcStatus = _TrdgDocDiffInvcStatus.TrdgDocDiffInvcStatus -- association [0..1]
LEFT OUTER JOIN R_TrdgReltdDocCategory AS _TrdgReltdDocCategory ON TrdgReltdDocCategory = _TrdgReltdDocCategory.TrdgReltdDocCategory -- association [0..1]
LEFT OUTER JOIN R_TrdgDocItemIsComplete AS _TrdgDocItemIsComplete ON TrdgDocItemIsComplete = _TrdgDocItemIsComplete.TrdgDocItemIsComplete -- association [0..1]
LEFT OUTER JOIN R_TrdgDocDeltnIsRlvt AS _TrdgDocDeltnIsRlvt ON TrdgDocDeltnIsRlvt = _TrdgDocDeltnIsRlvt.TrdgDocDeltnIsRlvt -- association [0..1]
LEFT OUTER JOIN R_TrdgDocProcCompltnCat AS _TrdgDocProcCompltnCat ON TrdgDocProcCompltnCat = _TrdgDocProcCompltnCat.TrdgDocProcCompltnCat -- association [0..1]
LEFT OUTER JOIN R_TrdgDocReltdSideCat AS _TrdgDocReltdSideCat ON TrdgDocReltdSideCat = _TrdgDocReltdSideCat.TrdgDocReltdSideCat -- association [0..1]
LEFT OUTER JOIN R_TrdgDocReltdDocValnCat AS _TrdgDocReltdDocValnCat ON TrdgDocReltdDocValnCat = _TrdgDocReltdDocValnCat.TrdgDocReltdDocValnCat -- association [0..1]
LEFT OUTER JOIN R_TradingProcessErrorFlag AS _TradingProcessErrorFlag ON TradingProcessErrorFlag = _TradingProcessErrorFlag.TradingProcessErrorFlag -- association [0..1]
LEFT OUTER JOIN I_Currency AS _Currency ON TrdgDocReltdDocCurrency = _Currency.Currency -- 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