11-07-2007 10:21 AM
Hai,
I have vbeln,erdat,netwr in itab.
Now i have to get DATA from vbpa table with refering itab-vbeln.
i have to hold all the fields of itab and one field from vbpa table.
how can we write the code for this.
Thanks,
srik
11-07-2007 10:35 AM
Hi Jonnakuti,
Suppose you have a field t_field which you need to select form VBPA .Do like this.
Select vbeln t_field form vbpa
into table itab1
for all entries in itab
where vbeln = i_tab-vbeln.
Now pass the values into itab.
Loop at itab.
read table itab1 with key vbeln = itab-vbeln binary search.
if sy-subrc = 0.
itab-t_field = itab1-t_field.
modify itab.
endif.
endloop.
Hope it helps.
regards
Sourabh Verma
11-07-2007 10:23 AM
Hi,
Loop at itab.
select single fieldname from vbpa into itab-fieldname where vbeln eq itab-vbeln.
modify itab index sy-tabix.
endloop.
11-07-2007 10:32 AM
LOOP AT ITAB.
SELECT <FIELD_NAME> FROM VBPA WHERE VBELN EQ ITAB-VBELN.
MODIFY ITAB TRANSPORTING <FIELD_NAME> INDEX SY-TABIX.
ENDSELECT.
ENDLOOP.
11-07-2007 10:35 AM
Hi Jonnakuti,
Suppose you have a field t_field which you need to select form VBPA .Do like this.
Select vbeln t_field form vbpa
into table itab1
for all entries in itab
where vbeln = i_tab-vbeln.
Now pass the values into itab.
Loop at itab.
read table itab1 with key vbeln = itab-vbeln binary search.
if sy-subrc = 0.
itab-t_field = itab1-t_field.
modify itab.
endif.
endloop.
Hope it helps.
regards
Sourabh Verma