fgl_lib_n_gl

DDL: FGL_LIB_N_GL Type: view_entity

FGLV_LIB_N_GL: GL Line Item Browser

fgl_lib_n_gl is a CDS View that provides data about "FGLV_LIB_N_GL: GL Line Item Browser" in SAP S/4HANA. It reads from 2 data sources (acdoca, finsc_ld_cmp) and exposes 33 fields with key fields rldnr, bukrs, gjahr, belnr, docln.

Data Sources (2)

SourceAliasJoin Type
acdoca acdoca from
finsc_ld_cmp finsc_ld_cmp inner

Parameters (3)

NameTypeDefault
p_langu spras
p_refdate sydatum
p_ale abap.char( 1 )

Annotations (7)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
AccessControl.personalData.blocking #NOT_REQUIRED view
EndUserText.label FGLV_LIB_N_GL: GL Line Item Browser view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view

Fields (33)

KeyFieldSource TableSource FieldDescription
KEY rldnr
KEY bukrs
KEY gjahr
KEY belnr
KEY docln
counter
quanunit
quantity acdoca msl
currkey_00
currval_00
currkey_0d
currval_0d
drcrkwhenHthen1else1endasnebtrasnebtr
drcrkwhenHthen1else1endasskntoassknto
drcrkwhenHthen1else1endasskfbtasskfbt
docnr
pkostl
kktpl
land1
rp_ktext rprctr ktext
rp_ltext rprctr ltext
sp_ktext sprctr ktext
sp_ltext sprctr ltext
rf_fkbtx rfkbt fkbtx
sf_fkbtx sfkbt fkbtx
cc_ktext rkostl ktext
cc_ltext rkostl ltext
or_ktext aufk ktext
mm_maktx rmatnr maktx
ga_txt20 hkont txt20
ga_txt50 hkont txt50
sk_txt20 saknr txt20
sk_txt50 saknr txt50
@AbapCatalog.viewEnhancementCategory: [#PROJECTION_LIST]

@AccessControl.authorizationCheck:#NOT_REQUIRED
@AccessControl.personalData.blocking:#NOT_REQUIRED

@EndUserText.label: 'FGLV_LIB_N_GL: GL Line Item Browser'

@Metadata.ignorePropagatedAnnotations: true

@ObjectModel.usageType:
  {
    serviceQuality: #D,
    sizeCategory: #XXL,
    dataClass: #MIXED
  }
define view entity fgl_lib_n_gl
  with parameters
    @Environment.systemField: #SYSTEM_LANGUAGE
    @EndUserText.label: 'Language'
    p_langu   : spras,
    @Environment.systemField: #SYSTEM_DATE
    @EndUserText.label: 'Reference Date'
    p_refdate : sydatum,
    @EndUserText.label: 'ALE-extern as Open Items'
    p_ale     : abap.char( 1 )

  as select from           acdoca

    left outer to one join bseg                                                         on  acdoca.rbukrs = bseg.bukrs
                                                                                        and acdoca.belnr  = bseg.belnr
                                                                                        and acdoca.gjahr  = bseg.gjahr
                                                                                        and acdoca.buzei  = bseg.buzei

    left outer to one join bseg_add                                                     on  acdoca.rbukrs = bseg_add.bukrs
                                                                                        and acdoca.belnr  = bseg_add.belnr
                                                                                        and acdoca.gjahr  = bseg_add.gjahr
                                                                                        and acdoca.docln  = bseg_add.buzei

    left outer to one join bkpf                                                         on  acdoca.rbukrs = bkpf.bukrs
                                                                                        and acdoca.belnr  = bkpf.belnr
                                                                                        and acdoca.gjahr  = bkpf.gjahr
  // customizing

    inner join             finsc_ld_cmp                                                 on  acdoca.rbukrs = finsc_ld_cmp.bukrs
                                                                                        and acdoca.rldnr  = finsc_ld_cmp.rldnr

    left outer to one join t001                                                         on acdoca.rbukrs = t001.bukrs

    left outer to one join t004                                                         on acdoca.ktopl = t004.ktopl

  // master data

    left outer to one join skb1                                                         on  acdoca.rbukrs = skb1.bukrs
                                                                                        and acdoca.racct  = skb1.saknr

    left outer to one join ska1                                                         on  acdoca.ktopl = ska1.ktopl
                                                                                        and acdoca.racct = ska1.saknr

    left outer to one join lfa1                                                         on acdoca.lifnr = lfa1.lifnr
    left outer to one join lfa1                                               as lfa1_offset                                          on  acdoca.gkont = lfa1.lifnr
                                                                                                                                      and acdoca.koart = 'K'


    left outer to one join kna1                                                         on acdoca.kunnr = kna1.kunnr
    left outer to one join kna1                                               as kna1_offset                                          on  acdoca.gkont = kna1.kunnr
                                                                                                                                      and acdoca.koart = 'D'

    left outer to one join fgl_lib_txt_prctr( p_langu : $parameters.p_langu ) as rprctr on  acdoca.kokrs =  rprctr.kokrs
                                                                                        and acdoca.prctr =  rprctr.prctr
                                                                                        and acdoca.budat >= rprctr.datab
                                                                                        and acdoca.budat <= rprctr.datbi

    left outer to one join fgl_lib_txt_prctr( p_langu : $parameters.p_langu ) as sprctr on  acdoca.kokrs  =  sprctr.kokrs
                                                                                        and acdoca.pprctr =  sprctr.prctr
                                                                                        and acdoca.budat  >= sprctr.datab
                                                                                        and acdoca.budat  <= sprctr.datbi

    left outer to one join fgl_lib_txt_fkber( p_langu : $parameters.p_langu ) as rfkbt  on acdoca.rfarea = rfkbt.fkber
    left outer to one join fgl_lib_txt_fkber( p_langu : $parameters.p_langu ) as sfkbt  on acdoca.sfarea = rfkbt.fkber

    left outer to one join fgl_lib_txt_kostl( p_langu : $parameters.p_langu ) as rkostl on  acdoca.kokrs =  rkostl.kokrs
                                                                                        and acdoca.rcntr =  rkostl.kostl
                                                                                        and acdoca.budat >= rkostl.datab
                                                                                        and acdoca.budat <= rkostl.datbi

    left outer to one join aufk                                                         on acdoca.aufnr = aufk.aufnr

    left outer to one join fgl_lib_txt_matnr( p_langu : $parameters.p_langu ) as rmatnr on acdoca.matnr = rmatnr.matnr

    left outer to one join fgl_lib_txt_skat( p_langu : $parameters.p_langu )  as hkont   on  acdoca.ktopl = hkont.ktopl
                                                                                         and acdoca.racct = hkont.saknr

    left outer to one join fgl_lib_txt_skat( p_langu : $parameters.p_langu )  as saknr   on  acdoca.ktopl = hkont.ktopl
                                                                                         and bseg.saknr   = hkont.saknr
{
      // KEY

  key cast( acdoca.rldnr as fins_ledger preserving type )                                          as rldnr, //<$fix>

  key cast( acdoca.rbukrs as bukrs preserving type )                                               as bukrs, //<$fix>

  key cast( acdoca.gjahr as gjahr preserving type )                                                as gjahr, //<$fix>

  key cast( acdoca.belnr as belnr_d preserving type )                                              as belnr, //<$fix>

  key cast( acdoca.docln as docln6 preserving type )                                               as docln, //<$fix>


      // DB COUNTER

      cast( 1 as sydbcnt)                                                                          as counter, //<$fix>


      // STANDARD CURRENCIES AND QUANTITIES


      cast( acdoca.runit as rounit preserving type )                                               as quanunit, //<$fix>

      @Semantics.quantity.unitOfMeasure: 'quanunit'
      acdoca.msl                                                                                   as quantity, //<$fix>


      cast( acdoca.rtcur as fagl_currkey_00 preserving type )                                      as currkey_00, //<$fix>

      @Semantics.amount.currencyCode: 'currkey_00'
      cast( acdoca.tsl as fagl_currval_00 preserving type )                                        as currval_00, //<$fix>


      cast( acdoca.rwcur as fagl_currkey_0d preserving type )                                      as currkey_0d, //<$fix>

      @Semantics.amount.currencyCode: 'currkey_0D'
      cast( acdoca.wsl as fagl_currval_0d preserving type )                                        as currval_0d, //<$fix>


      cast ( case '10'
        when  finsc_ld_cmp.curtph then acdoca.rhcur
        when  finsc_ld_cmp.curtpk then acdoca.rkcur
        when  finsc_ld_cmp.curtpo then acdoca.rocur
        when  finsc_ld_cmp.curtpv then acdoca.rvcur
        when  finsc_ld_cmp.curtpb then acdoca.rbcur
        when  finsc_ld_cmp.curtpc then acdoca.rccur
        when  finsc_ld_cmp.curtpd then acdoca.rdcur
        when  finsc_ld_cmp.curtpe then acdoca.recur
        when  finsc_ld_cmp.curtpf then acdoca.rfcur
        when  finsc_ld_cmp.curtpg then acdoca.rgcur
        else  ''
      end as fagl_currkey_10 )                                                                     as currkey_10, //<$fix>


      @Semantics.amount.currencyCode: 'currkey_10'
      cast ( case '10'
      when  finsc_ld_cmp.curtph then cast( acdoca.hsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpk then cast( acdoca.ksl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpo then cast( acdoca.osl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpv then cast( acdoca.vsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpb then cast( acdoca.bsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpc then cast( acdoca.csl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpd then cast( acdoca.dsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpe then cast( acdoca.esl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpf then cast( acdoca.fsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpg then cast( acdoca.gsl as abap.dec(23,2))
      else cast ( 0 as abap.dec(23,2))
      end as fagl_currval_10 )                                                                     as currval_10, //<$fix>


      cast ( case '11'
      when  finsc_ld_cmp.curtph then acdoca.rhcur
      when  finsc_ld_cmp.curtpk then acdoca.rkcur
      when  finsc_ld_cmp.curtpo then acdoca.rocur
      when  finsc_ld_cmp.curtpv then acdoca.rvcur
      when  finsc_ld_cmp.curtpb then acdoca.rbcur
      when  finsc_ld_cmp.curtpc then acdoca.rccur
      when  finsc_ld_cmp.curtpd then acdoca.rdcur
      when  finsc_ld_cmp.curtpe then acdoca.recur
      when  finsc_ld_cmp.curtpf then acdoca.rfcur
      when  finsc_ld_cmp.curtpg then acdoca.rgcur
      else  ''
      end as fagl_currkey_11 )                                                                     as currkey_11, //<$fix>


      @Semantics.amount.currencyCode: 'currkey_11'
      cast ( case '11'
        when  finsc_ld_cmp.curtph then cast( acdoca.hsl as abap.dec(23,2))
        when  finsc_ld_cmp.curtpk then cast( acdoca.ksl as abap.dec(23,2))
        when  finsc_ld_cmp.curtpo then cast( acdoca.osl as abap.dec(23,2))
        when  finsc_ld_cmp.curtpv then cast( acdoca.vsl as abap.dec(23,2))
        when  finsc_ld_cmp.curtpb then cast( acdoca.bsl as abap.dec(23,2))
        when  finsc_ld_cmp.curtpc then cast( acdoca.csl as abap.dec(23,2))
        when  finsc_ld_cmp.curtpd then cast( acdoca.dsl as abap.dec(23,2))
        when  finsc_ld_cmp.curtpe then cast( acdoca.esl as abap.dec(23,2))
        when  finsc_ld_cmp.curtpf then cast( acdoca.fsl as abap.dec(23,2))
        when  finsc_ld_cmp.curtpg then cast( acdoca.gsl as abap.dec(23,2))
        else cast ( 0 as abap.dec(23,2))
      end as fagl_currval_11 )                                                                     as currval_11, //<$fix>


      cast ( case '12'
      when  finsc_ld_cmp.curtph then acdoca.rhcur
      when  finsc_ld_cmp.curtpk then acdoca.rkcur
      when  finsc_ld_cmp.curtpo then acdoca.rocur
      when  finsc_ld_cmp.curtpv then acdoca.rvcur
      when  finsc_ld_cmp.curtpb then acdoca.rbcur
      when  finsc_ld_cmp.curtpc then acdoca.rccur
      when  finsc_ld_cmp.curtpd then acdoca.rdcur
      when  finsc_ld_cmp.curtpe then acdoca.recur
      when  finsc_ld_cmp.curtpf then acdoca.rfcur
      when  finsc_ld_cmp.curtpg then acdoca.rgcur
      else  ''
      end as fagl_currkey_12 )                                                                     as currkey_12, //<$fix>


      @Semantics.amount.currencyCode: 'currkey_12'
      cast ( case '12'
      when  finsc_ld_cmp.curtph then cast( acdoca.hsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpk then cast( acdoca.ksl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpo then cast( acdoca.osl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpv then cast( acdoca.vsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpb then cast( acdoca.bsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpc then cast( acdoca.csl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpd then cast( acdoca.dsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpe then cast( acdoca.esl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpf then cast( acdoca.fsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpg then cast( acdoca.gsl as abap.dec(23,2))
      else cast ( 0 as abap.dec(23,2))
      end as fagl_currval_12 )                                                                     as currval_12, //<$fix>


      cast ( case '30'
      when  finsc_ld_cmp.curtph then acdoca.rhcur
      when  finsc_ld_cmp.curtpk then acdoca.rkcur
      when  finsc_ld_cmp.curtpo then acdoca.rocur
      when  finsc_ld_cmp.curtpv then acdoca.rvcur
      when  finsc_ld_cmp.curtpb then acdoca.rbcur
      when  finsc_ld_cmp.curtpc then acdoca.rccur
      when  finsc_ld_cmp.curtpd then acdoca.rdcur
      when  finsc_ld_cmp.curtpe then acdoca.recur
      when  finsc_ld_cmp.curtpf then acdoca.rfcur
      when  finsc_ld_cmp.curtpg then acdoca.rgcur
      else  ''
      end as fagl_currkey_30 )                                                                     as currkey_30, //<$fix>


      @Semantics.amount.currencyCode: 'currkey_30'
      cast ( case '30'
      when  finsc_ld_cmp.curtph then cast( acdoca.hsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpk then cast( acdoca.ksl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpo then cast( acdoca.osl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpv then cast( acdoca.vsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpb then cast( acdoca.bsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpc then cast( acdoca.csl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpd then cast( acdoca.dsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpe then cast( acdoca.esl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpf then cast( acdoca.fsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpg then cast( acdoca.gsl as abap.dec(23,2))
      else cast ( 0 as abap.dec(23,2))
      end as fagl_currval_30 )                                                                     as currval_30, //<$fix>


      cast ( case '31'
      when  finsc_ld_cmp.curtph then acdoca.rhcur
      when  finsc_ld_cmp.curtpk then acdoca.rkcur
      when  finsc_ld_cmp.curtpo then acdoca.rocur
      when  finsc_ld_cmp.curtpv then acdoca.rvcur
      when  finsc_ld_cmp.curtpb then acdoca.rbcur
      when  finsc_ld_cmp.curtpc then acdoca.rccur
      when  finsc_ld_cmp.curtpd then acdoca.rdcur
      when  finsc_ld_cmp.curtpe then acdoca.recur
      when  finsc_ld_cmp.curtpf then acdoca.rfcur
      when  finsc_ld_cmp.curtpg then acdoca.rgcur
      else  ''
      end as fagl_currkey_31 )                                                                     as currkey_31, //<$fix>


      @Semantics.amount.currencyCode: 'currkey_31'
      cast ( case '31'
      when  finsc_ld_cmp.curtph then cast( acdoca.hsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpk then cast( acdoca.ksl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpo then cast( acdoca.osl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpv then cast( acdoca.vsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpb then cast( acdoca.bsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpc then cast( acdoca.csl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpd then cast( acdoca.dsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpe then cast( acdoca.esl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpf then cast( acdoca.fsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpg then cast( acdoca.gsl as abap.dec(23,2))
      else cast ( 0 as abap.dec(23,2))
      end as fagl_currval_31 )                                                                     as currval_31, //<$fix>


      cast ( case '32'
      when  finsc_ld_cmp.curtph then acdoca.rhcur
      when  finsc_ld_cmp.curtpk then acdoca.rkcur
      when  finsc_ld_cmp.curtpo then acdoca.rocur
      when  finsc_ld_cmp.curtpv then acdoca.rvcur
      when  finsc_ld_cmp.curtpb then acdoca.rbcur
      when  finsc_ld_cmp.curtpc then acdoca.rccur
      when  finsc_ld_cmp.curtpd then acdoca.rdcur
      when  finsc_ld_cmp.curtpe then acdoca.recur
      when  finsc_ld_cmp.curtpf then acdoca.rfcur
      when  finsc_ld_cmp.curtpg then acdoca.rgcur
      else  ''
      end as fagl_currkey_32 )                                                                     as currkey_32, //<$fix>


      @Semantics.amount.currencyCode: 'currkey_32'
      cast ( case '32'
      when  finsc_ld_cmp.curtph then cast( acdoca.hsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpk then cast( acdoca.ksl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpo then cast( acdoca.osl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpv then cast( acdoca.vsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpb then cast( acdoca.bsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpc then cast( acdoca.csl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpd then cast( acdoca.dsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpe then cast( acdoca.esl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpf then cast( acdoca.fsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpg then cast( acdoca.gsl as abap.dec(23,2))
      else cast ( 0 as abap.dec(23,2))
      end as fagl_currval_32 )                                                                     as currval_32, //<$fix>


      cast ( case '40'
      when  finsc_ld_cmp.curtph then acdoca.rhcur
      when  finsc_ld_cmp.curtpk then acdoca.rkcur
      when  finsc_ld_cmp.curtpo then acdoca.rocur
      when  finsc_ld_cmp.curtpv then acdoca.rvcur
      when  finsc_ld_cmp.curtpb then acdoca.rbcur
      when  finsc_ld_cmp.curtpc then acdoca.rccur
      when  finsc_ld_cmp.curtpd then acdoca.rdcur
      when  finsc_ld_cmp.curtpe then acdoca.recur
      when  finsc_ld_cmp.curtpf then acdoca.rfcur
      when  finsc_ld_cmp.curtpg then acdoca.rgcur
      else  ''
      end as fagl_currkey_40 )                                                                     as currkey_40, //<$fix>


      @Semantics.amount.currencyCode: 'currkey_40'
      cast ( case '40'
      when  finsc_ld_cmp.curtph then cast( acdoca.hsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpk then cast( acdoca.ksl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpo then cast( acdoca.osl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpv then cast( acdoca.vsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpb then cast( acdoca.bsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpc then cast( acdoca.csl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpd then cast( acdoca.dsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpe then cast( acdoca.esl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpf then cast( acdoca.fsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpg then cast( acdoca.gsl as abap.dec(23,2))
      else cast ( 0 as abap.dec(23,2))
      end as fagl_currval_40 )                                                                     as currval_40, //<$fix>


      cast ( case '50'
      when  finsc_ld_cmp.curtph then acdoca.rhcur
      when  finsc_ld_cmp.curtpk then acdoca.rkcur
      when  finsc_ld_cmp.curtpo then acdoca.rocur
      when  finsc_ld_cmp.curtpv then acdoca.rvcur
      when  finsc_ld_cmp.curtpb then acdoca.rbcur
      when  finsc_ld_cmp.curtpc then acdoca.rccur
      when  finsc_ld_cmp.curtpd then acdoca.rdcur
      when  finsc_ld_cmp.curtpe then acdoca.recur
      when  finsc_ld_cmp.curtpf then acdoca.rfcur
      when  finsc_ld_cmp.curtpg then acdoca.rgcur
      else  ''
      end as fagl_currkey_50 )                                                                     as currkey_50, //<$fix>


      @Semantics.amount.currencyCode: 'currkey_50'
      cast ( case '50'
      when  finsc_ld_cmp.curtph then cast( acdoca.hsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpk then cast( acdoca.ksl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpo then cast( acdoca.osl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpv then cast( acdoca.vsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpb then cast( acdoca.bsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpc then cast( acdoca.csl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpd then cast( acdoca.dsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpe then cast( acdoca.esl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpf then cast( acdoca.fsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpg then cast( acdoca.gsl as abap.dec(23,2))
      else cast ( 0 as abap.dec(23,2))
      end as fagl_currval_50 )                                                                     as currval_50, //<$fix>


      cast ( case '60'
      when  finsc_ld_cmp.curtph then acdoca.rhcur
      when  finsc_ld_cmp.curtpk then acdoca.rkcur
      when  finsc_ld_cmp.curtpo then acdoca.rocur
      when  finsc_ld_cmp.curtpv then acdoca.rvcur
      when  finsc_ld_cmp.curtpb then acdoca.rbcur
      when  finsc_ld_cmp.curtpc then acdoca.rccur
      when  finsc_ld_cmp.curtpd then acdoca.rdcur
      when  finsc_ld_cmp.curtpe then acdoca.recur
      when  finsc_ld_cmp.curtpf then acdoca.rfcur
      when  finsc_ld_cmp.curtpg then acdoca.rgcur
      else  ''
      end as fagl_currkey_60 )                                                                     as currkey_60, //<$fix>


      @Semantics.amount.currencyCode: 'currkey_60'
      cast ( case '60'
      when  finsc_ld_cmp.curtph then cast( acdoca.hsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpk then cast( acdoca.ksl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpo then cast( acdoca.osl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpv then cast( acdoca.vsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpb then cast( acdoca.bsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpc then cast( acdoca.csl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpd then cast( acdoca.dsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpe then cast( acdoca.esl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpf then cast( acdoca.fsl as abap.dec(23,2))
      when  finsc_ld_cmp.curtpg then cast( acdoca.gsl as abap.dec(23,2))
      else cast ( 0 as abap.dec(23,2))
      end as fagl_currval_60 )                                                                     as currval_60, //<$fix>


      // CALCULATED FIELDS

      cast ( case
        when acdoca.rebzt = '' and acdoca.rebzg = ''
          then acdoca.belnr
        else acdoca.rebzg
      end as rebzg preserving type )                                                               as rebzg, //<$fix>


      // set open/cleared item flag

      //  include ALE-extern open config

      cast(
        case
          when acdoca.augdt = '00000000' or acdoca.augdt > $parameters.p_refdate
           then ''
          when acdoca.augbl = 'ALE-extern'
           then case $parameters.p_ale when 'X' then '' else 'X' end
          else 'X'
        end as fagl_x_cleared_item preserving type )                                               as x_cleared_item, //<$fix>


      @Semantics.amount.currencyCode: 'currkey_00'
      cast ( cast ( bseg.nebtr as abap.dec(23,2) ) * case acdoca.drcrk when 'H' then -1 else 1 end
      as nebtr )                                                                                   as nebtr, //<$fix>


      @Semantics.amount.currencyCode: 'currkey_10'
      cast ( cast ( bseg.sknto as abap.dec(23,2) ) * case acdoca.drcrk when 'H' then -1 else 1 end
      as sknto )                                                                                   as sknto, //<$fix>


      @Semantics.amount.currencyCode: 'currkey_00'
      cast ( cast ( bseg.skfbt as abap.dec(23,2) ) * case acdoca.drcrk when 'H' then -1 else 1 end
      as skfbt )                                                                                   as skfbt, //<$fix>


      cast( '0000000000' as belnr_d )                                                              as docnr, //<$fix>

      cast( '0000000000' as skost )                                                                as pkostl, //<$fix>


      //replacing fagl_org_info

      cast( t004.kktpl as kktpl preserving type )                                                  as kktpl, //<$fix>

      cast( t001.land1 as land1 preserving type )                                                  as land1, //<$fix>


      // not available in V_GLPOS_N_GL_CT, are these needed in final GL view???

      //  cast( '' as bilabtyp preserving type )      as fstype, //<$fix>

      //  cast( '                  ' as fagl_glaccext preserving type ) as glaccext, //<$fix>

      //  @Semantics.amount.currencyCode: 'currkey_00'

      //  cast ( 0 as fagl_balance_val )                               as balance, //<$fix>

      //  @Semantics.amount.currencyCode: 'currkey_00'

      //  cast ( 0 as fagl_val_stock )                                 as val_stock, //<$fix>

      //  @Semantics.amount.currencyCode: 'currkey_00'

      //  cast ( 0 as fagl_val_flow )                                  as val_flow, //<$fix>


      // GENERATION ANCHOR FOR ALL REMAINING FIELDS

      // in ACDOCA, BSEG, BKPF, SKA1, SKB1, KNA1, LFA1

      //context dummy

      //context dummy

      //context dummy

      //context dummy

      //context dummy

      //context dummy

      //context dummy

      //context dummy

      //<$VF>

//<$FIELDS>

//<$VF>


      // additional texts

      rprctr.ktext                                                                                 as rp_ktext, //<$fix>

      rprctr.ltext                                                                                 as rp_ltext, //<$fix>

      sprctr.ktext                                                                                 as sp_ktext, //<$fix>

      sprctr.ltext                                                                                 as sp_ltext, //<$fix>

      rfkbt.fkbtx                                                                                  as rf_fkbtx, //<$fix>

      sfkbt.fkbtx                                                                                  as sf_fkbtx, //<$fix>

      rkostl.ktext                                                                                 as cc_ktext, //<$fix>

      rkostl.ltext                                                                                 as cc_ltext, //<$fix>

      aufk.ktext                                                                                   as or_ktext, //<$fix>

      rmatnr.maktx                                                                                 as mm_maktx, //<$fix>

      hkont.txt20                                                                                  as ga_txt20, //<$fix>

      hkont.txt50                                                                                  as ga_txt50, //<$fix>

      saknr.txt20                                                                                  as sk_txt20, //<$fix>

      saknr.txt50                                                                                  as sk_txt50 //<$fix>


}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"FGL_LIB_TXT_FKBER",
"FGL_LIB_TXT_KOSTL",
"FGL_LIB_TXT_MATNR",
"FGL_LIB_TXT_PRCTR",
"FGL_LIB_TXT_SKAT",
"ACDOCA",
"AUFK",
"BKPF",
"BSEG",
"BSEG_ADD",
"FINSC_LD_CMP",
"KNA1",
"LFA1",
"SKA1",
"SKB1",
"T001",
"T004"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/