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

DATATYPE

Former Member
0 Likes
749

HI EXPERTS!

CAN I CHANGE DATATYPE IN FIELDCATALOG (). EG . IF LTA 1S 222.50,

THEN OUTPUT SHOULD BE 223 ONLY .

FIELDCATALOG1-FIELDNAME = 'LTA_RETRO'.

FIELDCATALOG1-SELTEXT_M = 'Arrears LTA'.

FIELDCATALOG1-COL_POS = 80.

FIELDCATALOG1-OUTPUTLEN = 15.

APPEND FIELDCATALOG1 TO FIELDCATALOG1.

CLEAR FIELDCATALOG1.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
718

Hi,

FIELDCATALOG1-DATATYPE or

FIELDCATALOG1-INTTYPE

regards

Nicole

5 REPLIES 5
Read only

Former Member
0 Likes
719

Hi,

FIELDCATALOG1-DATATYPE or

FIELDCATALOG1-INTTYPE

regards

Nicole

Read only

Former Member
0 Likes
718

HI,

In the field catalog u have the option called 'No decimals'.Just populate this value with X u will get the result.

Thanks,CSR.

***Please Reward if helpful

Read only

Former Member
0 Likes
718

Hi Ranjna,

You can round up the value, while put that in final internal table for ALV.

For that u can use function module 'ROUND'.

And declered datatype of that field in final table is integer so it get print like that.

eg .

step 1)==>

begin of alv_final,

-


,

---,

LTA_RETRO type i,

---,

---,

end of alv_final.

step 2)==>

CALL FUNCTION 'ROUND'

EXPORTING

decimals = 0

input = wa_output-LTA

= ' '

IMPORTING

output = b

EXCEPTIONS

input_invalid = 1

overflow = 2

type_invalid = 3

OTHERS = 4

step 3)==>

wa_alv_final-LTA_RETRO = b.

step 4)==>

append wa_alv_final to alv_final.

Read only

Former Member
0 Likes
718

Hi,

Changing the field catalog wont help.

U r trying to do an approximation, so u ll have to it using ABAP syntax.

You can use this for doing the approximation -

value = ceil( p_val ).

Here is the sample code -

REPORT  ZSKC_TEST2.
PARAMETER : P_val TYPE p decimals 2.

data : value type p decimals 2.

start-of-selection.

value = ceil( p_val ).

write value.

This piece of code will return the higher value - you can use floor ( replace ceil) to get the lower value.

Hope it helps.

Read only

Former Member
0 Likes
718

Hi,

In your code add one more line code as below :

FIELDCATALOG1-NO_DECIMALS = 'X'.

Thanks,

Sriram Ponna.