12-16-2019 9:32 AM
Hi all,
please help me resolved it.
whats wrong with my code ?
when clm71 have a value = 15.202.500 and ADD to gv_jun. ABAP ERROR.
data begin of t_result_tmp OCCURS 0
....
gv_jun type p decimal 3.
END of t_result_tmp.
Thank you.
LOOP AT t_result.
ADD t_result-clm61 TO t_result_tmp-gv_jan. "Jan Manuring
ADD t_result-clm63 TO t_result_tmp-gv_feb. "Feb Manuring
ADD t_result-clm65 TO t_result_tmp-gv_mar. "Mar Manuring
ADD t_result-clm67 TO t_result_tmp-gv_apr. "Apr Manuring
ADD t_result-clm69 TO t_result_tmp-gv_mei. "Mei Manuring
ADD t_result-clm71 TO t_result_tmp-gv_jun. "Jun Manuring
ADD t_result-clm73 TO t_result_tmp-gv_jul. "Jul Manuring
ADD t_result-clm75 TO t_result_tmp-gv_aug. "Agu Manuring
ADD t_result-clm77 TO t_result_tmp-gv_sep. "Sep Manuring
ADD t_result-clm79 TO t_result_tmp-gv_okt. "Okt Manuring
ADD t_result-clm81 TO t_result_tmp-gv_nov. "Nov Manuring
ADD t_result-clm83 TO t_result_tmp-gv_dec. "Dec Manuring
ADD t_result-clm85 TO t_result_tmp-gv_tot. "Total
APPEND t_result_tmp.
ENDLOOP.
12-16-2019 10:08 AM
Hi,
I can see leading space in front of " 15,202.500". What is the type of this field?
i mean clm71 field type. Guess it is a char field which allowed Leading spaces and separators ","
Please assign it to a number field and continue with your addition operation.
Thank you.
12-17-2019 6:21 AM
all structure in internal table t_result is Char.
t_result_tmp LIKE t_result OCCURS 0 WITH HEADER LINE.
12-16-2019 10:13 AM
The field r_result-clm.. are not defined as number, should be CHAR is your number is XX,XXX.XXX (a nuber is XXXXX.XXX)
12-16-2019 11:37 AM
12-17-2019 12:41 AM
I think from the code of OP, what he want is sum value so t_result....shouldn't be CHAR.
12-16-2019 10:26 AM
The reason could be any of the below two reasons:
1) You are trying to store a character Value in a Number field due to which it is not able to interpret this value with ',' as a number.
2) You are trying to store the number in a format which is against the user format you have maintained.
Ideal solution would be for all Fields related to number (For eg, Currency , quantity field) use Write statement. This should solve your issue. Below Code for reference:
***Instead of
ADD t_result-clm61 TO t_result_tmp-gv_jan. "Jan Manuring
*** Use
WRITE t_result-clm61 TO t_result_tmp-gv_jan.
Regards!
12-16-2019 11:25 AM
It means that the kernel tries to convert a sequence of characters into a number, and that this sequence of characters is incorrect:
15,202.500
The comma is the problem as explained here:
12-16-2019 3:14 PM
before adding a CXHAR value eliminate the separating comma:
TRANSLATE t_result-clm61 USING ', '. "comma - space
CONDENSE t_result-clm61 NO-GAPS.
12-17-2019 12:46 AM
Can you tell us the type of CLMxx components? when you are doing mathematic on char type field, SAP will implicit convert them to number so if value in your table not a number then conversion failed.
07-22-2021 6:01 AM
The source fields should be of string or character datatype. Any field of numerical or date datatype may have caused the error that you are facing.
12-17-2021 6:15 PM