‎2009 Nov 27 12:51 PM
Hi,
I have declared fields BEWEG (Internal Movements) and netto (Net Volume) for a internal table. The data type of these fields is mseg-menge.
Sometimes when the value is negative like 578.000-, in internal table it stores as *8.00-.
It goes for dump when i try to do addition using this.
Why is that * coming in the value?
Is it because of lengh?
But for positve values, it works fine.
Ezhil.
‎2009 Nov 27 12:56 PM
Hi,
can you please show the declaration of the fields.
regards, Dieter
Sorry i have seen mseg-menge.
Edited by: Dieter Gröhn on Nov 27, 2009 1:58 PM
‎2009 Nov 27 12:58 PM
YPES: BEGIN OF ITEM,
werks1 LIKE T001L-WERKS,
LGORT1 LIKE T001L-LGORT,
zypom LIKE zys_mara-zypom,
lgobe1(50),
bukrs1 LIKE t001k-bukrs,
stloc LIKE zyt001l-zystloc,
flag LIKE zyt001l-zyflag,
zyfrb like zys_mara-zyfrb,
zyqua like zys_mara-zyqua,
anfang LIKE mard-labst,
prod LIKE mseg-menge, "MN210704
beweg LIKE mseg-menge, "MN210704
netto LIKE mseg-menge,
other LIKE mseg-menge,
adjust LIKE mseg-menge,
verk LIKE mseg-menge,
return LIKE mseg-menge,
end1 LIKE mard-vmlab,
diff LIKE mseg-menge,
zyppg like zys_mara-zyppg,
zytcd like zys_mara-zytcd,
zydt1 like zys_mara-zydt1,
zyfil Like zys_mara-zyfil,
zytyp like zys_mara-zytyp,
zymer like zys_mara-zymer,
add LIKE mseg-menge,
END OF ITEM.
‎2009 Nov 27 1:02 PM
MSEG-MENGE points to domain MENG13 which does not allow the negative sign. You should change the declaration to a field that allows negative values (e.g. MSKU-LABST which uses domain MENG13V).
Thomas
‎2009 Nov 27 1:04 PM
Hi,
i have tried this and there are no problems.
data menge like mseg-menge.
*
menge = 578000.
*
write: / menge.
*
menge = menge * ( -1 ).
*
write: / menge.
*
add 1000000 to menge.
*
write: / menge.
*
Regards, Dieter
‎2009 Nov 27 1:26 PM
Hello Thomas,
I think if you read the F1 help for the "Sign" attribute of the domain. It says that:
If the flag is not set but the field contains negative values, problems might occur during screen output
I personally declare many amount fields as WRBTR & based on Debit/Credit indicator multiply with '-1'. May be i have been doing this incorrect all way wrong.
Plz clarify.
BR,
Suhas
‎2009 Nov 27 2:56 PM
I think you guys are right, this flags matters for screen output. But then it is a mystery to me how the OP is generating this problem.
Thomas
‎2009 Nov 27 1:48 PM
Is the value is truncated when you select data from database table or when you are assigning values from some other internal tables ( Used earlier for data fetching ) to your items table.
you need to check data type of your other variables which you are using to pass data to your item internal table
‎2009 Nov 27 2:13 PM
‎2009 Nov 27 2:26 PM
Hi,
1. the negative values flag at domain level is relevant only for screen input/output.
2. I got used to write
menge = - menge.what seems to me the fastest and most transparent way.
3. the only other way to create a dump might be a numeric overflow.
Regards,
Clemens