Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Folks ,
Can someone help we with incremental script for below EDID4 table having "SEGNUM" as Primary Key , we don't have any date field in this table.
EDID4: // IDoc Data Records from 4.0 onwards
Load
*;
SQL Select MANDT COUNTER DOCNUM HLEVEL SEGNUM SEGNAM PSGNUM DTINT2 SDATA from EDID4
;
STORE * FROM EDID4 INTO D:\qvprod\qvd\SAP\KTX_100\EDID4.QVD;
DROP TABLE EDID4;
Thanks in advance!
Regards,
AS
Hi AS:
Try something like this where vL.Segnum contain the max value of field Segnum loaded in the previous execution:
EDID4:
LOAD
*
FROM
Concatenate(EDID4)
Load
*;
SQL
Select MANDT, COUNTER, DOCNUM, HLEVEL, SEGNUM, SEGNAM, PSGNUM, DTINT2, SDATA from EDID4
WHERE SEGNUM > $(vL.Segnum);
STORE * FROM EDID4 INTO D:\qvprod\qvd\SAP\KTX_100\EDID4.QVD;
DROP TABLE EDID4;
Best Regards,
Juan P. Barroso
do i need to define:
vL.Segnum=max(SEGNUM) ???
Thanks,
AS
Hi Amit,
No Max function will not work because it is a aggregation function.
If you are working with the primary key and it consists a string means use this below variable.
let max=peek('SEGNUM',-1,'EDID4');
Regards,
Manoj
Also use lastvalue(SEGNUM) it will also get the last value of the particular field.
ok thanks!
Regards,
AS
Hi,
I'm not sure , why I'm getting below error:
/QTQVC/OPEN_STREAM failed after 00:00:00 Key = SQL_ERROR (ID:00 Type:E Number:001 ">2" is invalid here (due to grammar). contains an invalid character or it is a keyword. (It might be possible to escape it using "!"). Or a space is missing or there is one space too many.)
SQL Select MANDT COUNTER SEGNUM HLEVEL DOCNUM SEGNAM PSGNUM DTINT2 SDATA from EDID4
Where SEGNUM >2
I'm trying something like below:
EDID4:
LOAD MANDT,
COUNTER,
SEGNUM,
HLEVEL,
DOCNUM,
SEGNAM,
PSGNUM,
DTINT2,
SDATA
FROM
(qvd);
Last_Updated_SEGNUM:
Load max(SEGNUM) as MaxSEGNUM
Resident EDID4;
Let vLastUpdatedSEGNUM =peek('MaxSEGNUM',0,'Last_Updated_SEGNUM');
NoConcatenate
Incremental:
Load
*;
SQL Select MANDT COUNTER SEGNUM HLEVEL DOCNUM SEGNAM PSGNUM DTINT2 SDATA from EDID4
Where SEGNUM >$(vLastUpdatedSEGNUM);
Concatenate (Incremental)
LOAD MANDT,
COUNTER,
SEGNUM,
HLEVEL,
DOCNUM,
SEGNAM,
PSGNUM,
DTINT2,
SDATA
Resident EDID4
Where not Exists (SEGNUM);
Inner Join (Incremental)
Load
SEGNUM;
SQL Select MANDT COUNTER SEGNUM HLEVEL DOCNUM SEGNAM PSGNUM DTINT2 SDATA from EDID4
;
STORE * FROM Incremental INTO D:\qvprod\qvd\SAP\KTX_100\Incremental.QVD;
DROP Tables Last_Updated_SEGNUM, EDID4;
Thanks,
AS
and SEGNUM is Primary Key.
Thanks,
AS
Guys any suggestion???
Regards,
AS
May be you can try not exist function in the where condition.
Check this out -