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: 

ALV table different for display and output

Former Member
0 Kudos

Hello,

I'm having trouble displaying an ALV table. The screen display is showing the qty fields with 3 decimal places. When I print or use print preview the qty fields are shown with no decimal places which is what I want.

Here's what I'm doing:

*showing the display in a grid, not the classic list

list_display = if_salv_c_bool_sap=>false

*---CUSTOMIZE COLUMNS

lr_columns = gr_table->get_columns( ).

lr_columns->set_optimize( abap_true ).

columns_table = lr_columns->get( ).

*---set the output to zero decimals

column-r_column->set_decimals( '0' ).

How do I set what shows on the screen to be the same as what's in the output? Thanks in advance for any help.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi ,

Try using code

column-r_column->decimals_out('0').

Thanks

Amit

3 REPLIES 3

Former Member
0 Kudos

Hi ,

Try using code

column-r_column->decimals_out('0').

Thanks

Amit

Former Member
0 Kudos

I tried using column-r_column->decimals_out('0')and got this error:

The method decimals_out does not exist...similarly named objects do exist: set_decimals_column and get_decimals_column

Any thoughts?

0 Kudos

I solved the problem by changing the data type of my quantity fields from menge(quan) to P decimals 0. Now, the grid displays only whole numbers instead of three decimal places which is what I wanted.