@VDM: {
lifecycle.contract.type: #SAP_INTERNAL_API,
viewType: #TRANSACTIONAL
}
@ObjectModel: {
sapObjectNodeType:{
name: 'SalesQuotation'
},
semanticKey: ['SalesQuotation'],
usageType: {
dataClass: #TRANSACTIONAL,
serviceQuality: #C,
sizeCategory: #L
}
}
@AccessControl: {
authorizationCheck: #CHECK,
personalData.blocking: #('TRANSACTIONAL_DATA'),
privilegedAssociations: [ '_CreatedByUser', '_LastChangedByUser', '_OutputRequest']
}
@Metadata.ignorePropagatedAnnotations: true
@EndUserText.label: 'Sales Quotation - TP'
define root view entity R_SalesQuotationTP
as select from I_SalesQuotation as SalesQuotation
left outer to one join I_OutputRequest as OutputRequest on OutputRequest.OutputControlApplicationObject = SalesQuotation.SalesQuotation
and OutputRequest.OutputControlApplObjectType = 'SALES_DOCUMENT'
composition [0..*] of R_SalesQuotationItemTP as _Item
composition [0..*] of R_SalesQuotationPartnerTP as _Partner
composition [0..*] of R_SalesQuotationTextTP as _Text
composition [0..*] of R_SlsQuotationPricingElementTP as _PricingElement
composition [0..1] of R_SalesQuotationShipToPartyTP as _ShipToParty
association [0..1] to R_OutputRequestTP as _OutputRequest on $projection.OutputRequestUUID = _OutputRequest.OutputRequestUUID
association [0..1] to I_SalesQuotationPartner as _SoldToParty on $projection.SalesQuotation = _SoldToParty.SalesQuotation
and _SoldToParty.PartnerFunction = 'AG'
association [0..1] to I_SlsOrganizationDistrChnl as _SlsOrganizationDistrChnl on $projection.SalesOrganization = _SlsOrganizationDistrChnl.SalesOrganization
and $projection.DistributionChannel = _SlsOrganizationDistrChnl.DistributionChannel
//Extension Association
association [1] to E_SalesDocumentBasic as _Extension on $projection.SalesQuotation = _Extension.SalesDocument
{
key SalesQuotation.SalesQuotation,
//Category
@ObjectModel.foreignKey.association: '_SalesQuotationType'
SalesQuotation.SalesQuotationType,
@Semantics.text:true
_SoldToParty.FullName as CustomerName,
_SoldToParty.AddressID as SoldToPartyAddressID,
//Organization
@ObjectModel.foreignKey.association: '_SalesOrganization'
SalesQuotation.SalesOrganization,
@ObjectModel.foreignKey.association: '_DistributionChannel'
SalesQuotation.DistributionChannel,
_SlsOrganizationDistrChnl.ReferenceDistributionChannel,
@ObjectModel.foreignKey.association: '_OrganizationDivision'
SalesQuotation.OrganizationDivision,
@ObjectModel.foreignKey.association: '_SalesOffice'
SalesQuotation.SalesOffice,
@ObjectModel.foreignKey.association: '_SalesGroup'
SalesQuotation.SalesGroup,
//Sales
@ObjectModel.text.element: ['CustomerName']
SalesQuotation.SoldToParty,
@ObjectModel.foreignKey.association: '_SalesDistrict'
SalesQuotation.SalesDistrict,
SalesQuotation.PurchaseOrderByCustomer,
SalesQuotation.SalesQuotationDate,
SalesQuotation.CustomerPurchaseOrderDate,
@ObjectModel.foreignKey.association: '_CustomerGroup'
SalesQuotation.CustomerGroup,
//Quotation
SalesQuotation.BindingPeriodValidityStartDate,
SalesQuotation.BindingPeriodValidityEndDate,
SalesQuotation.HdrOrderProbabilityInPercent,
//Pricing
@Semantics.amount.currencyCode: 'TransactionCurrency'
SalesQuotation.TotalNetAmount,
@ObjectModel.foreignKey.association: '_TransactionCurrency'
SalesQuotation.TransactionCurrency,
SalesQuotation.PricingDate,
@ObjectModel.foreignKey.association: '_CustomerPriceGroup'
SalesQuotation.CustomerPriceGroup,
@ObjectModel.foreignKey.association: '_SDPricingProcedure'
SalesQuotation.SDPricingProcedure,
//Admin
@Consumption.hidden: true
SalesQuotation.CreationDate,
@ObjectModel.foreignKey.association: '_CreatedByUser'
SalesQuotation.CreatedByUser,
@ObjectModel.foreignKey.association: '_LastChangedByUser'
SalesQuotation.LastChangedByUser,
SalesQuotation.CreationTime,
cast( dats_tims_to_tstmp( SalesQuotation.CreationDate, SalesQuotation.CreationTime, abap_system_timezone( $session.client, 'NULL' ),
$session.client, 'NULL' ) as creation_date_time ) as SalesDocumentCreationDateTime,
// case TSTMP_IS_VALID(cast(LastChangeDateTime as abap.dec(15,0)))
// when 0 then cast( dats_tims_to_tstmp( CreationDate, CreationTime, 'UTC', $session.client, 'NULL' ) as timestampl )
// else LastChangeDateTime
// end as LastChangeDateTime,
case tstmp_is_valid(cast(SalesQuotation.LastChangeDateTime as abap.dec(15,0)))
when 0 then cast( dats_tims_to_tstmp( SalesQuotation.CreationDate, SalesQuotation.CreationTime, 'UTC', $session.client, 'NULL' ) as last_changed_date_time )
else cast( SalesQuotation.LastChangeDateTime as last_changed_date_time )
end as LastChangeDateTime,
//Shipping
SalesQuotation.RequestedDeliveryDate,
@ObjectModel.foreignKey.association: '_IncotermsVersion'
SalesQuotation.IncotermsVersion,
@ObjectModel.foreignKey.association: '_IncotermsClassification'
SalesQuotation.IncotermsClassification,
SalesQuotation.IncotermsLocation1,
SalesQuotation.IncotermsLocation2,
@ObjectModel.foreignKey.association: '_ShippingCondition'
SalesQuotation.ShippingCondition,
@ObjectModel.foreignKey.association: '_ShippingType'
SalesQuotation.ShippingType,
//Billing
SalesQuotation.BillingDocumentDate,
//Reference
SalesQuotation.ReferenceSDDocument,
@ObjectModel.foreignKey.association: '_ReferenceSDDocumentCategory'
SalesQuotation.ReferenceSDDocumentCategory,
//Exposed for KPI fields
@ObjectModel.foreignKey.association: '_CustomerCreditAccount'
SalesQuotation.CustomerCreditAccount,
//Status
@ObjectModel.foreignKey.association: '_SDDocumentReason'
SalesQuotation.SDDocumentReason,
@ObjectModel.foreignKey.association: '_SalesQuotationApprovalReason'
SalesQuotation.SalesQuotationApprovalReason,
@ObjectModel.foreignKey.association: '_SalesDocApprovalStatus'
SalesQuotation.SalesDocApprovalStatus,
@ObjectModel.foreignKey.association: '_OverallSDProcessStatus'
SalesQuotation.OverallSDProcessStatus,
@ObjectModel.foreignKey.association: '_HdrGeneralIncompletionStatus'
cast(SalesQuotation.HdrGeneralIncompletionStatus as hdr_general_incompltn_status preserving type ) as HdrGeneralIncompletionStatus,
@ObjectModel.foreignKey.association: '_OvrlItmGeneralIncompletionSts'
cast(SalesQuotation.OvrlItmGeneralIncompletionSts as itms_ovrl_incompletion_status preserving type ) as OvrlItmGeneralIncompletionSts,
@ObjectModel.foreignKey.association: '_OverallSDDocReferenceStatus'
SalesQuotation.OverallSDDocReferenceStatus,
@ObjectModel.foreignKey.association: '_OverallSDDocumentRejectionSts'
SalesQuotation.OverallSDDocumentRejectionSts,
@ObjectModel.foreignKey.association: '_TotalCreditCheckStatus'
SalesQuotation.TotalCreditCheckStatus,
@ObjectModel.foreignKey.association: '_OverallChmlCmplncStatus'
SalesQuotation.OverallChmlCmplncStatus,
@ObjectModel.foreignKey.association: '_OverallDangerousGoodsStatus'
SalesQuotation.OverallDangerousGoodsStatus,
@ObjectModel.foreignKey.association: '_OvrlSftyDataSheetSts'
SalesQuotation.OverallSafetyDataSheetStatus,
@ObjectModel.foreignKey.association: '_OvrlTradeCmplncEmbargoStatus'
SalesQuotation.OverallTrdCmplncEmbargoSts,
//Payment
SalesQuotation.PaymentMethod,
@ObjectModel.foreignKey.association: '_CustomerPaymentTerms'
SalesQuotation.CustomerPaymentTerms,
SalesQuotation.BillingCompanyCode,
SalesQuotation.LastChangeDate,
OutputRequest.OutputRequestUUID,
_Item,
_Partner,
_Text,
_PricingElement,
_ShipToParty,
_OutputRequest,
//Exposed Associations
SalesQuotation._SalesQuotationType,
SalesQuotation._SalesOrganization,
SalesQuotation._DistributionChannel,
SalesQuotation._OrganizationDivision,
SalesQuotation._SalesOffice,
SalesQuotation._SalesGroup,
SalesQuotation._SalesDistrict,
SalesQuotation._ShippingCondition,
SalesQuotation._ShippingType,
SalesQuotation._IncotermsVersion,
SalesQuotation._IncotermsClassification,
SalesQuotation._SDDocumentReason,
SalesQuotation._ReferenceSDDocumentCategory,
SalesQuotation._TransactionCurrency,
SalesQuotation._CustomerPaymentTerms,
SalesQuotation._CustomerGroup,
SalesQuotation._CustomerPriceGroup,
SalesQuotation._SDPricingProcedure,
SalesQuotation._LastChangedByUser,
SalesQuotation._CreatedByUser,
SalesQuotation._CustomerCreditAccount,
SalesQuotation._SalesQuotationApprovalReason,
SalesQuotation._SalesDocApprovalStatus,
SalesQuotation._OverallSDProcessStatus,
SalesQuotation._HdrGeneralIncompletionStatus,
SalesQuotation._OvrlItmGeneralIncompletionSts,
SalesQuotation._OverallSDDocReferenceStatus,
SalesQuotation._OverallSDDocumentRejectionSts,
SalesQuotation._TotalCreditCheckStatus,
SalesQuotation._OverallChmlCmplncStatus,
SalesQuotation._OverallDangerousGoodsStatus,
SalesQuotation._OvrlSftyDataSheetSts,
SalesQuotation._OvrlTradeCmplncEmbargoStatus
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_OUTPUTREQUEST",
"I_SALESQUOTATION",
"I_SALESQUOTATIONPARTNER",
"I_SLSORGANIZATIONDISTRCHNL"
],
"ASSOCIATED":
[
"I_CURRENCY",
"I_CUSTOMER",
"I_CUSTOMERGROUP",
"I_CUSTOMERPAYMENTTERMS",
"I_CUSTOMERPRICEGROUP",
"I_DISTRIBUTIONCHANNEL",
"I_DIVISION",
"I_HDRGENINCOMPLETIONSTATUS",
"I_INCOTERMSCLASSIFICATION",
"I_INCOTERMSVERSION",
"I_OVERALLCHMLCMPLNCSTATUS",
"I_OVERALLDANGEROUSGOODSSTATUS",
"I_OVERALLSDDOCREFERENCESTATUS",
"I_OVERALLSDDOCUMENTRJCNSTATUS",
"I_OVERALLSDPROCESSSTATUS",
"I_OVRLITMGENINCOMPLETIONSTS",
"I_OVRLSFTYDATASHEETSTS",
"I_OVRLTRADECMPLNCEMBARGOSTATUS",
"I_SALESDISTRICT",
"I_SALESDOCAPPROVALSTATUS",
"I_SALESGROUP",
"I_SALESOFFICE",
"I_SALESORGANIZATION",
"I_SALESQUOTATIONTYPE",
"I_SDDOCUMENTCATEGORY",
"I_SDDOCUMENTREASON",
"I_SHIPPINGCONDITION",
"I_SHIPPINGTYPE",
"I_SLSPRICINGPROCEDURE",
"I_SLSQTANAPPROVALREASON",
"I_TOTALCREDITCHECKSTATUS",
"I_USER",
"R_OUTPUTREQUESTTP",
"R_SALESQUOTATIONITEMTP",
"R_SALESQUOTATIONPARTNERTP",
"R_SALESQUOTATIONSHIPTOPARTYTP",
"R_SALESQUOTATIONTEXTTP",
"R_SLSQUOTATIONPRICINGELEMENTTP"
],
"BASE":
[
"I_SALESQUOTATION"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/