‎2007 Aug 28 4:16 PM
Hi all,
In a BW end routine, I have 2 fields A and B, both of type QUANT (length 17, digits 3), but used as integers (no coma nore dot are in it).
I want to create a decimal field which integer's part will be A and decimal's part will be the 3 first numbers of B.
examples :
A = 54247
B = 1
result must be 54247,1
A = 1
B = 54247
result must be 1,542
How can I do that ?
Thanks for your help.
‎2007 Aug 28 4:20 PM
hi,
data : lv_a(5) type c,
lv_b(5) type c,
lv_total(6) type c.
concatenate lv_a ',' lv_b+0(3) into lv_total.
Thanks
Mahesh
‎2007 Aug 28 4:25 PM
Hi,
Use "Concatenate A ',' B+0(3) into the Decimal Variable".
Regards,
Lijo Joseph
‎2007 Aug 28 4:37 PM
Thanks both of you, I thought about that, but the compiler says that the output variable of concatenate function must be of char type.
sample :
==> CODE
DATA : res TYPE /BI0/OIQUANTITY.
Concatenate QUANTITY ',' UCQUANT+0(3) into res.
==> ERROR
E:"RES" must be a character-type data object (data type C, N, D, T or
STRING). field string)
‎2007 Aug 28 4:41 PM
Hi Gaudet,
Please use the following code:
DATA : w_a(15) TYPE c,
w_b(15) TYPE c,
w_c TYPE p DECIMALS 3,
w_d(20) TYPE c.
MOVE : 54247 TO w_a ,
1234 TO w_b .
CONDENSE : w_a, w_b.
CONCATENATE w_a '.' w_b(3) INTO w_d.
CONDENSE w_d.
MOVE w_d TO w_c.
Thanks and Best Regards,
Vikas Bittera.
***Points for usefull answers ***
‎2007 Aug 28 4:45 PM
Hi
First you have to remove the comma's and dots in the fields A and B
and then concatenate the fields A and B.
DATA: C(23) TYPE I,
COMMA TYPE C VALUE ','.
for removing commas and dots
UNPACK A.
UNPACK B.
then concatenate
CONCATENATE A AND B+0(3) INTO C SEPARATED BY COMMA.
try with the above logic with the available A and B values of type CURR.
Jeevi.
‎2007 Aug 28 4:48 PM
hi
good
Try with this functiion module.
VHUMISC_CONVERT_TO_ALTERN_UNIT
thanks
mrutyun
‎2007 Aug 28 4:50 PM
Thanks, you answeared my question.
The thing to know is that MOVE manages types conversions, and that's really helpfull.
Regards.