05-22-2015 11:49 AM
Hi Experts,
I have faced one problem.I want to fetch data from table COEP where VRGNG ne KOA*.It means I want that data whose VRGNG not starting with KOA.I have written the code which is written under..
SELECT * INTO CORRESPONDING FIELDS OF TABLE wcoep2
FROM coep
INNER JOIN zpm_cost
on coep~kstar = zpm_cost~kstar
FOR ALL ENTRIES IN waufk
WHERE coep~objnr = waufk-objnr
AND coep~vrgng NOT IN ('KOA%')
AND coep~kokrs = 'SRL1'
AND zpm_cost~ACTIVITY = 'PARTS'
AND TIMESTMP > ld_timestmp.
But,unfortunately this code is triggering KOA* data also.
Please have a look and give me the solution..
05-22-2015 11:57 AM
Hi Deb,
I would suggest, create a range table for VRGNG field.
and update like below and pass the same in query.
ranges: SO_VRGNG for coep-vrgng
SO_VRGNG-SING = 'I'.
SO_VRGNG -OPTION = 'NE'.
SO_VRGNG-LOW = 'KOA*'.
APPEND SO_VRGNG.
SELECT * INTO CORRESPONDING FIELDS OF TABLE wcoep2
FROM coep
INNER JOIN zpm_cost
on coep~kstar = zpm_cost~kstar
FOR ALL ENTRIES IN waufk
WHERE coep~objnr = waufk-objnr
AND coep~vrgng IN SO_VRGNG
AND coep~kokrs = 'SRL1'
AND zpm_cost~ACTIVITY = 'PARTS'
AND TIMESTMP > ld_timestmp.
regards,
Praveer.
05-22-2015 12:11 PM
HI,
Try this,
SELECT * INTO CORRESPONDING FIELDS OF TABLE wcoep2
FROM coep
INNER JOIN zpm_cost
on coep~kstar = zpm_cost~kstar
inner join waufk on waufk~objnr = coep~objnr
AND coep~vrgng ne 'KOA%'
AND coep~kokrs = 'SRL1'
AND zpm_cost~ACTIVITY = 'PARTS'
AND TIMESTMP > ld_timestmp.
Thanks,
Ashish
05-22-2015 12:34 PM
hello,
u can code as :
.............
WHERE coep~objnr = waufk-objnr
AND coep~vrgng NOT LIKE 'KOA%'.........
Also u can refer this site for help :