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

CONVT_NO_NUMBER ERROR

Former Member
0 Likes
487

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.

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.

2 REPLIES 2
Read only

Former Member
0 Likes
426

hi ,

anyone to help me out to solve this .

Vikki.

Read only

0 Likes
426

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