2008 Apr 11 12:14 PM
Hi all,
I am having quantity field in ALV grid display : VBAP-KWMENG. Iam getting quantity value as 1,000.My requirement is to get quantity value as 1.(without ',' and zeroes).
Suggest me a suitable solution.
Thanks all.
Hi all,
I am having quantity field in ALV grid display : VBAP-KWMENG. Iam getting quantity value as 1,000.My requirement is to get quantity value as 1.(without ',' and zeroes).
Suggest me a suitable solution.
Thanks all.
2008 Apr 11 12:16 PM
DECLARE A VARIABLE OF TYPE C.
and pass your quantity value to that variable and use this variable
2008 Apr 11 12:17 PM
Hi Soumya,
the best way to tackale this is .. pass the value to type P variable with decimals 0 ... i.e,.
data: v_quant like VBAP-KWMENG,
v_newquant type P decimals 0.
v_newqunat = v_quant.
2008 Apr 11 12:41 PM
Hi santosh,
Im getting quantity as 1,000 .I want to get it as 1.
Thanks.
2008 Apr 11 12:48 PM
2008 Apr 11 12:19 PM
Hi,
You better check ur select query first. If that is write, check if ur filling your field cat with the correct values.
Thanks
Nayan
2008 Apr 11 12:19 PM
Other way is check for the below code ..
DATA:
lv_decimal TYPE f DECIMALS 3,
lv_string TYPE string.
lv_decimal = '22.010'.
WRITE lv_decimal TO lv_string.
SHIFT lv_string RIGHT DELETING TRAILING '0'.
* also delete trailing '.', if possible
SHIFT lv_string RIGHT DELETING TRAILING'.'.
CONDENSE lv_string NO-GAPS.
* now no trailing zeros are in the decimal stored in LV_STRING
2008 Apr 11 12:25 PM
Hi,
The reason for having quanting value with leading zeros is because of the property of data type. You need to change the data type of the particular field in your internal table.You have to make it into character format.
regards
Sourabh Verma
2010 Jul 01 11:25 AM
First you need to pass the quantity field to another field of character type.
After that you can do Shift operations.
Regarads,
Debi
2010 Jul 01 11:53 AM
Hi, Try this below code
data : w_menge TYPE MENGE_D
, w_temp_menge TYPE i.
w_menge = '1'.
move w_menge to w_temp_menge.Thanks
Senthil