Skip to Content
0
Sep 30, 2013 at 12:09 PM

Flag from internal tables

334 Views

Hi experts,

I am filling in an abap program 3 internal tables with some document numbers.

Example:

Table 1:

Document number

Field1

Field2

1

XXX

ZZZ

2

YYY

VVV

Table 2:

Document number

Field1

Field2

Field3

1

AAA

300

A

3

BBB

400

C

Table 3:

Document number

Field1

2

200

3

150

I would like to create a global table listing the existence of a document in one of the internal tables or not with a flag as following:

Global Table:

Document number

Itable1

Itable2

Itable3

1

X

X

2

X

X

3

X

X

I thought about appending all the content of the 3 tables into one global table, then delete adjacent duplicates rcomparing document number.

Read table 1 with key Document number.
If sy-subrc eq 0.
GlobalTable-Itable1 = ‘X’.
Endif.

Do the same for the other tables.


What do you think? May be there is other simple and efficient ways to perform it. Waiting for your advices.

Thanks.

Amine