2007 Aug 09 12:08 PM
Hi friends,
I have two variables one is character variable another one is of type quan with decimals 3. As of now I am using the following statement to fill quantity variable
Charpack x_clabs to itab-clabs.
In above x_clabs is of type c with length 15 and itab-clabs is referring the table field mchb-clab.
The above statement is working for some cases and not working for some cases I mean
If my x_clabs contains 1.325,000 I want itab-clabs as 1325,000 but now after execution of charpack statement the itab-clabs is populating as 1.325 . I have one more example there x_clabs is showing as
20,827.807 after charpack statement the itab-clabs is 20827.807 this is correct. But some cases it is not working please help me how to write the logic to work all the cases.
I want no comma and . Before decimal point. Please help me.
Thanks to all.
2007 Aug 09 12:15 PM
Hi Bharat,
use this one
replace space in place of '.'
replace '.' with ' ' in x_clabs.
now remove the spaces.
condense x_clabs.
reward points to all helpful answers
kiran.M
2007 Aug 09 12:27 PM
TRY THIS IT MAY HELP YOU
DATA : TEXT(15) VALUE '1.234,560',
VQTY LIKE MSEG-MENGE.
REPLACE ALL OCCURRENCES OF '.' IN TEXT WITH SPACE.
REPLACE ALL OCCURRENCES OF ',' IN TEXT WITH SPACE.
CONDENSE TEXT.
VQTY = TEXT / 1000.
WRITE : / VQTY.
REGARDS
SHIBA DUTTA
2007 Aug 09 12:31 PM
try this in test report,
data : qty like mchb-clabs,
qty1 type p decimals 3.
qty = '1325000 '.
qty1 = qty.
write : qty, qty1.
2007 Aug 09 12:47 PM
I think zeros after decimals are being neglected.
so no need to worry.
in case of 1325,000 :
1325,000 = 1325
but in case of 20,827.807
20,827.807 ne 20827
it is showing 20827.807
Regards
Pradeep