Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to load incremental data from BSEG and BKPF table

Hi,

I would like to load incremental from the BSEG table. BSEG is a cluster table and there is no date field for incremental load. In BKPF table I'm using CPUDT field for incremental load. I get a error when I use the script below (see attachment).  Can somebody help me to solve this issue?

[BKPF]:   // Accounting Document Header

Load *;

SQL Select BUKRS MANDT GJAHR BELNR BUDAT WAERS MONAT BLART BLDAT CPUDT from BKPF

where CPUDT >= '$(vDateBKPF)';

 

CONCATENATE

LOAD * FROM [..\..\DATA\RAW\BKPF.QVD](qvd)

where CPUDT < '$(vDateBKPF_ALL)';

store BKPF into ..\..\DATA\RAW\BKPF.qvd (qvd);

//For BSEG load:

[BSEG]: // Accounting Document Segment

Load *;

Select MANDT KOKRS KOSTL BUKRS GJAHR BELNR BUZEI DMBTR UMSKS UMSKZ KOART AUGDT AUGBL ZUONR WRBTR MWSTS WMWST LIFNR KUNNR HKONT GSBER SAKNR SGTXT PRCTR SHKZG from BSEG

 

WHERE BELNR = ( SELECT BELNR FROM BKPF WHERE CPUDT >= '$(vDateBKPF)' );

 

CONCATENATE

LOAD * FROM [..\..\DATA\RAW\BSEG_ALL.QVD] (qvd);

 

store BSEG into ..\..\DATA\RAW\BSEG_ALL.qvd (qvd);

DROP TABLE [BKPF];

2 Replies
er_mohit
Master II
Master II

HIIII

BKPF:   // Accounting Document Header

Load *;

SQL Select BUKRS MANDT GJAHR BELNR BUDAT WAERS MONAT BLART BLDAT CPUDT from BKPF

where CPUDT >= '$(vDateBKPF)';

JOIN(BKPF)

LOAD * FROM [..\..\DATA\RAW\BKPF.QVD](qvd)

where CPUDT < '$(vDateBKPF_ALL)';

store BKPF into ..\..\DATA\RAW\BKPF.qvd (qvd);

//For BSEG load:

BSEG: // Accounting Document Segment

CONCATENATE

Load *;


Select MANDT KOKRS KOSTL BUKRS GJAHR BELNR BUZEI DMBTR UMSKS UMSKZ KOART AUGDT AUGBL ZUONR WRBTR MWSTS WMWST LIFNR KUNNR HKONT GSBER SAKNR SGTXT PRCTR SHKZG from BSEG;

LOAD * RESIDENT BKPF

WHERE CPUDT >= '$(vDateBKPF)' );

JOIN(BSEG)

LOAD * FROM [..\..\DATA\RAW\BSEG_ALL.QVD] (qvd);

store BSEG into ..\..\DATA\RAW\BSEG_ALL.qvd (qvd);

DROP TABLE [BKPF];

Not applicable
Author

Hi,

Thanks for your reply. Is this script a full reload or incremental load of BSEG?