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

convert or cast a value

Former Member
0 Likes
827

Hello!

I' m sorry for asking the question not correctly.

Therefore let me draft the question once more in a seperate posting

How can I convert or cast a variable (value)

to get below described results:

The main goal is removing the zeros

"zs_vmeng = has the type QUAN length is 15 and decimal

" places are 3.

data var1 type zs_vmeng .

data var2 type zs_vmeng .

var1 = '56.7'

var2 = 789

usually you will see in debugger

FOR var1 56.700

FOR var2 789.000

The goal is get in the debugger

or in the variable

FOR -> var1 56.7

FOR -> var2 789.

Regards

Ilhan Ertas

Hello!

I' m sorry for asking the question not correctly.

Therefore let me draft the question once more in a seperate posting

How can I convert or cast a variable (value)

to get below described results:

The main goal is removing the zeros

"zs_vmeng = has the type QUAN length is 15 and decimal

" places are 3.

data var1 type zs_vmeng .

data var2 type zs_vmeng .

var1 = '56.7'

var2 = 789

usually you will see in debugger

FOR var1 56.700

FOR var2 789.000

The goal is get in the debugger

or in the variable

FOR -> var1 56.7

FOR -> var2 789.

Regards

Ilhan Ertas

5 REPLIES 5
Read only

Former Member
0 Likes
702

data var1 type zs_vmeng .

data var2 type zs_vmeng .

data: v_char(20).

var1 = '56.7'

var2 = 789

write var1 to v_char1 decimals 1.

write var2 to v_char1 decimals 0.

Or

move var1 to v_char1.

move var2 to v_char2.

Regards,

Ravi

Read only

0 Likes
702

Ravi please notice no character as end value

the type of the variables must have remain the same.

The goal is to not show the zeros. I know to move a value

into a char or integer field can manupulate the value

but this not the intention.

before

type zs_vmeng

789.000

later

type zs_vmeng AND NOT CHAR OR INT

789

regards

ilhan

Read only

Former Member
0 Likes
702

Hi,

Define two varaibles;

One is <b>V_no1 type P decimals 1</b> : Move the var1 of your program to this.

It display 56.7

second declare <b>V_no2 type I</b> and move Var2 of your code to this, it displays 789.

regards,

Anji

Read only

0 Likes
702

hello Anji type I (integer) removes or cuts decimal places !

Reagrds

Ilhan

Read only

Former Member
0 Likes
702

just check in your previous thread if my second post is also not working pls let us know what wrong things you are getting..

regards

shiba dutta