‎2009 Jan 12 11:37 AM
hi all,
in the report i have the gt_file_export-value = 10000000000.00-
in the below they have written the code to keep the minus value first but due to the follwing code i.e., because of code this
MOVE '-' TO amount_to_print(1).
the value becoming as -0000000000.00 , one is missing and placing minus sign there
i need to get the value as -10000000000.00
check the code for the same.
WRITE: gt_file_export-value TO amount_to_print.
IF amount_to_print+15(1) = '-'.
MOVE '-' TO amount_to_print(1).
MOVE ' ' TO amount_to_print+15(1).
CONDENSE amount_to_print NO-GAPS.
WHILE amount_to_print+14(1) = ' '.
SHIFT amount_to_print RIGHT.
ENDWHILE.
ENDIF.
thanks in advance
‎2009 Jan 12 11:41 AM
Hello Hema,
Try this code:
IF amount_to_print CA '-'.
SHIFT amount_to_print BY 1 PLACES RIGHT CIRCULAR
ENDIF.
Hope this helps.
BR,
Suhas
Edited by: Suhas Saha on Jan 12, 2009 12:45 PM
‎2009 Jan 12 11:41 AM
‎2009 Jan 12 11:43 AM
try like dis..
IF amount_to_print+15(1) = '-'.
concatenate '-' amount_to_print+0(14) into amount_to_print.
ENDIF.
‎2009 Jan 12 11:44 AM
Make sure field amount_to_print is long enough.
Then, first do a
SHIFT amount_to_print RIGHT DELETING TRAILING SPACE.Next, if it's a negative value, add the minus sign.
amount_to_print(1) = '-'.Finally condense the field
CONDENSE amount_to_print NO-GAPS.
‎2009 Jan 12 11:45 AM
‎2009 Jan 12 11:46 AM
Hi
Try this
DATA amount_to_print(15) type c value '10000000000.00-'.
IF amount_to_print+14(1) = '-'.
MOVE amount_to_print(14) TO amount_to_print+1.
MOVE '-' TO amount_to_print(1).
CONDENSE amount_to_print NO-GAPS.
ENDIF.
write: amount_to_print.Max
‎2009 Jan 12 11:56 AM
hi,
check the length of 'amount_to_print'.
if the length is less than that it will condence.
‎2009 Jan 12 11:57 AM
hi ,
you are moving '-' to '1'.
with the statement MOVE '-' TO amount_to_print(1).
‎2009 Jan 13 7:16 AM