04-13-2009 4:18 PM
Hi Experts,
In Script form i have 4 columns like credit2008,debits2008, credit2009, debit2009
if no datas any one these column that column has '-' at the last place example
credit2008 debits2008 credit2009 debit2009
20,0000.90 - 98,0000.80 -
this is the actual program but ineed the '-' should be placed in 3rd digit from right.
like credit2008 .
-
plz see the actual program
FORM convert_amount USING p_amt1
p_amt2.
IF p_amt1 = 0.
p_amt2 = '-'.
ELSEIF p_amt1 < 0.
WRITE p_amt1 TO p_amt2.
REPLACE '-' IN p_amt2 WITH ' '.
CONDENSE p_amt2.
CONCATENATE '(' p_amt2 ')' INTO p_amt2.
CONDENSE p_amt2.
ELSE.
WRITE p_amt1 TO p_amt2.
CONDENSE p_amt2.
ENDIF.
ENDFORM.
Plz advice me .
Raja
04-13-2009 7:34 PM
if its only about displaying - at third place for all empty values then what you can do is.
Create a local variable of type char lenght equal to amount.
assign value to it as
temp+2(len-2) = '-'.
Now check if your amount is zero.
if yes then display temp or
display the field.
If i misinterpreted then reply with clear explanation.
Regards,
Lalit Mohan Gupta.
04-13-2009 5:36 PM
04-13-2009 7:34 PM
if its only about displaying - at third place for all empty values then what you can do is.
Create a local variable of type char lenght equal to amount.
assign value to it as
temp+2(len-2) = '-'.
Now check if your amount is zero.
if yes then display temp or
display the field.
If i misinterpreted then reply with clear explanation.
Regards,
Lalit Mohan Gupta.