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: 

ALV Grand total text

Former Member
0 Kudos

Hi,

How can i set a my own text to ALV grand total ?

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

for grand totals i think we cant display text like the process below....

but we have to add is_layout-totals_text = 'xxxxxxx'.

Try it out.....

To display the subtotal text, we need to give fieldcatalog of the sorting field with "NO_OUT" option as 'X'.

wg_fieldcatalog-no_out = 'X'. "No output

if you give the above option then the corresponding column will not shown in the output.If you want to display that field also then we need to declare the fieldcatalog for the same field twice one with "NO_OUT" option as 'X' and other with no "NO_OUT" option.

ls_layout-subtotals_text = 'SUBTOTAL'.

Reward all helpful answers...

Thanks

7 REPLIES 7

Former Member
0 Kudos

Hi,

Please refer to this link. It might be useful to you. Reward if useful.

Regards,

Mark

Former Member

Former Member

Former Member
0 Kudos

Hi,

for grand totals i think we cant display text like the process below....

but we have to add is_layout-totals_text = 'xxxxxxx'.

Try it out.....

To display the subtotal text, we need to give fieldcatalog of the sorting field with "NO_OUT" option as 'X'.

wg_fieldcatalog-no_out = 'X'. "No output

if you give the above option then the corresponding column will not shown in the output.If you want to display that field also then we need to declare the fieldcatalog for the same field twice one with "NO_OUT" option as 'X' and other with no "NO_OUT" option.

ls_layout-subtotals_text = 'SUBTOTAL'.

Reward all helpful answers...

Thanks

Former Member

Former Member
0 Kudos

add a new field to output table and populate it with the same value of field your totaling .

ls_fieldcat-fieldname = 'new_field'.

ls_fieldcat-tabname = 'TS_OUTPUT'.

ls_fieldcat-seltext_m = 'Totalling'.

ls_fieldcat-col_pos = 0.

ls_fieldcat-key = 'X'.

ls_fieldcat-no_out = 'X'. "No output

ls_fieldcat-tech = 'X'. "Technical field

APPEND ls_fieldcat TO gt_fieldcat.

CLEAR ls_fieldcat.

sort .

ls_sort-spos = '0' .

ls_sort-fieldname = 'new_field'.

ls_sort-tabname = 'TS_OUTPUT'.

ls_sort-up = 'X'.

ls_sort-subtot = 'X'.

APPEND ls_sort TO gt_sort.

CLEAR ls_sort.

events

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 4

IMPORTING

et_events = gt_events

EXCEPTIONS

list_type_wrong = 0

OTHERS = 0.

"* Subtotal

READ TABLE gt_events INTO ls_event

WITH KEY name = slis_ev_subtotal_text.

IF sy-subrc = 0.

MOVE c_formname_subtotal_text TO ls_event-form.

MODIFY gt_events FROM ls_event INDEX sy-tabix.

ENDIF.

Form sub_total_text

FORM subtotal_text CHANGING

p_total TYPE any

p_subtot_text TYPE slis_subtot_text.

  • Patient Level Text

IF p_subtot_text-criteria = 'new_field'.

p_subtot_text-display_text_for_subtotal

= 'GRAND Total'(011).

ENDIF.

Reward if helpfull

Former Member
0 Kudos

Hi,

Please refer the link below:

http://www.saptechnical.com/Tutorials/ALV/Total/text.htm

Thanks,

Sriram POnna.