C_Salescontractfs

DDL: C_SALESCONTRACTFS SQL: CSCONTRFS Type: view CONSUMPTION

Sales Contract

C_Salescontractfs is a Consumption CDS View that provides data about "Sales Contract" in SAP S/4HANA. It reads from 1 data source (I_SalesContract). It has 8 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_SalesContract SalesContract from

Associations (8)

CardinalityTargetAliasCondition
[0..1] C_SoldToValueHelp _SoldToParty $projection.SoldToParty = _SoldToParty.Customer
[0..*] C_Salescontractitemfs _Salescontractitemfs $projection.SalesContract = _Salescontractitemfs.SalesContract
[0..*] C_SalesContractPartnerCard _SalesContractPartnerCard $projection.SalesContract = _SalesContractPartnerCard.SalesContract
[0..*] C_SubsqntSalesOrder _SubsqntSalesOrder $projection.SalesContract = _SubsqntSalesOrder.PrecedingDocument
[0..*] C_LegalTransactionIntegFacet _LegalTransaction $projection.SalesContract = _LegalTransaction.LglCntntMLinkdObj and _LegalTransaction.LglCntntMIntegrationLink = 'SC'
[0..1] I_SalesContractPartner _EmployeeResponsible $projection.SalesContract = _EmployeeResponsible.SalesContract and _EmployeeResponsible.PartnerFunction = 'ZM' and _EmployeeResponsible.SDDocPartnerSequenceNumber = '000000'
[0..*] C_SalesContractProcessFlow _ProcessFlow $projection.SalesContract = _ProcessFlow.SalesContract
[1] E_SalesDocumentBasic _Extension $projection.SalesContract = _Extension.SalesDocument

Annotations (16)

NameValueLevelField
AbapCatalog.sqlViewName CSCONTRFS view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
EndUserText.label Sales Contract view
Search.searchable true view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #M view
UI.headerInfo.typeName Sales Contract view
UI.headerInfo.typeNamePlural Sales Contracts view
UI.headerInfo.title.type #STANDARD view
UI.headerInfo.title.value SalesDocumentTypeName view
Consumption.semanticObject SalesContract view
@AbapCatalog.sqlViewName: 'CSCONTRFS'
@ClientHandling.algorithm:#SESSION_VARIABLE
@VDM.viewType: #CONSUMPTION
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED
@AccessControl.privilegedAssociations: [ '_SalesContractPartnerCard' ]
@EndUserText.label: 'Sales Contract'
@Search.searchable: true
@ObjectModel: {
   semanticKey: ['SalesContract'],
   usageType.dataClass: #TRANSACTIONAL,
   usageType.serviceQuality: #C,
   usageType.sizeCategory: #M
}
@UI.headerInfo: {
     typeName:         'Sales Contract',
     typeNamePlural:   'Sales Contracts',
     title: {
           type:   #STANDARD,
           value:  'SalesDocumentTypeName'
        }
}

