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

Create table daymicly

Former Member
0 Likes
380

HI All ,

I have field symbol structure (type any ) and i want to build a table from it how can i do that ?

the structure is like

str1

f1 type char10

f2 type string

f3 type i

etc

Regards

Joy

1 ACCEPTED SOLUTION
Read only

former_member186741
Active Contributor
0 Likes
354

it depends which release of sap you are on but if it's one of the latest you can use this:

types:

begin of ty1,

f1(10) type c,

end of ty1.

data: dr type ref to data, l_entry type ty1.

field-symbols: <table> type table, <entry> type ty1.

CREATE DATA dr typE table of ty1.

ASSIGN dr->* TO <table>.

l_entry-f1 = 'stuff'.

append 'stuff' to <table>.

loop at <table> assigning <entry>.

write:/ <entry>-f1.

endloop.

2 REPLIES 2
Read only

former_member186741
Active Contributor
0 Likes
355

it depends which release of sap you are on but if it's one of the latest you can use this:

types:

begin of ty1,

f1(10) type c,

end of ty1.

data: dr type ref to data, l_entry type ty1.

field-symbols: <table> type table, <entry> type ty1.

CREATE DATA dr typE table of ty1.

ASSIGN dr->* TO <table>.

l_entry-f1 = 'stuff'.

append 'stuff' to <table>.

loop at <table> assigning <entry>.

write:/ <entry>-f1.

endloop.

Read only

Former Member
0 Likes
354

Please refer to sap help .

[http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb387a358411d1829f0000e829fbfe/content.htm]