12-11-2008 7:22 AM
Dear Experts,
i am modify one internel table.
for eg :
itab name is -->it_ekpo1
MAT NO ADD NO
1 10
2 10
3 10
4 15
I am Passing ADD NO to The ADRC(it_adrc) table. Pick the address.
for eg : 10 -
> should be one address.
15------>should be one address.
I am modify to (it_ekpo).
1---> 10>address(NOT STORED)
2 -- > 10-->address (stored)
3-> 10>address(NOT STORED)
4 > 15>address (stored)
My case same address will be stored in 1,2,3.
my code is.
select ADDRNUMBER name1 street STR_SUPPL1 STR_SUPPL3 location city1 post_code1 from adrc
into corresponding fields of table it_adrc for all entries in it_ekpo1
where ADDRNUMBER = it_ekpo1-adrn2.
loop at it_adrc into wa_adrc.
read table it_ekpo1 into wa_ekpo1 with key adrn2 = wa_adrc-ADDRNUMBER.
if sy-subrc = 0.
wa_ekpo1-adrn2 = wa_adrc-ADDRNUMBER.
wa_ekpo1-STR_SUPPL1 = wa_adrc-STR_SUPPL1.
wa_ekpo1-NAME1 = wa_adrc-NAME1.
wa_ekpo1-Street = wa_adrc-street.
wa_ekpo1-STR_SUPPL3 = wa_adrc-STR_SUPPL3.
wa_ekpo1-Location = wa_adrc-Location.
wa_ekpo1-city1 = wa_adrc-city1.
wa_ekpo1-POST_CODE1 = wa_adrc-POST_CODE1.
modify table it_ekpo1 from wa_ekpo1.
modify it_ekpo1 from wa_ekpo1 index sy-tabix.
endif.
endloop
PLZ HELP ME
regards,
raj
12-11-2008 9:10 AM
Just check this.
loop at it_adrc into wa_adrc.
read table it_ekpo1 into wa_ekpo1 with key adrn2 = wa_adrc-ADDRNUMBER.
if sy-subrc = 0.
wa_ekpo1-adrn2 = wa_adrc-ADDRNUMBER.
wa_ekpo1-STR_SUPPL1 = wa_adrc-STR_SUPPL1.
wa_ekpo1-NAME1 = wa_adrc-NAME1.
wa_ekpo1-Street = wa_adrc-street.
wa_ekpo1-STR_SUPPL3 = wa_adrc-STR_SUPPL3.
wa_ekpo1-Location = wa_adrc-Location.
wa_ekpo1-city1 = wa_adrc-city1.
wa_ekpo1-POST_CODE1 = wa_adrc-POST_CODE1.
modify table it_ekpo1 from wa_ekpo1 where adrn2 = wa_adrc-ADDRNUMBER. "<----
endif.
endloop.
its better to Go for loop at it_ekpo1 and read table it_adrc and perform this action.
12-11-2008 7:24 AM
12-11-2008 7:30 AM
Though your question is not very clear, i think MODIFY with a where clause on addr_number should help you out.
Please if possible just write your problem once more.
12-11-2008 9:10 AM
Just check this.
loop at it_adrc into wa_adrc.
read table it_ekpo1 into wa_ekpo1 with key adrn2 = wa_adrc-ADDRNUMBER.
if sy-subrc = 0.
wa_ekpo1-adrn2 = wa_adrc-ADDRNUMBER.
wa_ekpo1-STR_SUPPL1 = wa_adrc-STR_SUPPL1.
wa_ekpo1-NAME1 = wa_adrc-NAME1.
wa_ekpo1-Street = wa_adrc-street.
wa_ekpo1-STR_SUPPL3 = wa_adrc-STR_SUPPL3.
wa_ekpo1-Location = wa_adrc-Location.
wa_ekpo1-city1 = wa_adrc-city1.
wa_ekpo1-POST_CODE1 = wa_adrc-POST_CODE1.
modify table it_ekpo1 from wa_ekpo1 where adrn2 = wa_adrc-ADDRNUMBER. "<----
endif.
endloop.
its better to Go for loop at it_ekpo1 and read table it_adrc and perform this action.