04-23-2007 4:32 PM
I need to write NETWR into a file without the decimal point. So I am looking to assign it to another variable. How to do this
Say NETWR is 900.00
then var = 90000
04-23-2007 4:50 PM
Hi,
Please try this.
DATA: LV_NETWR1 LIKE VBAP-NETWR VALUE '900.00',
LV_NETWR2(10) TYPE C.
MOVE LV_NETWR1 TO LV_NETWR2.
TRANSLATE LV_NETWR2 USING '. '.
CONDENSE LV_NETWR2 NO-GAPS.
WRITE LV_NETWR2 TO LV_NETWR2 RIGHT-JUSTIFIED.
TRANSLATE LV_NETWR2 USING ' 0'.
WRITE: / LV_NETWR2.
Regards,
Ferry Lianto
04-23-2007 4:37 PM
Hi,
Please try this.
DATA: LV_NETWR1 LIKE VBAP-NETWR VALUE '900.00',
LV_NETWR2 TYPE I.
MOVE LV_NETWR1 TO LV_NETWR2.
WRITE: / LV_NETWR1, LV_NETWR2.
OR
DATA: LV_NETWR1 LIKE VBAP-NETWR VALUE '900.00',
LV_NETWR2(6) TYPE C.
MOVE LV_NETWR1 TO LV_NETWR2.
TRANSLATE LV_NETWR2 USING '. '.
CONDENSE LV_NETWR2 NO-GAPS.
WRITE: / LV_NETWR1, LV_NETWR2.
Regards,
Ferry Lianto
04-23-2007 4:37 PM
Hi Megan,
MOve it to a char type variable and then use the replace command.
v_char = v_netwr.
replace all occurances of '.' with '' into v_char.
*Now v_char wil have a value without decimal
Regards,
Ravi
04-23-2007 4:37 PM
Hi,
do this way
data: p type p decimals 3 value '1000.00'.
data: i type i.
move p to i.
write:/ i.
Regards,
Santosh
Message was edited by:
Santosh Kumar Patha
04-23-2007 4:39 PM
Hello,
try with this code:
DATA: P_TEXT(16) ."VALUE 'vasanth'.
DATA: NETWR LIKE VBAP-NETPR VALUE '900.00'.
MOVE NETWR TO P_TEXT.
REPLACE '.' WITH SPACE INTO P_TEXT.
CONDENSE P_TEXT NO-GAPS..
WRITE: P_TEXT NO-GAP.
REgards,
Vasanth
04-23-2007 4:43 PM
Hi Megan,
data:NETWR type f value '10319.972'.
data:netwr1 type i.
move netwr to netwr1.
write:/netwr1.
used these code u can solve the Problem.
Thanks & Regards,
Nelson
04-23-2007 4:46 PM
hi,
u can do like this
<b> write NETWR no decimals.</b>
reward points if this helps u
ravi
04-23-2007 4:47 PM
04-23-2007 4:51 PM
Hi Megan,
do this way
DATA: C(20) .
DATA: NETWR TYPE NETWR VALUE '900.00'.
MOVE NETWR TO C.
REPLACE ALL OCCURRENCES OF '.' IN C WITH SPACE.
CONDENSE C NO-GAPS..
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = C
IMPORTING
OUTPUT = C
.
WRITE: C NO-GAP.
Message was edited by:
Santosh Kumar Patha
04-23-2007 4:50 PM
Hi,
Please try this.
DATA: LV_NETWR1 LIKE VBAP-NETWR VALUE '900.00',
LV_NETWR2(10) TYPE C.
MOVE LV_NETWR1 TO LV_NETWR2.
TRANSLATE LV_NETWR2 USING '. '.
CONDENSE LV_NETWR2 NO-GAPS.
WRITE LV_NETWR2 TO LV_NETWR2 RIGHT-JUSTIFIED.
TRANSLATE LV_NETWR2 USING ' 0'.
WRITE: / LV_NETWR2.
Regards,
Ferry Lianto