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: 

Regarding select

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

Hi,

Loop at itab.

select single fieldname from vbpa into itab-fieldname where vbeln eq itab-vbeln.

modify itab index sy-tabix.

endloop.

former_member188827
Active Contributor
0 Kudos

LOOP AT ITAB.

SELECT <FIELD_NAME> FROM VBPA WHERE VBELN EQ ITAB-VBELN.

MODIFY ITAB TRANSPORTING <FIELD_NAME> INDEX SY-TABIX.

ENDSELECT.

ENDLOOP.

Former Member
0 Kudos

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