09-05-2009 5:42 PM
Hi,
I want all entries in vbrp but i am fetching on basis of for all entries in vbrk. how i'll get duplicate entries in vbrp as i have to show in final output.
And which internal table shell i loop ,whether on it_vbrp or on it_vbrk to fill final internal table by read commond . Is there any general rule to put loop
on header and detail table to fill final table.
Regards,
Himanshu
09-08-2009 9:38 AM
Hi,
Try this
if not it_vbrk[] is initial.
select -- -- -- --
from vbrp
into table it_vbrp
for all entries in it_vbrk
where (check for the key fields)
if sy-subrc eq 0.
sort it_vbrp.
endif.
endif.
If yu want all the item level details, then loop at the item level internal table, it_vbrp. Then read the table it_vbrk.
Then do further processing.
Regards
Ramesh Sundaram
09-05-2009 6:23 PM
please post one question per thread.
You need to use SELECT ... INNER JOIN ... . Check abap documentation, and many threads in this forum
09-06-2009 6:49 AM
Himanshu,
first sort it_vbrk then use select to populate it_vbrp with for all entries in it_vbrk. then loop on the table you want to populate. and use read command to read fields from other internal tables & populate the fields.
BR,
SB.
09-08-2009 9:38 AM
Hi,
Try this
if not it_vbrk[] is initial.
select -- -- -- --
from vbrp
into table it_vbrp
for all entries in it_vbrk
where (check for the key fields)
if sy-subrc eq 0.
sort it_vbrp.
endif.
endif.
If yu want all the item level details, then loop at the item level internal table, it_vbrp. Then read the table it_vbrk.
Then do further processing.
Regards
Ramesh Sundaram
09-09-2009 8:51 AM
> how i'll get duplicate entries in vbrp as i have to show in final output.
without details, I guess you are looking for duplicates which are deleted by the FOR ALL ENTRIES.
Use the join, it should anyway be your first choice.