‎2013 Oct 15 4:46 PM
Hi Guys.
I have a code:
DATA:v_netpr TYPE I.
move w_itab-value to v_netpr.
w_final-netpr = v_netpr.
w_itab-value is currency 22 decimals 2
When move the value 3.000,00 to v_netpr occurs the dump attached.
How i can change my code ?
Thanks.
‎2013 Oct 15 4:55 PM
‎2013 Oct 15 4:55 PM
‎2013 Oct 15 4:57 PM
I upload from csv file to internal table with filed currency 22 decimals 2
‎2013 Oct 15 4:58 PM
‎2013 Oct 15 5:07 PM
He will be a bapi parameter and the parameter is decimals .
if I would change the field to char and move to decimal the dump occurs?
‎2013 Oct 15 4:57 PM
Check
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fd9358411d1829f0000e829fbfe/content.htm
Type I does not support decimals try with P.
Another thing, probably your csv file contains numerical values with ',' you have to convert these values to internal format (with '.') before move to numeric variables. ( 3000,00 to 3000.00 )
‎2013 Oct 15 5:00 PM
Hi Ronaldo,
if you define like I or Type I means it wont take decimal values ..it only takes round figure values like 10, 20, 30, 31.
define like this.
DATA:v_netpr TYPE p Decimals 2.
3.000,00
it will take will not go dump.
Regard's,
Hiriyappa
‎2013 Oct 15 5:00 PM
Hi Ronaldo,
The dump is not because of size.
Please use below piece of code in your 'When 2' condition and before move w_itab-value to v_netpr.
replace all occurances of ',' in w_itab-value with '.'
‎2013 Oct 15 5:13 PM
Hi
Are you sure w_itab-value is a decimal? I mean it's a numeric type?
Your dump is a typical error when it tries to move a char field to numeric field, but the numeric value is not in the right format in the char field
If w_itab-value is char, you should replace comma with point.
Max
‎2013 Oct 15 7:20 PM
I understood my mistake.
The field came from the csv file with comma and point when I removed them could proceed.
My code now.
CASE w_itab-col.
WHEN 1.
w_final-matnr = w_itab-value.
WHEN 2.
v_len = strlen( w_itab-value ).
v_cont = v_len - 3.
IF w_itab-value+v_cont(1) = ','.
v_move = w_itab-value(v_cont).
CLEAR w_itab-value.
w_itab-value = v_move.
ENDIF.
REPLACE '.' IN w_itab-value WITH space.
CONDENSE w_itab-value.
w_final-netpr = w_itab-value.
CLEAR:v_len,
v_cont,
v_move.
WHEN 3.
w_final-mwskz = w_itab-value.
WHEN 4.
w_final-j_1bnbm = w_itab-value.
APPEND w_final TO t_final.
ENDCASE.
‎2013 Oct 16 10:00 AM
Hi
but now in your code it seems you loose the decimal part?
If the number in csv file has format like this:
3.345.789,12
you need to delete the points (as you do it):
REPLACE ALL OCCURRENCES OF '.' IN W_ITAB-VALUE WITH SPACE.
CONDENSE W_ITAB-VALUE.
and then replace the comma with point:
REPLACE ',' WITH '.' IN W_ITAB-VALUE.
Max