Application Development 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: 

dynamically create data type for structure

Former Member
0 Kudos
151

Hello Experts.

how to create dynamic data type for structres. for example.

data lv_struc_name type strukname.

lv_struc_name = get_struct_name( ) ****** this method gives the structure name('ct_struc')

now I want to create one data type, which is having the type of lv_struc_name content.(ct_struct)

thanks

Tim

1 ACCEPTED SOLUTION

mvoros
Active Contributor
0 Kudos
95

Hi,

here is the link to really good presentation about generic programming ABAP351.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b332e090-0201-0010-bdbd-b735e96f...

It contains examples how to create dynamic structure and tables.

Cheers

5 REPLIES 5

mvoros
Active Contributor
0 Kudos
96

Hi,

here is the link to really good presentation about generic programming ABAP351.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b332e090-0201-0010-bdbd-b735e96f...

It contains examples how to create dynamic structure and tables.

Cheers

Former Member
0 Kudos
95

any other inputs...

thanks

Tim

Former Member
0 Kudos
95

Hi,

You may try with field symbol.

try this link

http://help.sap.com/saphelp_46c/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm

Regards,

anirban

Former Member
0 Kudos
95

hi,

Plz refer to the link.

http://www.sap-basis-abap.com/sapab037.htm

Regards

Sumit Agarwal

Former Member
0 Kudos
95

Hi Babu,

This can be done through Field Symbols which allow you to access data objects dynamically in ABAP programs.

Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents.

For more info on Field Symbols you can refer help.sap.com

Regards,

Swapna.