I_SALESDOCITEMCOMPLETEPARTNER

CDS View

Sales Doc Item and Inherited Partners

I_SALESDOCITEMCOMPLETEPARTNER is a CDS View in S/4HANA. Sales Doc Item and Inherited Partners. It contains 33 fields. 13 CDS views read from this table.

CDS Views using this table (13)

ViewTypeJoinVDMDescription
C_ProjBillgElmntPartnerDetails view_entity from CONSUMPTION Project Billing Element Partner Details
C_SlsDocItmNonStdPartner view from CONSUMPTION Sls Doc Item Non Std Complete Partners
I_SlsDocItmNonStdPartner view from COMPOSITE Sls Doc Item Non Std Complete Partners
P_ProjBillgElmntPartnerCount view_entity from TRANSACTIONAL partner count for proj billing elelemt
P_SlsDocItemNonStdPartnerCount view from CONSUMPTION Count of non Std Partners in Sls Doc Item
R_CreditMemoReqItemPartnerTP view_entity from TRANSACTIONAL Credit Memo Request Item Partner - TP
R_CustomerReturnItemPartnerTP view_entity from TRANSACTIONAL Returns Order Item Partner - TP
R_DebitMemoReqItemPartnerTP view_entity from TRANSACTIONAL Debit Memo Request Item Partner - TP
R_SalesContractItemPartnerTP view_entity from TRANSACTIONAL Sales Contract Item Partner - TP
R_SalesOrderItemPartnerTP view_entity from TRANSACTIONAL Partner for Sales Order Item - TP
R_SalesQuotationItemPartnerTP view_entity from TRANSACTIONAL Sales Quotation Item Partner - TP
R_SlsOrdWthoutChrgItmPartnerTP view_entity from TRANSACTIONAL Sls Ord Without Charge Item Partner - TP
R_SlsSchedgAgrmtItemPartnerTP view_entity from TRANSACTIONAL Partner for Sls Sched Agr Item - TP

Fields (33)

KeyField CDS FieldsUsed in Views
KEY SalesDocument SalesDocument 2
KEY SalesDocumentItem SalesDocumentItem 2
_BPRefAddressForDocSpcfcAddr _BPRefAddressForDocSpcfcAddr 8
_BusinessPartnerAddress _BusinessPartnerAddress 8
_ContactPerson _ContactPerson 7
_DfltAddrRprstn _DfltAddrRprstn 10
_PartnerFunction _PartnerFunction 2
_SalesDocument _SalesDocument 2
_SalesDocumentItem _SalesDocumentItem 2
AddressID AddressID 11
AddressObjectType AddressObjectType 9
AddressPersonID AddressPersonID 11
BPAddrDeterminationTransaction BPAddrDeterminationTransaction 8
BPRefAddressIDForDocSpcfcAddr BPRefAddressIDForDocSpcfcAddr 8
ContactPerson ContactPerson 10
CorrespondenceLanguage CorrespondenceLanguage 6
Customer Customer 10
EmailAddress EmailAddress 8
FormOfAddress FormOfAddress 7
FullName BusinessPartnerFullName,FullName 9
InternationalFaxNumber InternationalFaxNumber 3
InternationalMobilePhoneNumber InternationalMobilePhoneNumber 7
InternationalPhoneNumber InternationalPhoneNumber 7
Partner BusinessPartner,Partner 10
PartnerIsOneTimeAccount PartnerIsOneTimeAccount 2
PartnerIsSpecificForSDDocItem PartnerIsSpecificForSDDocItem 8
Personnel Personnel 10
ReferenceBusinessPartner ReferenceBusinessPartner 8
SDDocPartnerAddressRefType SDDocPartnerAddressRefType 8
SDDocPartnerAddrIsDocSpecific SDDocPartnerAddrIsDocSpecific 7
Supplier Supplier 10
UnloadingPointName UnloadingPointName 7
VATRegistration VATRegistration 7
@AbapCatalog: {
  sqlViewName: 'ISLSDOCITMCMPLPT',
  compiler.compareFilter: true
}

@VDM: {
  viewType: #COMPOSITE,
  lifecycle.contract.type: #PUBLIC_LOCAL_API
}

@ClientHandling.algorithm: #SESSION_VARIABLE

@AccessControl: {
  authorizationCheck: #CHECK,
  personalData.blocking: #('TRANSACTIONAL_DATA'),
  privilegedAssociations:  [ '_Address', '_DfltAddrRprstn', '_PersonAddress', '_PersonName', '_OrganizationAddress', '_OrgNamePostalAddress' ]
}

