R_TrdgDocHeaderBasic

DDL: R_TRDGDOCHEADERBASIC Type: view_entity BASIC Package: VDM_LO_GT

Header of Trading Document

R_TrdgDocHeaderBasic is a Basic CDS View that provides data about "Header of Trading Document" in SAP S/4HANA. It reads from 1 data source (wbhk) and exposes 166 fields with key field TradingDocument. It has 54 associations to related views. Part of development package VDM_LO_GT.

Data Sources (1)

SourceAliasJoin Type
wbhk wbhk from

Associations (54)

CardinalityTargetAliasCondition
[0..1] R_TrdgDocType _TradingDocumentType $projection.TradingDocumentType = _TradingDocumentType.TradingDocumentType
[0..1] R_TrdgDocCategory _TrdgDocCategory $projection.TrdgDocCategory = _TrdgDocCategory.TrdgDocCategory
[0..1] R_TrdgDocApplicationStatus _TrdgDocApplStatus $projection.TrdgDocApplicationStatus = _TrdgDocApplStatus.TrdgDocApplicationStatus
[0..1] R_TrdgDocProcgStatus _TrdgDocProcgStatus $projection.TrdgDocProcgStatus = _TrdgDocProcgStatus.TrdgDocProcgStatus
[0..1] R_TrdgDocSuccssrArchived _TrdgDocSuccssrArchived $projection.TrdgDocSuccessorArchived = _TrdgDocSuccssrArchived.TrdgDocSuccessorArchived
[0..1] R_TrdgDocLastChgdCat _TrdgDocLastChgdCat $projection.TrdgDocLastChangedCategory = _TrdgDocLastChgdCat.TrdgDocLastChangedCategory
[0..1] R_TrdgDocVarContrSettlmt _TrdgDocVarContrSettlmt $projection.TrdgDocVarContrSettlmt = _TrdgDocVarContrSettlmt.TrdgDocVarContrSettlmt
[0..1] R_TrdgDocHasCnsldtdItem _TrdgDocHasCnsldtdItem $projection.TrdgDocHasCnsldtdItem = _TrdgDocHasCnsldtdItem.TrdgDocHasCnsldtdItem
[0..1] R_TrdgDocPricingType _TrdgDocPricingType $projection.TrdgDocPricingType = _TrdgDocPricingType.TrdgDocPricingType
[0..1] I_SalesDocumentType _SalesDocumentType $projection.SalesDocumentType = _SalesDocumentType.SalesDocumentType
[0..1] I_SDDocumentCategory _SDDocumentCategory $projection.SDDocumentCategory = _SDDocumentCategory.SDDocumentCategory
[0..1] I_User _CreatedByUser $projection.CreatedByUser = _CreatedByUser.UserID
[0..1] I_User _LastChangedByUser $projection.LastChangedByUser = _LastChangedByUser.UserID
[0..1] I_SalesOrganization _SalesOrganization $projection.SalesOrganization = _SalesOrganization.SalesOrganization
[0..1] I_DistributionChannel _DistributionChannel $projection.DistributionChannel = _DistributionChannel.DistributionChannel
[0..1] I_Division _OrganizationDivision $projection.OrganizationDivision = _OrganizationDivision.Division
[0..1] I_SalesGroup _SalesGroup $projection.SalesGroup = _SalesGroup.SalesGroup
[0..1] I_SalesOffice _SalesOffice $projection.SalesOffice = _SalesOffice.SalesOffice
[0..1] I_Customer _SoldToParty $projection.SoldToParty = _SoldToParty.Customer
[0..1] I_AdditionalCustomerGroup1 _AdditionalCustomerGroup1 $projection.AdditionalCustomerGroup1 = _AdditionalCustomerGroup1.AdditionalCustomerGroup1
[0..1] I_AdditionalCustomerGroup2 _AdditionalCustomerGroup2 $projection.AdditionalCustomerGroup2 = _AdditionalCustomerGroup2.AdditionalCustomerGroup2
[0..1] I_AdditionalCustomerGroup3 _AdditionalCustomerGroup3 $projection.AdditionalCustomerGroup3 = _AdditionalCustomerGroup3.AdditionalCustomerGroup3
[0..1] I_AdditionalCustomerGroup4 _AdditionalCustomerGroup4 $projection.AdditionalCustomerGroup4 = _AdditionalCustomerGroup4.AdditionalCustomerGroup4
[0..1] I_AdditionalCustomerGroup5 _AdditionalCustomerGroup5 $projection.AdditionalCustomerGroup5 = _AdditionalCustomerGroup5.AdditionalCustomerGroup5
[0..1] I_CreditControlArea _CreditControlArea $projection.CreditControlArea = _CreditControlArea.CreditControlArea
[0..1] I_SDDocumentReason _SalesOrderReason $projection.SalesOrderReason = _SalesOrderReason.SDDocumentReason
[0..1] I_CustomerPurchaseOrderType _CustomerPurchaseOrderType $projection.CustomerPurchaseOrderType = _CustomerPurchaseOrderType.CustomerPurchaseOrderType
[0..1] I_Currency _TrdgDocCurrency $projection.TrdgDocCurrency = _TrdgDocCurrency.Currency
[0..1] I_Currency _TrdgDocSalesCurrency $projection.TrdgDocSalesCurrency = _TrdgDocSalesCurrency.Currency
[0..1] I_ShippingCondition _ShippingCondition $projection.ShippingCondition = _ShippingCondition.ShippingCondition
[0..1] I_DeliveryBlockReason _DeliveryBlockReason $projection.DeliveryBlockReason = _DeliveryBlockReason.DeliveryBlockReason
[0..1] I_CompanyCode _CompanyCode $projection.CompanyCode = _CompanyCode.CompanyCode
[0..1] I_BillingBlockReason _HeaderBillingBlockReason $projection.HeaderBillingBlockReason = _HeaderBillingBlockReason.BillingBlockReason
[0..1] I_ExchangeRateType _TrdgDocExchangeRateType $projection.TrdgDocExchangeRateType = _TrdgDocExchangeRateType.ExchangeRateType
[0..1] I_ExchangeRateType _TrdgDocSlsExchangeRateType $projection.TrdgDocSalesExchangeRateType = _TrdgDocSlsExchangeRateType.ExchangeRateType
[0..1] I_SlsPricingProcedure _TrdgDocSlsPricingProcedure $projection.TrdgDocSalesPricingProcedure = _TrdgDocSlsPricingProcedure.PricingProcedure
[0..1] I_ControllingArea _ControllingArea $projection.ControllingArea = _ControllingArea.ControllingArea
[0..*] I_SalesArea _SalesArea $projection.SalesOrganization = _SalesArea.SalesOrganization
[0..1] I_Customer _CustomerCreditAccount $projection.CustomerCreditAccount = _CustomerCreditAccount.Customer
[0..1] I_Currency _ControllingAreaCurrency $projection.ControllingAreaCurrency = _ControllingAreaCurrency.Currency
[0..1] I_CustomerSalesArea _CustomerSalesArea $projection.SoldToParty = _CustomerSalesArea.Customer and $projection.SalesOrganization = _CustomerSalesArea.SalesOrganization and $projection.DistributionChannel = _CustomerSalesArea.DistributionChannel and $projection.OrganizationDivision = _CustomerSalesArea.Division
[0..1] R_TrdgDocReleaseStatus _TrdgDocReleaseStatus $projection.TrdgDocReleaseStatus = _TrdgDocReleaseStatus.TrdgDocReleaseStatus
[0..1] R_TrdgDocBusProcCategory _TrdgDocBusProcCategory $projection.TrdgDocBusProcessCategory = _TrdgDocBusProcCategory.TrdgDocBusProcessCategory
[0..1] R_TrdgProcessVariantType _TradingProcessVariantType $projection.TradingProcessVariantType = _TradingProcessVariantType.TradingProcessVariantType
[0..1] I_WBSElementBasicData _WBSElementInternalID $projection.WBSElementInternalID = _WBSElementInternalID.WBSElementInternalID
[0..1] R_TrdgDocPurpose _TrdgDocPurpose $projection.TrdgDocPurpose = _TrdgDocPurpose.TrdgDocPurpose
[0..1] R_TrdgDocSrceDocType _TrdgDocSrceDocType $projection.TrdgDocSrceDocType = _TrdgDocSrceDocType.TrdgDocSrceDocType
[0..1] R_TrdgDocIsComplete _TrdgDocIsComplete $projection.TrdgDocIsComplete = _TrdgDocIsComplete.TrdgDocIsComplete
[0..1] I_SalesOrderType _SalesOrderType $projection.SalesDocumentType = _SalesOrderType.SalesOrderType
[0..1] I_MatlUsageIndicator _MatlUsageIndicator $projection.TrdgDocProdUsgeCat = _MatlUsageIndicator.MatlUsageIndicator
[0..1] I_Country _TaxDepartureCountry $projection.TaxDepartureCountry = _TaxDepartureCountry.Country
[0..1] I_Country _VATRegistrationCountry $projection.VATRegistrationCountry = _VATRegistrationCountry.Country
[0..1] I_TrdgDocAddlExpnsBlkRsnVH _TrdgDocAddlExpnsBlkRsn $projection.TrdgDocAddlExpnsBlkRsn = _TrdgDocAddlExpnsBlkRsn.TrdgDocAddlExpnsBlkRsn
[0..1] I_TrdgDocSuplrBillgBlkRsn _TrdgDocSuplrBillgBlkRsn $projection.TrdgDocSuplrBillgBlkRsn = _TrdgDocSuplrBillgBlkRsn.TrdgDocSuplrBillgBlkRsn

