P_GMAVCDataUser

DDL: P_GMAVCDATAUSER SQL: PGMAVCDATAUSER Type: view BASIC

P_GMAVCDataUser is a Basic CDS View in SAP S/4HANA. It reads from 5 data sources (P_GMAVCT_Compat, t001, gmgr, fpb_persparm, fpb_persparm) and exposes 15 fields with key fields rbukrs, rrcty, rldnr, ryear, grantee_fy_9.

Data Sources (5)

SourceAliasJoin Type
P_GMAVCT_Compat AVC from
t001 CC inner
gmgr MD inner
fpb_persparm p1 left_outer
fpb_persparm p2 left_outer

Parameters (3)

NameTypeDefault
P_uname syuname
P_CompanyCodeCurrency vdm_v_company_code_currency
P_AvailabilityControlLedger buavc_aldnr

Annotations (9)

NameValueLevelField
AbapCatalog.sqlViewName PGMAVCDATAUSER view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #P view
ObjectModel.usageType.sizeCategory #L view
AbapCatalog.compiler.compareFilter true view
VDM.viewType #BASIC view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view

Fields (15)

KeyFieldSource TableSource FieldDescription
KEY rbukrs rbukrs
KEY rrcty rrcty
KEY rldnr rldnr
KEY ryear ryear
KEY grantee_fy_9 grantee_fy_9
KEY ceffyear_9 ceffyear_9
KEY rgrant_nbr rgrant_nbr
KEY rfund rfund
KEY alloctype_9 alloctype_9
KEY wfstate_9 wfstate_9
KEY rtcur rtcur
curr242endasHSLAmount1
curr242endasHSLAmount0
curr242endasTSLAmount1
curr242endasTSLAmount0
@AbapCatalog.sqlViewName: 'PGMAVCDATAUSER'
//@ClientDependent: true

@ClientHandling.algorithm: #SESSION_VARIABLE //Inserted by VDM CDS Suite Plugin

@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality:  #P
@ObjectModel.usageType.sizeCategory: #L //Inserted by VDM CDS Suite Plugin

@AbapCatalog.compiler.compareFilter: true
@VDM.viewType: #BASIC
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private:true
//@EndUserText.label: 'Personalized GM AVC data'

define view P_GMAVCDataUser
  with parameters
    @Environment.systemField : #USER
    P_uname: syuname,
    P_CompanyCodeCurrency: vdm_v_company_code_currency,
    @Consumption.defaultValue: '9K'
    P_AvailabilityControlLedger: buavc_aldnr
  
  as select from P_GMAVCT_Compat as AVC 
    inner join t001 as CC on CC.waers = :P_CompanyCodeCurrency
  
    inner join gmgr as MD on  MD.grant_nbr    = AVC.rgrant_nbr
                          and MD.company_code = CC.bukrs
                     
// Personalization (FPB application), for Grant Type and Sponsor selection:                          

    left outer join   fpb_persparm    as p1  on  p1.perskeytp       = 'U'
                                             and p1.perskey         = :P_uname
                                             and p1.applid          = 'GM-MY_GRANTS'
                                             and p1.fieldname       = 'GRANT_TYPE'
                                             and p1.pers_subcontext = ''
                                             and p1.noauth          = ' '
                                             and p1.sel_sign        = 'I'
                                             and p1.fieldtype       = 'V'
                                             and p1.sel_option      = 'EQ'

    left outer join   fpb_persparm    as p2  on  p2.perskeytp       = 'U'
                                             and p2.perskey         = :P_uname
                                             and p2.applid          = 'GM-MY_GRANTS'
                                             and p2.fieldname       = 'SPONSOR'
                                             and p2.pers_subcontext = ''
                                             and p2.noauth          = ' '
                                             and p2.sel_sign        = 'I'
                                             and p2.fieldtype       = 'V'
                                             and p2.sel_option      = 'EQ'

// ToDo: Personalization via responsibility in Grant Master...


{
  key rbukrs,
  key rrcty,
  key rldnr,
  key ryear,        //Sponsor fiscal year

  key grantee_fy_9, //Company Code fiscal year

  key ceffyear_9,   //not used

  key rgrant_nbr,
  key rfund,
  key rsponsored_prog,
  key rsponsored_class,
  key rbdgt_vldty_nbr,
  key alloctype_9,
  key wfstate_9,
  key rtcur, //Grant currency (for TSL fields); HSL fields use Company Code currency


      case rrcty when '0'
           then cast(0 as abap.curr(24,2))
           else cast((hsl01 + hsl02 +
                      hsl03 + hsl04 +
                      hsl05 + hsl06 +
                      hsl07 + hsl08 +
                      hsl09 + hsl10 +
                      hsl11 + hsl12 +
                      hsl13 + hsl14 +
                      hsl15 + hsl16) as abap.curr(24,2))
           end  as HSLAmount1,

      case rrcty when '0'
           then cast((hsl01 + hsl02 +
                      hsl03 + hsl04 +
                      hsl05 + hsl06 +
                      hsl07 + hsl08 +
                      hsl09 + hsl10 +
                      hsl11 + hsl12 +
                      hsl13 + hsl14 +
                      hsl15 + hsl16) as abap.curr(24,2))
           else cast(0 as abap.curr(24,2))
           end  as HSLAmount0,

      case rrcty when '0'
           then cast(0 as abap.curr(24,2))
           else cast((tsl01 + tsl02 +
                      tsl03 + tsl04 +
                      tsl05 + tsl06 +
                      tsl07 + tsl08 +
                      tsl09 + tsl10 +
                      tsl11 + tsl12 +
                      tsl13 + tsl14 +
                      tsl15 + tsl16) as abap.curr(24,2))
           end  as TSLAmount1,

      case rrcty when '0'
           then cast((tsl01 + tsl02 +
                      tsl03 + tsl04 +
                      tsl05 + tsl06 +
                      tsl07 + tsl08 +
                      tsl09 + tsl10 +
                      tsl11 + tsl12 +
                      tsl13 + tsl14 +
                      tsl15 + tsl16) as abap.curr(24,2))
           else cast(0 as abap.curr(24,2))
           end  as TSLAmount0

}

where rldnr  = :P_AvailabilityControlLedger 
  and rbukrs = CC.bukrs
  and
      (
      AVC.wfstate_9 = 'P' or
      AVC.wfstate_9 = 'R'
      )
  and (
      p1.low        is null or
      p1.low        = '*' or
      MD.grant_type = p1.low
      )
  and (
      p2.low     is null or 
      p2.low     = '*' or
      MD.partner = p2.low
      )
  
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"P_GMAVCT_COMPAT",
"FPB_PERSPARM",
"GMGR",
"T001"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/