08-28-2006 6:42 AM
Hello All,
I have a issue with the Declarations of fields:
1st Condition:
Data: CALRATEGC type P decimals 5.
if calrategc gt '9999.99999'.
calrategc = '9999.99999'.
endif.
2ndCondition:
Data:f_cal_rate_gc like BAPIACCR09-AMT_DOCCUR.(DEC 23 Decimal 4)
shift exch_rate_gc left deleting leading space.
exrate_gc = ( p_line_item-dmbtr1 / p_line_item-wrbtr ).
ftact_gc = ( ffact_gc / tfact_gc ).
f_cal_rate_gc = exrate_gc * ftact_gc.
calrategc = f_cal_rate_gc. <b><--</b>
So, at this point as f_cal_rate_gc (Value 12,117,999,990.0000)is moved to calrategc i am receiving an Dump. How can i overcome this issue.
Please provide certain pointers to overcome this.
Regards,
-PSK
08-28-2006 6:47 AM
08-28-2006 6:52 AM
Hello Chandrasekhar,
I receive the message :
A calculation field is defined too small.
The reason for the exception is:
A value generated during processing is too large for the
field "CALRATEGC" of the program "ZJVUPLOAD".
shift exch_rate_gc left deleting leading space.
exrate_gc = ( p_line_item-dmbtr1 / p_line_item-wrbtr ).
ftact_gc = ( ffact_gc / tfact_gc ).
f_cal_rate_gc = exrate_gc * ftact_gc.
>calrategc = f_cal_rate_gc.
if calrategc lt '0'.
calrategc = calrategc * -1.
else.
calrategc = calrategc.
endif.
This is how my Code looks and the Arrow mark pointed above indicates the line the Dump occured.
Regards,
PSK
08-28-2006 7:00 AM
Hi Sravan,
For TYPE P , maximim allowed length is only 16, and u rassigning more than that to the field calrategc , declare <b>calrategc</b> also as type BAPI<b>ACCR09-AMT_DOCCUR</b>
08-28-2006 7:07 AM
Hi Chandrasekhar,
Thanks for the posting.
Declaring 'calrategc' as like BAPIACCR09-AMT_DOCCUR would solve the issue but,
I have a rule that needs to be considered which comes right after the code that i have provided in my earlier posting:
if calrategc gt '9999.99999'. <-- 9999.99999 is Hardcoded
calrategc = '9999.99999'.
endif.
So, by declaring calrategc as like BAPIACCR09-AMT_DOCCUR will the above condition get validated.
Regards,
PSK
08-28-2006 7:13 AM
i am afraid the 5th decimal will get truncated,
check out if there is any other dataelement with decimals 5 and try out
08-28-2006 8:29 AM
08-28-2006 7:03 AM
Hi,
declare calrategc also as type BAPIACCR09-AMT_DOCCUR
Currently u declaed as TYPE p.
For TYPE P , maximim allowed length is only 16, and u reassigning more than that to the field calrategc.
08-28-2006 7:13 AM
Mr.Sravan,
Dump is caused because of data type/length mismatching.
In the declararion of fields, U defined a variable of type P decimals 5. A Packed data type can accomidate a max. lenght of 16, where as field f_cal_rate_gc has (DEC 23 Decimal 4). Because of length mismatch, it is causing short dump.
If helpful, reward points.
Rgds,
CK