03-01-2010 12:28 PM
Hi experts,
I'm trying to put sing of a number on the left in a field of ALV. I tried this:
wa_catalog-edit_mask = '-___.__'.
But it doens't work correctly, since in some cases the program does the following:
123456789 --> -123.45
Can you help me??
THANKS A LOT...
03-01-2010 12:37 PM
Hi LydiaMM,
Try this : -
DATA TIME TYPE T VALUE '154633'.
WRITE (8) TIME USING EDIT MASK '__:__:__'. "Output: 15:46:33
or
write sy-datum using edit mask '__/__/____' to sydatum.
or
incude a character field of length 10 in your final internal table.
data: wrk_date(10) .
then in the loop.. endloop of the final internal table
suppose sy-datum is varibale which need conversion.
USE THE BELOW CODE FOR CONVERSION.
WRITE sy-datum TO wrk_date USING EDIT MASK '__.__.____' .
Regards,
Kittu
03-01-2010 12:41 PM
Hi Kittu,
I want to convert a number in this way:
123456 --> -1234.56
Thanks anyway
03-01-2010 12:50 PM
could you tell us if, currently, you have a sign displayed on the right (1234.56-) or no sign at all?
03-01-2010 1:00 PM
David,
I tried this, and a DUMP has been ocurred.
Raymond,
I tried this, and it doesn't work correctly.
Sandra,
Yes, in my ALV the program is displaying this 1234.56-, but I can't resolve my problem
Thanks everybody.
03-01-2010 1:18 PM
Give a correct number of "_" related to the length of the field, the mask will be filled from left (exception if mask begin with "RR")
Regards,
Raymond
03-01-2010 12:45 PM
Try using FM CLOI_PUT_SIGN_IN_FRONT before adding your field to the itab for the ALV. Sort out your decimals before calling the FM.
03-01-2010 12:48 PM
03-01-2010 1:22 PM
David,
I tried this, and a DUMP has been ocurred.
You have to use a character field for FM CLOI_PUT_SIGN_IN_FRONT. You need to WRITE num_field TO char_field and call FM CLOI_PUT_SIGN_IN_FRONT using char_field.
The field catalog entry for this field for your ALV must then reflect the CHAR value and not the NUM value. In the field catalog you can also use JUST = 'L' or 'R' for left or right justified.
03-01-2010 1:26 PM
Hi,
<li>Try these methods
wa_fcat-edit_mask = '-________________'.
Thanks
Venkat.Owa_fcat-edit_mask = 'V________________'.
03-01-2010 2:23 PM
Hi all,
I have tried all possibilities and it do not work.
If I used '-___________' when I have the example '123.45-' the alv shows the next number -12345, because the mask isn't defining the number of decimals.
I used this mask 'V________________' and also it doesn´t work correctly.
Thanks everybody...
03-01-2010 2:31 PM
- What is the exact definition of the field (packed 13,3, curr which type)
- What is the exact number of decimal position you want
- Do you want the actual sign of the number (use "V") or force to negative (use "-")
Regards,
Raymond
03-01-2010 2:36 PM
Hi Raymond,
The type of the date is: KINVZ (CURR 13)
The number of decimals is: 2
And I always want to force to negative.
Thanks
03-01-2010 3:34 PM
You could try 'RR-___________.__', but this field is a currency field, so number of decimal is related to currency code, it would be easier/safer to negate the amount before displaying the ALV, else you will have to deceive the program, to consider the field as a single packed field (changing other attributes of the field catalog, changing DATATYPE from CURR to DEC and clearing CFIELDNAME)
Regards,
Raymond
03-01-2010 3:50 PM
Lydia, by the way, maybe this request makes no sense as all SAP reports display the sign on the right (tell the functional people that it's definitely an issue in SAP), or maybe it is a very special report...