Annotations (13)

NameValueLevelField
VDM.viewType #BASIC view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
ObjectModel.compositionRoot false view
ObjectModel.representativeKey TradingDocument view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.sizeCategory #XL view
Analytics.dataExtraction.enabled false view
Analytics.internalName #LOCAL view
Metadata.allowExtensions false view
EndUserText.label Header of Trading Document view
Metadata.ignorePropagatedAnnotations true view

Fields (166)

KeyFieldSource TableSource FieldDescription
KEY TradingDocument tkonn Trading Contract
TradingDocumentType tctyp Contract Type
TrdgDocCategory tccat TC Category
TrdgDocApplicationStatus btbsta Only Copy Appr.TC
SalesDocumentType auart Sales Doc. Type
CreatedByUser ernam User Name
LastChangedByUser aenam User Name
TrdgDocPersonResponsible tksachb Pers. Respons.
CreationDate erdat Entered On
CreationTime Time created
LastChangeDate aedat Obsolete
LastChangeTime aezeit Time changed
TrdgDocDate budat Posting Date
SalesOrganization vkorg SD Sales Org.
DistributionChannel vtweg RefDistCh-Cust/Mat.
OrganizationDivision spart Source supplier
SalesGroup vkgrp Sales Group
SalesOffice vkbur Sales Office
SoldToParty kunnr Stock customer
AdditionalCustomerGroup1 kvgr1_sd Customer Grp 1
AdditionalCustomerGroup2 kvgr2_sd Customer Grp 2
AdditionalCustomerGroup3 kvgr3_sd Customer Grp 3
AdditionalCustomerGroup4 kvgr4_sd Customer Grp 4
AdditionalCustomerGroup5 kvgr5_sd Customer Grp 5
CreditControlArea kkber Cred.Contr.Area
SDDocumentCategory vbtyp_sd Document Cat.
SalesDocumentDate Trans. Period End
SalesOrderReason augru Sales Document Reason
SDDocumentCollectiveNumber submi_sd Collective No.
CustomerPurchaseOrderType bsark_sd Pur. Ord. Type
CustomerPurchaseOrderSuplmnt bstzd_sd Supplement
BindingPeriodValidityStartDate angdt_sd Valid From
BindingPeriodValidityEndDate bnddt_sd Valid To
TrdgDocSlsValidityStartDate Valid From
TrdgDocSlsValidityEndDate Valid To
TrdgDocProdUsgeCat Usage
ForeignTrade exnum Official No.
TrdgDocSlsPersonName bname_sd Name
PhoneNumber1 Telephone
TrdgDocSlsNrOfFollowUps No.of Contacts
DocumentReferenceID xblnr_sd Reference
TrdgDocPricingType pricing_type Pricing
TrdgDocCurrency tkwaers TrCont currency
TrdgDocTotalNetAmount netwr_sd Net Value
TrdgDocExchangeRate Exchange Rate
TrdgDocExchangeRateType kurst Fix.rate type (EMU)
TrdgDocExchangeRateDate wkurs_dat Exch. Rate Date
TrdgDocSalesCurrency sdwrs Doc. Currency
TrdgDocSalesExchangeRate Exchange Rate
TrdgDocSalesExchangeRateType Exch. Rate Type
TrdgDocSalesPricingDate Pricing Date
TrdgDocSalesPricingProcedure Procedure
CustomerTaxClassification1 taxk1_sd Alt.Tax Class.
CustomerTaxClassification2 taxk2_sd Tax Cls.2 Cust.
CustomerTaxClassification3 taxk3_sd Tax Cls.3 Cust.
CustomerTaxClassification4 taxk4_sd Tax Cls.4 Cust.
CustomerTaxClassification5 taxk5_sd Tax Cls.5 Cust.
CustomerTaxClassification6 taxk6_sd Tax Cls.6 Cust.
CustomerTaxClassification7 taxk7_sd Tax Cls.7 Cust.
CustomerTaxClassification8 taxk8_sd Tax Cls.8 Cust.
CustomerTaxClassification9 taxk9_sd Tax Cls.9 Cust.
ShippingCondition vsbed_sd Shipping Conditions
CompleteDeliveryIsDefined autlf_sd Complete Dlv.
DeliveryBlockReason lifsk_sd Delivery Block
CompanyCode company_code Company Code
HeaderBillingBlockReason faksk_sd Billing Block
ControllingArea kokrs Org. Value
CustomerCreditAccount knkli Credit Account
CustomerCreditGroup grupp Planning group
CreditRepresentativeGroup sbgrp Rep. group
CustomerRiskCategory ctlpc Risk Category
ControllingAreaCurrency cmwae Currency
CreditBlockReleaseDate cmfre Release date
NextCreditCheckDate cmnup Next Check
NextShippingDate cmngv Next date
ReleasedCreditAmount amtbl Credit Value
TrdgDocLastChangedCategory Last Chngd By
AccountingExchangeRate Exch.Rate Acct.
TrdgDocSlsExternalReference ihrez_sd Your Reference
TrdgDocIsComplete Totals status
LastCustomerContactDate mahdt_sd Last Contact Dt
TrdgDocQuantityIsComplete quan_complete Full Quantities
TrdgDocReleaseStatus tc_released Release for Doc
TrdgDocExternalIdentifier tkonn_ex Ext. Identifier
TrdgDocBusProcessCategory Use Case Type
TradingDocumentGoodsReceiver Customer
VATRegistrationCountry stceg_l Tax Dest. Cty/R
TaxDepartureCountry landtx Tx Dep Ctry/Reg
IsEUTriangularDeal xegdr EU Triang. Deal
TrdgDocHdrIsExtended dummy_wbhk_incl_eew_ps Dummy
TrdgDocSuccessorArchived succ_arch Network Status
TrdgDocHasCnsldtdItem Consol. item exists
TrdgDocVarContrSettlmt set_variant Process Variant
TrdgDocIsInApproval in_approval Approval Started
TrdgDocBatDetnProcedure kalsm_ch Search Proced.
TrdgDocProcgStatus Prc. Status
TrdgDocProcessingLastAction pf_last_action Last ActionCode
TrdgDocProcgLastSequence pf_last_order Last Seq. No.
TradingProcessVariantType tew_type TEW Type
WBSElementInternalID WBS Element
TrdgDocSrceDocType created_from Source Doc
TrdgDocPurpose purpose Purpose Type
TrdgDocPOByCustomer Cust. Reference
CustomerPurchaseOrderDate Cust. Ref. Date
PaymentGuaranteeProcedure abssc Paym.Guar.Proc.
InternalFinancialDocument lcnum Financ.Doc.No.
DepreciationPercentage akprz Depreciation
LogicalSystem logsys Source system
TrdgDocAddlExpnsBlkRsn Block Reason
TrdgDocSuplrBillgBlkRsn Block Reason
SalesDocumentCondition Doc. Condition
TrdgDocOutputControl output_control Output Control Indicator
_TradingDocumentType _TradingDocumentType
_TrdgDocCategory _TrdgDocCategory
_TrdgDocApplStatus _TrdgDocApplStatus
_TrdgDocHasCnsldtdItem _TrdgDocHasCnsldtdItem
_TrdgDocLastChgdCat _TrdgDocLastChgdCat
_SalesDocumentType _SalesDocumentType
_CreatedByUser _CreatedByUser
_TrdgDocVarContrSettlmt _TrdgDocVarContrSettlmt
_LastChangedByUser _LastChangedByUser
_SalesOrganization _SalesOrganization
_DistributionChannel _DistributionChannel
_OrganizationDivision _OrganizationDivision
_SalesGroup _SalesGroup
_SalesOffice _SalesOffice
_SoldToParty _SoldToParty
_TrdgDocProcgStatus _TrdgDocProcgStatus
_AdditionalCustomerGroup1 _AdditionalCustomerGroup1
_AdditionalCustomerGroup2 _AdditionalCustomerGroup2
_AdditionalCustomerGroup3 _AdditionalCustomerGroup3
_AdditionalCustomerGroup4 _AdditionalCustomerGroup4
_AdditionalCustomerGroup5 _AdditionalCustomerGroup5
_CreditControlArea _CreditControlArea
_SalesOrderReason _SalesOrderReason
_SDDocumentCategory _SDDocumentCategory
_CustomerPurchaseOrderType _CustomerPurchaseOrderType
_TrdgDocCurrency _TrdgDocCurrency
_TrdgDocSalesCurrency _TrdgDocSalesCurrency
_TrdgDocPricingType _TrdgDocPricingType
_ShippingCondition _ShippingCondition
_DeliveryBlockReason _DeliveryBlockReason
_CompanyCode _CompanyCode
_HeaderBillingBlockReason _HeaderBillingBlockReason
_TrdgDocExchangeRateType _TrdgDocExchangeRateType
_TrdgDocSlsExchangeRateType _TrdgDocSlsExchangeRateType
_TrdgDocSlsPricingProcedure _TrdgDocSlsPricingProcedure
_ControllingArea _ControllingArea
_SalesArea _SalesArea
_CustomerCreditAccount _CustomerCreditAccount
_ControllingAreaCurrency _ControllingAreaCurrency
_TrdgDocReleaseStatus _TrdgDocReleaseStatus
_TrdgDocBusProcCategory _TrdgDocBusProcCategory
_TradingProcessVariantType _TradingProcessVariantType
_TrdgDocSrceDocType _TrdgDocSrceDocType
_TrdgDocPurpose _TrdgDocPurpose
_TrdgDocSuccssrArchived _TrdgDocSuccssrArchived
_WBSElementInternalID _WBSElementInternalID
_TrdgDocIsComplete _TrdgDocIsComplete
_CustomerSalesArea _CustomerSalesArea
_SalesOrderType _SalesOrderType
_MatlUsageIndicator _MatlUsageIndicator
_TaxDepartureCountry _TaxDepartureCountry
_VATRegistrationCountry _VATRegistrationCountry
_TrdgDocAddlExpnsBlkRsn _TrdgDocAddlExpnsBlkRsn
_TrdgDocSuplrBillgBlkRsn _TrdgDocSuplrBillgBlkRsn

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_TrdgDocHeaderBasic.
-- 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_TrdgDocHeaderBasic AS
SELECT
  tkonn AS TradingDocument,
  tctyp AS TradingDocumentType,
  tccat AS TrdgDocCategory,
  btbsta AS TrdgDocApplicationStatus,
  auart AS SalesDocumentType,
  ernam AS CreatedByUser,
  aenam AS LastChangedByUser,
  tksachb AS TrdgDocPersonResponsible,
  erdat AS CreationDate,
  cast( erzeit as wb2_created_at preserving type ) AS CreationTime,
  aedat AS LastChangeDate,
  aezeit AS LastChangeTime,
  budat AS TrdgDocDate,
  vkorg AS SalesOrganization,
  vtweg AS DistributionChannel,
  spart AS OrganizationDivision,
  vkgrp AS SalesGroup,
  vkbur AS SalesOffice,
  kunnr AS SoldToParty,
  kvgr1_sd AS AdditionalCustomerGroup1,
  kvgr2_sd AS AdditionalCustomerGroup2,
  kvgr3_sd AS AdditionalCustomerGroup3,
  kvgr4_sd AS AdditionalCustomerGroup4,
  kvgr5_sd AS AdditionalCustomerGroup5,
  kkber AS CreditControlArea,
  vbtyp_sd AS SDDocumentCategory,
  cast (audat as wb2_sales_document_date preserving type ) AS SalesDocumentDate,
  augru AS SalesOrderReason,
  submi_sd AS SDDocumentCollectiveNumber,
  bsark_sd AS CustomerPurchaseOrderType,
  bstzd_sd AS CustomerPurchaseOrderSuplmnt,
  angdt_sd AS BindingPeriodValidityStartDate,
  bnddt_sd AS BindingPeriodValidityEndDate,
  cast( guebg as wb2_sls_valdty_start_dte preserving type ) AS TrdgDocSlsValidityStartDate,
  cast( gueen as wb2_sls_valdty_end_dte preserving type ) AS TrdgDocSlsValidityEndDate,
  cast( abrvw as wb2_prod_usge_cat preserving type ) AS TrdgDocProdUsgeCat,
  exnum AS ForeignTrade,
  bname_sd AS TrdgDocSlsPersonName,
  cast( telf1_sd as wb2_cust_tel preserving type ) AS PhoneNumber1,
  cast( mahza_sd as wb2_sls_nrof_contacts preserving type ) AS TrdgDocSlsNrOfFollowUps,
  xblnr_sd AS DocumentReferenceID,
  pricing_type AS TrdgDocPricingType,
  tkwaers AS TrdgDocCurrency,
  netwr_sd AS TrdgDocTotalNetAmount,
  cast( tkrate as wb2_tkrate_no_cnext preserving type ) AS TrdgDocExchangeRate,
  kurst AS TrdgDocExchangeRateType,
  wkurs_dat AS TrdgDocExchangeRateDate,
  sdwrs AS TrdgDocSalesCurrency,
  cast( tkrate_sd as wb2_sls_exch_rate_no_cnext preserving type ) AS TrdgDocSalesExchangeRate,
  cast( kurst_sd as wb2_sls_exch_rate_type preserving type ) AS TrdgDocSalesExchangeRateType,
  cast( prsdt_sd as wb2_sls_prcg_dte preserving type ) AS TrdgDocSalesPricingDate,
  cast( kalsm_sd as wb2_sls_prcg_proced preserving type ) AS TrdgDocSalesPricingProcedure,
  taxk1_sd AS CustomerTaxClassification1,
  taxk2_sd AS CustomerTaxClassification2,
  taxk3_sd AS CustomerTaxClassification3,
  taxk4_sd AS CustomerTaxClassification4,
  taxk5_sd AS CustomerTaxClassification5,
  taxk6_sd AS CustomerTaxClassification6,
  taxk7_sd AS CustomerTaxClassification7,
  taxk8_sd AS CustomerTaxClassification8,
  taxk9_sd AS CustomerTaxClassification9,
  vsbed_sd AS ShippingCondition,
  autlf_sd AS CompleteDeliveryIsDefined,
  lifsk_sd AS DeliveryBlockReason,
  company_code AS CompanyCode,
  faksk_sd AS HeaderBillingBlockReason,
  kokrs AS ControllingArea,
  knkli AS CustomerCreditAccount,
  grupp AS CustomerCreditGroup,
  sbgrp AS CreditRepresentativeGroup,
  ctlpc AS CustomerRiskCategory,
  cmwae AS ControllingAreaCurrency,
  cmfre AS CreditBlockReleaseDate,
  cmnup AS NextCreditCheckDate,
  cmngv AS NextShippingDate,
  amtbl AS ReleasedCreditAmount,
  cast( wbpch as wb2_tc_last_changed_cat preserving type ) AS TrdgDocLastChangedCategory,
  cast( kurrf as wb2_acc_exchange_rate preserving type ) AS AccountingExchangeRate,
  ihrez_sd AS TrdgDocSlsExternalReference,
  cast( complete as wb2_doc_is_complete preserving type ) AS TrdgDocIsComplete,
  mahdt_sd AS LastCustomerContactDate,
  quan_complete AS TrdgDocQuantityIsComplete,
  tc_released AS TrdgDocReleaseStatus,
  tkonn_ex AS TrdgDocExternalIdentifier,
  cast( use_case as wb2_bus_proc_cat preserving type ) AS TrdgDocBusProcessCategory,
  cast( we_kunnr as wb2_goods_receiver preserving type ) AS TradingDocumentGoodsReceiver,
  stceg_l AS VATRegistrationCountry,
  landtx AS TaxDepartureCountry,
  xegdr AS IsEUTriangularDeal,
  dummy_wbhk_incl_eew_ps AS TrdgDocHdrIsExtended,
  succ_arch AS TrdgDocSuccessorArchived,
  cast( consol_it_exist as wb2_consol_item_exist preserving type ) AS TrdgDocHasCnsldtdItem,
  set_variant AS TrdgDocVarContrSettlmt,
  in_approval AS TrdgDocIsInApproval,
  kalsm_ch AS TrdgDocBatDetnProcedure,
  cast( pf_status as wb2_tc_procg_status preserving type ) AS TrdgDocProcgStatus,
  pf_last_action AS TrdgDocProcessingLastAction,
  pf_last_order AS TrdgDocProcgLastSequence,
  tew_type AS TradingProcessVariantType,
  cast ( ps_psp_pnr as ps_s4_pspnr preserving type ) AS WBSElementInternalID,
  created_from AS TrdgDocSrceDocType,
  purpose AS TrdgDocPurpose,
  cast( bstnk as wb2_po_by_customer preserving type) AS TrdgDocPOByCustomer,
  cast( bstdk as wb2_cust_purch_order_date preserving type ) AS CustomerPurchaseOrderDate,
  abssc AS PaymentGuaranteeProcedure,
  lcnum AS InternalFinancialDocument,
  akprz AS DepreciationPercentage,
  logsys AS LogicalSystem,
  cast( lfspg as wb2_addl_expns_blk_rsn preserving type ) AS TrdgDocAddlExpnsBlkRsn,
  cast( lfspg as wb2_suplr_billg_blk_rsn preserving type ) AS TrdgDocSuplrBillgBlkRsn,
  cast( knumv_sd as wb2_sls_doc_cndn preserving type ) AS SalesDocumentCondition,
  output_control AS TrdgDocOutputControl
