2008 Oct 10 5:49 AM
Hello All,
I have to Convert Character field to a Quantity field.
Ex:
G_F_CHAR = '123456,789'.
Here G_F_CHAR is a character type and length is 10.
I want this value into G_F_QUAN ( like G_F_QUAN = 123456,789), where G_F_QUAN is a quantity field with 3 decmals.
Is there any function module to convert like this.
Thanks in advance.
Best Regards,
Sasidhar Reddy Matli.
2008 Oct 10 6:40 AM
Hi Sasidhar,
Use the following code.
data : g_f_char(10) type c,
g_f_quan type resb-bdmng,
g_f_temp(8) type p.
g_f_char = '123456789'.
g_f_temp = g_f_char.
g_f_quan = g_f_temp.
WRITE : g_f_char,
/ g_f_quan.
Regards
Alok Vishnoi
Hello All,
I have to Convert Character field to a Quantity field.
Ex:
G_F_CHAR = '123456,789'.
Here G_F_CHAR is a character type and length is 10.
I want this value into G_F_QUAN ( like G_F_QUAN = 123456,789), where G_F_QUAN is a quantity field with 3 decmals.
Is there any function module to convert like this.
Thanks in advance.
Best Regards,
Sasidhar Reddy Matli.
2008 Oct 10 5:53 AM
2008 Oct 10 6:12 AM
Hi,
Remove all the ',' from the character string... Then have a variable of type p , decimals 3...
assign this g_f_char to that variable....
should solve your issue...
regards,
madan..
2008 Oct 10 6:40 AM
Hi Sasidhar,
Use the following code.
data : g_f_char(10) type c,
g_f_quan type resb-bdmng,
g_f_temp(8) type p.
g_f_char = '123456789'.
g_f_temp = g_f_char.
g_f_quan = g_f_temp.
WRITE : g_f_char,
/ g_f_quan.
Regards
Alok Vishnoi
2008 Oct 10 9:41 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |