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

Generic standard table type

Former Member
0 Likes
5,070

Anybody please resolve my doubt

types tb_std_type type table of sflight.

-->this i understand as not a generic table type.'NON-UNIQUE" and DEFAULT KEYS are implicity defined .

data it_std type tb_std.-->Since i could declare an internal table of tb_std_type,i strongly belive tb_std_type is not a genric table type.

But when i try to declare another type of same table type tb_std_type ie

types tb2_type type tb_std_type.

This is giving me an error saying\

tb_std_type has a generic type.Use of this type is only possible for typing field symbols and formal parameters.

If thats true then how was i able to create a internal table out of it...

In case of sorted and hashed tables it behaves as exactly as it is defined.(Like if generic,can only be used for typing formal params.field symbold..and if non generic--internal tables declaration and normal typing is possible)

Please resolve this

*Would be great if could avoid a copy paste from std.help..because i have been through it..

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
2,950

Hello Teenu,

Query#1

types tb2_type type tb_std_type.

This is giving me an error saying\

tb_std_type has a generic type.Use of this type is only possible for typing field symbols and formal parameters.

Why is the table generic? An excerpt from SAP documentation clearly states that:

An internal table that has no table key or an incomplete table key is generic with respect to the table key. A table type of this nature can be used only for typing formal parameters or field symbols.

Query#2

If thats true then how was i able to create a internal table out of it...

SAP says:

A standard table type with a generic primary table key can only be specified after TYPE when DATA is used.

Source: [http://help.sap.com/abapdocu_70/en/ABAPTYPES_KEYDEF.htm|http://help.sap.com/abapdocu_70/en/ABAPTYPES_KEYDEF.htm]

BR,

Suhas

3 REPLIES 3
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
2,951

Hello Teenu,

Query#1

types tb2_type type tb_std_type.

This is giving me an error saying\

tb_std_type has a generic type.Use of this type is only possible for typing field symbols and formal parameters.

Why is the table generic? An excerpt from SAP documentation clearly states that:

An internal table that has no table key or an incomplete table key is generic with respect to the table key. A table type of this nature can be used only for typing formal parameters or field symbols.

Query#2

If thats true then how was i able to create a internal table out of it...

SAP says:

A standard table type with a generic primary table key can only be specified after TYPE when DATA is used.

Source: [http://help.sap.com/abapdocu_70/en/ABAPTYPES_KEYDEF.htm|http://help.sap.com/abapdocu_70/en/ABAPTYPES_KEYDEF.htm]

BR,

Suhas

Read only

Former Member
0 Likes
2,950

Oh okay..

so with that 'data' declaration,a bound table type with a standarad key is generated ..right..and

it happens only with standard tables....

that was a good piece of help

Thanks alot Suhas

Read only

Former Member
0 Likes
2,950

.