I_SubscriptionOrder

DDL: I_SUBSCRIPTIONORDER Type: view_entity COMPOSITE

Subscription Order

I_SubscriptionOrder is a Composite CDS View that provides data about "Subscription Order" in SAP S/4HANA. It reads from 1 data source (I_ServiceDocumentEnhcd) and exposes 52 fields with key field SubscriptionOrder. It has 10 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_ServiceDocumentEnhcd I_ServiceDocumentEnhcd from

Associations (10)

CardinalityTargetAliasCondition
[0..1] I_StatusObjectUUIDStatus _SrvcOrdStatus $projection.SubscriptionOrderUUID = _SrvcOrdStatus.StatusObjectUUID and ( _SrvcOrdStatus.StatusCode = 'I1002' or _SrvcOrdStatus.StatusCode = 'I1003' or _SrvcOrdStatus.StatusCode = 'I1004' or _SrvcOrdStatus.StatusCode = 'I1005' ) and _SrvcOrdStatus.StatusIsActive = 'X'
[0..*] I_SubscriptionOrderItem _SubscriptionOrderItem $projection.SubscriptionOrder = _SubscriptionOrderItem.SubscriptionOrder
[0..*] I_SubscriptionOrderPartner _SubscriptionOrderPartner $projection.SubscriptionOrder = _SubscriptionOrderPartner.SubscriptionOrder
[0..*] I_SubscriptionOrderUserStatus _SubscriptionOrderUserStatus $projection.SubscriptionOrder = _SubscriptionOrderUserStatus.SubscriptionOrder
[0..1] I_SubscrpnOrdExternalReference _ExternalReference $projection.SubscriptionOrder = _ExternalReference.SubscriptionOrder
[0..*] I_SubscrpnOrdFUPSubscrpnContr _FollowUpContract $projection.SubscriptionOrder = _FollowUpContract.SubscriptionOrder
[0..*] I_SubscrpnOrdFUPSalesOrder _FollowUpSalesOrder $projection.SubscriptionOrder = _FollowUpSalesOrder.SubscriptionOrder
[0..*] I_ChgOrdPrdcssrBusSolnQtan _PredecessorQuotation $projection.SubscriptionOrder = _PredecessorQuotation.SubscriptionOrder
[0..*] I_ChgOrdPrdcssrSubscrpnContr _PredecessorContract $projection.SubscriptionOrder = _PredecessorContract.SubscriptionOrder
[0..*] I_WBSElementBasicData _WBSElement $projection.WBSElementExternalID = _WBSElement.WBSElementExternalID

Annotations (8)

NameValueLevelField
AccessControl.authorizationCheck #CHECK view
VDM.viewType #COMPOSITE view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
Metadata.ignorePropagatedAnnotations true view
EndUserText.label Subscription Order view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view

Fields (52)

KeyFieldSource TableSource FieldDescription
KEY SubscriptionOrder ServiceDocument
ServiceObjectType ServiceObjectType
ServiceDocumentType ServiceDocumentType
SubscriptionOrderUUID ServiceDocumentUUID
SubscriptionOrderDescription ServiceDocumentDescription
CreationDateTime ServiceDocCreationDateTime
LastChangeDateTime ServiceDocChangedDateTime
CreatedByUser ServiceDocumentCreatedByUser
LastChangedByUser ServiceDocumentChangedByUser
PurchaseOrderByCustomer PurchaseOrderByCustomer
SubscrpnOrdIsOpen ServiceDocumentIsOpen
SubscrpnOrdHasError ServiceDocumentHasError
SrvcDocRejectionStatus SrvcDocRejectionStatus
SoldToParty SoldToParty
ShipToParty ShipToParty
BillToParty BillToParty
PayerParty PayerParty
ContactPerson
PersonResponsible
SalesOrganization SalesOrganization
DistributionChannel DistributionChannel
Division Division
SalesOffice SalesOffice
SalesGroup SalesGroup
SalesOrganizationOrgUnitID SalesOrganizationOrgUnitID
SalesOfficeOrgUnitID SalesOfficeOrgUnitID
SalesGroupOrgUnitID SalesGroupOrgUnitID
ServiceOrganization ServiceOrganization
PaymentTerms PaymentTerms
TransactionCurrency TransactionCurrency
_SubscriptionOrderItem _SubscriptionOrderItem
_SubscriptionOrderPartner _SubscriptionOrderPartner
_SubscriptionOrderUserStatus _SubscriptionOrderUserStatus
_ExternalReference _ExternalReference
_FollowUpContract _FollowUpContract
_FollowUpSalesOrder _FollowUpSalesOrder
_PredecessorQuotation _PredecessorQuotation
_PredecessorContract _PredecessorContract
_SalesOrganization _SalesOrganization
_DistributionChannel _DistributionChannel
_Division _Division
_SalesOffice _SalesOffice
_SalesGroup _SalesGroup
_SalesOrganizationOrgUnit_2 _SalesOrganizationOrgUnit_2
_SalesOfficeOrgUnit_2 _SalesOfficeOrgUnit_2
_SalesGroupOrgUnit_2 _SalesGroupOrgUnit_2
_ServiceOrganizationOrgUnit_2 _ServiceOrganizationOrgUnit_2
_TransactionCurrency _TransactionCurrency
_PaymentTerms _PaymentTerms
_ServiceObjType _ServiceObjType
_ServiceDocumentType _ServiceDocumentType
_WBSElement _WBSElement
@AccessControl: {
  authorizationCheck: #CHECK,
  personalData.blocking: #('TRANSACTIONAL_DATA')
}
@VDM: {
  viewType: #COMPOSITE,
  lifecycle.contract.type: #SAP_INTERNAL_API
}
@Metadata:
{
  ignorePropagatedAnnotations: true
}

