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

update internal table

Former Member
0 Likes
535

Hi,

I have an internal table with structure as follows

MANDT

KDMAT

VBELN

POSNR

VBTYP

CHARG

ERDAT

Now I need to fill this table from 2 different database tables:

VBAK: VBELN, VBTYP, ERDAT

VBAP: KDMAT, POSNR, CHARG.

Should I have 2 itabs for VBAK and VBAP. And fill the final itab looping thru VBAK and VBAP itabs?

What would be the best way to do this?

Regards,

Sriram.

2 REPLIES 2
Read only

RaymondGiuseppi
Active Contributor
0 Likes
501

You can use a [SELECT - join|http://help.sap.com/abapdocu_70/en/ABAPSELECT_JOIN.htm], the choice between JOIN or two SELECT (second via [FOR ALL ENTRIES|http://help.sap.com/abapdocu_70/en/ABENWHERE_LOGEXP_ITAB.htm] or[ WHERE|http://help.sap.com/abapdocu_70/en/ABAPWHERE.htm] option) depends on factor like volume of data and selection criteria.

Regards,

Raymond

Read only

Former Member
0 Likes
501

Hi,

You can use Join statement to fetch data from different DB table at once.

Select AVBELN AVBTYP AERDAT BKDMAT BPOSNR BCHARG

into corresponding fields of table itab

from VBAK as A inner join VBAP as B

ON Avbeln = Bvbeln

Where <condition>.

Regards,

N3