Skip to Content
0

calculation field is defined too small when using a SAP function in Query

Nov 10, 2016 at 01:57 PM

663

avatar image

Hi folks,

I applied a SAP function which is to convert amount in local currency. I got the below short dump when I execute the job.

"Calculation field is defined too small.[SAP NWRFC 720][SAP Partner 740 ]

The calculate field is decimal. I made the target table larger which did not help. In the Query, I'm not able to edit on the type of calculation field.

Please give me some help! Thanks!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Dirk Venken
Nov 10, 2016 at 03:40 PM
0

This is not a DS error. The error message comes from the SAP function. Which function do you call? What are the values you pass?

Show 2 Share
10 |10000 characters needed characters left characters exceeded

I called a custom function we called 'Z_CONVERT_TO_LOCAL_CURR_RFC'. This function is copied from SAP function' CONVERT_TO_LOCAL_CURRENCY'. ( We have to create a custom function since the original function is not allowed to change the Process Type to 'Remote-Enabled module'.)

The code like this

CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'

EXPORTING client = client date = date foreign_amount = foreign_amount foreign_currency = foreign_currency local_currency = local_currency rate = rate type_of_rate = type_of_rate read_tcurr = read_tcurr

IMPORTING exchange_rate = exchange_rate foreign_factor = foreign_factor local_amount = local_amount local_factor = local_factor exchange_ratex = exchange_ratex fixed_rate = fixed_rate derived_rate_type = derived_rate_type EXCEPTIONS no_rate_found = 1 overflow = 2 no_factors_found = 3 no_spread_found = 4 derived_2_times = 5. CASE sy-subrc. WHEN 0. WHEN 1. RAISE no_rate_found. WHEN 2. RAISE overflow. WHEN 3. RAISE no_factors_found. WHEN 4. RAISE no_spread_found. WHEN 5. RAISE derived_2_times. ENDCASE.

I also attached the input and output. Thanks!

input.jpg (47.1 kB)
output.jpg (41.7 kB)
0

Dump Message

dump.jpg (143.8 kB)
0
Dirk Venken
Nov 10, 2016 at 04:38 PM
0

That confirms my answer. There's a FOREIGN_AMOUNT value resulting in a too high value for EXCHANGE_RATEX. Can you run data profiling on the input column?

Show 1 Share
10 |10000 characters needed characters left characters exceeded

I removed the variable from FOREIGH_AMOUNT, instead of, hardcode a value 50.00. It still return the same message.:( Thanks!

hardcode-data.jpg (48.2 kB)
0
CC Gao Nov 10, 2016 at 05:15 PM
0

I changed the data type of EXCHANGE_RATEX. Then the previous warning has gone. But there is a new one.

R/3 CallReceive warning: <Function Z_CONVERT_TO_LOCAL_CURR_RFC: RFC_ABAP_EXCEPTION-(Exception_Key: NO_RATE_FOUND, Enter 3300 / USD rate type M for 2009.04.15 in the system settings)[SAP NWRFC 720][SAP Partner 740

I have put 'Rate' as default value 0 / 8/4.11....etc.. Not sure what kind of value should put here. Please advise.

Thanks!


input.jpg (47.1 kB)
Share
10 |10000 characters needed characters left characters exceeded
Peter Houston
Nov 10, 2016 at 05:56 PM
0

I suggest testing your function in se37 before trying to use in Data Services.

Share
10 |10000 characters needed characters left characters exceeded