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

Dump when move values.

ronaldo_aparecido
Contributor
0 Likes
1,693

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.


1 ACCEPTED SOLUTION
Read only

former_member188827
Active Contributor
0 Likes
1,463

Please share the data type of w_itab-value.

Regards

10 REPLIES 10
Read only

former_member188827
Active Contributor
0 Likes
1,464

Please share the data type of w_itab-value.

Regards

Read only

0 Likes
1,463

I upload from csv file to internal table with filed currency 22 decimals 2

Read only

0 Likes
1,463

Share the declaration of internal table.

Regards

Read only

0 Likes
1,463

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?

Read only

Former Member
0 Likes
1,463

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 )

Read only

hiriyappa_myageri
Participant
0 Likes
1,463

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

Read only

hemanth_kumar21
Contributor
0 Likes
1,463

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 '.'

Read only

Former Member
0 Likes
1,463

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

Read only

0 Likes
1,463

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.

Read only

0 Likes
1,463

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