Application Development and Automation 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: 
Read only

Regarding select

Former Member
0 Likes
562

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
Read only

Former Member
0 Likes
536

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
Read only

Former Member
0 Likes
536

Hi,

Loop at itab.

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

modify itab index sy-tabix.

endloop.

Read only

former_member188827
Active Contributor
0 Likes
536

LOOP AT ITAB.

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

MODIFY ITAB TRANSPORTING <FIELD_NAME> INDEX SY-TABIX.

ENDSELECT.

ENDLOOP.

Read only

Former Member
0 Likes
537

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