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

Syntax Help

Former Member
0 Likes
756

Hi,

I'm new to ABAP, i coded the below statements, when i check i get the message:

E:Incomplete arithmetic expression: ")" missing at end of statement. Can anyone please let me what is the issue with the below code.

deno1 = ( ( 60 ) / ( SOURCE_FIELDS-/BIC/ZKPICKSPH ) ) + ( ppha ).

deno2 = ( ( 60 ) / ( tpph ) ) + ( ppha ).

if deno1 = '0'.

overpc1 = ( ( SOURCE_FIELDS-/BIC/ZKEMPIPHR ) / ( 60 / 0.0001 ) ) * 100.

else.

overpc1 = ( SOURCE_FIELDS-/BIC/ZKEMPIPHR / ( 60 / deno1 ) ) * 100.

endif.

if deno2 = '0'.

overpc2 = ( SOURCE_FIELDS-/BIC/ZKEMPIPHR / ( 60 / 0.0001 ) ) * 100.

else.

overpc1 = ( SOURCE_FIELDS-/BIC/ZKEMPIPHR / ( 60 / deno2 ) ) * 100.

endif.

Thanks,

AM

4 REPLIES 4
Read only

Former Member
0 Likes
665

what is this /BIC/ZKEMPIPHR?

/ can be taken as division operator every where. can you rename the above variable

Read only

0 Likes
665

Hi,

Thanks for your reply. /BIC/ZKEMPIPHR is structure, this is a code for a BW routine. There are no issues with this field. I guess the issue is with the usage of "(" and ")".

Thanks,

AM

Read only

0 Likes
665

Try like this



deno1 = ( ( 60 ) / ( SOURCE_FIELDS-/BIC/ZKPICKSPH ) ) + ( ppha ).
deno2 = ( ( 60 ) / ( tpph ) ) + ( ppha ).

if deno1 = '0'.
overpc1 = ( ( SOURCE_FIELDS-/BIC/ZKEMPIPHR ) / ( 60 / 0.0001 ) ) * 100.
else.
overpc1 = ( ( SOURCE_FIELDS-/BIC/ZKEMPIPHR )  / ( 60 / deno1 ) ) * 100.
endif.

if deno2 = '0'.
overpc2 = ( ( SOURCE_FIELDS-/BIC/ZKEMPIPHR ) / ( 60 / 0.0001 ) ) * 100.
else.
overpc1 = ( ( SOURCE_FIELDS-/BIC/ZKEMPIPHR )  / ( 60 / deno2 ) ) * 100.
endif.

Read only

Former Member
0 Likes
665

Hi,

You are rgt...the problem is with the brackets. Give a space after and before the brackets.It should work fine.

Regards,

Ramya Shree