Application Development 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: 

Problem in displaying total text in total line

Former Member
0 Kudos

Hi...I am facing problem in displaying total text in first column of total line. Width of first column is sufficient to display text "TOTAL". But somehow its not getting displayed....Please Help...?

code is as follows:

ls_layout TYPE slis_layout_alv .

ls_layout-totals_text = 'TOTAL'.

ls_layout-colwidth_optimize = 'X'.

ls_layout-no_vline = 'X'.

ls_layout-no_hline = 'X'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = gv_repid " Report ID

i_callback_top_of_page = 'TOP_OF_PAGE'

is_layout = ls_layout

it_fieldcat = gt_fieldcat " Field Catlog

TABLES

t_outtab = gt_cost_output " Output Table

10 REPLIES 10

jayanthi_jayaraman
Active Contributor

Former Member
0 Kudos

Hi

try this way.

CASE ls_ftcat-fieldname.
WHEN 'TOTAL'.
ls_ftcat-seltext_s     = 'TOTAL'.
ls_ftcat-seltext_m     = 'TOTAL'.
ls_ftcat-seltext_l     = 'TOTAL'.
<b>ls_ftcat-reptext_ddic  = 'TOTAL'.</b>
ls_ftcat-outputlen     = '6'.
MODIFY gt_fieldcat FROM ls_ftcat.

regards,

venu.

0 Kudos

HI Venu....

Thanx for reply.....

But i want total to be displayed in last row & not in column.

My report is like this

plant material qty

101 4236 20

101 4256 30

Total 50

I am getting 50 but not the text "Total"

I tried following code also but still its not working

ls_layout-no_input = 'X'.

ls_layout-colwidth_optimize = 'X'.

ls_layout-totals_text = <b>'Totals'(201)</b>.

Regards,

Prafulla

0 Kudos

Hi Prafulla,

i see no error in your code:

here's another example , which works fine:

  lay-window_titlebar = text.
  lay-zebra           = 'X'.
  lay-flexible_key      = 'X'.
  lay-totals_text      =  text-002."=SUM
  lay-detail_initial_lines      =  'X'.
*
  x_save = 'X'.
  gs_variant-report     = sy-repid.

  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
            I_STRUCTURE_NAME = c_tabname
            IS_VARIANT       = gs_variant
            IS_layout        = lay
            I_SAVE           = x_save
       TABLES
            T_OUTTAB         = gridtab
       EXCEPTIONS
            OTHERS           = 1.

regards Andreas

0 Kudos

Hi Andreas,

Thanx for reply.....

I tried doing as per ur suggestion....

But somehow its still not working.

Is there any dependancy....I mean Total_text = "Total" works only when some other option is on or so...?

Regards

Prafulla

Former Member
0 Kudos

Hi Prafulla,

it seems, that totals_text and subtotals_text is supported by ALV LIST only.

The way of viewing totals is in ALV GRID little bit different then in ALV LIST, asterisks aren't show in 1st column, but in the same column as totals and so on...

You can easily test differences between ALV LIST and ALV GRID by replacing GRID with LIST in CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'.

Regards,

Petr

0 Kudos

Hey Petr....

You are right.....

I tried it with REUSE_ALV_GRID_DISPLAY. Total text is displayed in list But somehow its not working in GRID.

Do you know any work around for this problem?

Regards

Prafulla

0 Kudos

Hi Prafulla,

I explored FM REUSE_ALV_GRID_DISPLAY and there is no possibility to put totals_text probably, unfortunately...

Regards,

Petr

Former Member
0 Kudos

hi me to i have the same problem

   FORM create_layout .
  data: text(20) TYPE c.
  it_layout-window_titlebar   = text.
  it_layout-colwidth_optimize = 'X'.
  it_layout-totals_text       = text-013."'Totals'(013).
  it_layout-cell_merge        = 'X'.
  it_layout-zebra             = 'X'.
ENDFORM.         

but no output total in alv

also i had another broplem i had unit i wanna show it in total line and calc value in header

manuelhildemaro_ramossanc
Active Participant
0 Kudos

Hi Prafulla.

Check this link http://www.saptechnical.com/Tutorials/ALV/Subtotals/text.htm

Regards,

Manuel H.