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: 

How to fill the data of two different tables into one?

Former Member
0 Kudos
93

Hi Experts,

I have two tables named CDHDR and CDSHW(structure). I have extracted the data from these two tables through two function modules named CHANGEDDOCUMENT_HEADER and CHANGEDOCUMENT_POSITION. Now I have the data in to different tables.

These two tables neither has relationship with each other through any field nor have any field which exist in both. Can anyone tell me in this case what should be the process to take the data of both the tables into one table. How can I match the record of one table to another?

thanks a ton in advance.

Edited by: Moni Bindal on Apr 28, 2008 4:16 PM

Edited by: Alvaro Tejada Galindo on Apr 28, 2008 1:42 PM

4 REPLIES 4

Former Member
0 Kudos
54

Hi,

The table CDHDR has a relationship with table CDPOS like header and item.

Can you use CDPOS?

Regards,

Fernando

Former Member
0 Kudos
54

hi with out having any relation between the data tables you cannot relate them...this is not possible..one more thing here you r relating the data base table with a structure...and you are filling the structure how..

regards,

venkat

Former Member
0 Kudos
54

Hye Bindal,

without a relation, it is not possible to club the data of 2 internal tables. More over it depends on the requirement as to y u should club to non related quantities in an internal table.

if you wish to do so, one thing is it has internal table which includes the strucute of the 2.

data: begin of ty_out,

first type first_structure,

second type second_structure,

end of ty_out.

data: itab type standard table of ty_out.

data: wa type ty_out.

loop into it1 into wa1.

move corresponding wa to wa1.

append wa to itab.

endloop.

loop into it2 into wa2.

move corresponding wa to wa2.

append wa to itab.

endloop.

now the internal table itab will have all the contents of it1 and it2.

<REMOVED BY MODERATOR>

Thanks,

Imran.

Edited by: Alvaro Tejada Galindo on Apr 28, 2008 1:43 PM

Former Member
0 Kudos
54

Solved