2006 Jun 14 9:50 PM
Hi,
In my Smartform Output requirment If amount is Initial I need to Show a Blank .
My variable is XVAR(6) Type P decimals 2.
How do we do that?
Regards
Vara
2006 Jun 14 10:45 PM
Hi Vara,
Can you try this code and let me know your concern, if any.
data : XVAR(6) Type P decimals 2.
constants : c_blank(1) type c value ' '.
if xvar is initial. "or if xvar = '0.00'
write : c_blank.
else.
write : xvar.
endif.
Cheers,
Vikram
Hi Vara,
Can you try this code and let me know your concern, if any.
data : XVAR(6) Type P decimals 2.
constants : c_blank(1) type c value ' '.
if xvar is initial. "or if xvar = '0.00'
write : c_blank.
else.
write : xvar.
endif.
Cheers,
Vikram
2006 Jun 14 9:54 PM
hi
the initial value of numeric field is 0 and character field is space.
so if you want space then do the below change.
data:xvar(6) type p decimals 2,
char(6) type c.
move xvar to char.
Cheers,
Abdul Hakim
Mark useful answers..
2006 Jun 14 9:59 PM
Hi Vara,
Pls have a look at the code :
data : XVAR(6) Type P decimals 2.
constants : c_blank(1) type c value ' '.
if xvar is initial.
write : c_blank.
else.
write : xvar.
endif.
Hope this will give you an idea.
Cheers,
Vikram
pls reward for helpful replies!!
2006 Jun 14 10:05 PM
hi vara,
data: v_blank type c value ''.
if xvar is initial.
write v_blank.
endif.
award if helpful.
regards,
keerthi.
2006 Jun 14 10:12 PM
Hi All,
Thank you for your answers.
My Target field (X_VAR) is of TYPE P DECIMALS 2.
I need to repalce with a Blank in to this when value is '0.00'.
Regards
Vara
2006 Jun 14 10:18 PM
hi
you cannot assign a blank value to numeric datatype field so follow the method which i have described above..
Cheers,
Abdul Hakim
2006 Jun 14 10:18 PM
hi Vara,
data v_char value ' '.
do this way ...
<b> if x_var = '0.00'.
x_var = v_char.
endif.</b>
Regards,
Santosh
2006 Jun 14 10:18 PM
Hi,
when you define a field of type P decimals 2, it will take an default value of '0.00'.
Why cant you use the code that i have mentioned above?
Cheers,
Vikram
2006 Jun 14 10:30 PM
Hi All,
I worked with all of your recommendations.
Still the default value is '0.00'.
I am unable to replace it.
Kindly If possible send me an example where it replaces.
Regards
Prasad
2006 Jun 14 10:32 PM
<b>data:xvar(6) type p decimals 2,
char(6) type c.
move xvar to char.</b>
and use char for your display..
Cheers,
Abdul Hakim
2006 Jun 14 10:35 PM
Abdul,
It still display 0.00.
data:xvar(6) type p decimals 2,
char(6) type c.
move char to xvar.
write :/10 xvar.
regards
Vara
2006 Jun 14 10:38 PM
you should output the char & not type p..
data:xvar(6) type p decimals 2,
w_char(6) type c.
move xvar to w_char.
write :/10 xvar,w_char.
Regards,
Suresh datti
2006 Jun 14 10:52 PM
Try:
DATA: num(13) TYPE p DECIMALS 2,
char(16).
WRITE num TO char NO-ZERO.
num = '256.44'.
WRITE num TO char NO-ZERO.
Make sure to pass CHAR to the Smartform.
Rob
2006 Jun 14 10:45 PM
Hi Vara,
Can you try this code and let me know your concern, if any.
data : XVAR(6) Type P decimals 2.
constants : c_blank(1) type c value ' '.
if xvar is initial. "or if xvar = '0.00'
write : c_blank.
else.
write : xvar.
endif.
Cheers,
Vikram
2006 Jun 14 10:56 PM
All,
I resolved it my self.
Just I kept a Condition while printing in smartform.
XVAR NE '0.00'.
Thank you all for your quick replies.
Regards
Vara
2006 Jun 14 10:59 PM
2006 Jun 14 11:03 PM
2006 Jun 14 11:03 PM
2006 Jun 15 12:04 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |