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

REUSE_ALV_GRID_DISPLAY

how to group a field based on another field using it_sort --- reuse_alv_grid_display ??????

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 Jan 08, 2007 at 08:23 AM

    i cannot get your question properly but

    if you are asking what value you have to pass in

    it_sort-group then you can pass '' or 'UL' means it will group that as per your it_sort-fieldname. and '' means grouping comes on next page and 'UL' means under line comes after every grouping

    regards

    shiba dutta

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08, 2007 at 09:04 AM

    U append the it_sort table with the firldname based on which you like to sort.

    FORM f8000_sortcat_init CHANGING i_sortcat TYPE slis_t_sortinfo_alv.
    
      CLEAR wa_sortinfo.
      wa_sortinfo-fieldname = 'RMATNR'.
      wa_sortinfo-tabname = 'I_REPORTDATA1'.
      wa_sortinfo-spos = 2.            " First sort by this field.
      wa_sortinfo-up = 'X'.            "   Ascending
      wa_sortinfo-subtot = 'X'.        " Subtotal at Name1
      APPEND wa_sortinfo TO i_sortcat.
    
      CLEAR wa_sortinfo.
      wa_sortinfo-fieldname = 'CPUDT'.
      wa_sortinfo-tabname = 'I_REPORTDATA1'.
      wa_sortinfo-spos = 1.            " First sort by this field.
      wa_sortinfo-up = 'X'.            "   Ascending
      wa_sortinfo-subtot = 'X'.        " Subtotal at Name1
      APPEND wa_sortinfo TO i_sortcat.
    
    ENDFORM.                    " f8000_sortcat_init
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program     = report_id
                i_grid_title           = ws_title
    *            i_callback_top_of_page = 'TOP-OF-PAGE'
                is_layout              = wa_layout
                it_fieldcat            = i_fieldcat[]
                it_sort                = i_sortcat
                i_save                 = 'A'
                it_events              = i_events
           TABLES
                t_outtab               = i_reportdata1
           EXCEPTIONS
                program_error          = 1
                OTHERS                 = 2.

    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.