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

dynamically create data type for structure

Former Member
0 Likes
916

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
Read only

mvoros
Active Contributor
0 Likes
860

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
Read only

mvoros
Active Contributor
0 Likes
861

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

Read only

Former Member
0 Likes
860

any other inputs...

thanks

Tim

Read only

Former Member
0 Likes
860

Hi,

You may try with field symbol.

try this link

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

Regards,

anirban

Read only

Former Member
0 Likes
860

hi,

Plz refer to the link.

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

Regards

Sumit Agarwal

Read only

Former Member
0 Likes
860

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.