@AbapCatalog.sqlViewName: 'IBPSUPLADDRINFO'
@AbapCatalog.compiler.compareFilter: true
//@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #MANDATORY
@EndUserText.label: 'BP Supp Add Dep Gen Info'
@AccessControl.personalData.blocking: #REQUIRED
@ClientHandling.algorithm : #SESSION_VARIABLE
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass: #MASTER
@VDM.viewType: #COMPOSITE
define view I_BPSupplierAddrDepdntGenInfo
as select from I_BusPartAddress as BusinessPartnerAddress
inner join I_BusinessPartnerSupplier as BusinessPartnerSupplier on BusinessPartnerAddress.BusinessPartner = BusinessPartnerSupplier.BusinessPartner
left outer to one join I_SupplierAddrDepdntGeneral as SuplAddrDepdntInformation on BusinessPartnerSupplier.Supplier = SuplAddrDepdntInformation.Supplier
and BusinessPartnerAddress.AddressID = SuplAddrDepdntInformation.AddressID
association [1..1] to I_BusinessPartner as _BusinessPartner on _BusinessPartner.BusinessPartner = $projection.BusinessPartner
association [1..1] to I_Supplier as _Supplier on $projection.Supplier = _Supplier.Supplier
association [1..1] to I_BPCurrentDefaultAddress as _DefaultAddress on _DefaultAddress.BusinessPartner = $projection.BusinessPartner
{
key BusinessPartnerAddress.BusinessPartner as BusinessPartner,
key BusinessPartnerAddress.AddressID as AddressID,
BusinessPartnerSupplier.Supplier as Supplier,
// Logic to determine Supplier address number: If Address is marked as standard address at business partner level, then check if any addr dependent info is maintained in lfa1_addr,
// If addr dependent data is maintained use 'lfa1_addr' tables address number If no deviation data is maintained, fallback to 'lfa1' tables addr number
// For a non standard BP address with no address dependent data , The address number will be fetched from 'LFA1' table
// Fields common to both LFA1_ADDR and LFA1 tables
// When an address number exists for Supplier address depdedent information, Fetch data from LFA1_ADDR table
// Else fetch data from LFA1 table
case when SuplAddrDepdntInformation.AddressID is not initial then SuplAddrDepdntInformation.TrainStationName
else BusinessPartnerSupplier.TrainStationName end as TrainStationName,
case when SuplAddrDepdntInformation.AddressID is not initial then SuplAddrDepdntInformation.FactoryCalendar
else BusinessPartnerSupplier.FactoryCalendar end as FactoryCalendar,
case when SuplAddrDepdntInformation.AddressID is not initial then SuplAddrDepdntInformation.TranspServiceAgentStstcGrp
else BusinessPartnerSupplier.TranspServiceAgentStstcGrp end as TranspServiceAgentStstcGrp,
case when SuplAddrDepdntInformation.AddressID is not initial then SuplAddrDepdntInformation.IsToBeAcceptedAtOrigin
else BusinessPartnerSupplier.IsToBeAcceptedAtOrigin end as IsToBeAcceptedAtOrigin,
//case when SuplAddrDepdntInformation.AddressID is not initial then SuplAddrDepdntInformation.SuplrTaxAuthorityAccountNumber
//else BusinessPartnerSupplier.SuplrTaxAuthorityAccountNumber end as SuplrTaxAuthorityAccountNumber,
// LFA1 fields
BusinessPartnerSupplier.SupplierAccountGroup,
//BusinessPartnerSupplier.FormOfAddress,
BusinessPartnerSupplier.FormOfAddress as TitleSupplier,
BusinessPartnerSupplier.InternationalLocationNumber1,
BusinessPartnerSupplier.InternationalLocationNumber2,
BusinessPartnerSupplier.InternationalLocationNumber3,
//@ObjectModel.text.association: '_ReferenceAccountGroupText'
BusinessPartnerSupplier.ReferenceAccountGroup,
//@Consumption.valueHelp: '_SupplierAlternativePayee'
//@ObjectModel.foreignKey.association: '_SupplierAlternativePayee'
BusinessPartnerSupplier.SupplierAlternativePayee as SupplierAlternativePayee,
BusinessPartnerSupplier.Customer,
BusinessPartnerSupplier.PostingIsBlocked,
BusinessPartnerSupplier.PurchasingIsBlocked,
BusinessPartnerSupplier.VATLiability,
BusinessPartnerSupplier.PaymentIsBlockedForSupplier,
BusinessPartnerSupplier.SuplrProofOfDelivRlvtCode,
BusinessPartnerSupplier.BR_TaxIsSplit,
cast( 'X' as sdraft_is_active preserving type ) as IsActiveEntity,
BusinessPartnerSupplier.AuthorizationGroup,
BusinessPartnerSupplier.SupplierCorporateGroup,
BusinessPartnerSupplier.ResponsibleType,
//@Consumption.valueHelp: '_FiscalAddress'
BusinessPartnerSupplier.FiscalAddress,
BusinessPartnerSupplier.SupplierProcurementBlock,
BusinessPartnerSupplier.DataExchangeInstructionKey,
BusinessPartnerSupplier.BPIsEqualizationTaxSubject,
BusinessPartnerSupplier.BRSpcfcTaxBasePercentageCode,
BusinessPartnerSupplier.DataMediumExchangeIndicator,
BusinessPartnerSupplier.TaxNumberResponsible,
BusinessPartnerSupplier.TaxNumberType,
BusinessPartnerSupplier.SuplrQualityManagementSystem,
BusinessPartnerSupplier.SuplrQltyInProcmtCertfnValidTo,
BusinessPartnerSupplier.SupplierIsSubRangeRelevant,
BusinessPartnerSupplier.AlternativePayeeIsAllowed,
BusinessPartnerSupplier.PaytSlipWthRefSubscriber,
BusinessPartnerSupplier.SupplierIsPlantRelevant,
BusinessPartnerSupplier.SupplierPlant,
BusinessPartnerSupplier.DeletionIndicator,
@Semantics.booleanIndicator: true
BusinessPartnerSupplier.IsBusinessPurposeCompleted,
BusinessPartnerSupplier.PaymentReason,
@Semantics.booleanIndicator:true
BusinessPartnerSupplier.SupplierCentralDeletionIsBlock,
_BusinessPartner,
_Supplier,
_DefaultAddress
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BUSINESSPARTNERSUPPLIER",
"I_BUSPARTADDRESS",
"I_SUPPLIERADDRDEPDNTGENERAL"
],
"ASSOCIATED":
[
"I_BPCURRENTDEFAULTADDRESS",
"I_BUSINESSPARTNER",
"I_SUPPLIER"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/