Application Development 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: 

Type Declarations

Former Member
0 Kudos

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

8 REPLIES 8

Former Member
0 Kudos

can u show the error analysis of dump

0 Kudos

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

Former Member
0 Kudos

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>

0 Kudos

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

0 Kudos

i am afraid the 5th decimal will get truncated,

check out if there is any other dataelement with decimals 5 and try out

0 Kudos

is ur problem solved??

reward if helpful

Former Member
0 Kudos

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.

Former Member
0 Kudos

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