Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Script Output

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

2 REPLIES 2

Former Member
0 Kudos

Problem not understood...........Please explain clearly

Former Member
0 Kudos

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.