fgl_lib_c
LIB Base View
fgl_lib_c is a CDS View that provides data about "LIB Base View" in SAP S/4HANA. It reads from 4 data sources (bkpf, bkpf, bseg, bseg_add) and exposes 40 fields with key fields bukrs, gjahr, belnr, buzei.
Data Sources (4)
Parameters (3)
| Name | Type | Default |
|---|---|---|
| p_langu | spras | |
| p_refdate | sydatum | |
| p_ale | abap.char( 1 ) |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| AccessControl.personalData.blocking | #NOT_REQUIRED | view | |
| EndUserText.label | LIB Base View | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #XXL | view | |
| ObjectModel.usageType.dataClass | #MIXED | view |
Fields (40)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | bukrs | |||
| KEY | gjahr | |||
| KEY | belnr | |||
| KEY | buzei | |||
| counter | ||||
| quanunit | ||||
| currkey_00 | ||||
| currkey_0d | ||||
| currkey_10 | ||||
| shkzgwhenHthen1else1endasnebtrasnebtr | ||||
| shkzgwhenHthen1else1endasskntoassknto | ||||
| shkzgwhenHthen1else1endasskfbtasskfbt | ||||
| pycur | ||||
| fiscper | ||||
| kktpl | ||||
| land1 | ||||
| periv | ||||
| fikrs | ||||
| ktopl | ||||
| ktop2 | ||||
| koart | ||||
| lifnr | ||||
| kunnr | ||||
| hkont | ||||
| gkont | ||||
| gkart | ||||
| rp_ktext | ||||
| rp_ltext | ||||
| sp_ktext | ||||
| sp_ltext | ||||
| rf_fkbtx | ||||
| sf_fkbtx | ||||
| cc_ktext | ||||
| cc_ltext | ||||
| or_ktext | ||||
| mm_maktx | ||||
| ga_txt20 | ||||
| ga_txt50 | ||||
| sk_txt20 | ||||
| sk_txt50 |
Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.
-- Derived SQL interpretation of CDS view fgl_lib_c.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- Parameters: p_langu : spras, p_refdate : sydatum, p_ale : abap.char( 1 )
CREATE VIEW fgl_lib_c AS
SELECT
cast( bseg.bukrs as bukrs preserving type ) AS bukrs,
cast( bseg.gjahr as gjahr preserving type ) AS gjahr,
cast( bseg.belnr as belnr_d preserving type ) AS belnr,
cast( bseg.buzei as buzei preserving type ) AS buzei,
cast( 1 as sydbcnt) AS counter,
cast( bseg.meins as rounit preserving type ) AS quanunit,
cast( bseg.pswsl as fagl_currkey_00 preserving type ) AS currkey_00,
cast( bkpf.waers as fagl_currkey_0d preserving type ) AS currkey_0d,
cast( bkpf.hwaer as fagl_currkey_10 preserving type ) AS currkey_10,
cast ( cast ( bseg.nebtr as abap.dec(23,2) ) * case bseg.shkzg when 'H' then -1 else 1 end as nebtr ) as nebtr AS shkzgwhenHthen1else1endasnebtrasnebtr,
cast ( cast ( bseg.sknto as abap.dec(23,2) ) * case bseg.shkzg when 'H' then -1 else 1 end as sknto ) as sknto AS shkzgwhenHthen1else1endasskntoassknto,
cast ( cast ( bseg.skfbt as abap.dec(23,2) ) * case bseg.shkzg when 'H' then -1 else 1 end as skfbt ) as skfbt AS shkzgwhenHthen1else1endasskfbtasskfbt,
cast( bseg.pycur as pycur preserving type ) AS pycur,
cast( concat(bseg.gjahr,concat('0',bseg.h_monat)) as rsfiscper ) AS fiscper,
cast( t004.kktpl as kktpl preserving type ) AS kktpl,
cast( t001.land1 as land1 preserving type ) AS land1,
cast( t001.periv as periv preserving type ) AS periv,
cast( t001.fikrs as fikrs preserving type ) AS fikrs,
cast( t001.ktopl as ktopl preserving type ) AS ktopl,
cast( t001.ktop2 as ktop2 preserving type ) AS ktop2,
cast( bseg.koart as koart preserving type ) AS koart,
cast( bseg.lifnr as lifnr preserving type ) AS lifnr,
cast( bseg.kunnr as kunnr preserving type ) AS kunnr,
cast( bseg.hkont as hkont preserving type ) AS hkont,
cast( bseg.gkont as gkont preserving type ) AS gkont,
cast( bseg.gkart as gkart preserving type ) AS gkart,
cast( coalesce( rprctr.ktext, cast( '' as fagl_text_prctr_short ) ) as fagl_text_prctr_short preserving type ) AS rp_ktext,
cast( coalesce( rprctr.ltext, cast( '' as fagl_text_prctr_long ) ) as fagl_text_prctr_long preserving type ) AS rp_ltext,
cast( coalesce( sprctr.ktext, cast( '' as fagl_text_pprctr_short ) ) as fagl_text_pprctr_short preserving type ) AS sp_ktext,
cast( coalesce( sprctr.ltext, cast( '' as fagl_text_pprctr_long ) ) as fagl_text_pprctr_long preserving type ) AS sp_ltext,
cast( coalesce( rfkbt.fkbtx, cast( '' as fagl_text_farea ) ) as fagl_text_farea preserving type ) AS rf_fkbtx,
cast( coalesce( sfkbt.fkbtx, cast( '' as fagl_text_pfarea ) ) as fagl_text_pfarea preserving type ) AS sf_fkbtx,
cast( coalesce( rkostl.ktext, cast( '' as fagl_text_ccntr_short ) ) as fagl_text_ccntr_short preserving type ) AS cc_ktext,
cast( coalesce( rkostl.ltext, cast( '' as fagl_text_ccntr_long ) ) as fagl_text_ccntr_long preserving type ) AS cc_ltext,
cast( coalesce( aufk.ktext, cast( '' as fagl_text_order_short ) ) as fagl_text_order_short preserving type ) AS or_ktext,
cast( coalesce( rmatnr.maktx, cast( '' as fagl_text_material ) ) as fagl_text_material preserving type ) AS mm_maktx,
cast( coalesce( hkont.txt20, cast( '' as fagl_text_gl_account_short ) ) as fagl_text_gl_account_short preserving type ) AS ga_txt20,
cast( coalesce( hkont.txt50, cast( '' as fagl_text_gl_account_long ) ) as fagl_text_gl_account_long preserving type ) AS ga_txt50,
cast( coalesce( saknr.txt20, cast( '' as fagl_text_saknr_short ) ) as fagl_text_saknr_short preserving type ) AS sk_txt20,
cast( coalesce( saknr.txt50, cast( '' as fagl_text_saknr_long ) ) as fagl_text_saknr_long preserving type ) AS sk_txt50
FROM bseg
INNER JOIN bkpf ON /* join condition not captured in parsed metadata */
-- UNION ALL with additional select branch(es): bseg_add
;
Learn More
- CDS View Annotations — A Complete Guide
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA
- BSEG to ACDOCA: The Universal Journal Migration
- Business Partner Migration: KNA1/LFA1 to BUT000
- Material Document Migration: MSEG/MKPF to MATDOC
- How to Find the Right CDS View for an SAP Table
- BW Extractor to CDS View Migration Guide
- S/4HANA CDS View Deprecation: What You Need to Know
- ABAP CDS View Tutorial — From Basics to Real-World Examples
- RAP and CDS Views — Building Transactional Apps in SAP S/4HANA
- Sales Document Status Migration: VBUP/VBUK Removal in S/4HANA
- CO Tables in S/4HANA: COEP, COBK, COSS, COSP to ACDOCA