Skip to Content
author's profile photo Former Member
Former Member

Declaring internal table by including 2 tables

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 04, 2009 at 07:44 AM

    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)

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.