@AbapCatalog.sqlViewName: 'CPRREQITMDELADD'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@VDM.viewType: #CONSUMPTION
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #L
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@EndUserText.label: 'Consumption View for Purchase Reqn Delivery address'
@Metadata.ignorePropagatedAnnotations: true
//define view C_PurReqnItemDeliveryAddress as select from I_PurchaseReqnDeliveryAddress as _PurchaseReqnDeliveryAddress
//{
// key PurchaseRequisition,
// key PurchaseRequisitionItem,
// @UI.identification: { position: 10, importance: #HIGH }
// @UI.fieldGroup:[{qualifier: 'Address1', position: 10, label: 'Title', importance: #HIGH}]
// FormOfAddress,
//// @UI.identification: { position: 10, importance: #HIGH }
//// @UI.fieldGroup:[{qualifier: 'Address1', position: 20, label: 'Full Name', importance: #HIGH}]
//// BusinessPartnerName1,
//// @UI.identification: { position: 20, importance: #HIGH }
//// @UI.fieldGroup:[{qualifier: 'Address1', position: 40, label: 'Name 2', importance: #HIGH}]
//// BusinessPartnerName2,
// @UI.identification: { position: 20, importance: #HIGH }
// @UI.fieldGroup:[{qualifier: 'Address1', position: 40, label: 'Name 2', importance: #HIGH}]
// FullName,
// @UI.identification: { position: 30, importance: #HIGH }
// @UI.fieldGroup:[{qualifier: 'Address1', position: 50, label: 'Postal Code', importance: #HIGH}]
// POBoxPostalCode,
// @UI.identification: { position: 20, importance: #HIGH }
// @UI.fieldGroup:[{qualifier: 'Address1', position: 60, label: 'Street', importance: #HIGH}]
// StreetName,
// @UI.identification: { position: 20, importance: #HIGH }
// @UI.fieldGroup:[{qualifier: 'Address2', position: 20, label: 'City', importance: #HIGH}]
// CityName,
// @UI.identification: { position: 20, importance: #HIGH }
// @UI.fieldGroup:[{qualifier: 'Address2', position: 30, label: 'House Number', importance: #HIGH}]
// HouseNumber,
// @UI.identification: { position: 20, importance: #HIGH }
// @UI.fieldGroup:[{qualifier: 'Address2', position: 40, label: 'Country', importance: #HIGH}]
// Country,
// @UI.identification: { position: 20, importance: #HIGH }
// @UI.fieldGroup:[{qualifier: 'Address2', position: 50, label: 'Region', importance: #HIGH}]
// Region,
// _PurchaseReqnDeliveryAddress._PurchaseReqnItem.PurchaseRequisitionType as PurchaseRequisitionType,
// _PurchaseReqnDeliveryAddress._PurchaseReqnItem.PurchasingGroup as PurchasingGroup,
// _PurchaseReqnDeliveryAddress._PurchaseReqnItem.PurchasingOrganization as PurchasingOrganization,
// _PurchaseReqnDeliveryAddress._PurchaseReqnItem.Plant as Plant
//}
define view C_PurReqnItemDeliveryAddress as select from I_Purchaserequisitionitem as _Purchaserequisitionitem
//association [0..1] to I_Address as _Address on $projection.DeliveryAddressID = _Address.AddressID
association [0..1] to I_OrganizationAddress as _OrganizationAddress on $projection.DeliveryAddressID = _OrganizationAddress.AddressID
and _OrganizationAddress.AddressPersonID = ''
and _OrganizationAddress.AddressRepresentationCode = ''
//Address Associations for fax and phone
association [0..1] to I_AddrCurDefaultFaxNumber as _CurrentDfltFaxNumber on $projection.DeliveryAddressID = _CurrentDfltFaxNumber.AddressID
association [0..*] to I_AddressPhoneNumber_2 as _PhoneNumber on $projection.DeliveryAddressID = _PhoneNumber.AddressID
and _PhoneNumber.PhNmbrIsCurrentOverallDefault = 'X'
{
key _Purchaserequisitionitem.PurchaseRequisition,
key _Purchaserequisitionitem.PurchaseRequisitionItem,
//_Address.AddressID,
_OrganizationAddress.AddressID,
case
when _Purchaserequisitionitem.ManualDeliveryAddressID <> ''
then cast ( 'U' as purreqnaddrtype)
when _Purchaserequisitionitem.ManualDeliveryAddressID = '' and _Purchaserequisitionitem.ItemDeliveryAddressID = ''
and _Purchaserequisitionitem.DeliveryAddressID <> ''
then cast ( 'P' as purreqnaddrtype)
else
cast ( 'P' as purreqnaddrtype)
end as AddressType,
_Purchaserequisitionitem.DeliveryAddressID,
_Purchaserequisitionitem.Plant,
_Purchaserequisitionitem.ManualDeliveryAddressID,
_Purchaserequisitionitem.ItemDeliveryAddressID,
_Purchaserequisitionitem.PurchasingGroup,
_Purchaserequisitionitem.PurchaseRequisitionType,
_Purchaserequisitionitem.PurchasingOrganization,
// 2308CL : Use of new address interface I_ADDRESS_2 (I_OrganizationAddress)
/*
_Address.CareOfName,
_Address.AdditionalStreetSuffixName,
_Address.CorrespondenceLanguage,
_Address.PrfrdCommMediumType,
_Address.POBox,
_Address.POBoxIsWithoutNumber,
_Address.POBoxPostalCode,
_Address.POBoxLobbyName,
_Address.POBoxDeviatingCityName,
_Address.POBoxDeviatingRegion,
_Address.POBoxDeviatingCountry,
_Address.DeliveryServiceTypeCode,
_Address.DeliveryServiceNumber,
_Address.AddressTimeZone,
@ObjectModel.readOnly: true
@UI.identification: { position: 20, importance: #HIGH }
@UI.fieldGroup:[{qualifier: 'Address1', position: 40, label: 'Full Name', importance: #HIGH}]
_Address.FullName,
@ObjectModel.readOnly: true
@UI.identification: { position: 20, importance: #HIGH }
@UI.fieldGroup:[{qualifier: 'Address2', position: 20, label: 'City', importance: #HIGH}]
_Address.CityName,
_Address.District,
_Address.CityCode,
_Address.HomeCityName,
@ObjectModel.readOnly: true
@UI.identification: { position: 30, importance: #HIGH }
@UI.fieldGroup:[{qualifier: 'Address1', position: 50, label: 'Postal Code', importance: #HIGH}]
_Address.PostalCode,
_Address.CompanyPostalCode,
@ObjectModel.readOnly: true
@UI.identification: { position: 20, importance: #HIGH }
@UI.fieldGroup:[{qualifier: 'Address1', position: 60, label: 'Street', importance: #HIGH}]
_Address.StreetName,
_Address.StreetPrefixName,
_Address.AdditionalStreetPrefixName,
_Address.StreetSuffixName,
@ObjectModel.readOnly: true
@UI.identification: { position: 20, importance: #HIGH }
@UI.fieldGroup:[{qualifier: 'Address2', position: 30, label: 'House Number', importance: #HIGH}]
_Address.HouseNumber,
_Address.HouseNumberSupplementText,
_Address.Building,
_Address.Floor,
_Address.RoomNumber,
@ObjectModel.readOnly: true
@UI.identification: { position: 20, importance: #HIGH }
@UI.fieldGroup:[{qualifier: 'Address2', position: 40, label: 'Country/Region', importance: #HIGH}]
_Address.Country,
@ObjectModel.readOnly: true
@UI.identification: { position: 20, importance: #HIGH }
@UI.fieldGroup:[{qualifier: 'Address2', position: 50, label: 'Region', importance: #HIGH}]
_Address.Region,
_Address.County,
// @UI.identification: { position: 10, importance: #HIGH }
// @UI.fieldGroup:[{qualifier: 'Address1', position: 10, label: 'Title', importance: #HIGH}]
_Address.FormOfAddress as FormOfAddress,
//_FormOfAddressText.Langauge,
_Address.BusinessPartnerName1,
_Address.BusinessPartnerName2,
_Address.Nation,
_Address.PhoneNumber,
_Address.FaxNumber,
_Address.SearchTerm1,
_Address.StreetSearch,
_Address.CitySearch,
_Address.BusinessPartnerName3,
_Address.BusinessPartnerName4,
_Address.TaxJurisdiction,
_Address.TransportZone,
_Address.Person,
@ObjectModel.readOnly: true
@UI.identification: { position: 10, importance: #HIGH }
@UI.fieldGroup:[{qualifier: 'Address1', position: 10, label: 'Title', importance: #HIGH}]
_Address._FormOfAddress._Text[1:Language = $session.system_language].FormOfAddressName as FormOfAddressName,
//Associations
_Address._FormOfAddress,
_Address._Region
*/
// 2308CL : Use of new address interface I_ADDRESS_2 (I_OrganizationAddress)
_OrganizationAddress.CareOfName,
_OrganizationAddress.StreetSuffixName2 as AdditionalStreetSuffixName,
_OrganizationAddress.CorrespondenceLanguage,
_OrganizationAddress.PrfrdCommMediumType,
_OrganizationAddress.POBox,
_OrganizationAddress.POBoxIsWithoutNumber,
_OrganizationAddress.POBoxPostalCode,
_OrganizationAddress.POBoxLobbyName,
_OrganizationAddress.POBoxDeviatingCityName,
_OrganizationAddress.POBoxDeviatingRegion,
_OrganizationAddress.POBoxDeviatingCountry,
_OrganizationAddress.DeliveryServiceTypeCode,
_OrganizationAddress.DeliveryServiceNumber,
_OrganizationAddress.AddressTimeZone,
@ObjectModel.readOnly: true
@UI.identification: { position: 20, importance: #HIGH }
@UI.fieldGroup:[{qualifier: 'Address1', position: 40, label: 'Full Name', importance: #HIGH}]
_OrganizationAddress.AddresseeFullName as FullName,
@ObjectModel.readOnly: true
@UI.identification: { position: 20, importance: #HIGH }
@UI.fieldGroup:[{qualifier: 'Address2', position: 20, label: 'City', importance: #HIGH}]
_OrganizationAddress.CityName,
_OrganizationAddress.DistrictName as District,
_OrganizationAddress.CityNumber as CityCode,
_OrganizationAddress.VillageName as HomeCityName,
@ObjectModel.readOnly: true
@UI.identification: { position: 30, importance: #HIGH }
@UI.fieldGroup:[{qualifier: 'Address1', position: 50, label: 'Postal Code', importance: #HIGH}]
_OrganizationAddress.PostalCode,
_OrganizationAddress.CompanyPostalCode,
@ObjectModel.readOnly: true
@UI.identification: { position: 20, importance: #HIGH }
@UI.fieldGroup:[{qualifier: 'Address1', position: 60, label: 'Street', importance: #HIGH}]
_OrganizationAddress.StreetName,
_OrganizationAddress.StreetPrefixName1 as StreetPrefixName,
_OrganizationAddress.StreetPrefixName2 as AdditionalStreetPrefixName,
_OrganizationAddress.StreetSuffixName1 as StreetSuffixName,
@ObjectModel.readOnly: true
@UI.identification: { position: 20, importance: #HIGH }
@UI.fieldGroup:[{qualifier: 'Address2', position: 30, label: 'House Number', importance: #HIGH}]
_OrganizationAddress.HouseNumber,
_OrganizationAddress.HouseNumberSupplementText,
_OrganizationAddress.Building,
_OrganizationAddress.Floor,
_OrganizationAddress.RoomNumber,
@ObjectModel.readOnly: true
@UI.identification: { position: 20, importance: #HIGH }
@UI.fieldGroup:[{qualifier: 'Address2', position: 40, label: 'Country/Region', importance: #HIGH}]
_OrganizationAddress.Country,
@ObjectModel.readOnly: true
@UI.identification: { position: 20, importance: #HIGH }
@UI.fieldGroup:[{qualifier: 'Address2', position: 50, label: 'Region', importance: #HIGH}]
_OrganizationAddress.Region,
_OrganizationAddress.SecondaryRegionName as County,
// @UI.identification: { position: 10, importance: #HIGH }
// @UI.fieldGroup:[{qualifier: 'Address1', position: 10, label: 'Title', importance: #HIGH}]
_OrganizationAddress.FormOfAddress,
//_FormOfAddressText.Langauge,
_OrganizationAddress.AddresseeName1 as BusinessPartnerName1,
_OrganizationAddress.AddresseeName2 as BusinessPartnerName2,
_OrganizationAddress.AddressRepresentationCode as Nation,
_PhoneNumber.PhoneAreaCodeSubscriberNumber as PhoneNumber,
_CurrentDfltFaxNumber.FaxAreaCodeSubscriberNumber as FaxNumber,
_OrganizationAddress.AddressSearchTerm1 as SearchTerm1,
'' as StreetSearch,
'' as CitySearch,
_OrganizationAddress.AddresseeName3 as BusinessPartnerName3,
_OrganizationAddress.AddresseeName4 as BusinessPartnerName4,
_OrganizationAddress.TaxJurisdiction,
_OrganizationAddress.TransportZone,
_OrganizationAddress.AddressPersonID as Person, // NULL data
@ObjectModel.readOnly: true
@UI.identification: { position: 10, importance: #HIGH }
@UI.fieldGroup:[{qualifier: 'Address1', position: 10, label: 'Title', importance: #HIGH}]
_OrganizationAddress._FormOfAddress._Text[1:Language = $session.system_language].FormOfAddressName as FormOfAddressName,
//Associations
_OrganizationAddress._FormOfAddress,
_OrganizationAddress._Region
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ADDRCURDEFAULTFAXNUMBER",
"I_ADDRESSPHONENUMBER_2",
"I_FORMOFADDRESS",
"I_FORMOFADDRESSTEXT",
"I_ORGANIZATIONADDRESS",
"I_PURCHASEREQUISITIONITEM"
],
"ASSOCIATED":
[
"I_ADDRCURDEFAULTFAXNUMBER",
"I_ADDRESSPHONENUMBER_2",
"I_FORMOFADDRESS",
"I_ORGANIZATIONADDRESS",
"I_REGION"
],
"BASE":
[
"I_ORGANIZATIONADDRESS"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/