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

Dynamic type of variable

Former Member
0 Likes
713

Hi everyone,

i would like to create a dynamic type of variable but I am not really sure how to do it. I already know that the type is char but the length is going to be variable, depends on the execution.

DATA: lv_number(lv_variable_length) TYPE c.

I made that but it does not work

Anyone can help me please? Thanks in advanced!

Moderator message: Please search in SCN before posting, there are lot of threads available regarding this topic. ( search for "Dynamic variable creation" )

Message was edited by: Kesavadas Thekkillath

Hi everyone,

i would like to create a dynamic type of variable but I am not really sure how to do it. I already know that the type is char but the length is going to be variable, depends on the execution.

DATA: lv_number(lv_variable_length) TYPE c.

I made that but it does not work

Anyone can help me please? Thanks in advanced!

Moderator message: Please search in SCN before posting, there are lot of threads available regarding this topic. ( search for "Dynamic variable creation" )

Message was edited by: Kesavadas Thekkillath

2 REPLIES 2
Read only

Former Member
0 Likes
676

Dear Borja Huerta,

Don't you try to use Field symbol ?

field-symbols: <fs_matnr> type any.

ASSIGN : lwa-matnr TO <fs_matnr>.

Regards,

Yance

Read only

0 Likes
676

Hi Yance,

It a really good answer but i am not going to know the type never. I only know that the type it's gonna be always char but the problem is the length.... sometime i would like to create a variable DATA: lv_number(20) TYPE c. another times i have to create a variable DATA: lv_number(4) TYPE c.