cancel
Showing results for 
Search instead for 
Did you mean: 

Dump while converting amount in script

Former Member
0 Kudos

Dear all ,

I am facing a problem while passing a value retreived from the script.

i.e

read table intab index 1.

i am reading the value from intab and the value is in this format. 1,234.00

when passing this value to the variable defined for the import paramter of FM HR_IN_CHG_INR_WRDS of type PC207-BETRG

i am getting dump. saying 'Unable to interpret "1,234.00  " as a number.

and i tried to eliminate the comma by using

SELECT SINGLE DCPFM FROM USR01

INTO VAR_DCPFM WHERE BNAME EQ SY-UNAME.

IF VAR_DCPFM EQ 'X'.

REPLACE ALL OCCURRENCES OF ',' IN: V_DATA4 WITH ''.

TRANSLATE V_DATA4 USING ','.

ELSEIF VAR_DCPFM EQ ''.

REPLACE ALL OCCURRENCES OF '.' IN: V_DATA4 WITH ''.

TRANSLATE V_DATA4 USING '.'.

TRANSLATE V_DATA4 USING ',.'.

ELSEIF VAR_DCPFM EQ 'Y'.

TRANSLATE V_DATA4 USING ',.'.

ENDIF.

CONDENSE V_DATA4 NO-GAPS.

So that it will be in the format 1234.00

now also whenever we are passing this data to the defined variable for import parameter of FM HR_IN_CHG_INR_WRDS

i am getting dump saying Unable to interpret "1234.00  " as a number

can any one help me out how to solve the problem

Thanks & regards

sreehari

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

solved

former_member242255
Active Contributor
0 Kudos

please check the delcaraiton type of the variable.

Former Member
0 Kudos

Hi

Intab-value is passed to v_data4 which is of type c and length 19.

this is passed to v_data1 of type PC207-BETRG.

I am getting dump here

rameshkumar_ramasamy2
Participant
0 Kudos

Hi ,

Assign the result of that Value to a datatype which is declared as KWERT.

I mean packed decimal. Thn u assign that varaible to PC207-BETRG..

Data: lv_1 type KWERT.

Lv_1 = v_data4.

PC207-BETRG = lv_1.