‎2007 Apr 02 2:31 PM
Hi people,
I have:
char 13 like this: 1.613,000
char 13 like this: 8.240,000
the result must be 1613 + 8240. In other words, without decimals and points and that it allows me operate with them.
Than you
‎2007 Apr 02 2:50 PM
hi,
Use this sample code.
data: v_char1(13) type c value '1.613,000',
v_char2(13) type c value '8.240,000'.
data: v_res type p decimals 0,
v_flag1 type p decimals 0,
v_flag2 type p decimals 0.
translate v_char1 using '. '.
translate v_char1 using ',.'.
condense v_char1 no-gaps.
translate v_char2 using '. '.
translate v_char2 using ',.'.
condense v_char2 no-gaps.
pack v_char1 to v_flag1.
pack v_char2 to v_flag2.
v_res = v_char1 + v_char2.
write v_res.v_res contains 9853
Regards,
Sailaja.
‎2007 Apr 02 2:39 PM
Hi,
Please try this.
REPLACE ALL OCCURRENCES OF ',000' IN WA_AMT1 WITH ' '.
TRANSLATE WA_AMT1 USING '. '.
CONDENSE WA_AMT1 NO-GAPS.
REPLACE ALL OCCURRENCES OF ',000' IN WA_AMT2 WITH ' '.
TRANSLATE WA_AMT2 USING '. '.
CONDENSE WA_AMT2 NO-GAPS.
WA_TOTAL = WA_AMT1 + WA_AMT2.
WRITE: / WA_TOTAL.
Regards,
Ferry Lianto
‎2007 Apr 02 2:58 PM
hI...
data:
w_c1(13) type c value '1.613,000',
w_c2(13) type c value '8.240,000',
W_TEMP TYPE STRING.
data:
w_SUM(10) type N,
w_n1(9) type n,
w_n2(9) type n
.
SPLIT W_C1 AT ',' INTO W_C1 W_TEMP.
SPLIT W_C2 AT ',' INTO W_C2 W_TEMP.
w_n1 = w_c1.
w_n2 = w_c2.
W_SUM = W_N1 + W_N2.
write: w_SUM NO-ZERO, / w_n1 NO-ZERO, / w_n2 NO-ZERO.
‎2007 Apr 02 2:41 PM
Hi,
Add both the Qty fields and movethe result into A TYPE I field
or use the ROUND/FLOOR/CEIL maths operators to make it rounded.
reward if useful
regards,
Anji
‎2007 Apr 02 2:50 PM
hi,
Use this sample code.
data: v_char1(13) type c value '1.613,000',
v_char2(13) type c value '8.240,000'.
data: v_res type p decimals 0,
v_flag1 type p decimals 0,
v_flag2 type p decimals 0.
translate v_char1 using '. '.
translate v_char1 using ',.'.
condense v_char1 no-gaps.
translate v_char2 using '. '.
translate v_char2 using ',.'.
condense v_char2 no-gaps.
pack v_char1 to v_flag1.
pack v_char2 to v_flag2.
v_res = v_char1 + v_char2.
write v_res.v_res contains 9853
Regards,
Sailaja.
‎2007 Apr 02 2:53 PM
‎2007 Apr 02 2:57 PM
hi,
My logic works for 1.215.700,000 also.
v_res will be 1223940
Regards,
Sailaja.
‎2007 Apr 02 2:58 PM
Hi..,
use these variable as..
w_result = w_val1(9) + w_val2(9). ** u will get onli the integral parts added
plz do remember to close the thread , when ur problem is solved!!
reward all helpful answers..
sai ramesh
‎2007 Apr 02 3:02 PM
‎2007 Apr 02 4:20 PM