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

Merge two differents tables in one new structure

Former Member
0 Kudos
2,079

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

marius_greeff
Active Participant
0 Kudos
622

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

former_member222860
Active Contributor
0 Kudos
622

Hi,

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

DATA: matnr1 like mara-matnr,

matnr2 like marc-matnr.

Regards

Mahesh

Read only

Former Member
0 Kudos
622

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

Read only

0 Kudos
622

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

Read only

marius_greeff
Active Participant
0 Kudos
623

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

Read only

0 Kudos
622

Hello Marius,

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

I can't create a structure in SE11.

Thanks!

Kleber

Read only

0 Kudos
622

Hi,

Use include structure like:

data begin of itab occurs 0.

include structure MARA.

include structure MARC.

-


-


data end of itab.

Read only

Former Member
0 Kudos
622

Hi,

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

With Regards,

Sumodh.P