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

Declaring internal table by including 2 tables

Former Member
0 Likes
2,192

Hi Experts,

I have a requirement , where i need to display a report containing all the feilds from two table EBAN and EBKN avoiding duplicates.

My question is how to find all the feilds in the 2 tables avoind duplicates. is there any function module for which if if we give input as 2 tables , then it gives all the feilds present i it by avoiding duplicates.

How could i declare my internal table .

TYPES: BEGIN OF t_final.

INCLUDE STRUCTURE ebkn.

INCLUDE STRUCTURE eban.

TYPES: END OF t_final.

If i declare this way, it is showing error that some feilds are already declared.

is there any other way instead of listing all the feilds

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,077

Hello

There are no exist such FM. But you may try like this:


TYPES: BEGIN OF t_final.
INCLUDE STRUCTURE ebkn AS a RENAMING WITH SUFFIX a1.
INCLUDE STRUCTURE eban AS b RENAMING WITH SUFFIX b1.
TYPES: END OF t_final.

DATA: FINAL TYPE t_final OCCURS 0 WITH HEADER LINE.

Table FINAL will be contain all fields from both structures (with duplicates).

Access fields:

FINAL-MANDTA1 - field MANDT for table EBKN (also you may use FINAL-A-MANDT)

FINAL-MANDTB1 - field MANDT for table EBAN (also you may use FINAL-B-MANDT)

Hi Experts,

I have a requirement , where i need to display a report containing all the feilds from two table EBAN and EBKN avoiding duplicates.

My question is how to find all the feilds in the 2 tables avoind duplicates. is there any function module for which if if we give input as 2 tables , then it gives all the feilds present i it by avoiding duplicates.

How could i declare my internal table .

TYPES: BEGIN OF t_final.

INCLUDE STRUCTURE ebkn.

INCLUDE STRUCTURE eban.

TYPES: END OF t_final.

If i declare this way, it is showing error that some feilds are already declared.

is there any other way instead of listing all the feilds

1 REPLY 1
Read only

Former Member
0 Likes
1,078

Hello

There are no exist such FM. But you may try like this:


TYPES: BEGIN OF t_final.
INCLUDE STRUCTURE ebkn AS a RENAMING WITH SUFFIX a1.
INCLUDE STRUCTURE eban AS b RENAMING WITH SUFFIX b1.
TYPES: END OF t_final.

DATA: FINAL TYPE t_final OCCURS 0 WITH HEADER LINE.

Table FINAL will be contain all fields from both structures (with duplicates).

Access fields:

FINAL-MANDTA1 - field MANDT for table EBKN (also you may use FINAL-A-MANDT)

FINAL-MANDTB1 - field MANDT for table EBAN (also you may use FINAL-B-MANDT)