‎2008 Jan 14 5:51 AM
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.
‎2008 Jan 14 5:58 AM
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
‎2008 Jan 14 5:55 AM
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
‎2008 Jan 14 5:56 AM
‎2008 Jan 14 5:57 AM
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
‎2008 Jan 14 5:58 AM
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
‎2008 Jan 14 6:07 AM
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