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

Short dump when division

Former Member
0 Likes
404

Hi All,

Im using a FM CLAF_CLASSIFICATION_OF_OBJECT to get the material classfication view values.

The internal table it_out is filled by the FM . now i have to calculate PC per carton, so i have to perform a division.

Now it_out-ausp1 has got the number, But not all the time, Im also getting values like ?, ' ', 220F, 55F and so on . Now if i do a division operation , its throwing me a short dump Unable to interpret ? as a number.

loop at it_out.

if it_out-smbez = 'FIBROUS STICK LENGTH'.

move it_out-ausp1 to ausp11.

endif.

if it_out-smbez = 'CARTON QUANTITY'.

move it_out-ausp1 to ausp12.

endif.

<b>it_final-pcpercar = ausp12 / ausp11.</b>

endloop.

Kindly letme know some possible solution to overcome this.

Thanks

S

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
354

Hi,

use

CATCH SYSTEM-EXCEPTION OTHERS = 7.
  it_final-pcpercar = ausp12 / ausp11.
ENDCATCH.
IF sy-subrc <> 0.
  clear it_final-pcpercar.
ENDIF

Regards,

Clemens

Hi All,

Im using a FM CLAF_CLASSIFICATION_OF_OBJECT to get the material classfication view values.

The internal table it_out is filled by the FM . now i have to calculate PC per carton, so i have to perform a division.

Now it_out-ausp1 has got the number, But not all the time, Im also getting values like ?, ' ', 220F, 55F and so on . Now if i do a division operation , its throwing me a short dump Unable to interpret ? as a number.

loop at it_out.

if it_out-smbez = 'FIBROUS STICK LENGTH'.

move it_out-ausp1 to ausp11.

endif.

if it_out-smbez = 'CARTON QUANTITY'.

move it_out-ausp1 to ausp12.

endif.

<b>it_final-pcpercar = ausp12 / ausp11.</b>

endloop.

Kindly letme know some possible solution to overcome this.

Thanks

S

1 REPLY 1
Read only

Clemenss
Active Contributor
0 Likes
355

Hi,

use

CATCH SYSTEM-EXCEPTION OTHERS = 7.
  it_final-pcpercar = ausp12 / ausp11.
ENDCATCH.
IF sy-subrc <> 0.
  clear it_final-pcpercar.
ENDIF

Regards,

Clemens