Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sush
Contributor III
Contributor III

SAP Connector to Incremental read COEP Table with combination of multiple columns as primary key

Hi All,

I am trying to read SAP table - COEP into qvd file using Qliksense and SAP Connector.

My requirement is to identify the below items

1. Insert new records from SAP to qvd file

2. Update modified records from SAP to qvd file

3. Delete records from qvd which are not present in SAP

The key columns for COEP Table when I look at it are combination of the below columns

  • MANDT(Client)
  • KOKRS(Controlling Area)
  • BELNR (Document Number)
  • BUZEI (Posting Row)

Could you please let me know how would I proceed with this?

 

Also do we have any standard template to read SAP Standard tables and have it updated in the qvd whenever the data gets changed from SAP Side?

Labels (1)
1 Reply
EdgarMM
Contributor III
Contributor III

Hi

     To perfom the incremental on COEP you can use COBK as the base of your script since from here you will be able to get new data using field CPUDT, your "keygroup" will be these fields: KOKRS GJAHR BELNR; if you want to filter by company code you should included into your script:

 

[COEPINCR]:
Load
*;
SQL SUBSELECT KOKRS GJAHR BELNR MANDT BUKRS FKBER MATNR WERKS MEINH EBELN EBELP BUZEI GSBER OBJNR QMNUM PAOBJNR PERNR PARGB SGTXT VBUND ZEKKN DABRZ HRKFT GEBER SCOPE OWAER VERSN KSTAR SEGMENT ERLKZ GRANT_NBR BUDGET_PD WRTTP BELTP PERIO TWAER LEDNR REFBZ VRGNG TIMESTMP PSEGMENT PRODPER GKOAR GKONT USPOB WTGBTR WKGBTR WKFBTR WOGBTR PAGBTR PAFBTR MEGBTR MEFBTR PAROB PGEBER PGRANT_NBR PBUDGET_PD PFKBER MBGBTR MBFBTR PAROB1 BEKNZ MEINB MVFLG ZLENR BW_REFBZ RBEST BTRKL OBJNR_N1 OBJNR_N2 OBJNR_N3 LOGSYSO PKSTAR PBUKRS PSCOPE LOGSYSP BWSTRAT OBJNR_HK REFBZ_FI
from COEP
WHERE KOKRS GJAHR BELNR IN
(
SELECT KOKRS GJAHR BELNR FROM COBK WHERE
(
(CPUDT > '$(vTodaysDate)')
));
STORE * FROM [COEPINCR] INTO [..\QVD\COEPINCR.QVD];
DROP TABLE [COEPINCR];

 

If you are going to create a dashboard related to expenses do not forget to extract as well table COEJ which stores the "Plan" or Budget information versions.

 

Hope this helps.

 

Regards,

Edgar M.