FROM wbhk
LEFT OUTER JOIN R_TrdgDocType AS _TradingDocumentType ON TradingDocumentType = _TradingDocumentType.TradingDocumentType  -- association [0..1]
LEFT OUTER JOIN R_TrdgDocCategory AS _TrdgDocCategory ON TrdgDocCategory = _TrdgDocCategory.TrdgDocCategory  -- association [0..1]
LEFT OUTER JOIN R_TrdgDocApplicationStatus AS _TrdgDocApplStatus ON TrdgDocApplicationStatus = _TrdgDocApplStatus.TrdgDocApplicationStatus  -- association [0..1]
LEFT OUTER JOIN R_TrdgDocProcgStatus AS _TrdgDocProcgStatus ON TrdgDocProcgStatus = _TrdgDocProcgStatus.TrdgDocProcgStatus  -- association [0..1]
LEFT OUTER JOIN R_TrdgDocSuccssrArchived AS _TrdgDocSuccssrArchived ON TrdgDocSuccessorArchived = _TrdgDocSuccssrArchived.TrdgDocSuccessorArchived  -- association [0..1]
LEFT OUTER JOIN R_TrdgDocLastChgdCat AS _TrdgDocLastChgdCat ON TrdgDocLastChangedCategory = _TrdgDocLastChgdCat.TrdgDocLastChangedCategory  -- association [0..1]
LEFT OUTER JOIN R_TrdgDocVarContrSettlmt AS _TrdgDocVarContrSettlmt ON TrdgDocVarContrSettlmt = _TrdgDocVarContrSettlmt.TrdgDocVarContrSettlmt  -- association [0..1]
LEFT OUTER JOIN R_TrdgDocHasCnsldtdItem AS _TrdgDocHasCnsldtdItem ON TrdgDocHasCnsldtdItem = _TrdgDocHasCnsldtdItem.TrdgDocHasCnsldtdItem  -- association [0..1]
LEFT OUTER JOIN R_TrdgDocPricingType AS _TrdgDocPricingType ON TrdgDocPricingType = _TrdgDocPricingType.TrdgDocPricingType  -- association [0..1]
LEFT OUTER JOIN I_SalesDocumentType AS _SalesDocumentType ON SalesDocumentType = _SalesDocumentType.SalesDocumentType  -- association [0..1]
LEFT OUTER JOIN I_SDDocumentCategory AS _SDDocumentCategory ON SDDocumentCategory = _SDDocumentCategory.SDDocumentCategory  -- association [0..1]
LEFT OUTER JOIN I_User AS _CreatedByUser ON CreatedByUser = _CreatedByUser.UserID  -- association [0..1]
LEFT OUTER JOIN I_User AS _LastChangedByUser ON LastChangedByUser = _LastChangedByUser.UserID  -- association [0..1]
LEFT OUTER JOIN I_SalesOrganization AS _SalesOrganization ON SalesOrganization = _SalesOrganization.SalesOrganization  -- association [0..1]
LEFT OUTER JOIN I_DistributionChannel AS _DistributionChannel ON DistributionChannel = _DistributionChannel.DistributionChannel  -- association [0..1]
LEFT OUTER JOIN I_Division AS _OrganizationDivision ON OrganizationDivision = _OrganizationDivision.Division  -- association [0..1]
LEFT OUTER JOIN I_SalesGroup AS _SalesGroup ON SalesGroup = _SalesGroup.SalesGroup  -- association [0..1]
LEFT OUTER JOIN I_SalesOffice AS _SalesOffice ON SalesOffice = _SalesOffice.SalesOffice  -- association [0..1]
LEFT OUTER JOIN I_Customer AS _SoldToParty ON SoldToParty = _SoldToParty.Customer  -- association [0..1]
LEFT OUTER JOIN I_AdditionalCustomerGroup1 AS _AdditionalCustomerGroup1 ON AdditionalCustomerGroup1 = _AdditionalCustomerGroup1.AdditionalCustomerGroup1  -- association [0..1]
LEFT OUTER JOIN I_AdditionalCustomerGroup2 AS _AdditionalCustomerGroup2 ON AdditionalCustomerGroup2 = _AdditionalCustomerGroup2.AdditionalCustomerGroup2  -- association [0..1]
LEFT OUTER JOIN I_AdditionalCustomerGroup3 AS _AdditionalCustomerGroup3 ON AdditionalCustomerGroup3 = _AdditionalCustomerGroup3.AdditionalCustomerGroup3  -- association [0..1]
LEFT OUTER JOIN I_AdditionalCustomerGroup4 AS _AdditionalCustomerGroup4 ON AdditionalCustomerGroup4 = _AdditionalCustomerGroup4.AdditionalCustomerGroup4  -- association [0..1]
LEFT OUTER JOIN I_AdditionalCustomerGroup5 AS _AdditionalCustomerGroup5 ON AdditionalCustomerGroup5 = _AdditionalCustomerGroup5.AdditionalCustomerGroup5  -- association [0..1]
LEFT OUTER JOIN I_CreditControlArea AS _CreditControlArea ON CreditControlArea = _CreditControlArea.CreditControlArea  -- association [0..1]
LEFT OUTER JOIN I_SDDocumentReason AS _SalesOrderReason ON SalesOrderReason = _SalesOrderReason.SDDocumentReason  -- association [0..1]
LEFT OUTER JOIN I_CustomerPurchaseOrderType AS _CustomerPurchaseOrderType ON CustomerPurchaseOrderType = _CustomerPurchaseOrderType.CustomerPurchaseOrderType  -- association [0..1]
LEFT OUTER JOIN I_Currency AS _TrdgDocCurrency ON TrdgDocCurrency = _TrdgDocCurrency.Currency  -- association [0..1]
LEFT OUTER JOIN I_Currency AS _TrdgDocSalesCurrency ON TrdgDocSalesCurrency = _TrdgDocSalesCurrency.Currency  -- association [0..1]
LEFT OUTER JOIN I_ShippingCondition AS _ShippingCondition ON ShippingCondition = _ShippingCondition.ShippingCondition  -- association [0..1]
LEFT OUTER JOIN I_DeliveryBlockReason AS _DeliveryBlockReason ON DeliveryBlockReason = _DeliveryBlockReason.DeliveryBlockReason  -- association [0..1]
LEFT OUTER JOIN I_CompanyCode AS _CompanyCode ON CompanyCode = _CompanyCode.CompanyCode  -- association [0..1]
LEFT OUTER JOIN I_BillingBlockReason AS _HeaderBillingBlockReason ON HeaderBillingBlockReason = _HeaderBillingBlockReason.BillingBlockReason  -- association [0..1]
LEFT OUTER JOIN I_ExchangeRateType AS _TrdgDocExchangeRateType ON TrdgDocExchangeRateType = _TrdgDocExchangeRateType.ExchangeRateType  -- association [0..1]
LEFT OUTER JOIN I_ExchangeRateType AS _TrdgDocSlsExchangeRateType ON TrdgDocSalesExchangeRateType = _TrdgDocSlsExchangeRateType.ExchangeRateType  -- association [0..1]
LEFT OUTER JOIN I_SlsPricingProcedure AS _TrdgDocSlsPricingProcedure ON TrdgDocSalesPricingProcedure = _TrdgDocSlsPricingProcedure.PricingProcedure  -- association [0..1]
LEFT OUTER JOIN I_ControllingArea AS _ControllingArea ON ControllingArea = _ControllingArea.ControllingArea  -- association [0..1]
LEFT OUTER JOIN I_SalesArea AS _SalesArea ON SalesOrganization = _SalesArea.SalesOrganization  -- association [0..*]
LEFT OUTER JOIN I_Customer AS _CustomerCreditAccount ON CustomerCreditAccount = _CustomerCreditAccount.Customer  -- association [0..1]
LEFT OUTER JOIN I_Currency AS _ControllingAreaCurrency ON ControllingAreaCurrency = _ControllingAreaCurrency.Currency  -- association [0..1]
LEFT OUTER JOIN I_CustomerSalesArea AS _CustomerSalesArea ON SoldToParty = _CustomerSalesArea.Customer AND SalesOrganization = _CustomerSalesArea.SalesOrganization AND DistributionChannel = _CustomerSalesArea.DistributionChannel AND OrganizationDivision = _CustomerSalesArea.Division  -- association [0..1]
LEFT OUTER JOIN R_TrdgDocReleaseStatus AS _TrdgDocReleaseStatus ON TrdgDocReleaseStatus = _TrdgDocReleaseStatus.TrdgDocReleaseStatus  -- association [0..1]
LEFT OUTER JOIN R_TrdgDocBusProcCategory AS _TrdgDocBusProcCategory ON TrdgDocBusProcessCategory = _TrdgDocBusProcCategory.TrdgDocBusProcessCategory  -- association [0..1]
LEFT OUTER JOIN R_TrdgProcessVariantType AS _TradingProcessVariantType ON TradingProcessVariantType = _TradingProcessVariantType.TradingProcessVariantType  -- association [0..1]
LEFT OUTER JOIN I_WBSElementBasicData AS _WBSElementInternalID ON WBSElementInternalID = _WBSElementInternalID.WBSElementInternalID  -- association [0..1]
LEFT OUTER JOIN R_TrdgDocPurpose AS _TrdgDocPurpose ON TrdgDocPurpose = _TrdgDocPurpose.TrdgDocPurpose  -- association [0..1]
LEFT OUTER JOIN R_TrdgDocSrceDocType AS _TrdgDocSrceDocType ON TrdgDocSrceDocType = _TrdgDocSrceDocType.TrdgDocSrceDocType  -- association [0..1]
LEFT OUTER JOIN R_TrdgDocIsComplete AS _TrdgDocIsComplete ON TrdgDocIsComplete = _TrdgDocIsComplete.TrdgDocIsComplete  -- association [0..1]
LEFT OUTER JOIN I_SalesOrderType AS _SalesOrderType ON SalesDocumentType = _SalesOrderType.SalesOrderType  -- association [0..1]
LEFT OUTER JOIN I_MatlUsageIndicator AS _MatlUsageIndicator ON TrdgDocProdUsgeCat = _MatlUsageIndicator.MatlUsageIndicator  -- association [0..1]
LEFT OUTER JOIN I_Country AS _TaxDepartureCountry ON TaxDepartureCountry = _TaxDepartureCountry.Country  -- association [0..1]
LEFT OUTER JOIN I_Country AS _VATRegistrationCountry ON VATRegistrationCountry = _VATRegistrationCountry.Country  -- association [0..1]
LEFT OUTER JOIN I_TrdgDocAddlExpnsBlkRsnVH AS _TrdgDocAddlExpnsBlkRsn ON TrdgDocAddlExpnsBlkRsn = _TrdgDocAddlExpnsBlkRsn.TrdgDocAddlExpnsBlkRsn  -- association [0..1]
LEFT OUTER JOIN I_TrdgDocSuplrBillgBlkRsn AS _TrdgDocSuplrBillgBlkRsn ON TrdgDocSuplrBillgBlkRsn = _TrdgDocSuplrBillgBlkRsn.TrdgDocSuplrBillgBlkRsn  -- association [0..1]
;