‎2007 Dec 31 11:24 AM
Hi,
I have some records in itab.
select field3 from knkk for all entries in itab
where kunnr = itab-kunnr.
Here I have to modify table itab with field3 to particular record?
How can i do this in as efficient way?
Regards,
Subbu
‎2007 Dec 31 12:18 PM
>
> Hi,
>
> I have some records in itab.
DATA : idx LIKE sy-tabix.
LOOP AT itab.
idx = sy-tabix.
select <fieldname> into itab-fld3 from knkk where kunnr = itab-kunnr.
if sy-subrc eq 0.
MODIFY itab INDEX idx.
endif.
ENDLOOP.
> Here I have to modify table itab with field3 to particular record?
>
> How can i do this in as efficient way?
>
> Regards,
> Subbu
‎2007 Dec 31 11:28 AM
loop at itab.
if itab-field = specific value
itab-field3 = field3 value.
modify itab.
endif.
endloop.
Awrd POints if useful
Bhupal
‎2007 Dec 31 11:28 AM
‎2007 Dec 31 11:30 AM
Hi subba reddy,
Try the below logic.It will helpful to u ok..
itab-number = 3.
itab-name = 'REDDy'. "previous name is reddi
modify itab.
Award points if helpful.
Kiran Kumar.G
Have a Nice Day..
‎2007 Dec 31 11:31 AM
hi,
sort internal table and then use read in bineary search mode. do the code given by bhupal. that will more effective as per my knowledge.
WISH YOU HAPPY NEW YEAR
pavan
‎2007 Dec 31 11:47 AM
Hi Pavan,
Thanks and wish you the same
Please find my query once again.
Itab:fields f1 f2 f3 f4
values 1 ab zz
2 ac zc
etc....,
Now I have to select f3 from knkk where f1 = itab-f1
and f2 = itab-f2 .
Then I have to update itab-f3 with that value.
What will be the efficient way to do that?
Thanks for the response.
Subbu
‎2007 Dec 31 12:07 PM
hi
select f3 from xxx for all entries of table itab
where f1 = itab-f1 and f2= itab-f2.
modify table itab-f3 transporting f3.
regards,
pavan
‎2007 Dec 31 11:38 AM
Hi,
Will you please more clear about question.
Thanks,
Sakthi C
‎2007 Dec 31 11:44 AM
Hai,
Try the following code:
Read Table itab index i.
itab-field3 = newValue.
append itab.
where i is the index of the record which you want to modify.
Regards
‎2007 Dec 31 12:18 PM
>
> Hi,
>
> I have some records in itab.
DATA : idx LIKE sy-tabix.
LOOP AT itab.
idx = sy-tabix.
select <fieldname> into itab-fld3 from knkk where kunnr = itab-kunnr.
if sy-subrc eq 0.
MODIFY itab INDEX idx.
endif.
ENDLOOP.
> Here I have to modify table itab with field3 to particular record?
>
> How can i do this in as efficient way?
>
> Regards,
> Subbu
‎2007 Dec 31 12:54 PM
Hi.,
Try this following code for your solution.
loop at itab.
select single field3 from KNKK into KNKK-field3 where kunnr = itab-kunnr.
if sy-subrc = 0.
itab-field3 = KNKK-field3
modify itab transporting field3
else.
delete itab index sy-tabix.
endif.
endloop.
Regards,
Raj.