Skip to Content
author's profile photo Former Member
Former Member

DATATYPE

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 10, 2007 at 08:52 AM

    Hi,

    FIELDCATALOG1-DATATYPE or

    FIELDCATALOG1-INTTYPE

    regards

    Nicole

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 10, 2007 at 08:55 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 10, 2007 at 09:01 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 10, 2007 at 09:13 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 10, 2007 at 09:16 AM

    Hi,

    In your code add one more line code as below :

    FIELDCATALOG1-NO_DECIMALS = 'X'.

    Thanks,

    Sriram Ponna.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.