10-18-2008 9:47 AM
Hi Experts,
I have a field in a internal table of type currency .
While printing for some records the value is 0.00.
My requirement is i want to print as blank instead of "0.00' in ALV o/p
While populating i tried to assign with variable of space of same type as below
data: w_cspace type wert8 value space.
How to print the currency value as blank.
Please advice
Regards
Balaji R
10-18-2008 10:14 AM
Hi Balaji,
Just check the Field catalog structure 'SLIS_FIELDCAT_ALV' . In this structure check ' 'SLIS_FIELDCAT_MAIN0 ' structure , you will find 'NO_ZERO' field in that.
When you are filling field catalog just put NO_ZERO = 'X'.
Ex:
WA_FCAT-NO_ZERO = 'X'.
DATA:
WA_FCAT TYPE SLIS_FIELDCAT_ALV .
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'PRICE'.
WA_FCAT-TABNAME = 'SFLIGHT'.
WA_FCAT-REPTEXT_DDIC = 'Ticket Price'.
WA_FCAT-NO_ZERO = 'X'.
APPEND WA_FCAT TO T_FCAT.
Now you will not get '0.00'.
You will get Space in place of '0.00'.
when you are printing result using ALV then by filling the particular currency field with SPACE will not work. Because it takes the declaration type of that particular field and prints the values. So try with 'NO_ZERO' option. Now It works fine .
Regards,
Rajitha.
10-18-2008 9:56 AM
Hi,
Better you convert your currency field to char field and replace it with blank...
10-18-2008 10:05 AM
Hello,
Thanks for your reply.
It is an internal table.
I have currency values for some records in whch i need to print the actual values.
i need to print balank when the value is 0.00.
Thanks
10-18-2008 10:08 AM
Ok...I got your point so just before your text field enter a code line in which you will asign the currency field into the charecter field...and replace the 0.00 with space.....
I have done like this it helps your particular requirement.
Try it.
10-18-2008 10:14 AM
Hi Balaji,
Just check the Field catalog structure 'SLIS_FIELDCAT_ALV' . In this structure check ' 'SLIS_FIELDCAT_MAIN0 ' structure , you will find 'NO_ZERO' field in that.
When you are filling field catalog just put NO_ZERO = 'X'.
Ex:
WA_FCAT-NO_ZERO = 'X'.
DATA:
WA_FCAT TYPE SLIS_FIELDCAT_ALV .
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'PRICE'.
WA_FCAT-TABNAME = 'SFLIGHT'.
WA_FCAT-REPTEXT_DDIC = 'Ticket Price'.
WA_FCAT-NO_ZERO = 'X'.
APPEND WA_FCAT TO T_FCAT.
Now you will not get '0.00'.
You will get Space in place of '0.00'.
when you are printing result using ALV then by filling the particular currency field with SPACE will not work. Because it takes the declaration type of that particular field and prints the values. So try with 'NO_ZERO' option. Now It works fine .
Regards,
Rajitha.
10-18-2008 10:25 AM
fieldcat-tabname = 'NAV_T'.
fieldcat-fieldname = 'VERTN'.
fieldcat-col_pos = '8'.
fieldcat-seltext_m = 'No sr Iss'.
fieldcat-just = 'C'.
fieldcat-outputlen = 13.
fieldcat-do_sum = 'X'.
fieldcat-datatype = 'CURR'.
*******************************
fieldcat-no_zero = 'X'.
********************************
APPEND fieldcat TO fieldtab2.
CLEAR fieldcat.
This will suatable for you
10-18-2008 10:40 AM
Thank you for all of who contributed.
Problem Solved.
Thanks.
Regards
Balaji