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

problem in multiply

Former Member
0 Likes
1,151

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
Read only

Former Member
0 Likes
1,109
data: j type i,
n type i.

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

write :/  n.
Read only

0 Likes
1,109

thanks but i know that,

am asking can we write like this

write j * n.

in abap or not

Read only

0 Likes
1,109

Ali,

am asking can we write like this

write j * n.

in abap or not

Answer is not.

Read only

matt
Active Contributor
0 Likes
1,109

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

Read only

0 Likes
1,109

Ten (virtual) points to Matthew.

Rob

Read only

Former Member
0 Likes
1,109

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.

Read only

Former Member
0 Likes
1,109

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.

Read only

Former Member
0 Likes
1,109
data: j type i,
n type i,
result type i.

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

Former Member
0 Likes
1,109

Hi,

try this code-

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

j = 10.
n = 20.

Result = j  *  n.


write result.

Read only

Former Member
0 Likes
1,109

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

Read only

Former Member
0 Likes
1,109

Hi,

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

Thanks,

Sriram POnna.

Read only

Former Member
0 Likes
1,109

hi,

its not possible in abap...

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

Rgds.,

subash