I_PT_SAFTCUSTPARTNERFUNCTION

CDS View

SAFT MOG Customer partner function

I_PT_SAFTCUSTPARTNERFUNCTION is a CDS View in S/4HANA. SAFT MOG Customer partner function. It contains 11 fields. 2 CDS views read from this table.

CDS Views using this table (2)

ViewTypeJoinVDMDescription
I_PT_SAFTDeliveryCustomer_2 view_entity from COMPOSITE SAFT for Normal Customer
I_PT_SAFTDeliveryOneTimeCust_2 view_entity from COMPOSITE One Time Customer for SAFT

Fields (11)

KeyField CDS FieldsUsed in Views
KEY CompanyCode CompanyCode 1
KEY DeliveryDocument DeliveryDocument 2
KEY PortugueseDeliveryNumber PortugueseDeliveryNumber 1
_DelDoc _DelDoc 1
Customer Customer 1
DeliveryDate DocumentDate 1
FaxNumber FaxNumber 1
PortugueseDigitalSignatureDate CreationDate 1
PortugueseDigitalSignatureTime CreationTime 1
PT_ShipToPartyAddressAsText PT_ShipToPartyAddressAsText 1
WebsiteURL WebsiteURL 1
@AccessControl.authorizationCheck:#MANDATORY
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #MIXED 
@AccessControl.personalData.blocking: #REQUIRED
@EndUserText.label: 'SAFT MOG Customer partner function'
@Metadata.ignorePropagatedAnnotations: true
@VDM.viewType: #COMPOSITE  
define view entity I_PT_SAFTCustPartnerFunction 
 as select from I_PT_DeliveryDgtlSgntr_2 as sig 
 association [0..*] to I_PT_SAFTDeliveryPartner as _CustPartner on sig.DeliveryDocument = _CustPartner.DeliveryDocument  
{
   key PortugueseDeliveryNumber,
   key sig.DeliveryDocument,
   key coalesce( _CustPartner[ PartnerFunction = 'AG'].Customer, _CustPartner[ PartnerFunction = 'WE'].Customer )                                 as Customer,
   key CompanyCode,
   PortugueseDigitalSignatureDate,
   PortugueseDigitalSignatureTime,
   PortugueseDigitalSignature,
   DeliveryDate, 

   coalesce( sig._DelDoc._ShipToParty.VATRegistration, sig._DelDoc._SoldToParty.VATRegistration)                                                  as VATRegistration,
   coalesce( sig._DelDoc._ShipToParty.TaxNumber1, sig._DelDoc._SoldToParty.TaxNumber1)                                                            as TaxNumber1,   
   coalesce( sig._DelDoc._ShipToParty.CustomerName, sig._DelDoc._SoldToParty.CustomerName)                                                        as CompanyName, 
   coalesce( sig._DelDoc._ShipToParty.CityName, sig._DelDoc._SoldToParty.CityName)                                                                as CityName,  
   coalesce( sig._DelDoc._ShipToParty.Country, sig._DelDoc._SoldToParty.Country)                                                                  as Country,      
   coalesce( sig._DelDoc._ShipToParty.PostalCode, sig._DelDoc._SoldToParty.PostalCode)                                                            as PostalCode,     
   coalesce( sig._DelDoc._ShipToParty.StreetName, sig._DelDoc._SoldToParty.StreetName)                                                            as StreetName,                 
   coalesce( sig._DelDoc._ShipToParty._AddressRepresentation.HouseNumber, sig._DelDoc._SoldToParty._AddressRepresentation.HouseNumber)            as HouseNumber,  
   coalesce( sig._DelDoc._ShipToParty.Region, sig._DelDoc._SoldToParty.Region)                                                                    as Region,       
   coalesce( sig._DelDoc._ShipToParty.CustomerFullName, sig._DelDoc._SoldToParty.CustomerFullName)                                                as CustomerFullName,     
   coalesce( sig._DelDoc._ShipToParty._AddressDefaultRepresentation._PhoneNumber.InternationalPhoneNumber, sig._DelDoc._SoldToParty._AddressDefaultRepresentation._PhoneNumber.InternationalPhoneNumber)                    
                                                                                                                                                  as PhoneNumber,       
   coalesce( sig._DelDoc._ShipToParty.FaxNumber, sig._DelDoc._SoldToParty.FaxNumber)                                                              as FaxNumber, 
   coalesce( sig._DelDoc._ShipToParty._AddressDefaultRepresentation._CurrentDfltEmailAddress.EmailAddress  , sig._DelDoc._SoldToParty._AddressDefaultRepresentation._CurrentDfltEmailAddress.EmailAddress )   
                                                                                                                                                  as EmailAddress,     
   ' '                                                                                                                                            as WebsiteURL,
   case coalesce( _CustPartner[ PartnerFunction = 'AG'].IsOneTimeAccount, _CustPartner[ PartnerFunction = 'WE'].IsOneTimeAccount )   
    when 'X'
     then 
      concat ( coalesce( _CustPartner[ PartnerFunction = 'AG']._DfltAddrRprstn.StreetName, _CustPartner[ PartnerFunction = 'WE']._DfltAddrRprstn.StreetName ), 
            coalesce( _CustPartner[ PartnerFunction = 'AG']._DfltAddrRprstn.HouseNumber, _CustPartner[ PartnerFunction = 'WE']._DfltAddrRprstn.HouseNumber ) )       
    else
      concat ( coalesce( sig._DelDoc._ShipToParty.StreetName, sig._DelDoc._SoldToParty.StreetName) , 
            coalesce( sig._DelDoc._ShipToParty._AddressRepresentation.HouseNumber, sig._DelDoc._SoldToParty._AddressRepresentation.HouseNumber) )
   end                                                                                                                                                                 as PT_ShipToPartyAddressAsText,                                                                                                                                                   
   // OneTime Customer                                                                                                                                                      

   cast(coalesce( _CustPartner[ PartnerFunction = 'AG'].IsOneTimeAccount, _CustPartner[ PartnerFunction = 'WE'].IsOneTimeAccount ) as xcpdk)                           as IsOneTimeAccount,
 //  cast(coalesce( _CustPartner[ PartnerFunction = 'AG'].CustomerVATRegistration, _CustPartner[ PartnerFunction = 'WE'].CustomerVATRegistration ) as abap.char(20))     as CustomerVATRegistration,   

  case coalesce( _CustPartner[ PartnerFunction = 'AG'].CustomerVATRegistration, _CustPartner[ PartnerFunction = 'WE'].CustomerVATRegistration )
     when ''
     then 
     coalesce( _CustPartner[ PartnerFunction = 'WE'].CustomerVATRegistration, _CustPartner[ PartnerFunction = 'AG'].CustomerVATRegistration ) 
     else 
     coalesce( _CustPartner[ PartnerFunction = 'AG'].CustomerVATRegistration, _CustPartner[ PartnerFunction = 'WE'].CustomerVATRegistration )
     end  as CustomerVATRegistration,    
   coalesce( _CustPartner[ PartnerFunction = 'AG']._DfltAddrRprstn.CityName, _CustPartner[ PartnerFunction = 'WE']._DfltAddrRprstn.CityName )                          as ShipToPartyCityName,   
   coalesce( _CustPartner[ PartnerFunction = 'AG']._DfltAddrRprstn.Country, _CustPartner[ PartnerFunction = 'WE']._DfltAddrRprstn.Country )                            as ShipToPartyCountry,
   coalesce( _CustPartner[ PartnerFunction = 'AG']._DfltAddrRprstn.PostalCode, _CustPartner[ PartnerFunction = 'WE']._DfltAddrRprstn.PostalCode )                      as ShipToPartyPostalCode,   
   coalesce( _CustPartner[ PartnerFunction = 'AG']._DfltAddrRprstn.StreetName, _CustPartner[ PartnerFunction = 'WE']._DfltAddrRprstn.StreetName )                      as ShipToPartyStreetName,      
   coalesce( sig._DelDoc._ShipToParty.Region, sig._DelDoc._SoldToParty.Region)                                                                                         as ShipToPartyRegion, 
   coalesce( _CustPartner[ PartnerFunction = 'AG']._DfltAddrRprstn.HouseNumber, _CustPartner[ PartnerFunction = 'WE']._DfltAddrRprstn.HouseNumber )                    as ShipToPartyHouseNumber,  
   case coalesce( _CustPartner[ PartnerFunction = 'AG']._DfltAddrRprstn.AddresseeFullName, _CustPartner[ PartnerFunction = 'WE']._DfltAddrRprstn.AddresseeFullName )
     when ''
     then 
     coalesce( _CustPartner[ PartnerFunction = 'WE']._DfltAddrRprstn.AddresseeFullName, _CustPartner[ PartnerFunction = 'AG']._DfltAddrRprstn.AddresseeFullName ) 
     else 
     coalesce( _CustPartner[ PartnerFunction = 'AG']._DfltAddrRprstn.AddresseeFullName, _CustPartner[ PartnerFunction = 'WE']._DfltAddrRprstn.AddresseeFullName )
     end  as PT_ShipToPartyCompanyName,    
   
   //Association                 

   _CustPartner,   
   sig._DelDoc    
}
where
 sig.PortugueseDigitalSignature <> ''