2008 Nov 11 6:51 AM
hi ,
I am doing a mathematical calculation as follows where all the fields are type C.
IT_FINAL-LENGTH = ( IT_FINAL-LENGTH * IT_FINAL-UMVKZ ) / IT_FINAL-UMVKN.
i am using the following code to catch the convt_no_number error. in some of the systems the decimal format is different , so i had to use Catch system-exceptions.
But now the problem i am facing is : inside CATCH SYSTEM-EXCEPTIONS
the mathematical calculation is not happening.
IT_FINAL-LENGTH = 2,000.00
IT_FINAL-UMVKZ ) = 1
IT_FINAL-UMVKN = 1000.00
i should get IT_FINAL-LENGTH = 2. BUT THE CALCULATION IS NOT being processed inside the CATCH statement.
How can i solve this. should i change the declaration of the field types.
CATCH SYSTEM-EXCEPTIONS CONVT_NO_NUMBER = 1.
IT_FINAL-LENGTH = ( IT_FINAL-LENGTH * IT_FINAL-UMVKZ ) / IT_FINAL-UMVKN.
ENDCATCH.
IF SY-SUBRC = 1.
CLEAR SY-SUBRC.
WHILE SY-SUBRC = 0.
REPLACE ',' WITH SPACE INTO IT_FINAL-LENGTH.
ENDWHILE.
CLEAR SY-SUBRC.
WHILE SY-SUBRC = 0.
REPLACE '.' WITH SPACE INTO IT_FINAL-LENGTH.
ENDWHILE.
CONDENSE IT_FINAL-LENGTH NO-GAPS.
ENDIF.
MODIFY IT_FINAL.
Thanks.
Vikki.
Why you are using Character type for all variables, you should use appropriate numeric types while calculation and then you have to move them to character variables.
So consider changing the type of the variables.
Regards
Karthik D
2008 Nov 11 7:11 AM
2008 Nov 11 7:38 AM
Why you are using Character type for all variables, you should use appropriate numeric types while calculation and then you have to move them to character variables.
So consider changing the type of the variables.
Regards
Karthik D
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |