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: 

problem in multiply

Former Member
0 Kudos

hi gurus,

data: j type i,

n type i.

j = 10.

n = 20.

write j * n.

in above program can we write like that but anm getting error:unable to interpret *

12 REPLIES 12

former_member223537
Active Contributor
0 Kudos
data: j type i,
n type i.

j = 10.
n = 20.
n = n *  j.

write 😕  n.

0 Kudos

thanks but i know that,

am asking can we write like this

write j * n.

in abap or not

0 Kudos

Ali,

am asking can we write like this

write j * n.

in abap or not

Answer is not.

0 Kudos

Why don't you try it and see, rather than clogging up the forums with trivial questions.

0 Kudos

Ten (virtual) points to Matthew.

Rob

Former Member
0 Kudos

Hi,

The code which was wrote by you is syntactically wrong. If you want to multiply declare another variable and assign the multiplication value to that variable.

data: j type i,

n type i,

m type i.

j = 10.

n = 20.

m = j * n.

write m.

Former Member
0 Kudos

hi,

in ABAP you can't assign runtime vlue to write statement like this. Try this

data: j type i,
        n type i,
product type i .

j = 10.
n = 20.

product = j * n
write product.

former_member181995
Active Contributor
0 Kudos
data: j type i,
n type i,
result type i.

j = 10.
n = 20.
result = j * n.
write:result.

Former Member
0 Kudos

Hi,

try this code-

data: j type i,
n type i,
result type i.

j = 10.
n = 20.

Result = j  *  n.


write result.

Former Member
0 Kudos

Hi Ali,

No, you cannot write in that way.

Try the following:

data: j type i,
        n type i,
        w_mul type i .
j = 10.
n = 20.
 
w_mul  = j * n
write w_mul.

Regards,

Chandra Sekhar

Former Member
0 Kudos

Hi,

Declare another variable and store the result and use that variable to display the result in the list.

Thanks,

Sriram POnna.

Former Member
0 Kudos

hi,

its not possible in abap...

as u know we have to assign it to some variable and display that variable.

Rgds.,

subash