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

Help

Former Member
0 Likes
722

Hi all,

How to define a variable which have dynamic length.

Thanks in advance.

Regards,

Swati

6 REPLIES 6
Read only

Former Member
0 Likes
697

define it as type <b>i</b>(INT)

Read only

Former Member
0 Likes
697

Hi

Declare that variable as type string

Read only

Former Member
0 Likes
697

HI,

You can use the FIELD-SYMBOLS

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/field_sy.htm

Regards

Sudheer

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
697

Hi,

STRING TYPE is somthing which is variable in length.

Its handled differently at the runtime compared to any other type.

Regards,

Sesh

Read only

Former Member
0 Likes
697

Hi,

You can define a field symbol of Type any.

Field-symbols: <fs> type any.

At run time , you can assign a variable to this field.

Assign VAR1 to <fs>.

Then this field-symbol will have the length of the assigned Variable VAR1.

Pls reward if it is useful..

Read only

Former Member
0 Likes
697

HI Swati

check your variable length (mask)

  
data mask(100) type c.
data length type i value 10.

clear mask.
do length times.
concatenate mask '*' into mask.
enddo.

Reward all helpfull answers

Regards

krishna