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

Former Member
0 Likes
561

Hi

I hwve problem in the following code. I am trying to multiply IT_DETAIL-DMBTR (value is 10,000) to -1. But output is 0 instead of -10,000.

Pls help me

ELSEIF  IT_DETAIL-BLART = 'SA' and IT_DETAIL-SHKZG = 'H'.  " AND it_detail-sgtxt(2) = 'DR'.   
 IT_SUM-MACHINE = ( IT_DETAIL-DMBTR ) * ( -1 ).

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
527

Hello Kumar

Assuming that IT_SUM-MACHINE allows for negative values (do we know???) then you may try another calculation:

IT_SUM-MACHINE = 0.
IT_SUM-MACHINE = IT_SUM-MACHINE - IT_DETAIL-DMBTR.

However, I assume that the problem lies in the type definition of MACHINE.

Regards

Uwe

2 REPLIES 2
Read only

uwe_schieferstein
Active Contributor
0 Likes
528

Hello Kumar

Assuming that IT_SUM-MACHINE allows for negative values (do we know???) then you may try another calculation:

IT_SUM-MACHINE = 0.
IT_SUM-MACHINE = IT_SUM-MACHINE - IT_DETAIL-DMBTR.

However, I assume that the problem lies in the type definition of MACHINE.

Regards

Uwe

Read only

Former Member
0 Likes
527

you can do this also.

IT_SUM-MACHINE = IT_DETAIL-DMBTR * -1 .

What is the declaration of IT_SUM-MACHINE..?