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: 

Help

Former Member
0 Kudos
134

Hi all,

How to define a variable which have dynamic length.

Thanks in advance.

Regards,

Swati

6 REPLIES 6

Former Member
0 Kudos
109

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

Former Member
0 Kudos
109

Hi

Declare that variable as type string

Former Member
0 Kudos
109

HI,

You can use the FIELD-SYMBOLS

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

Regards

Sudheer

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Kudos
109

Hi,

STRING TYPE is somthing which is variable in length.

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

Regards,

Sesh

Former Member
0 Kudos
109

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..

Former Member
0 Kudos
109

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