@ObjectModel: {
   representativeKey: 'PartnerFunction',
   usageType: {
     dataClass:      #TRANSACTIONAL,
     serviceQuality: #C,
     sizeCategory:   #XL
   }
}

@Metadata.ignorePropagatedAnnotations:true
@Consumption.dbHints: [ 'USE_HEX_PLAN', 'NO_SUBPLAN_SHARING' ]
@EndUserText.label: 'Sales Doc Item and Inherited Partners'
define view I_SalesDocItemCompletePartner
  as select from P_SalesDocItemCompletePartner as ItemPartner

  association [1]    to I_WorkAssignment               as _WorkAssignment               on  $projection.Personnel = _WorkAssignment.WorkAssignment

  association [0..1] to I_OrganizationAddress          as _OrganizationAddress          on  $projection.AddressID                          = _OrganizationAddress.AddressID
                                                                                        and $projection.AddressPersonID                    = _OrganizationAddress.AddressPersonID
                                                                                        and $projection.AddressObjectType                  = '1'
                                                                                        and _OrganizationAddress.AddressRepresentationCode is initial

  association [0..1] to I_PersonAddress                as _PersonAddress                on  $projection.AddressID                    = _PersonAddress.AddressID
                                                                                        and $projection.AddressPersonID              = _PersonAddress.AddressPersonID
                                                                                        and $projection.AddressObjectType            = '2'
                                                                                        and _PersonAddress.AddressRepresentationCode is initial

  association [0..1] to I_PersonWorkplaceAddress       as _PersonWorkplaceAddress       on  $projection.AddressID                             = _PersonWorkplaceAddress.AddressID
                                                                                        and $projection.AddressPersonID                       = _PersonWorkplaceAddress.AddressPersonID
                                                                                        and $projection.AddressObjectType                     = '3'
                                                                                        and _PersonWorkplaceAddress.AddressRepresentationCode is initial

  association [0..1] to I_AddrOrgNamePostalAddress     as _OrgNamePostalAddress         on  $projection.AddressID                           = _OrgNamePostalAddress.AddressID
                                                                                        and _OrgNamePostalAddress.AddressRepresentationCode is initial

  association [0..1] to I_AddressPersonName            as _PersonName                   on  $projection.AddressPersonID           = _PersonName.AddressPersonID
                                                                                        and _PersonName.AddressRepresentationCode is initial

  association [0..1] to I_AddrCurDfltLandlinePhoneNmbr as _CurrentDfltLandlinePhoneNmbr on  $projection.AddressID       = _CurrentDfltLandlinePhoneNmbr.AddressID
                                                                                        and $projection.AddressPersonID = _CurrentDfltLandlinePhoneNmbr.AddressPersonID

  association [0..1] to I_AddrCurDefaultEmailAddress   as _CurrentDfltEmailAddress      on  $projection.AddressID       = _CurrentDfltEmailAddress.AddressID
                                                                                        and $projection.AddressPersonID = _CurrentDfltEmailAddress.AddressPersonID

  association [0..1] to I_AddrCurDfltMobilePhoneNumber as _CurrentDfltMobilePhoneNumber on  $projection.AddressID       = _CurrentDfltMobilePhoneNumber.AddressID
                                                                                        and $projection.AddressPersonID = _CurrentDfltMobilePhoneNumber.AddressPersonID
  association [0..1] to I_AddrCurDefaultFaxNumber      as _CurrentDfltFaxNumber         on  $projection.AddressID       = _CurrentDfltFaxNumber.AddressID
                                                                                        and $projection.AddressPersonID = _CurrentDfltFaxNumber.AddressPersonID

  association [1]    to I_WorkplaceAddress             as _WorkPlaceAddress             on  $projection.ReferenceBusinessPartner = _WorkPlaceAddress.BusinessPartner