@Consumption.semanticObject: 'SalesContract'
define view C_Salescontractfs

  as select from I_SalesContract as SalesContract
  association [0..1] to C_SoldToValueHelp            as _SoldToParty              on  $projection.SoldToParty = _SoldToParty.Customer
  association [0..*] to C_Salescontractitemfs        as _Salescontractitemfs      on  $projection.SalesContract = _Salescontractitemfs.SalesContract
  association [0..*] to C_SalesContractPartnerCard   as _SalesContractPartnerCard on  $projection.SalesContract = _SalesContractPartnerCard.SalesContract
  association [0..*] to C_SubsqntSalesOrder          as _SubsqntSalesOrder        on  $projection.SalesContract = _SubsqntSalesOrder.PrecedingDocument
  association [0..*] to C_LegalTransactionIntegFacet as _LegalTransaction         on  $projection.SalesContract                  = _LegalTransaction.LglCntntMLinkdObj
                                                                                  and _LegalTransaction.LglCntntMIntegrationLink = 'SC'
  association [0..1] to I_SalesContractPartner       as _EmployeeResponsible      on  $projection.SalesContract                       = _EmployeeResponsible.SalesContract
                                                                                  and _EmployeeResponsible.PartnerFunction            = 'ZM'
                                                                                  and _EmployeeResponsible.SDDocPartnerSequenceNumber = '000000'
  association [0..*] to C_SalesContractProcessFlow   as _ProcessFlow              on  $projection.SalesContract = _ProcessFlow.SalesContract
  //Extension Association

  association [1]    to E_SalesDocumentBasic         as _Extension                on  $projection.SalesContract = _Extension.SalesDocument
{
      //Header

      //**********************************************************************************************

      //Key

      @Search.defaultSearchElement: true
      @Search.ranking: #HIGH
      @Consumption.semanticObject: 'SalesContract'
      @UI.lineItem:{position:1}
  key SalesContract.SalesContract,

      concat_with_space(SalesContract._SalesContractType._Text[1: Language=$session.system_language].SalesDocumentTypeName, ltrim(SalesContract, '0'), 1) as SalesDocumentTypeName,

      SalesContractType,

      @UI:{
      fieldGroup:{qualifier: 'SoldParty', position: 10 ,importance: #HIGH}
      }
      @Consumption.semanticObject: 'Customer'
      @ObjectModel:{ foreignKey.association: '_SoldToParty',
                     text.element: ['SoldToPartyName'] }
      SalesContract.SoldToParty,
      
      @UI.hidden: true
      @Semantics.text:true
      @ObjectModel.virtualElement: true
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_SLSCONTR_UI_PARTNER_UTIL'
      cast('' as ad_namtext )                                                                       as SoldToPartyName,

      @UI:{
       fieldGroup:{qualifier: 'Status', position: 10 ,importance: #HIGH},
       textArrangement: #TEXT_ONLY
      }
      SalesContract.OverallSDProcessStatus,

      @UI:{
        fieldGroup:{qualifier: 'Status', position: 20 ,importance: #HIGH},
        textArrangement: #TEXT_ONLY
      }
      SalesContract.OverallSDDocumentRejectionSts,

      @UI:{
        fieldGroup:{qualifier: 'Status', position: 30 ,importance: #HIGH},
        textArrangement: #TEXT_ONLY
      }
      SalesContract.OverallSDDocReferenceStatus,

      @UI:{
        fieldGroup:{qualifier: 'Status', position: 40 ,importance: #HIGH },
        textArrangement: #TEXT_ONLY
      }
      @Feature: 'SD_SLS_CCO_DOWNPAYMENT_1911'
      ContractDownPaymentStatus,

      @UI:{
      fieldGroup:{qualifier: 'Approval', position: 10 ,importance: #HIGH, criticality: 'SlsContrApprovalStsCriticality'},
      textArrangement: #TEXT_ONLY
      }
      SalesContract.SalesDocApprovalStatus,

      @UI.hidden: true
      cast(
      case
        when SalesContract.SalesDocApprovalStatus  = 'A' then  2 -- | 2: yellow colour
        when SalesContract.SalesDocApprovalStatus  = 'B' then  3 -- | 3: green colour
        when SalesContract.SalesDocApprovalStatus  = 'C' then  1 -- | 1: red colour
        when SalesContract.SalesDocApprovalStatus  = 'D' then  2 -- | 2: yellow colour
                                                            else  0 -- | 0: neutral
      end  as abap.int1
      )                                                                                                                                                   as SlsContrApprovalStsCriticality,

      @UI:{
      fieldGroup:{qualifier: 'Approval', position: 20 ,importance: #HIGH },
      textArrangement: #TEXT_ONLY
      }
      @EndUserText.label: 'Approval Request Reason'
      SalesContract.SalesContractApprovalReason,

      @UI:{
      fieldGroup:{qualifier: 'Date', position: 10 ,importance: #HIGH}
      }
      SalesContract.SalesContractValidityStartDate,

      @UI:{
      fieldGroup:{qualifier: 'Date', position: 20 ,importance: #HIGH}
      }
      SalesContract.SalesContractValidityEndDate,

      TransactionCurrency,

      @UI:{
      dataPoint:{description:'Net Amount'}
      }
      @DefaultAggregation: #NONE
      TotalNetAmount,

      //General Info

      //**********************************************************************************************

      @UI: {
        identification: {position:10,  importance: #HIGH}
      }
      cast(
      concat_with_space(
        concat(
          concat(
            _SalesOrganization._Text[1: Language=$session.system_language].SalesOrganizationName,
            concat_with_space(',',_DistributionChannel._Text[1: Language=$session.system_language].DistributionChannelName,1)
          ),
          ','
        ),
        _OrganizationDivision._Text[1: Language=$session.system_language].DivisionName
      ,1) as txt_vtrber )                                                                                                                                 as SalesAreaDesc,

      SalesOrganization,
      DistributionChannel,
      OrganizationDivision,

      @ObjectModel: { text.element: ['ResponsibleEmployeeName']}
      @UI: {
      identification: {position:20, importance: #HIGH, label:'Employee Responsible'}

      }
      @Search.defaultSearchElement: false
      cast( _EmployeeResponsible.Personnel as resp_empl preserving type  )                                                                                as ResponsibleEmployee,
      @Semantics.text: true
      @UI.hidden: true
      @Search.defaultSearchElement: false // without this annotation the search does not work (needed for local testing and START)

      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_SLSCONTR_UI_PARTNER_UTIL'
      cast('' as ad_namtext )                                                                                                                             as ResponsibleEmployeeName,

      @UI.fieldGroup:[{ qualifier:'CustomerReference', position:10, importance: #HIGH }]
      PurchaseOrderByCustomer,


      @Semantics: {businessDate.at: true }
      @UI.fieldGroup:[{qualifier:'CustomerReference',position:20,importance:#HIGH}]
      CustomerPurchaseOrderDate,

      @Semantics.businessDate.at: true
      @UI: {
       fieldGroup: {qualifier:'G3', position:10,  importance: #HIGH}
      }
      SalesContract.SalesContractDate,

      _DownPaymentStatus,
      _OverallSDProcessStatus,
      _OverallSDDocumentRejectionSts,
      _OverallSDDocReferenceStatus,
      _SalesContractPartnerCard,
      _Salescontractitemfs,
      _SubsqntSalesOrder,
      _SoldToParty,
      _SalesDocApprovalStatus,
      _SalesContractApprovalReason,
      _LegalTransaction,
      _EmployeeResponsible,
      @ObjectModel.filter.enabled: false
      _ProcessFlow
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_DISTRIBUTIONCHANNEL",
"I_DISTRIBUTIONCHANNELTEXT",
"I_DIVISION",
"I_DIVISIONTEXT",
"I_SALESCONTRACT",
"I_SALESCONTRACTPARTNER",
"I_SALESCONTRACTTYPE",
"I_SALESDOCUMENTTYPETEXT",
"I_SALESORGANIZATION",
"I_SALESORGANIZATIONTEXT"
],
"ASSOCIATED":
[
"C_LEGALTRANSACTIONINTEGFACET",
"C_SALESCONTRACTITEMFS",
"C_SALESCONTRACTPARTNERCARD",
"C_SALESCONTRACTPROCESSFLOW",
"C_SOLDTOVALUEHELP",
"C_SUBSQNTSALESORDER",
"E_SALESDOCUMENTBASIC",
"I_CONTRACTDOWNPAYMENTSTATUS",
"I_OVERALLSDDOCREFERENCESTATUS",
"I_OVERALLSDDOCUMENTRJCNSTATUS",
"I_OVERALLSDPROCESSSTATUS",
"I_SALESCONTRACTAPPROVALREASON",
"I_SALESCONTRACTPARTNER",
"I_SALESDOCAPPROVALSTATUS"
],
"BASE":
[
"I_SALESCONTRACT"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/