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: 

EDIT_MASK IN ALV

0 Kudos

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...

14 REPLIES 14

Former Member
0 Kudos

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

0 Kudos

Hi Kittu,

I want to convert a number in this way:

123456 --> -1234.56

Thanks anyway

0 Kudos

could you tell us if, currently, you have a sign displayed on the right (1234.56-) or no sign at all?

0 Kudos

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.

0 Kudos

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

Former Member
0 Kudos

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.

raymond_giuseppi
Active Contributor
0 Kudos

Try

wa_catalog-edit_mask = 'V___.__'.

Regards,

Raymond

Former Member
0 Kudos

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.

venkat_o
Active Contributor
0 Kudos

Hi, <li>Try these methods

wa_fcat-edit_mask = '-________________'.
wa_fcat-edit_mask = 'V________________'.
Thanks Venkat.O

0 Kudos

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...

0 Kudos

- 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

0 Kudos

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

0 Kudos

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

0 Kudos

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...