‎2007 Sep 12 9:17 AM
Hi all,
Refer this code and answer my query.
data : ece1 LIKE J_1IEXCDTL-ECSRATE.
ece1 = ( 60000 / 1300 ) * 100 .
this program is going into dump at calculation part. the result of calculation is
4615.384615384615384615384 . but since ece1 is less than that size it is not getting assigned. i tried taking the value into packed decimal, char type and assigning to ece1. but still while assigning it to ece1 it is going into dump.I know that dump is due to mismatch in assigment. but can anyone tell me a way to assign it(like any function modules available).can anyone plz solve my problem.
if i take the value into type n i am getting rounded value. but i want value including decimal places.
Message was edited by:
KURUVELLA NAVEEN
Message was edited by:
KURUVELLA NAVEEN
Message was edited by:
KURUVELLA NAVEEN
‎2007 Sep 12 10:00 AM
data : ece1 LIKE J_1IEXCDTL-ECSRATE.
data ece TYPE p decimals 2.
<b>ece1 = ( 60000 / 1300 ).
ece = ece1 * 100.</b>WRITE / ece.
check if dis satisfies ur need.
Message was edited by:
abapuser
‎2007 Sep 12 9:22 AM
Hello Naveen,
Dump is due to mismatch of the type.
see you are declaring ece1 LIKE J_1IEXCDTL-ECSRATE. you need to pass values to ece1 those which are of type same as type of ECSRATE in J_1IEXCDTL.
Reward If Useful.
Regards
--
Sasidhar Reddy Matli.
‎2007 Sep 12 9:23 AM
This code is working fine for me
data ece1 type p decimals 4.
ece1 = ( 60000 / 1300 ) * 100 .
‎2007 Sep 12 9:26 AM
data : ece1 LIKE J_1IEXCDTL-ECSRATE.
data ece type n.
ece = ( 60000 / 1300 ) * 100 .
ece1 = ece.
plz reward if dis helps
‎2007 Sep 12 9:26 AM
Hi,
Normally ABAP Program allows 14 Decimal Places only.
But in your program the result consist of more than 31 places.
So the result is not fit for the field and it goes to dump error.
Thanks,
Reward If Helpful.
‎2007 Sep 12 9:28 AM
as i mentioned,first carry out calculation in type n variable n den move to ece1..
it works!!!!!!!!!
‎2007 Sep 12 9:51 AM
Hi naveen,
Once you use this declaration ece1 LIKE J_1IEXCDTL-ECSRATE.
it taken 7 chars in that 4decimal places so u r getting only 3 places before decimal part , for eg: 000.0000 (This is ur declaration).
But ur cala part giving 4615.384615384615384615384 , so its not possible to fit that value into 000.0000.
If u have any possibility then change declaration and use the variable which fits ur requirement.
Reward if it useful......
‎2007 Sep 12 10:00 AM
data : ece1 LIKE J_1IEXCDTL-ECSRATE.
data ece TYPE p decimals 2.
<b>ece1 = ( 60000 / 1300 ).
ece = ece1 * 100.</b>WRITE / ece.
check if dis satisfies ur need.
Message was edited by:
abapuser
‎2008 Jul 04 7:29 AM
‎2008 Jul 04 7:29 AM