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

arithmetic expression error

Former Member
0 Likes
2,952

hi gurus.........

the following arithmetic expression gets me error...pls help me ....

*wa_bseg-dmbtr = ( wa_konv-kwert * 11.33 ) / 100 ) - wa_bseg-dmbtr.*

ERROR is: incomplete arithmetic expression

Thank you

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,201

HI,

Try this

wa_bseg-dmbtr = ( ( wa_konv-kwert * 11.33  )  / 100 ) - wa_bseg-dmbtr.

15 REPLIES 15
Read only

Former Member
0 Likes
2,201

11.33 must in brackets.

Regards,

Shailaja

Read only

Former Member
0 Likes
2,201

Write like this

wa_bseg-dmbtr = ( ( wa_konv-kwert * 11.33 ) / 100 ) - wa_bseg-dmbtr

Read only

Former Member
0 Likes
2,202

HI,

Try this

wa_bseg-dmbtr = ( ( wa_konv-kwert * 11.33  )  / 100 ) - wa_bseg-dmbtr.

Read only

0 Likes
2,201

hi all ....i tried the way ...but STIL THE SAME ERROR

treid all combinations below

( ( wa_konv-kwert * 11.33 ) / 100 ) - ( wa_bseg-dmbtr )

( ( wa_konv-kwert * 11.33 ) / 100 ) - wa_bseg-dmbtr

( ( wa_konv-kwert * ( 11.33 ) / 100 ) ) - ( wa_bseg-dmbtr )

( ( wa_konv-kwert * 11.33 ) / 100 ) - wa_bseg-dmbtr

ERROR

Incomplete arithmetic expression: ")" missing at end of statement.

Statement "33" is not defined. Check your spelling.

Read only

0 Likes
2,201

hi,

try my logic, it works...

Rgds.,

subash

Read only

0 Likes
2,201

Hi

write it this way

( wa_konv-kwert * '11.33' / 100 ) - wa_bseg-dmbtr.

This works and its tested....

Regards,

Siddarth

Read only

0 Likes
2,201

Hi,

Try this way,

wa_bseg-dmbtr = ( ( wa_konv-kwert * 1133 ) / 10000 ) - ( wa_bseg-dmbtr ).

You cant provide numbers with decimal places.

Regards,

Shailaja

Read only

0 Likes
2,201

hi subash thanks problem is solved

Read only

0 Likes
2,201

Hi Shailaja ,

Who said that numbers cant be provided with decimals, just try giving the number with decimals in single quotes and then tell if it works or not

Regards,

Siddarth

Read only

0 Likes
2,201

hi,

Just declare a variable of packed decimal type containing the value '11.33'. And then use the variable in the arithmetic expression instead of putting the value directly into the expression.Please ensure that the number of opening brackets matches the number of closing brackets.

Hope this solves your problem.

thanks,

Abhijit

Read only

0 Likes
2,201

Hi Siddarth,

Numbers with decimals can be provided as variables. But what I meant was, we cant give the numbers with decimals as it is because the system takes the decimal point as period. So the part after the decimal point.... it takes as a next line.

Regards,

Shailaja

Read only

Former Member
0 Likes
2,201

hi:

Do like this

data lv_dmbtr type bseg-dmbtr.

lv_dmbtr = *wa_bseg-dmbtr

lv_dmbtr = ( ( wa_konv-kwert * 11.33 ) / 100 ) - lv_dmbtr.

Regards

Shashi

Read only

Former Member
0 Likes
2,201

I think U missed one '('

try this

wa_bseg-dmbtr = ( ( wa_konv-kwert * 11.33 ) / 100 ) - wa_bseg-dmbtr

Read only

Former Member
0 Likes
2,201

hi,

*wa_bseg-dmbtr = ( wa_konv-kwert * 11.33 ) / 100 ) - wa_bseg-dmbtr.*

change it to

data : lv_data type p decimals 2 value '11.33'.

wa_bseg-dmbtr = ( ( ( wa_konv-kwert * lv_data ) / 100 ) - wa_bseg-dmbtr ).

just copy and paste then check for syntax check.

Rgds.,

subash

Read only

Former Member
0 Likes
2,201

Your given problem is:

wa_bseg-dmbtr = ( wa_konv-kwert * 11.33 ) / 100 ) - wa_bseg-dmbtr.*

First problem in your expression is: 1 bracket is missing here.

Second problem in your expression is: you need to declare 11.33 as packed decimal.

Do the following declaration.

data : v_val type p decimals 2 value '11.33'.

and use v_val in your expression.The expression will sure work.

Best regards.

P.N. : I just tried in sap editor and found error until and unless i declared 11.33 as packed decimal.So declare it as a packed decimal and use it in your expression as a variable. It'll work.