‎2009 May 14 4:36 PM
hi experts , i need a logic
i have a internal table itab_equi in that i am getting 11 values when i pass this internal table to another table using for all entries i will get 4 values in int_bmgkobj . i need logic for how to get the deleted values i.e 9 values deleted . i need that value 9 values ..
SELECT matnr
sernr
kunde
objnr FROM equi
INTO TABLE itab_equi " i am getting 11 values here
WHERE kunde = kunde .
IF itab_equi[] IS NOT INITIAL.
SELECT j_objnr
gwldt
gwlen FROM bgmkobj
INTO TABLE itab_bgmkobj " i am getting 4 values here
FOR ALL ENTRIES IN itab_equi
WHERE j_objnr = itab_equi-objnr .i need the deleted 9 values in a seperate internal table ..
plz help me for this logic
regards
chinnaiya P
‎2009 May 14 4:47 PM
HI,
Check this ..
SELECT matnr
sernr
kunde
objnr FROM equi
INTO TABLE itab_equi " i am getting 11 values here
WHERE kunde = kunde .
IF itab_equi[] IS NOT INITIAL.
SELECT j_objnr
gwldt
gwlen FROM bgmkobj
INTO TABLE itab_bgmkobj " i am getting 4 values here
FOR ALL ENTRIES IN itab_equi
WHERE j_objnr NE itab_equi-objnr . "--> Check here
Or
Select all the data from bgmkobj into internal table itab_bgmkobj.
Loop the itab_bgmkobj and check the entry using entries in internal table itab_equi..if found delete ..the left entries are what you required
‎2009 May 14 4:44 PM
select the whole second table into anothe internal table, loop on it and read itab_bgmkobj with the apropiate key to locate a match. If found, delete that record from your new internal table. At the end of this loop you'll have the entries separated in the two tables.
You could also loop at itab_bgmkobj and read the new table, deleting there, this could work faster for this case, although with this ammount of data, it's almost non mesurable.
‎2009 May 14 4:47 PM
HI,
Check this ..
SELECT matnr
sernr
kunde
objnr FROM equi
INTO TABLE itab_equi " i am getting 11 values here
WHERE kunde = kunde .
IF itab_equi[] IS NOT INITIAL.
SELECT j_objnr
gwldt
gwlen FROM bgmkobj
INTO TABLE itab_bgmkobj " i am getting 4 values here
FOR ALL ENTRIES IN itab_equi
WHERE j_objnr NE itab_equi-objnr . "--> Check here
Or
Select all the data from bgmkobj into internal table itab_bgmkobj.
Loop the itab_bgmkobj and check the entry using entries in internal table itab_equi..if found delete ..the left entries are what you required
‎2009 May 14 5:06 PM
It's generally not a good idea to select all entries into an internal table and then filter them. This can cause performance problems.
Here, the problem is likely due to the fact that FOR ALL ENTRIES eliminates duplicates according to the fields used in the WHERE clause.
This is documented in SELECT. Have a look at it.
Rob