Application Development and Automation 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: 
Read only

Formatting on Screen level

Former Member
0 Likes
997

Dear All,

I am displaying one internal table on screen in table control.

It has several QUAN (quantity) and CURR (currency) fields with values in decimals...

But I want to display values before decimal point i.e. if it is 13.000, I want to display only 13.

Is there any setting on screen field level that I can do ?

You valuable suggestions are most welcome ...........

Thanks...................

Dear All,

I am displaying one internal table on screen in table control.

It has several QUAN (quantity) and CURR (currency) fields with values in decimals...

But I want to display values before decimal point i.e. if it is 13.000, I want to display only 13.

Is there any setting on screen field level that I can do ?

You valuable suggestions are most welcome ...........

Thanks...................

6 REPLIES 6
Read only

Former Member
0 Likes
924

hi,

use variable on screen based on abap dictionary (se11) which has no decimal places...

(search it by domain with no decimals places)

regards, darek

Read only

former_member203501
Active Contributor
0 Likes
924

declare it as a character on the screen ...and do like this...in the coding

data: v_dec type p decimals 3 value '13',

v_char type char10,

v_ext type char5.

v_char = v_dec.

write:/ v_char.

split v_char at '.' into v_char v_ext .

condense v_char.

concatenate v_char '.' into v_char.

write:/ v_char.

Read only

Former Member
0 Likes
924

Hi Ubhaka,

just Declare all your QUAN (quantity) and CURR (currency) fields with the TYPE I that is integers..

so that you can remove decimal points...

or else you can do one more thing

DATA : lv_num type p decimals 3 value '50.326',
lv_final type i.

lv_final = FLOOR( lv_num  ).

Now lv_final will have the only 50.

ie. use the FLOOR funtionality

Thanks!

Edited by: Prasanth on Mar 7, 2009 7:17 PM

Read only

former_member156446
Active Contributor
0 Likes
924

try CEIL(m)

or

DATA: fld1 TYPE P DECIMALS 2,
fld2 TYPE P DECIMALS 2 VALUE '5.99'.

fld1 = FLOOR( fld2 ).
WRITE: / 'FLOOR:', fld1.

out put: 5

or

PARAMETER:
  p_input  TYPE konv-kbetr DEFAULT '28.99'.
 
DATA:  w_out   TYPE konv-kbetr,
       w_unit TYPE  vtbfima-runit VALUE 2.
 
 
CALL FUNCTION 'FIMA_NUMERICAL_VALUE_ROUND'
  EXPORTING
    i_rtype     = '-'
    i_runit     = w_unit
    i_value     = p_input
  IMPORTING
    e_value_rnd = w_out.
 
WRITE:/ 'Input:',p_input,
           / 'Output:',w_out.

Read only

Former Member
0 Likes
924

Try this

   
    IF p_fieldname = 'DELQTY'. " In fieldcatalog when you pass field name use decimals option also
         ls_fieldcat-decimals    = '000000'.
    ENDIF.

Read only

Former Member
0 Likes
924

solved