Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

I want all entries in vbrp but i am fetching on basis of for all entries

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

4 REPLIES 4

Sandra_Rossi
Active Contributor
0 Kudos

please post one question per thread.

You need to use SELECT ... INNER JOIN ... . Check abap documentation, and many threads in this forum

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

former_member194613
Active Contributor
0 Kudos

> 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.