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

Multiply Keyword...

Former Member
0 Likes
965

hi all,

i want to multiply two fields, i m using multiply keyword as

MULTIPLY OBJ1 BY OBJ2.

BUT IT IS GIVING ERROR AS MULTIPLY NOT EXPECTED.

REGARDS,

YUNUS

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
923

data: f1 type i value 3,

f2 type i value 4,

f3 type i.

f3 = f1 * f2.

write : f3.

or

data: f1 type i value 3,

f2 type i value 4,

multiply f1 by f2.

write : f1.

hi all,

i want to multiply two fields, i m using multiply keyword as

MULTIPLY OBJ1 BY OBJ2.

BUT IT IS GIVING ERROR AS MULTIPLY NOT EXPECTED.

REGARDS,

YUNUS

7 REPLIES 7
Read only

Former Member
0 Likes
924

data: f1 type i value 3,

f2 type i value 4,

f3 type i.

f3 = f1 * f2.

write : f3.

or

data: f1 type i value 3,

f2 type i value 4,

multiply f1 by f2.

write : f1.

Read only

Former Member
0 Likes
923

Hi yunus,

1. Ideally it should work.

2. There might be some typing / minor mistake.

3. just copy paste and check, if this works.

4.

report abc.

data : a type i,

b type i,

c type i.

*----


a = 5.

b = 10.

multiply a by b.

write a. "---50

regards,

amit m.

Read only

Former Member
0 Likes
923

Did you see if you have ended the previous statement with a period?

This works fine in my system.

Regards,

Ravi

Read only

Former Member
0 Likes
923

hi


data : obj1 type i.
data : obj2 type i.

MULTIPLY OBJ1 BY OBJ2.

does not give me any error..

please check your previous statements..

regards

satesh

Read only

Former Member
0 Likes
923

hi,

use

OBJ1 * OBJ2.

alternatively see this eg:

DATA: DAYS_PER_YEAR TYPE P VALUE 365,

HOURS_PER_DAY TYPE F VALUE '24.0',

MINUTES_PER_YEAR TYPE I VALUE 1.

MULTIPLY MINUTES_PER_YEAR BY DAYS_PER_YEAR.

MULTIPLY MINUTES_PER_YEAR BY HOURS_PER_DAY.

MULTIPLY MINUTES_PER_YEAR BY 60.

rgds,

latheesh

Message was edited by: Latheesh Kaduthara

Read only

Former Member
0 Likes
923

Hi Yunus,

REPORT test.

*

data: i type i value 10.

data: j type i value 20.

*

write: i, j.

*

multiply i by j.

*

write: i, j.

This works correct.

Which Declaration do you have for OBJ1 and OBJ2.

Regards, Dieter

Read only

Former Member
0 Likes
923

Hi,

what is the <b>data type of the fields OBJ1 and OBj2</b>. MULTIPLY supports only I,P and F fields.

MULTIPLY OBJ1 BY OBJ2 is a correct statement only where OBJ1 will contained the result.

equivalent to

OBJ1 = OBJ1 * OBJ2.

Regards,

Aswin