Skip to Content

Grouping the similar fields in the ALV report

How to group the similar fields in ALV report as the below what must be the code.

Here clearing doc are same so 4 itsm are grouped under into one.


After that I want to calculate the sum of pls refer the below screen shot.

First Colum is groped into one and amount in summed and show in the output how to do that.


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Jan 13, 2015 at 10:37 AM

    Set SUM = 'X' in fieldcat for field "AMOUNT" and set "SORT" for Column "Clearing doc"

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 13, 2015 at 12:22 PM

    Hi,

    DATA :

          it_sort TYPE slis_t_sortinfo_alv,

          t_sort TYPE slis_sortinfo_alv.

      t_sort-fieldname = 'AUGBL'.

      t_sort-spos = 1.

      t_sort-up = 'X'.

      APPEND t_sort TO it_sort.

      CLEAR t_sort.

      call function 'REUSE_ALV_GRID_DISPLAY'

           exporting

                i_callback_program      = gd_repid

                i_callback_top_of_page  = 'TOP-OF-PAGE'  "see FORM

                is_layout               = gd_layout

                it_fieldcat             = fieldcatalog[]

                it_sort                 = it_sort[]

                i_save                  = 'X'

          tables

                t_outtab                = it_ekko

           exceptions

                program_error           = 1

                others                  = 2.

      if sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    •         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      endif.

    endform.                    " DISPLAY_ALV_REPORT

    Regards,

    Venkat.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 15, 2015 at 02:08 PM

    First, execute The Consistency Check, and correct any inconsistency raised.

    There, also display layout and look for field NO_MERGING, musy be initial

    Then display your grid and thru menu remove every sort criteria and sort only on the field you want to group. What result do you get?

    When (and if) okay, reexecute the consistency check and analyze the SORT internal table, so you should be able to code it.

    NB: If Grid is input allowed, I fear you can no longer group fields.


    Regards,

    Raymond


    Add comment
    10|10000 characters needed characters exceeded

  • Jan 15, 2015 at 03:51 PM

    Rejected already, and now reposted three times. So now locked.

    Post questions once in one place. If your post is rejected, don't post again.

    Add comment
    10|10000 characters needed characters exceeded