A_SalesOrder
Sales Order Header
A_SalesOrder is a Composite CDS View that provides data about "Sales Order Header" in SAP S/4HANA. It reads from 1 data source (I_SalesOrder) and exposes 91 fields with key field SalesOrder. It has 10 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_SalesOrder | SalesOrder | from |
Associations (10)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..*] | A_SalesOrderItem | _Item | _Item.SalesOrder = $projection.SalesOrder |
| [0..*] | A_SalesOrderHeaderPartner | _Partner | _Partner.SalesOrder = $projection.SalesOrder |
| [0..*] | A_SalesOrderHeaderPrElement | _PricingElement | _PricingElement.SalesOrder = $projection.SalesOrder |
| [0..*] | A_SalesOrderText | _Text | _Text.SalesOrder = $projection.SalesOrder |
| [0..1] | A_SalesOrderBillingPlan | _BillingPlan | _BillingPlan.SalesOrder = $projection.SalesOrder and _BillingPlan.BillingPlan = $projection.BillingPlan |
| [0..*] | A_SlsOrdPaymentPlanItemDetails | _PaymentPlanItemDetails | _PaymentPlanItemDetails.SalesOrder = $projection.SalesOrder |
| [0..*] | A_SalesOrderRelatedObject | _RelatedObject | _RelatedObject.SalesOrder = $projection.SalesOrder |
| [0..*] | A_SalesOrderPrecdgProcFlow | _PrecedingProcFlowDoc | _PrecedingProcFlowDoc.SalesOrder = $projection.SalesOrder |
| [0..*] | A_SalesOrderSubsqntProcFlow | _SubsequentProcFlowDoc | _SubsequentProcFlowDoc.SalesOrder = $projection.SalesOrder |
| [0..1] | E_SalesDocumentBasic | _Extension | $projection.SalesOrder = _Extension.SalesDocument |
Annotations (15)
| Name | Value | Level | Field |
|---|---|---|---|
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| EndUserText.label | Sales Order Header | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.lifecycle.contract.type | #PUBLIC_REMOTE_API | view | |
| AbapCatalog.sqlViewName | ASALESORDER | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| ObjectModel.representativeKey | SalesOrder | view | |
| ObjectModel.createEnabled | true | view | |
| ObjectModel.updateEnabled | true | view | |
| ObjectModel.deleteEnabled | true | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| ObjectModel.usageType.serviceQuality | #B | view | |
| ObjectModel.usageType.sizeCategory | #L | view | |
| Metadata.ignorePropagatedAnnotations | true | view |
Fields (91)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | SalesOrder | SalesOrder | ||
| SalesOrderType | SalesOrderType | |||
| SalesOrganization | SalesOrganization | |||
| DistributionChannel | DistributionChannel | |||
| OrganizationDivision | OrganizationDivision | |||
| SalesGroup | SalesGroup | |||
| SalesOffice | SalesOffice | |||
| SalesDistrict | SalesDistrict | |||
| SoldToParty | SoldToParty | |||
| CreationDate | CreationDate | |||
| CreatedByUser | CreatedByUser | |||
| LastChangeDate | LastChangeDate | |||
| SenderBusinessSystemName | SenderBusinessSystemName | |||
| ExternalDocumentID | ExternalDocumentID | |||
| ExternalDocLastChangeDateTime | ExternalDocLastChangeDateTime | |||
| PurchaseOrderByCustomer | PurchaseOrderByCustomer | |||
| PurchaseOrderByShipToParty | PurchaseOrderByShipToParty | |||
| CustomerPurchaseOrderType | CustomerPurchaseOrderType | |||
| CustomerPurchaseOrderDate | CustomerPurchaseOrderDate | |||
| SalesOrderDate | SalesOrderDate | |||
| TotalNetAmount | TotalNetAmount | |||
| OverallDeliveryStatus | OverallDeliveryStatus | |||
| TotalBlockStatus | TotalBlockStatus | |||
| OverallOrdReltdBillgStatus | OverallOrdReltdBillgStatus | |||
| OverallSDDocReferenceStatus | OverallSDDocReferenceStatus | |||
| TransactionCurrency | TransactionCurrency | |||
| SDDocumentReason | SDDocumentReason | |||
| PricingDate | PricingDate | |||
| PriceDetnExchangeRate | PriceDetnExchangeRate | |||
| BillingPlan | BillingPlan | |||
| RequestedDeliveryDate | RequestedDeliveryDate | |||
| ShippingCondition | ShippingCondition | |||
| CompleteDeliveryIsDefined | CompleteDeliveryIsDefined | |||
| ShippingType | ShippingType | |||
| HeaderBillingBlockReason | HeaderBillingBlockReason | |||
| DeliveryBlockReason | DeliveryBlockReason | |||
| DeliveryDateTypeRule | DeliveryDateTypeRule | |||
| IncotermsClassification | IncotermsClassification | |||
| IncotermsTransferLocation | IncotermsTransferLocation | |||
| IncotermsLocation1 | IncotermsLocation1 | |||
| IncotermsLocation2 | IncotermsLocation2 | |||
| IncotermsVersion | IncotermsVersion | |||
| CustomerPriceGroup | CustomerPriceGroup | |||
| PriceListType | PriceListType | |||
| CustomerPaymentTerms | CustomerPaymentTerms | |||
| PaymentMethod | PaymentMethod | |||
| FixedValueDate | FixedValueDate | |||
| AssignmentReference | AssignmentReference | |||
| ReferenceSDDocument | ReferenceSDDocument | |||
| ReferenceSDDocumentCategory | ReferenceSDDocumentCategory | |||
| AccountingDocExternalReference | AccountingDocExternalReference | |||
| CustomerAccountAssignmentGroup | CustomerAccountAssignmentGroup | |||
| AccountingExchangeRate | AccountingExchangeRate | |||
| CustomerGroup | CustomerGroup | |||
| AdditionalCustomerGroup1 | AdditionalCustomerGroup1 | |||
| AdditionalCustomerGroup2 | AdditionalCustomerGroup2 | |||
| AdditionalCustomerGroup3 | AdditionalCustomerGroup3 | |||
| AdditionalCustomerGroup4 | AdditionalCustomerGroup4 | |||
| AdditionalCustomerGroup5 | AdditionalCustomerGroup5 | |||
| SlsDocIsRlvtForProofOfDeliv | SlsDocIsRlvtForProofOfDeliv | |||
| CustomerTaxClassification1 | CustomerTaxClassification1 | |||
| CustomerTaxClassification2 | CustomerTaxClassification2 | |||
| CustomerTaxClassification3 | CustomerTaxClassification3 | |||
| CustomerTaxClassification4 | CustomerTaxClassification4 | |||
| CustomerTaxClassification5 | CustomerTaxClassification5 | |||
| CustomerTaxClassification6 | CustomerTaxClassification6 | |||
| CustomerTaxClassification7 | CustomerTaxClassification7 | |||
| CustomerTaxClassification8 | CustomerTaxClassification8 | |||
| CustomerTaxClassification9 | CustomerTaxClassification9 | |||
| TaxDepartureCountry | TaxDepartureCountry | |||
| VATRegistrationCountry | VATRegistrationCountry | |||
| SalesOrderApprovalReason | SalesOrderApprovalReason | |||
| SalesDocApprovalStatus | SalesDocApprovalStatus | |||
| OverallSDProcessStatus | OverallSDProcessStatus | |||
| TotalCreditCheckStatus | TotalCreditCheckStatus | |||
| OverallTotalDeliveryStatus | OverallTotalDeliveryStatus | |||
| OverallSDDocumentRejectionSts | OverallSDDocumentRejectionSts | |||
| BillingDocumentDate | BillingDocumentDate | |||
| ContractAccount | ContractAccount | |||
| AdditionalValueDays | AdditionalValueDays | |||
| CustomerPurchaseOrderSuplmnt | CustomerPurchaseOrderSuplmnt | |||
| ServicesRenderedDate | ServicesRenderedDate | |||
| _Item | _Item | |||
| _Partner | _Partner | |||
| _PricingElement | _PricingElement | |||
| _Text | _Text | |||
| _PaymentPlanItemDetails | _PaymentPlanItemDetails | |||
| _RelatedObject | _RelatedObject | |||
| _BillingPlan | _BillingPlan | |||
| _PrecedingProcFlowDoc | _PrecedingProcFlowDoc | |||
| _SubsequentProcFlowDoc | _SubsequentProcFlowDoc |
@ClientHandling.algorithm:#SESSION_VARIABLE
@EndUserText.label: 'Sales Order Header'
@VDM: {
viewType: #COMPOSITE,
lifecycle.contract.type: #PUBLIC_REMOTE_API
}
@AbapCatalog: {
sqlViewName: 'ASALESORDER',
compiler.compareFilter: true
}
@AccessControl: {
authorizationCheck: #CHECK,
personalData.blocking: #('TRANSACTIONAL_DATA')
}
@ObjectModel: {
representativeKey: 'SalesOrder',
createEnabled: true,
updateEnabled: true,
deleteEnabled: true,
usageType: {
dataClass: #TRANSACTIONAL,
serviceQuality: #B,
sizeCategory: #L
}
}
@Metadata.ignorePropagatedAnnotations: true
define view A_SalesOrder
as select from I_SalesOrder as SalesOrder
association [0..*] to A_SalesOrderItem as _Item on _Item.SalesOrder = $projection.SalesOrder
association [0..*] to A_SalesOrderHeaderPartner as _Partner on _Partner.SalesOrder = $projection.SalesOrder
association [0..*] to A_SalesOrderHeaderPrElement as _PricingElement on _PricingElement.SalesOrder = $projection.SalesOrder
association [0..*] to A_SalesOrderText as _Text on _Text.SalesOrder = $projection.SalesOrder
association [0..1] to A_SalesOrderBillingPlan as _BillingPlan on _BillingPlan.SalesOrder = $projection.SalesOrder
and _BillingPlan.BillingPlan = $projection.BillingPlan
association [0..*] to A_SlsOrdPaymentPlanItemDetails as _PaymentPlanItemDetails on _PaymentPlanItemDetails.SalesOrder = $projection.SalesOrder
association [0..*] to A_SalesOrderRelatedObject as _RelatedObject on _RelatedObject.SalesOrder = $projection.SalesOrder
association [0..*] to A_SalesOrderPrecdgProcFlow as _PrecedingProcFlowDoc on _PrecedingProcFlowDoc.SalesOrder = $projection.SalesOrder
association [0..*] to A_SalesOrderSubsqntProcFlow as _SubsequentProcFlowDoc on _SubsequentProcFlowDoc.SalesOrder = $projection.SalesOrder
//Extensibility
association [0..1] to E_SalesDocumentBasic as _Extension on $projection.SalesOrder = _Extension.SalesDocument
{
key SalesOrder,
@ObjectModel.sapObjectNodeTypeReference: 'SalesOrderType'
SalesOrderType,
SalesOrganization,
DistributionChannel,
OrganizationDivision,
SalesGroup,
SalesOffice,
SalesDistrict,
SoldToParty,
@ObjectModel.readOnly: true
CreationDate,
@ObjectModel.readOnly: true
CreatedByUser,
@ObjectModel.readOnly: true
LastChangeDate,
@ObjectModel.readOnly: true
SenderBusinessSystemName,
@ObjectModel.readOnly: true
ExternalDocumentID,
@ObjectModel.readOnly: true
case tstmp_is_valid(LastChangeDateTime)
when 0 then cast( dats_tims_to_tstmp( CreationDate, CreationTime, 'UTC', $session.client, 'NULL' ) as timestampl )
else LastChangeDateTime
end as LastChangeDateTime,
@ObjectModel.readOnly: true
ExternalDocLastChangeDateTime,
PurchaseOrderByCustomer,
PurchaseOrderByShipToParty,
@ObjectModel.sapObjectNodeTypeReference: 'PurchaseOrderTypeByCustomer'
CustomerPurchaseOrderType,
CustomerPurchaseOrderDate,
SalesOrderDate,
@ObjectModel.readOnly: true
@Semantics.amount.currencyCode: 'TransactionCurrency'
TotalNetAmount,
@ObjectModel.readOnly: true
@ObjectModel.sapObjectNodeTypeReference: 'SalesDocOverallDeliveryStatus'
OverallDeliveryStatus,
@ObjectModel.readOnly: true
TotalBlockStatus,
@ObjectModel.readOnly: true
@ObjectModel.sapObjectNodeTypeReference: 'OverallOrdReltdBillgStatus'
OverallOrdReltdBillgStatus,
@ObjectModel.readOnly: true
@ObjectModel.sapObjectNodeTypeReference: 'OverallSDDocReferenceStatus'
OverallSDDocReferenceStatus,
@Semantics.currencyCode: true
@ObjectModel.sapObjectNodeTypeReference: 'Currency'
TransactionCurrency,
@ObjectModel.sapObjectNodeTypeReference: 'SalesDocumentReason'
SDDocumentReason,
PricingDate,
PriceDetnExchangeRate,
BillingPlan,
RequestedDeliveryDate,
ShippingCondition,
CompleteDeliveryIsDefined,
ShippingType,
@ObjectModel.sapObjectNodeTypeReference: 'BillingBlockReason'
HeaderBillingBlockReason,
DeliveryBlockReason,
@ObjectModel.sapObjectNodeTypeReference: 'DeliveryDateTypeRule'
DeliveryDateTypeRule,
@ObjectModel.sapObjectNodeTypeReference: 'IncotermsClassification'
IncotermsClassification,
IncotermsTransferLocation,
IncotermsLocation1,
IncotermsLocation2,
@ObjectModel.sapObjectNodeTypeReference: 'IncotermsVersion'
IncotermsVersion,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerPriceGroup'
CustomerPriceGroup,
PriceListType,
CustomerPaymentTerms,
@ObjectModel.sapObjectNodeTypeReference: 'PaymentMethod'
PaymentMethod,
FixedValueDate,
AssignmentReference,
ReferenceSDDocument,
@ObjectModel.readOnly: true
ReferenceSDDocumentCategory,
AccountingDocExternalReference,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerAccountAssignmentGroup'
CustomerAccountAssignmentGroup,
AccountingExchangeRate,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerGroup'
CustomerGroup,
@ObjectModel.sapObjectNodeTypeReference: 'AdditionalCustomerGroup1'
AdditionalCustomerGroup1,
@ObjectModel.sapObjectNodeTypeReference: 'AdditionalCustomerGroup2'
AdditionalCustomerGroup2,
@ObjectModel.sapObjectNodeTypeReference: 'AdditionalCustomerGroup3'
AdditionalCustomerGroup3,
@ObjectModel.sapObjectNodeTypeReference: 'AdditionalCustomerGroup4'
AdditionalCustomerGroup4,
@ObjectModel.sapObjectNodeTypeReference: 'AdditionalCustomerGroup5'
AdditionalCustomerGroup5,
SlsDocIsRlvtForProofOfDeliv,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerTaxClassification'
CustomerTaxClassification1,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerTaxClassification'
CustomerTaxClassification2,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerTaxClassification'
CustomerTaxClassification3,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerTaxClassification'
CustomerTaxClassification4,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerTaxClassification'
CustomerTaxClassification5,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerTaxClassification'
CustomerTaxClassification6,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerTaxClassification'
CustomerTaxClassification7,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerTaxClassification'
CustomerTaxClassification8,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerTaxClassification'
CustomerTaxClassification9,
TaxDepartureCountry,
VATRegistrationCountry,
@ObjectModel.readOnly: true
@ObjectModel.sapObjectNodeTypeReference: 'SalesOrderApprovalReason'
SalesOrderApprovalReason,
@ObjectModel.readOnly: true
@ObjectModel.sapObjectNodeTypeReference: 'SalesDocApprovalStatus'
SalesDocApprovalStatus,
@ObjectModel.readOnly: true
@ObjectModel.sapObjectNodeTypeReference: 'OverallSDProcessStatus'
OverallSDProcessStatus,
@ObjectModel.readOnly: true
@ObjectModel.sapObjectNodeTypeReference: 'TotalCreditCheckStatus'
TotalCreditCheckStatus,
@ObjectModel.readOnly: true
@ObjectModel.sapObjectNodeTypeReference: 'SlsDocOvrlTotalDeliveryStatus'
OverallTotalDeliveryStatus,
@ObjectModel.readOnly: true
@ObjectModel.sapObjectNodeTypeReference: 'OverallSDDocumentRejectionSts'
OverallSDDocumentRejectionSts,
// Accounting
BillingDocumentDate,
ContractAccount,
AdditionalValueDays,
CustomerPurchaseOrderSuplmnt,
ServicesRenderedDate,
// Expose own associations
_Item,
_Partner,
_PricingElement,
_Text,
_PaymentPlanItemDetails,
_RelatedObject,
_BillingPlan,
_PrecedingProcFlowDoc,
_SubsequentProcFlowDoc
}
where
SalesOrder.SalesOrderProcessingType <> 'P' and // PBS scenarios
SalesOrder.SalesOrderProcessingType <> 'S' // Solution order scenarios
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_SALESORDER"
],
"ASSOCIATED":
[
"A_SALESORDERBILLINGPLAN",
"A_SALESORDERHEADERPARTNER",
"A_SALESORDERHEADERPRELEMENT",
"A_SALESORDERITEM",
"A_SALESORDERPRECDGPROCFLOW",
"A_SALESORDERRELATEDOBJECT",
"A_SALESORDERSUBSQNTPROCFLOW",
"A_SALESORDERTEXT",
"A_SLSORDPAYMENTPLANITEMDETAILS",
"E_SALESDOCUMENTBASIC"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- 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