{
      @ObjectModel.foreignKey.association: '_SalesDocument'
  key ItemPartner.SalesDocument,
      @ObjectModel.foreignKey.association: '_SalesDocumentItem'
  key ItemPartner.SalesDocumentItem,
      @ObjectModel.foreignKey.association: '_PartnerFunction'
  key ItemPartner.PartnerFunction,

      ItemPartner.Customer,

      ItemPartner.Supplier,

      ItemPartner.ContactPerson,

      ItemPartner.Personnel,

      ItemPartner.VATRegistration,

      @Semantics.text: true
      ItemPartner.UnloadingPointName,

      case
        when ItemPartner.Customer != ''
            then ItemPartner.Customer
        when ItemPartner.Supplier != ''
            then ItemPartner.Supplier
        when ItemPartner.Personnel != '00000000'
            then cast(ItemPartner.Personnel as kunnr)
        when ItemPartner.ContactPerson != '0000000000'
            then cast(ItemPartner.ContactPerson as kunnr)
        else
            ''
        end                                                    as Partner,

      cast(
      case AddressID
        when ''
          then
            case
              when Personnel != '00000000'
               then coalesce(_WorkAssignment.PersonFullName,
                             _WorkAssignment._BusinessPartner.LastName)
            end
        else
          case
            when ItemPartner.AddressObjectType = '1'
              then
                case
                  when ItemPartner.ContactPerson != '0000000000'
                    then
                      cast(substring(replace(concat(ItemPartner._ContactPerson.FirstName,
                                             concat(' &@', ItemPartner._ContactPerson.LastName) ), '&@', '') ,1,80) as ad_namtext )
                  when ItemPartner.Personnel != '00000000'
                    then _OrganizationAddress.AddresseeName1  //Document specific personnel

                  else
                    cast(concat_with_space(_OrganizationAddress.AddresseeName1,
                                           _OrganizationAddress.AddresseeName2, 1) as ad_namtext )
                  end
            when ItemPartner.AddressObjectType = '2'
              then _PersonAddress.PersonFullName
            when ItemPartner.AddressObjectType = '3'
              then _PersonWorkplaceAddress.PersonFullName
          end
      end as ad_namtext )                                      as FullName,

      ItemPartner.ReferenceBusinessPartner,

      ItemPartner.AddressID,

      ItemPartner.AddressPersonID,

      ItemPartner.AddressObjectType,

      ItemPartner.SDDocPartnerAddressRefType,

      ItemPartner.BPAddrDeterminationTransaction,

      ItemPartner.BPRefAddressIDForDocSpcfcAddr,
      
      ItemPartner.PartnerIsOneTimeAccount,

      ItemPartner.PartnerIsSpecificForSDDocItem,

      cast(
      case ItemPartner.SDDocPartnerAddressRefType
        when 'E' then 'X'
        when 'F' then 'X'
        else ' '
      end                 as sd_pd_doc_spec_addr_flag)         as SDDocPartnerAddrIsDocSpecific,

      _OrgNamePostalAddress.Country,

      cast(
        coalesce( _PersonName.FormOfAddress,
                  _OrgNamePostalAddress.FormOfAddress )
         as ad_title preserving type )                         as FormOfAddress,

      coalesce( _PersonName.CorrespondenceLanguage,
                _OrgNamePostalAddress.CorrespondenceLanguage ) as CorrespondenceLanguage,

      /* Communication Related Data */
      cast(
        case ItemPartner.AddressID
          when ''
            then _WorkPlaceAddress.NormalizedPhoneNumber
          else _CurrentDfltLandlinePhoneNmbr.InternationalPhoneNumber
        end as vdm_sd_sls_phone preserving type )              as InternationalPhoneNumber,

      cast(
        case ItemPartner.AddressID
          when ''
            then _WorkPlaceAddress.MblNormalizedPhoneNumber
          else _CurrentDfltMobilePhoneNumber.InternationalPhoneNumber
        end as vdm_sd_sls_mobile preserving type )             as InternationalMobilePhoneNumber,

      cast(
        case ItemPartner.AddressID
          when ''
            then _WorkPlaceAddress.InternationalFaxNumber
          else _CurrentDfltFaxNumber.InternationalFaxNumber
        end as vdm_sd_sls_fax preserving type )                as InternationalFaxNumber,

      cast(
        case ItemPartner.AddressID
          when ''
            then _WorkPlaceAddress.DefaultEmailAddress
          else _CurrentDfltEmailAddress.EmailAddress
        end as vdm_sd_sls_email preserving type )              as EmailAddress,

      ItemPartner._Address,

      ItemPartner._DfltAddrRprstn,

      ItemPartner._BusinessPartnerAddress,

      ItemPartner._BPRefAddressForDocSpcfcAddr,

      ItemPartner._SalesDocument,

      ItemPartner._SalesDocumentItem,

      ItemPartner._PartnerFunction,

      _ContactPerson,
      _PersonAddress,
      _PersonName,
      _OrganizationAddress,
      _OrgNamePostalAddress
}