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

Right justified data into internal table

**Hello Gurus,**

I have an Internal table having data

abc 10.00; 20.00 30.00

def 20.00 00.00 40.00

Total 30.00 20.00 70.00

I want to align my "Total" word to be right justified.

and if the particular column is having "00.00"; amount it should not be display.

and i want to bold the particular row only. i.e. my "Total" should be bold.

can anybody help me to resolve this problem

Thanks in adv.

Kaustubh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 14, 2009 at 04:47 AM

    Hi Kaustubh,

    Your question is not very much clear. still if you are this in ALV report.

    the in fieldcat you can add this.

    gcat-just = 'R'.

    gcat-no_zeo = 'X'.

    fcat-decimals_out = 0.

    Hope this will help you.

    Regards,

    Vijay

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 17, 2009 at 11:20 AM

    Hi Kaustubh,

    As Vijay said, you can specify your display conditions in ALV as the snippet shows...But, In fact u need not even populate the total field in the third row...

    While creating the field catalog, just assign 'X' to the do_sum option in the field catalog...then simply pass the internal table containing the first two records in to the REUSE_ALV* FMs and the ALV would sum these columns up and show the total in standard formatting...saves you a lot of code 😊

    Eg. Lets say your fieldcatalog structure is wa_fieldcat and its table is it_fieldcat...u will need to do this while preparing the fcat...

    WA_FIELDCAT-FIELDNAME = 'WA_ITAB-COL1'. --> the field u want to sum.

    WA_FIELDCAT-TABNAME = 'ITAB'. --> Your Internal Table

    WA_FIELDCAT-DO_SUM = 'X'.

    APPEND WA_FIELDCAT TO IT_FIELDCAT.

    CLEAR WA_FIELDCAT.

    WA_FIELDCAT-FIELDNAME = 'WA_ITAB-COL2'.

    WA_FIELDCAT-TABNAME = 'ITAB'.

    WA_FIELDCAT-DO_SUM = 'X'.

    APPEND WA_FIELDCAT TO IT_FIELDCAT.

    CLEAR WA_FIELDCAT.

    The FM would then generate the ALV with the columns summed up at the bottom. The best part is it takes care of the currency and quantity reference too...

    Hope it helps out...

    Regards...Jaison

    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.