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

two different internal table data move to out put internal table

Former Member
0 Likes
1,043

i want to move l_t_vbrk and l_vbak table to l_t_output_header_data.

table 1 ; l_t_vbrk (billing document header data)

table 2 ; l_t_vbak (sales document header data)

there is no fields is maching both table ......

with out maching a fields i want to move to third table....

i want to move l_t_vbrk and l_vbak table to l_t_output_header_data.

table 1 ; l_t_vbrk (billing document header data)

table 2 ; l_t_vbak (sales document header data)

there is no fields is maching both table ......

with out maching a fields i want to move to third table....

7 REPLIES 7
Read only

Former Member
0 Likes
1,009

If you have no matching field than you can use the below..

loop at l_t_vbrk.

read table l_vbak index sy-tabix.

move-corresponding l_t_vbrk to l_t_output_header_data.

move-corresponding l_vbak to l_t_output_header_data.

append l_t_output_header_data.

endloop.

Please make sure that l_t_vbrk has more lines as compared to l_vbak.

Read only

Former Member
0 Likes
1,009

is it that you want to append the two tables to a third one ?

then append them one by one.. whats the problem in it ?

and please explain this strange scenario in detail.

regards,

Sandeep Josyula

*Mark helpful answers

Read only

Sharadha1
Active Contributor
0 Likes
1,009

Hi Santhosh,

can i know your requirement.why u want to combine both the tables that does not have even a field in common?

it is not logically correct,even though u cna achieve it technically.

Regards,

Sharadha

Read only

Former Member
0 Likes
1,009

Declare the third internal table with include structures of other two internal table. then move the data. I hope u understood this.

regards,

Chandra.

Read only

Former Member
0 Likes
1,009

Hi,

Ur problem is not clear. Why do u want to combine itabs of sales document header & billing document header. Obviously there'll be more entries in VBRK than VBAK.

Logically u need to have a field as a reference to VBAK in VBRK.

I m not clear about what u want to achieve without this.

Read only

Former Member
0 Likes
1,009

Hi santosh ..

Welcome to SDN.

U need to know the sales flow before u start any coding ..

just try to understand this flow..

from Delivery -


> sales here u go

VBRK-VBELN = VBRP-VBELN. "BILLING

VBRP-VGBEL = LIPS-VBELN. "DELIVERY

VBRP-VGPOS = LIPS-POSNR.

LIPS-VGBEL = VBAP-VBELN. "SALES ITEM

LIPS-VGPOS = VBAP-POSNR.

VBAP-VBELN = VBAK-VBELN .. "SALES HEADER

See this is the flow u need to understand.

take a Billing Number and start navigating the flow ..

or get the functional flow first of all ..

once u have the data joining them is not a prob ..

but for u u need to understand the schema flow ..

regards,

VIjay.

Read only

Clemenss
Active Contributor
0 Likes
1,009

Santosh,

the tables do not match directly because they are linked not by header but item data.

First find the invoive items from VBRP. For each VBRP item there is exactly naximum one VBAK order.

I don't remember the fieldname now but you can find out easily taking an order and an invoice from the document flow and compare the contents.

Regards,

Clemens