
@AbapCatalog.sqlViewName: 'myview'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Selection of PO items for Inb Delivery creation Dim. Priv.'
define view myviews
// select the AB ekes entries for which no LA records exists.
as select from I_PurchasingDocumentItem as poitem
inner join ekes on ekes.ebeln = poitem.PurchasingDocument and
ekes.ebelp = poitem.PurchasingDocumentItem and
ekes.ebtyp = 'AB'
left outer join ekes as ekesla on ekesla.ebeln = ekes.ebeln and
ekesla.ebelp = ekes.ebelp and
ekesla.ebtyp = 'LA' and
ekesla.eindt = ekes.eindt and
ekesla.menge = ekes.menge
{
ekes.ebeln as ebeln,
ekes.ebelp as ebelp,
ekes.menge as menge,
ekes.eindt as eindt,
poitem.Plant as werks,
poitem.StorageLocation as lgort,
poitem.SupplierConfirmationControlKey as bstae,
poitem.PurchasingDocumentDeletionCode as loekz,
poitem.IsCompletelyDelivered as elikz,
poitem.IsReturnsItem as retpo,
poitem.PurchasingDocumentItemCategory as pstyp,
poitem.OrderQuantityUnit as meins,
poitem.Material as matnr ,
poitem.PurchasingDocumentItemText as txz01,
poitem.GoodsReceiptIsExpected as wepos
}
where
ekesla.ebelp is null
and ekesla.ebeln is null
and
(
poitem.SupplierConfirmationControlKey = '0001' or
poitem.SupplierConfirmationControlKey = '0004' or
poitem.SupplierConfirmationControlKey = '0005'
)
and
poitem.GoodsReceiptIsExpected = 'X' //wepos
union
// Further select eket entries for which no ab entries exists and no LA entries exists.
select from I_PurchasingDocumentItem as poitem
inner join eket on eket.ebeln = poitem.PurchasingDocument and
eket.ebelp = poitem.PurchasingDocumentItem
left outer join ekes as ekesab on ekesab.ebeln = eket.ebeln and
ekesab.ebelp = eket.ebelp and
(ekesab.ebtyp = 'AB' or ekesab.ebtyp = 'LA')
{
eket.ebeln as ebeln,
eket.ebelp as ebelp,
eket.menge as menge,
eket.eindt as eindt,
poitem.Plant as werks,
poitem.StorageLocation as lgort,
poitem.SupplierConfirmationControlKey as bstae,
poitem.PurchasingDocumentDeletionCode as loekz,
poitem.IsCompletelyDelivered as elikz,
poitem.IsReturnsItem as retpo,
poitem.PurchasingDocumentItemCategory as pstyp,
poitem.OrderQuantityUnit as meins,
poitem.Material as matnr ,
poitem.PurchasingDocumentItemText as txz01,
poitem.GoodsReceiptIsExpected as wepos
}
where
ekesab.ebelp is null and
ekesab.ebeln is null and
(
poitem.SupplierConfirmationControlKey = '0001' or
poitem.SupplierConfirmationControlKey = '0004' or
poitem.SupplierConfirmationControlKey = '0005'
) and
poitem.GoodsReceiptIsExpected = 'X' //wepos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 |