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: 

Typecasting Variables

Former Member
0 Kudos
215

Hi,

I want to type cast a variable in ABAP.

I have a variable of type STRING. I want to pass this string to the function module 'STRING_SPLIT_AT_POSITION'. However, this function takes in a type C. How can I convert (or type cast) my STRING to C in ABAP?

Thanks,

1 REPLY 1

ramki_maley
Active Contributor
0 Kudos
55

Declare a character variable and assign the string to it. I do not remember what is the size limit for a char variable.

vstring type string,

vchar(128) type c.

vcharr = vstring.

If your string is larger, see FM STRING_SPLIT. You may have to call this in a loop until the complete string is processed.

Cheers,

Ramki.