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

Computation dilemma

aris_hidalgo
Contributor
0 Likes
582

Hello guys,

I am currently modifying a report where in I must replace all hardcoded computations with the values from a certain table. the fields which I will be getting values from is EWT and EWT2 from the ZTF0158 table. The value of EWT and EWT2 is 1.1 and 11 respectively but it can be changed anytime by the user. So in the program, instead of

lv_am1 = ( t_upload_ii-amount * lv_glob ) * 1.1

I would do instead:

lv_am1 = ( t_upload_ii-amount * lv_glob ) * v_tm_interco_ewt

***v_tm_interco_ewt gets its value from the ZTF0158 table.

But my problem is this, how can I change hard coded computations like the value .1 since the value in EWT is 1.1.So instead of .1 I would put in the variable v_tm_interco_ewt but it has a value of 1.1. I have posted below the code.

lv_ovat = ( t_upload_ii-amount - lv_ob ) * '.1'.

Help would greatly be appreciated.Thanks guys!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
562

TABLES: ZTF0158.

SELECT SINGLE EWT EWT2

INTO ( v_tm_interco_ewt , i_ewt2 )

FROM ZTF0158

.

lv_am1 = ( t_upload_ii-amount * lv_glob ) * v_tm_interco_ewt.

lv_ovat = ( t_upload_ii-amount - lv_ob ) * v_tm_interco_ewt.

Hello guys,

I am currently modifying a report where in I must replace all hardcoded computations with the values from a certain table. the fields which I will be getting values from is EWT and EWT2 from the ZTF0158 table. The value of EWT and EWT2 is 1.1 and 11 respectively but it can be changed anytime by the user. So in the program, instead of

lv_am1 = ( t_upload_ii-amount * lv_glob ) * 1.1

I would do instead:

lv_am1 = ( t_upload_ii-amount * lv_glob ) * v_tm_interco_ewt

***v_tm_interco_ewt gets its value from the ZTF0158 table.

But my problem is this, how can I change hard coded computations like the value .1 since the value in EWT is 1.1.So instead of .1 I would put in the variable v_tm_interco_ewt but it has a value of 1.1. I have posted below the code.

lv_ovat = ( t_upload_ii-amount - lv_ob ) * '.1'.

Help would greatly be appreciated.Thanks guys!

2 REPLIES 2
Read only

Former Member
0 Likes
563

TABLES: ZTF0158.

SELECT SINGLE EWT EWT2

INTO ( v_tm_interco_ewt , i_ewt2 )

FROM ZTF0158

.

lv_am1 = ( t_upload_ii-amount * lv_glob ) * v_tm_interco_ewt.

lv_ovat = ( t_upload_ii-amount - lv_ob ) * v_tm_interco_ewt.

Read only

Former Member
0 Likes
562

Hi viraylab

You have to declare another variable with decimal 1 for

ex.

data v_tm_interco_ewt(3) type c value '1.1'.

data v_tm_interco_ewt2 type p decimals 1.

v_tm_interco_ewt2 = v_tm_interco_ewt / 10.

write: v_tm_interco_ewt2.

<b>lv_ovat = ( t_upload_ii-amount - lv_ob ) * v_tm_interco_ewt2.</b>

regards

kishore