@EndUserText.label: 'Subscription Order'
@ObjectModel: {
   usageType: {dataClass:      #TRANSACTIONAL,
                serviceQuality: #C,
                sizeCategory:   #L}
}

define view entity I_SubscriptionOrder
  as select from I_ServiceDocumentEnhcd
  association [0..1] to I_StatusObjectUUIDStatus       as _SrvcOrdStatus               on  $projection.SubscriptionOrderUUID = _SrvcOrdStatus.StatusObjectUUID
                                                                                       and (
                                                                                          _SrvcOrdStatus.StatusCode          = 'I1002'
                                                                                          or _SrvcOrdStatus.StatusCode       = 'I1003'
                                                                                          or _SrvcOrdStatus.StatusCode       = 'I1004'
                                                                                          or _SrvcOrdStatus.StatusCode       = 'I1005'
                                                                                        )
                                                                                       and _SrvcOrdStatus.StatusIsActive     = 'X'

  association [0..*] to I_SubscriptionOrderItem        as _SubscriptionOrderItem       on  $projection.SubscriptionOrder = _SubscriptionOrderItem.SubscriptionOrder
  association [0..*] to I_SubscriptionOrderPartner     as _SubscriptionOrderPartner    on  $projection.SubscriptionOrder = _SubscriptionOrderPartner.SubscriptionOrder
  association [0..*] to I_SubscriptionOrderUserStatus  as _SubscriptionOrderUserStatus on  $projection.SubscriptionOrder = _SubscriptionOrderUserStatus.SubscriptionOrder
  association [0..1] to I_SubscrpnOrdExternalReference as _ExternalReference         on  $projection.SubscriptionOrder = _ExternalReference.SubscriptionOrder
  association [0..*] to I_SubscrpnOrdFUPSubscrpnContr  as _FollowUpContract            on  $projection.SubscriptionOrder = _FollowUpContract.SubscriptionOrder
  association [0..*] to I_SubscrpnOrdFUPSalesOrder     as _FollowUpSalesOrder          on  $projection.SubscriptionOrder = _FollowUpSalesOrder.SubscriptionOrder
  association [0..*] to I_ChgOrdPrdcssrBusSolnQtan     as _PredecessorQuotation        on  $projection.SubscriptionOrder = _PredecessorQuotation.SubscriptionOrder
  association [0..*] to I_ChgOrdPrdcssrSubscrpnContr   as _PredecessorContract         on  $projection.SubscriptionOrder = _PredecessorContract.SubscriptionOrder
  association [0..*] to I_WBSElementBasicData          as _WBSElement                  on  $projection.WBSElementExternalID = _WBSElement.WBSElementExternalID
{
  key ServiceDocument                               as SubscriptionOrder,
      @ObjectModel.foreignKey.association: '_ServiceObjType'
      ServiceObjectType,
      @ObjectModel.foreignKey.association: '_ServiceDocumentType'
      ServiceDocumentType,
      ServiceDocumentUUID                           as SubscriptionOrderUUID,
      ServiceDocumentDescription                    as SubscriptionOrderDescription,
      ServiceDocCreationDateTime                    as CreationDateTime,
      ServiceDocChangedDateTime                     as LastChangeDateTime,
      ServiceDocumentCreatedByUser                  as CreatedByUser,
      ServiceDocumentChangedByUser                  as LastChangedByUser,
      // Sales Set

      PurchaseOrderByCustomer,


      // Status

      cast( case _SrvcOrdStatus.StatusCode
      when 'I1002' then 'X'
      else ' '
      end       as   xfeld preserving type     )    as SubscrpnOrderIsNew,
      cast( case _SrvcOrdStatus.StatusCode
      when 'I1003' then 'X'
      else ' '
      end      as   xfeld preserving type     )     as SubscrpnOrdIsInProcess,
      cast( case _SrvcOrdStatus.StatusCode
      when 'I1004' then 'X'
      else ' '
      end      as   xfeld preserving type     )     as SubscrpnOrdIsReleased,
      cast( case _SrvcOrdStatus.StatusCode
      when 'I1005' then 'X'
      else ' '
      end     as   xfeld preserving type     )      as SubscrpnOrdIsCompleted,
      @Semantics.booleanIndicator
      ServiceDocumentIsOpen                         as SubscrpnOrdIsOpen,
      @Semantics.booleanIndicator
      ServiceDocumentHasError                       as SubscrpnOrdHasError,
      SrvcDocRejectionStatus,


      // Partners

      SoldToParty,
      ShipToParty,
      BillToParty,
      PayerParty,
      cast( ContactPerson as abap.numc( 10 ))       as ContactPerson,
      cast( ResponsibleEmployee as abap.char( 12 )) as PersonResponsible,


      // Organizational Data

      @ObjectModel.foreignKey.association: '_SalesOrganization'
      SalesOrganization,
      @ObjectModel.foreignKey.association: '_DistributionChannel'
      DistributionChannel,
      @ObjectModel.foreignKey.association: '_Division'
      Division,
      @ObjectModel.foreignKey.association: '_SalesOffice'
      SalesOffice,
      @ObjectModel.foreignKey.association: '_SalesGroup'
      SalesGroup,

      //CRM Org units

      //these feilds are only ON PREMISE

      @Feature: 'BF:API_FULLSCOPE'
      @ObjectModel.foreignKey.association: '_SalesOrganizationOrgUnit_2'
      SalesOrganizationOrgUnitID,
      @Feature: 'BF:API_FULLSCOPE'
      @ObjectModel.foreignKey.association: '_SalesOfficeOrgUnit_2'
      SalesOfficeOrgUnitID,
      @Feature: 'BF:API_FULLSCOPE'
      @ObjectModel.foreignKey.association: '_SalesGroupOrgUnit_2'
      SalesGroupOrgUnitID,
      @Feature: 'BF:API_FULLSCOPE'
      @ObjectModel.foreignKey.association: '_ServiceOrganizationOrgUnit_2'
      ServiceOrganization,

      // Pricing Parameter Set

      @ObjectModel.foreignKey.association: '_PaymentTerms'
      PaymentTerms,
      @ObjectModel.foreignKey.association: '_TransactionCurrency'
      TransactionCurrency,
      
      // WBS element  

      case SrvcDocAcctAssgmtObjectType
      when '03' then cast(SrvcDocAcctAssgmtObject as ps_posid_edit)
      else ' '
      end  as WBSElementExternalID,
      
      // All Associations Below

      _SubscriptionOrderItem,
      _SubscriptionOrderPartner,
      _SubscriptionOrderUserStatus,
      _ExternalReference,
      _FollowUpContract,
      _FollowUpSalesOrder,
      _PredecessorQuotation,
      _PredecessorContract,

      //Org Units

      _SalesOrganization,
      _DistributionChannel,
      _Division,
      _SalesOffice,
      _SalesGroup,

      _SalesOrganizationOrgUnit_2,
      _SalesOfficeOrgUnit_2,
      _SalesGroupOrgUnit_2,
      _ServiceOrganizationOrgUnit_2,

      // Pricing Parameter Set

      _TransactionCurrency,
      _PaymentTerms,

      _ServiceObjType,
      _ServiceDocumentType,
      _WBSElement
}
where
  ServiceObjectType = 'BUS2000265' // Subscription  Order

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_SERVICEDOCUMENTENHCD",
"I_STATUSOBJECTUUIDSTATUS"
],
"ASSOCIATED":
[
"I_CHGORDPRDCSSRBUSSOLNQTAN",
"I_CHGORDPRDCSSRSUBSCRPNCONTR",
"I_CURRENCY",
"I_CUSTMGMTBUSOBJTYPE",
"I_DISTRIBUTIONCHANNEL",
"I_DIVISION",
"I_PAYMENTTERMS",
"I_SALESGROUP",
"I_SALESOFFICE",
"I_SALESORGANIZATION",
"I_SERVICEDOCUMENTTYPE",
"I_SRVCMGMTORGANIZATIONUNIT",
"I_SUBSCRIPTIONORDERITEM",
"I_SUBSCRIPTIONORDERPARTNER",
"I_SUBSCRIPTIONORDERUSERSTATUS",
"I_SUBSCRPNORDEXTERNALREFERENCE",
"I_SUBSCRPNORDFUPSALESORDER",
"I_SUBSCRPNORDFUPSUBSCRPNCONTR",
"I_WBSELEMENTBASICDATA"
],
"BASE":
[
"I_SERVICEDOCUMENTENHCD"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/