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: 

Merge two differents tables in one new structure

Former Member
0 Kudos

Hello guys,

How can I merge two differents tables in one new structure (workarea) dynamically?

For example, merge MARA and MARC in a new structure that contains all fields from MARA and all fields from MARC.

In this case, it isn't necessary that identical fields be repeated (MATNR).

Can you help me?

Thanks!

Kleber

1 ACCEPTED SOLUTION

marius_greeff
Active Participant
0 Kudos

Hi,

One option is to create a table view in SE11 using the two tables. I am even shore the performance will be faster than writing a join in ABAP.

Regards,

Marius

7 REPLIES 7

former_member222860
Active Contributor
0 Kudos

Hi,

To include similar fields from both tables, give different name, Say

DATA: matnr1 like mara-matnr,

matnr2 like marc-matnr.

Regards

Mahesh

Former Member
0 Kudos

Search sdn for "Create dynammic internal table"...

0 Kudos

Hello Veeranji,

I've searched a lot, but unfortunately I haven't find anything that help me.

In fact, I need to create a dynamic structure (workarea), and don't a dynamic internal table.

Thanks for your reply!

Kleber

marius_greeff
Active Participant
0 Kudos

Hi,

One option is to create a table view in SE11 using the two tables. I am even shore the performance will be faster than writing a join in ABAP.

Regards,

Marius

0 Kudos

Hello Marius,

MARA and MARC are only an example, because the tables are dynamic.

I can't create a structure in SE11.

Thanks!

Kleber

0 Kudos

Hi,

Use include structure like:

data begin of itab occurs 0.

include structure MARA.

include structure MARC.

-


-


data end of itab.

former_member536879
Active Contributor
0 Kudos

Hi,

Not at all we need to repeat the same field in the structure.

With Regards,

Sumodh.P