SAP ABAP - CDS View Sales Order Characteristic
@AbapCatalog.sqlViewName: 'ZVIBINCHAR'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@ClientHandling.type: #CLIENT_DEPENDENT
@EndUserText.label: 'Sales Order Characteristic From IBIN'
define view ZCDS_IBINVAL as select from ibin
left outer join vbap on ibin.instance = vbap.cuobj
left outer join ibinvalues on ibin.in_recno = ibinvalues.in_recno and ibin.mandt = ibinvalues.mandt
left outer join ibsymbol on ibinvalues.symbol_id = ibsymbol.symbol_id and ibsymbol.mandt = ibinvalues.mandt
left outer join cabn on ibsymbol.atinn = cabn.atinn and cabn.mandt = ibsymbol.mandt
left outer join cawn on cawn.atinn = ibsymbol.atinn and cawn.atwrt = ibsymbol.atwrt
left outer join cawnt on cawn.atinn = cawnt.atinn and cawn.atzhl = cawnt.atzhl
left outer join cabnt on cabn.atinn = cabnt.atinn and cabnt.spras = $session.system_language
{
// ibsymbol~*, ibin~instance, ibinvalues~in_recno, cabn~atnam
ibsymbol.mandt,
ibsymbol.symbol_id,
vbap.vbeln,
vbap.posnr,
ibsymbol.atinn,
ibsymbol.atwrt,
ibsymbol.atflv,
ibsymbol.atflb,
ibsymbol.atcod,
ibin.instance,
ibinvalues.in_recno,
cabn.atfor,
cabn.atnam,
cabnt.atbez,
cawn.atzhl,
//cawnt.atwtb,
case
when cabn.atfor = 'CHAR' and cabn.atnam = 'FG_MASTER_CARD' then
cawnt.atwtb
else ibsymbol.atwrt end as atwtb
} where ibin.mandt = $session.client;
Comments
Post a Comment