Symptom
Extraction of G/L from S/4 HANA Cloud Public to SAP Datasphere, using a view. The information relates to invoiced records with the AccountingDocumentType: 'RV'. The work item identifier is missing from these data.
Cause
Billing documents and newly created FI documents do not contain information about work item specifics.
Resolution
The following link from openSAP Microlearning, shows how to add and join multiple released CDS views into a custom view and to add filter- click hereUsing the following CDS views the information may be retrieved:
- I_PrjBlgElmEntrJrnlEntrLink (Journal Entry for Billing Element): with this the projects which belong to the I_GLAccountLineItemRawData having Work item can be retrieved.
- I_ProjectBillingElementEntrFlw (Entry Flow for Project Billing Element): contains mapping between projects and project billing document requests. ProjBillgElmntEntrItmUUID field of I_PrjBlgElmEntrJrnlEntrLink can be used for the association.
- I_BillingDocumentItem (Billing Document Item): using ReferenceSDDocument and ReferenceSDDocumentItem fields the billing documents to the project billing items can be found.
https://api.sap.com/cdsviews/I_PRJBLGELMENTRJRNLENTRLINK This CDS view provides the link between the project billing element entry and the journal entry postings for work breakdown structure elements.
Following is an example query to retrieve all billing GL account line items for a work package / work item, which can be adjusted as per one’s needs:
select distinct f~workpackage, f~workitem, pb~billingdocument as PBDR, bi~billingdocument, bf~accountingdocument from I_GLAccountLineItemRawData as f
inner join I_PrjBlgElmEntrJrnlEntrLink as p on p~ledger = f~sourceledger and p~companycode = f~companycode
and p~accountingdocument = f~accountingdocument and p~fiscalyear = f~fiscalyear and p~LedgerGLLineItem = f~LedgerGLLineItem
inner join I_ProjectBillingElementEntrFlw as pb on pb~ProjBillgElmntEntrItmUUID = p~ProjBillgElmntEntrItmUUID
inner join I_BillingDocumentItem as bi on bi~referencesddocument = pb~billingdocument and bi~referencesddocumentitem = pb~BillingDocumentItem
inner join I_GLAccountLineItemRawData as bf on bf~ReferenceDocument = bi~billingdocument and bf~accountingdocumenttype = 'RV'
where f~workitem <> '' and bi~referencesddocument <> '' order by f~workpackage, f~workitem
See Also
openSAP Microlearning - Creating Custom CDS Views as External APIs - SAP S/4HANA Cloud Extensibility - openSAP Microlearning
Keywords
CDS views; work item; GL Data , KBA , PS-BIL , Project Billing , XX-SER-MCC , Mission Control Center - Knowledge Management , How To