Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

about alv

Former Member
0 Likes
1,329

hi friends,

how to put subtotal text in alv output.

regards,

krishna.

1 ACCEPTED SOLUTION
Read only

Laxmana_Appana_
Active Contributor
0 Likes
1,288

Hi,

Check these links :

Also go through the link,

http://help.sap.com/saphelp_47x200/helpdata/en/ee/c8e056d52611d2b468006094192fe3/frameset.htm

Regards

Appana

hi friends,

how to put subtotal text in alv output.

regards,

krishna.

10 REPLIES 10
Read only

Laxmana_Appana_
Active Contributor
0 Likes
1,289

Hi,

Check these links :

Also go through the link,

http://help.sap.com/saphelp_47x200/helpdata/en/ee/c8e056d52611d2b468006094192fe3/frameset.htm

Regards

Appana

Read only

RichHeilman
Developer Advocate
Developer Advocate
Read only

Former Member
0 Likes
1,288

hi Krishna,

Check this out

  <b>x_layout-subtotals_text = 'Account Subtotal'(t23).</b>
  x_layout-totals_text    = 'Grand Total'(t24).

* Detail Report Display
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
            i_callback_program = v_repid
            it_fieldcat        = it_fieldcat
            it_events          = it_event
            is_layout          = x_layout
            it_sort            = it_sort[]
       TABLES
            t_outtab           = it_detail
       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.

Read only

0 Likes
1,288

dear friend,

this is not working in alv subtotal text.

regards,

kathir.

Read only

0 Likes
1,288

Hi Krishna,

For getting subtotals text you have to do two things.

1. While building fieldcatalog you need to pass DO_SUM='X' to the field which you want to make sum.

2.While building layout you need to pass this subtotals text.

<b>

PSEUDO CODE.
1.Populate fieldcatalog with DO_SUM='X'.</b>
CLEAR LS_FIELDCAT.
LS_FIELDCAT-FIELDNAME    = 'PRICE'.
LS_FIELDCAT-DO_SUM       = 'X'.
APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
<b>
2.Populate layout with subtotals text.</b>

WA_LAYOUT-TOTALS_TEXT       = 'Krishna'.
WA_LAYOUT-SUBTOTALS_TEXT    = 'PRASAD'. ;-)

* Call ABAP List Viewer
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
            I_CALLBACK_PROGRAM      = G_REPID
            IS_LAYOUT               = GS_LAYOUT
            IT_FIELDCAT             = GT_FIELDCAT[]

.........

Regards,

Raghav

Read only

Former Member
0 Likes
1,288

Hi ,

Check BALVST01.

Regards,

Raghav

Read only

Former Member
0 Likes
1,288

Please search the forum before you post your questions:

refer these links:

Regards,

Ravi

Read only

Former Member
0 Likes
1,288

Check out this link and have a look at the thread which gives details about displaying Subtotal text.

http://help.sap.com/saphelp_47x200/helpdata/en/ee/c8e056d52611d2b468006094192fe3/frameset.htm

ashish

Read only

rahulkavuri
Active Contributor
0 Likes
1,288

hi for this we need to use the following code

DATA: LAYOUT TYPE SLIS_LAYOUT_ALV. "LAYOUT

FORM DEFINE_LAYOUT.

LAYOUT-ZEBRA = 'X'.

<b> LAYOUT-SUBTOTALS_TEXT = 'SUBTOTAL SUM'.</b> LAYOUT-WINDOW_TITLEBAR = 'EXERCISE 2'.

LAYOUT-TOTALS_TEXT = 'TOTAL'.

ENDFORM. "DEFINE_LAYOUT

Read only

Former Member
0 Likes
1,288

Hi Krishna,

For doing sub total follow two steps.

1. while building field catalog give do_sum = 'X' for the amount or quantity field.

2. Build a sort catalog to sort by the field by which you want sub total.

regards..

jaison