10-26-2007 2:33 AM
Hi all
I have a currency field with negative value if i display that in ALV grid the negative symbol is coming after the value like 159.00-
but i want to display it as -159.00 in the ALV grid
is there is any way to do this other than CLOI_PUT_SIGN_IN_FRONT
If i use this first i need to conver currency field to char field
i did that but again i want to assign that character field to currency field when i tried this it is not taking how to assign char to currency field
Thank you.
10-26-2007 2:38 AM
May be you can try by passing '-________________' ( 16 Under scores in single quotes) to EDIT_MASK of field catalog for the required field.
When you fill the field catalog you can pass the edit_mast to the same field as well.
Regards
Gopi
10-26-2007 3:11 AM
If i use fieldcat-edit_mask = '-_______________' it is effecting all the records
but i want only the value which contains negative how do i check that
Thank you
10-26-2007 3:33 AM
Hi Pradeed, try this being a lengthy one, but should work for sure.
I just tried on my system.
PARAMETER : p_int TYPE i.
DATA : ch(15) TYPE c.
START-OF-SELECTION.
ch = p_int.
CONDENSE ch NO-GAPS.
REPLACE '-' INTO ch WITH space.
CONCATENATE '-' ch INTO ch.
WRITE : p_int.
WRITE : / ch.
Regards
Gopi
10-26-2007 3:01 AM
HI Praddep..
For display your field type might be currency type..
For display make your field Character type..
DATA F1 type char15 .
IF (your currency field ) < 0 .
(your currency field ) = (your currency field ) * -1 .
COCATENATE '-' (your currency field ) INTO F1 .
ENDIF .
Hope this helps .
06-14-2010 12:31 PM
Use Conversion exit.
Define your own conversion exit like.
for eg. "CONVERSION_EXIT_ZSIGN_OUTPUT".
write code as :
DATA: lv_char TYPE CHAR20.
WRITE INPUT TO lv_char.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
value = lv_char.
OUTPUT = lv_char.
now pass this conversion exit to your field catalog like :
<z_li_fcat>-ref_fieldname = 'WRBTR'.
<z_li_fcat>-ref_tabname = 'RSEG'.
<z_li_fcat>-datatype = 'CURR'.
<z_li_fcat>-edit_mask = '==ZSCON'.
<z_li_fcat>-intlen = '16'.
<z_li_fcat>-inttype = 'CHAR'.
This will definately solve your issue as i was facing the same.
06-14-2010 12:39 PM
06-14-2010 3:20 PM
Hi all,
maybe this is a too easy and dumb suggestion but shouldn't the display of currency fields be set in the User Defaults?
So instead of coding something just set the correct values for number display?
06-14-2010 3:26 PM
Before anyone else decides to answer, please look at the date of the OP.
Rob