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

drawing a line at my ALV-Grid

Hi!

How can I draw or place a line at my ALV-Grid output.

I need this line in end of a column in order

to write a value below this line.

regards

ertas

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Jul 08, 2008 at 07:20 AM

    You can get it from SORT Table, Populate the SORT Group etc.

    then you will get the line etc.

    if you give GROUP = '*' "then it will give page break

    if you give "UL" then it will give a line for a particular combination it groups and gives a Line.

    Add a comment
    10|10000 characters needed characters exceeded

    • Check this sample code..

      wa_sort-group = '*'. "this will Trigger Page

      wa_sort-group = 'UL' . this will give a line

      REPORT  ztest_alv.
       
      TYPE-POOLS: slis.
       
      DATA: BEGIN OF it_flight OCCURS 0,
             carrid  LIKE sflight-carrid,
             connid   LIKE sflight-connid,
             fldate   LIKE sflight-fldate,
             seatsmax LIKE sflight-seatsmax,
             seatsocc LIKE sflight-seatsocc,
            END OF it_flight.
      DATA: it_fieldcat TYPE  slis_t_fieldcat_alv,
            wa_fcat like line of it_fieldcat,
            layout TYPE  slis_layout_alv.
      data: IT_SORT TYPE  SLIS_T_SORTINFO_ALV,
             wa_sort like line of it_sort.
       
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = sy-repid
          i_internal_tabname     = 'IT_FLIGHT'
          i_inclname             = sy-repid
        CHANGING
          ct_fieldcat            = it_fieldcat
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2.
       
      SELECT carrid
             connid
             fldate
             seatsmax
             seatsocc
       FROM sflight
       INTO CORRESPONDING FIELDS OF TABLE it_flight
       UP TO 20 ROWS.
      .
      wa_fcat-do_sum = 'X'.
      modify it_fieldcat from wa_fcat TRANSPORTING do_sum
       where fieldname = 'SEATSOCC' .
       
      wa_sort-fieldname = 'CARRID'.
      wa_sort-group = 'UL'.
      wa_sort-up = 'X'.
      append wa_sort to it_sort.
       
      wa_sort-fieldname = 'CONNID'.
      wa_sort-subtot = 'X'.
      wa_sort-up = 'X'.
      append wa_sort to it_sort.
       
       
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'    EXPORTING
          i_callback_program = sy-repid
          is_layout          = layout
          it_fieldcat        = it_fieldcat
          it_sort            = it_sort
        TABLES
          t_outtab           = it_flight
        EXCEPTIONS
          program_error      = 1.

      Regards

      Vijay Babu Dudla

  • author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2008 at 10:53 PM

    Hi,

    You can use the 'Sum' function to create totals for one or more numeric columns. You can then use the "Subtotals" function to set up control level lists: You can use the 'Subtotal' function to structure control level lists: select the columns (non-numeric columns only) that you want to use and the corresponding control level totals are displayed.

    After declaring the fieldcat

    for doing sum : wa_fieldcat-do_sum = 'X'.

    fro caluculating subtotal : wa_sort-subtot = 'X'.

    If you want to create print lists with zebra stripes, set field -zebra to "X".

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 07, 2008 at 11:18 PM

    thanks ...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 08, 2008 at 07:17 AM

    I need a function like 'Sum' function only with the

    possibility to write by myself any other value instead of

    aggregated value of column.

    regards

    ertas

    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.