‎2008 Feb 13 7:55 AM
Hi Everbody!
DELETE lt_itab removes the wrong line
from internal table because the
number of lv_tabix is not equally with
the really affected line of internal table which has
to be deleted. Do you know a better
way to do that.
Thanks in advance
sas
data: lt_itab type standard table of IS_PDATFU,
wa_itab type IS_PDATFU,
lt_roles type standard table of BAPIBUS1006_BPROLES,
wa_roles type BAPIBUS1006_BPROLES,
lt_return type standard table of BAPIRET2,
lv_partner type BU_PARTNER,
lv_tabix type i value 1.
lt_itab = l_pdatfu_tab.
LOOP AT lt_itab into wa_itab.
CALL FUNCTION 'BUPA_ROLES_GET_2'
EXPORTING
IV_PARTNER = wa_itab-IPPERS
IV_PARTNER_GUID =
IV_DATE = SY-DATLO
TABLES
ET_PARTNERROLES = lt_roles
ET_RETURN = lt_return.
read table lt_roles into wa_roles index 1.
IF wa_itab-IPPERSGRP EQ 'C' AND wa_roles-PARTNERROLE EQ 'IKOS' .
DELETE lt_itab INDEX lv_tabix.
ENDIF.
clear wa_roles.
lv_tabix = lv_tabix + 1.
ENDLOOP.
l_pdatfu_tab = lt_itab.
‎2008 Feb 13 7:58 AM
‎2008 Feb 13 7:58 AM
‎2008 Feb 13 8:01 AM
Also try this
LOOP AT lt_itab into wa_itab.
lv_tabix = SY-TABIX.
and the use DELETE as you had used
‎2008 Feb 13 8:07 AM
Hi
In loop place" lv_tabix = SY-TABIX."
then,
DELETE TABLE lt_itab FROM wa_itab..
It will b of format
LOOP AT lt_itab into wa_itab.
lv_tabix = SY-TABIX."
DELETE TABLE lt_itab FROM wa_itab index lv_tabix..
Endloop.
‎2008 Feb 13 8:06 AM
Hi,
when u delete the record then select that record and send it to another internal table after compltion of ur
task in that table then do this logic.
loop at it_temp.
loop at it_tab where field1 = it_temp.
delete it_tab with sy-tabix.
endloop.
endloop.
Plzz reward points if it helps.
‎2008 Feb 13 8:14 AM
Chandrasekhar I thank you very much .
You are the best !!
DELETE TABLE lt_itab FROM wa_itab..
was the solution.
Bye
sas
‎2008 Feb 13 8:24 AM
Hello erdem sas ,
Really good Question. The Answer againest you question mark by other users are also good to adopt. But I have one another solution.
tries it out.
Don't delete the table by using the folowing statment
DELETE lt_itab INDEX lv_tabix.
out side the loop you try this. from the side of performance this one is really good.
Sort it_itab by IPPERSGRP IPPERSGRP.
Delete it_itab where IPPERSGRP EQ 'C' and PARTNERROLE EQ 'IKOS' .
Please Chcek the syntex error , because I am outside office and type the code.
Regards
Swati...
‎2008 Feb 13 8:25 AM
erdem,
Instead of index use SY-TABIX.
You are in loop of internal table So use
DELETE lt_itab INDEX SY-TABIX.
Don't forget to reward if useful...