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

Table with String data type ???

Former Member
0 Likes
12,689

Hello Friends,

Is it possible to create a structure with one of the field of type STRING ?

and later on can we use that structure for the Table ?

Thanks for your time.

1 ACCEPTED SOLUTION
Read only

Former Member
5,991

Hi,

Use Data Element ALVSTLI or ALPFSTRING to create a field of type STRING in the structure - In case you want to create a structure in the Data dictionary.

For creating a Structure in a program.

Use:

TYPES:

begin of ty_struc,

field1 type string,

field2 type c,

field3 type i,

End of ty_struc.

data: itab type table of ty_struc.

data: wa type ty_struc.

Cheers!!!

Lokesh

Edited by: Lokesh Aggarwal on Dec 28, 2007 3:31 PM

6 REPLIES 6
Read only

Former Member
0 Likes
5,991

Hi

you can use field type

field like tline-tdline.

Reward if helpful

vivekanand

Read only

0 Likes
5,991

Hi

you can use field type

field like tline-tdline.

Reward if helpful

vivekanand

Read only

Former Member
5,992

Hi,

Use Data Element ALVSTLI or ALPFSTRING to create a field of type STRING in the structure - In case you want to create a structure in the Data dictionary.

For creating a Structure in a program.

Use:

TYPES:

begin of ty_struc,

field1 type string,

field2 type c,

field3 type i,

End of ty_struc.

data: itab type table of ty_struc.

data: wa type ty_struc.

Cheers!!!

Lokesh

Edited by: Lokesh Aggarwal on Dec 28, 2007 3:31 PM

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
5,991

Yes, you can.



Types: begin of struct,
       fld1(10) type c,
       flds type string,
       end of struct.
data: itab type table of struct.
data: wa like line of itab.   

Regards,

RIch Heilman

Read only

0 Likes
5,991

Basically it is the same for defining structures and table types in the ABAP dictionary. Check out table type STRING_TABLE

Regards,

Rich Heilman

Read only

0 Likes
5,991

Thanks all for your valuable response.

The one solution which worked for me is ALPFSTRING .