2009 Jul 30 8:45 AM
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æ
2009 Jul 30 9:09 AM
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æ
2009 Jul 30 8:54 AM
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.
2009 Jul 30 8:55 AM
Hi,
TYPES:
BEGIN OF ty_s_tablejoin.
TYPES: INCLUDE STRUCTURE z_table1,
TYPES: INCLUDE STRUCTURE z_table2,
END OF ty_s_tablejoin.
2009 Jul 30 9:09 AM
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æ
2009 Jul 30 9:25 AM
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
2009 Jul 30 9:33 AM
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.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |