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 - Conditional Decimal in ALV column

Former Member
0 Kudos

Hello All,

I need to display data like this in ALV column :

100

100.67

489.90

200

How to remove decimal fields for certain rows only? I need to sum them too. So can not write using character/ string.

1 ACCEPTED SOLUTION

former_member210008
Active Participant

You want to remove zero decimals ( i.e. 66.00 -> 66; 45.43 -> 45.43 ), right?

Create FM CONVERSION_EXIT_XXXXX_OUTPUT with code:

data l_int type i.

l_int = input.

if l_int = input.

  output = l_int.

else.

  output = input.

endif.

Then add edit mask '==XXXXX' to your column.

4 REPLIES 4

former_member210008
Active Participant

You want to remove zero decimals ( i.e. 66.00 -> 66; 45.43 -> 45.43 ), right?

Create FM CONVERSION_EXIT_XXXXX_OUTPUT with code:

data l_int type i.

l_int = input.

if l_int = input.

  output = l_int.

else.

  output = input.

endif.

Then add edit mask '==XXXXX' to your column.

0 Kudos

Hi,

With the help of REPLACE keyword , you can get desire result.

take CHAR data type for your quantity column , use replace key word and FIEDLCATLOG-DATATYPE = 'QUAN'.

Kindly find the attachment.

Former Member
0 Kudos

Hi Malika,

Try using TRUNC Keyword for all the values in column in ALV.

Thanks & Regards,

Swati

hiriyappa_myageri
Participant
0 Kudos

Hi Malika,

1.Define one Charcter variable of length 13  in final structure.

2.Define field catlog to the new variable.

3.After getting into final internal make user Loop Statement .

3.Inside loop u check ur quantity field and ur condtion if the condtion .

4.finally move quantity data to character variable of your final structure

I hope this will resolve your issue.

Regards,

Hiriyappa.