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

Runtime error in data type

Former Member
0 Likes
898

i written following code in subroutine for script.

it is giving runtime error as " UNABLE TO INTERPRET 10,000 AS A NUMBER .

And it is indicating error in the line

a_skfbt = in_tab-value.

pls suggest me solution.

form whd_tax tables in_tab structure itcsy

out_tab structure itcsy.

data: A_SKFBT type regup-skfbt,

A_WRBTR type regud-wrbtr ,

C_WTAX TYPE regud-skfbt.

*break-point.

read table in_tab WITH KEY NAME = 'REGUP-SKFBT'.

check sy-subrc = 0.

A_SKFBT = in_tab-value.

read table in_tab WITH KEY NAME = 'REGUD-WRBTR'.

check sy-subrc = 0.

A_WRBTR = in_tab-value.

C_WTAX = A_SKFBT - A_WRBTR.

  • and shkzg = 'H'.

read table out_tab index 1.

check sy-subrc = 0.

out_tab-value = C_WTAX.

modify out_tab index 1.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
828

Try using FM: TELNUMBER_REMOVE_SPECIAL_CHAR before moving the value to a_skfbt.

Note that this FM will treat decimal point as special char as well.

Kind Regards

Eswar

Just found another FM: C14W_CHAR_NUMBER_CONVERSION. This keeps the decimal point intact.

Edited by: Eswar Rao Boddeti on Jan 14, 2008 2:04 PM

5 REPLIES 5
Read only

Former Member
0 Likes
828

Hi Venkat

Comma (',') is not recognised as a decimal separator format internally in SAP. In this statement

a_skfbt = in_tab-value.

a_skfbt --> Is a currency field, so this won't take comma.

Remove comman from itab-value and put '.' (Dot) as decimal separator and then move it to a_skfbt. That should solve your problem.

~ Ranganath

Read only

Vijay
Active Contributor
0 Likes
828

hi

please check if the data type of

a_skfbt and in_tab-value is same or not .

i think it is giving error bcoz of there type mismatch.

regards

vijay

reward points if helpfull

Read only

Former Member
0 Likes
828

read table in_tab WITH KEY NAME = 'REGUP-SKFBT'.

check sy-subrc = 0.

A_SKFBT = in_tab-value.

read table in_tab WITH KEY NAME = 'REGUD-WRBTR'.

check sy-subrc = 0.

Dont use single quotes.

Give it as

read table in_tab WITH KEY NAME = REGUP-SKFBT.

read table in_tab WITH KEY NAME = REGUD-WRBTR.

Regards,

Nishant

Read only

Former Member
0 Likes
829

Try using FM: TELNUMBER_REMOVE_SPECIAL_CHAR before moving the value to a_skfbt.

Note that this FM will treat decimal point as special char as well.

Kind Regards

Eswar

Just found another FM: C14W_CHAR_NUMBER_CONVERSION. This keeps the decimal point intact.

Edited by: Eswar Rao Boddeti on Jan 14, 2008 2:04 PM

Read only

Former Member
0 Likes
828

Hi Venkat

I have written the following code and it is not giving me any error:

DATA: in_tab TYPE STANDARD TABLE OF itcsy,

out_tab TYPE STANDARD TABLE OF itcsy.

PERFORM whd_tax TABLES in_tab

out_tab.

&----


*& Form whd_tax

&----


  • text

----


  • -->PA_IN_TAB text

  • -->PA_OUT_TAB text

----


FORM whd_tax TABLES pa_in_tab STRUCTURE itcsy

pa_out_tab STRUCTURE itcsy.

DATA: a_skfbt TYPE regud-sskfb,

a_wrbtr TYPE regud-wrbtr ,

c_wtax TYPE regud-sskfb.

READ TABLE pa_in_tab WITH KEY name = 'REGUP-SKFBT'.

CHECK sy-subrc = 0.

a_skfbt = pa_in_tab-value.

READ TABLE pa_in_tab WITH KEY name = 'REGUD-WRBTR'.

CHECK sy-subrc = 0.

a_wrbtr = pa_in_tab-value.

c_wtax = a_skfbt - a_wrbtr.

READ TABLE pa_out_tab INDEX 1.

CHECK sy-subrc = 0.

pa_out_tab-value = c_wtax.

MODIFY pa_out_tab INDEX 1.

ENDFORM. "whd_tax

Please let me know what is your exact problem?

I am working in ECC 5.0.

Thanks and Regards

Shivika Bhorchi