Skip to Content

Sub totla in ALV Grid

hii all,

In my alv grid i want to add the cost of materials vendor wise, which should appear as sub total at the end of records of a particular vendor(internal table sorted by vendor).the sum of the material should appear as a sub total.help me in this regards.

with regards,

sandeep akella.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Sep 23, 2008 at 03:00 PM

    Populate the sort table based on vendor , do you have any material count in your display, if so use DO_SUM option.

    for the material count use DO_SUM in the fieldcatalog , and for Sort

    SORT-FIELDNAME = 'LIFNR'.
    sort-up = 'X'.
    sort-subtot = 'X'.
    append sort to it_sort.

    Add a comment
    10|10000 characters needed characters exceeded

    • in the fieldcatalog population for the TOTAL_COST field enable the option DO_SUM.

      fieldcat-fieldname = 'TOT_COST'.
      fieldcat-do_sum = 'X'.
      ....
      ..
      append fieldcat to it_fieldcat.

      if you want the same to cons_cost then check the same.

      and For subtotals.

      You have to do this..

      sort-fieldname = 'LIFNUM'.
      sort-up = 'X'.
      sort-subtot = 'X'.
      append sort to it_sort.

      pass this it_sort to the it_sort option of the Set table display method.

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.