02-04-2010 9:03 AM
i am selecting
vrgar
perio
paobjnr
belnr
gjahr
perde
budat
kndnr
artnr
frwae
kursf
rec_waers
kaufn
kdpos
bukrs
kokrs
werks
gsber
vkorg
vtweg
spart
rbeln
rposn
prctr
pprctr
kunnr
land1
regio
kunwe
kvgr1
wwpmg
zterm
wwcst
wwrst
mvgr3
wwseg
wwcls
wwesa
prdha
wwbun
wwexd
wwph1
wwph2
wwph3
wwph4
prat1
prat2
vrprs
vv510
vv508
vv509
vvqt2
vv515
INTO TABLE ct_ce11000 FROM ce11000
WHERE paledger EQ gv_ledbo AND
vrgar EQ lc_vrgar AND
belnr GT uv_belnr AND
gjahr EQ pa_gjahr AND
perde EQ pa_perd AND
bukrs EQ pa_bukrs.
now i awant to delete all those entries from my internal table ct_ce11000 where my plant (WEKRS) and company code (BUKRS)
i am writting
loop at ct_ce11000 into wa_ce11000.
if wa_ce11000-werks ne wa_ce11000-bukrs.
now how can i delete all the entries from nmy internal table (ct_ce11000) when plant and company code is not same
pls help me with logic.
thank you for helping me
02-04-2010 9:08 AM
loop at ct_ce11000 into wa_ce11000.
if wa_ce11000-werks ne wa_ce11000-bukrs.
delete ct_ce11000 index sy-tabix.
endif.
endloop.
02-04-2010 9:09 AM
Hi,
Check this one.
loop at ct_ce11000 into wa_ce11000.
if wa_ce11000-bukrs ne wa_ce11000-werks.
delete ct_ce11000 from wa_ce11000 index sy-tabix.
endif.
endloop.
Edited by: Jayanth16 on Feb 4, 2010 10:11 AM
02-04-2010 9:25 AM
Hi,
Loop at ct_ce11000 into wa_ce11000.
IF wa_ce11000-bukrs NE wa_ce11000-werks.
DELETE ct_ce11000 INDEX SY-TABIXx.
MODIFY ct_ce11000 FROM wa_ce11000.
ENDIF.
CLEAR wa_ce11000.
ENDLOOP.
02-04-2010 9:37 AM
Hello Guys,
It is not advisable to delete the entries from the internal table you are looping upon. See this thread: [|]
And to answer the OP's question select data into some local internal table & based on the condition populate your final table. Creating a local table of the same type as the final table will not create too much performance overhead
Cheers,
Suhas
02-04-2010 9:41 AM
02-04-2010 9:39 AM