I_PT_SAFTDeliveryOneTimeCust_2 is a Composite CDS View that provides data about "One Time Customer for SAFT" in SAP S/4HANA. It reads from 1 data source (I_PT_SAFTCustPartnerFunction) and exposes 16 fields with key fields Customer, CompanyCode, PortugueseDeliveryNumber, DeliveryDocument. Part of development package GLO-LOG-PT.
@VDM.viewType:#COMPOSITE// #BASIC
@AccessControl.authorizationCheck: #MANDATORY@Metadata.ignorePropagatedAnnotations:true@ObjectModel.usageType.sizeCategory: #XL@ObjectModel.usageType.serviceQuality: #X@ObjectModel.usageType.dataClass: #MIXED@AccessControl.personalData.blocking: #REQUIRED@EndUserText.label:'One Time Customer for SAFT'
defineviewentity I_PT_SAFTDeliveryOneTimeCust_2
asselectfrom I_PT_SAFTCustPartnerFunction as cust
{
key Customer as Customer,
key CompanyCode as CompanyCode,
key PortugueseDeliveryNumber as PortugueseDeliveryNumber,
key cust.DeliveryDocument,
DeliveryDate as DeliveryDate,
cast( cust.IsOneTimeAccount as xcpdk) as IsOneTimeAccount,
CustomerVATRegistration,
/* casewhen cust.VATRegistration is initial or cust.VATRegistration isnullthen concat(cust.Customer, concat('/', '999999990'))
else concat(cust.Customer, concat('/', cust.VATRegistration))
endas BusinessPartnerCustomer, */casewhen cust.ShipToPartyStreetName isnotnulland cust.ShipToPartyStreetName isnot initial
then cust.ShipToPartyStreetName
else 'Desconhecido'
endas StreetName,
casewhen cust.ShipToPartyHouseNumber isnotnulland cust.ShipToPartyHouseNumber isnot initial
then cust.ShipToPartyHouseNumber
else ''
endas HouseNumber,
casewhen cust.ShipToPartyCityName isnotnulland cust.ShipToPartyCityName isnot initial
then cust.ShipToPartyCityName
else 'Desconhecido'
endas CityName,
casewhen cust.ShipToPartyPostalCode isnotnulland cust.ShipToPartyPostalCode isnot initial
then cust.ShipToPartyPostalCode
else '0000-000'
endas PostalCode,
cast( cust.ShipToPartyCountry as land1) as Country,
casewhen cust._CustPartner._DfltAddrRprstn._PhoneNumber.InternationalPhoneNumber isnotnulland cust._CustPartner._DfltAddrRprstn._PhoneNumber.InternationalPhoneNumber isnot initial
then cust._CustPartner._DfltAddrRprstn._PhoneNumber.InternationalPhoneNumber
endas PhoneNumber,
casewhen cust.ShipToPartyRegion isnotnulland cust.ShipToPartyRegion isnot initial
then cust.ShipToPartyRegion
else ''
endas Region,
casewhen cust.PT_ShipToPartyCompanyName isnotnulland cust.PT_ShipToPartyCompanyName isnot initial
then cust.PT_ShipToPartyCompanyName
else ''
endas CompanyName,
casewhen ( CustomerVATRegistration is initial
and ( HouseNumber is initial
and StreetName is initial
and CityName is initial
and PostalCode is initial
and Country is initial ) )
then cust.Customer
when ( CustomerVATRegistration is initial
and ( HouseNumber isnot initial
or StreetName isnot initial
or CityName isnot initial
or PostalCode isnot initial
or Country isnot initial ) )
then concat( cust.Customer, concat( '_', cust.DeliveryDocument ) )
when ( CustomerVATRegistration isnot initial )
then concat( CustomerVATRegistration,
concat( '_', cust.DeliveryDocument ) )
else ''
endas BusinessPartnerCustomer,
cust.PT_ShipToPartyAddressAsText,
cust._CustPartner.AddressID,
cust._CustPartner._DfltAddrRprstn,
cust._CustPartner.AddressPersonID,
cust.FaxNumber,
// cust.EmailAddress,
cust.WebsiteURL
}
where
cust.IsOneTimeAccount = 'X'
and cust.PortugueseDigitalSignature <> ''