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

alv display

Former Member
0 Likes
531

Hi ,

The Requirent is as below example at the moment am able to display all fields except the 'subtotal' 'division total' 'capacity' row and the sum for that .

Any sample code pls.

eg : display in the alv grid

group plant status week

-


g1 | plant1 | R | 10

g1 | palnt1 | l | 20

g1 | plant1 | b | 30

subtotal| plant | | 60

g1 | plant2 | R | 10

g1 | palnt2 | l | 20

g1 | plant2 | b | 30

subtotal | plant | 60

divisiontot| division | 120

capacity | division | 180

-


thanks,

vind.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
509

Hello,

In the IT_SORT parameter of REUSE_ALV_LIST_DISPLAY

fill entries for following parameter.

fieldname = plant

subtot = 'X'

append fieldname to it_sort.

fieldname = division.

subtot = 'X'

append fieldname to it_sort.

And it will by default show you subtotals.

Hope that helps.

Regards

Kapadia

***Assigning points is the way to say thanks in SDN.***

Hi ,

The Requirent is as below example at the moment am able to display all fields except the 'subtotal' 'division total' 'capacity' row and the sum for that .

Any sample code pls.

eg : display in the alv grid

group plant status week

-


g1 | plant1 | R | 10

g1 | palnt1 | l | 20

g1 | plant1 | b | 30

subtotal| plant | | 60

g1 | plant2 | R | 10

g1 | palnt2 | l | 20

g1 | plant2 | b | 30

subtotal | plant | 60

divisiontot| division | 120

capacity | division | 180

-


thanks,

vind.

3 REPLIES 3
Read only

Former Member
0 Likes
510

Hello,

In the IT_SORT parameter of REUSE_ALV_LIST_DISPLAY

fill entries for following parameter.

fieldname = plant

subtot = 'X'

append fieldname to it_sort.

fieldname = division.

subtot = 'X'

append fieldname to it_sort.

And it will by default show you subtotals.

Hope that helps.

Regards

Kapadia

***Assigning points is the way to say thanks in SDN.***

Read only

Former Member
0 Likes
509

for the fieldcat of week field ifieldcat-do_sum = 'X'.

data : isort type slis_t_sortinfo_alv,

wsort type slis_sortinfo_alv.

wsort-fieldname = 'WERKS'.

wsort-up = 'X'.

wsort-subtot = 'X'.

wsort-group = 'UL'.

append wsort to isort.

do same for division also.

now pass isort to alv grid display fn module.

regards

shiba dutta

Read only

0 Likes
509

Hi,

I checked with the code and its give me a runtime error that 'FM interface allows you to soecify only fields of a particular type under IT_FIELDCAT . The field T_FIELDCAT specified here has a different field type.

i have include the code like below......

-


data : isort type slis_t_sortinfo_alv,

wsort type slis_sortinfo_alv.

wsort-fieldname = 'WERKS'.

wsort-up = 'X'.

wsort-subtot = 'X'.

wsort-group = 'UL'.

append wsort to isort.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = 'ZTEST'

i_callback_pf_status_set = 'SET_PF_STATUS'

i_callback_user_command = 'USER_COMMAND_ALV'

i_structure_name = 'ITAB_DISPLAY'

is_layout = t_layout

it_fieldcat = t_fieldcat

it_sort = isort

it_special_groups = t_spec_groups

i_default = 'X'

i_save = g_save

is_variant = g_variant

it_events = t_events

TABLES

t_outtab = itab_display

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.

ENDFORM. " do_the_alv

-


may i know how to rectify this error and get the right output..

thanks,

vind.