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

Dictionary structure with reference to two transparent tables

Former Member
0 Likes
980

Hi

I have a question about structures defined as dictionary objects.

Is it possible to define a dictionary structure consisting of the structure types of two transparent tables, i.e. to define a dictionary type that corresponds to something like this:

TYPES:

BEGIN OF ty_s_tablejoin,

tab1 TYPE z_table1,

tab2 TYPE z_table2,

END OF ty_s_tablejoin.

where z_table1 and z_table2 are both transparent tables?

I need it as a dictionary type in order to pass the structure/table into a function module as an input parameter.

There might be other ways of doing this, but it could be interesting to know if it is possible. Please excuse me if this is a weird question, I'm rather new with SAP.

kind regards

Klaus Stenbæ

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
833

Thank you for the quick answers, but I think you misunderstood me a little:

The type definition that I mention in my own post is valid and working within an ABAP report, however I'm interested in defining that type as a dictionary object (structure) so that I can use it as 'associated type' of an input parameter in a function module.

kind regards

Klaus Stenbæ

Hi

I have a question about structures defined as dictionary objects.

Is it possible to define a dictionary structure consisting of the structure types of two transparent tables, i.e. to define a dictionary type that corresponds to something like this:

TYPES:

BEGIN OF ty_s_tablejoin,

tab1 TYPE z_table1,

tab2 TYPE z_table2,

END OF ty_s_tablejoin.

where z_table1 and z_table2 are both transparent tables?

I need it as a dictionary type in order to pass the structure/table into a function module as an input parameter.

There might be other ways of doing this, but it could be interesting to know if it is possible. Please excuse me if this is a weird question, I'm rather new with SAP.

kind regards

Klaus Stenbæ

5 REPLIES 5
Read only

sridhar_meesala
Active Contributor
0 Likes
833

Hi,

I guess we cannot do so. But however

TYPES:
BEGIN OF ty_s_tablejoin,
col1 TYPE z_table-col1,
col2 TYPE z_table-col2,
END OF ty_s_tablejoin.

is possible.

Thanks,

Sri.

Read only

Former Member
0 Likes
833

Hi,

TYPES:
BEGIN OF ty_s_tablejoin.
 TYPES: INCLUDE STRUCTURE z_table1,
 TYPES: INCLUDE STRUCTURE  z_table2,
END OF ty_s_tablejoin.

Read only

Former Member
0 Likes
834

Thank you for the quick answers, but I think you misunderstood me a little:

The type definition that I mention in my own post is valid and working within an ABAP report, however I'm interested in defining that type as a dictionary object (structure) so that I can use it as 'associated type' of an input parameter in a function module.

kind regards

Klaus Stenbæ

Read only

0 Likes
833

Hi Klaus,

You can't create a structure in the data dictionary from two tables. However, you can define tables based on structures then create a structure combining both.

For example;

Create structures ZST1 and ZST2 (containing the fields of z_table1 and z_table2 respectively)

Then create tables z_table1 and z_table2, defining them based on ZST1 and ZST2

Finally create a structure (say ZST12) combining both ZST1 and ZST2

From a practical point of view, ZST1 and ZST2 should not contain the client field as when you combine them the field will duplicate. Add the client field to z_table1, z_table2 and ZST12 before including the structres.

Hope this helps,

Nick

Read only

Former Member
0 Likes
833

Hi,

Here is a way.

Create Z_structure1 and Z_structure2 for Z_table1 and Z_table2 respectively.

Then while creating Z_table1, use ".INCLUDE" in field ans Z_structure1in the data element column of se11.

Same for Z_table2.

Then for Z_table_join, include both these structures.

Thanks,

Renjith.