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

Changing ALV Subtotal Text..???

Former Member
0 Likes
1,070

Dear ABAP ers,

I have a question for you.

I am dealing with the event SUTOTAL_TEXT in ALV, to change sub total text in the screen?

But the event is not triggered and the control is not going to that FORM.

*****************************************************************************

FORM eventtab_build CHANGING lt_events TYPE slis_t_event.

CONSTANTS: gc_formname_subtotal_text TYPE slis_formname value 'SUBTOTAL_TEXT',

DATA: ls_event TYPE slis_alv_event.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = lt_events.

READ TABLE lt_events WITH KEY name = slis_ev_subtotal_text into ls_event.

if sy-subrc = 0.

move 'gc_formname_subtotal_text to ls_event-form.

append ls_event to lt_events.

endif.

ENDFORM.

*****************************************************************************

FORM alv.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = g_repid

is_layout = gs_layout

it_fieldcat = gt_fieldcat[]

it_sort = gt_sort[]

it_events = gt_events[]

is_print = gs_print

tables

t_outtab = gt_output

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.

FORM subtotal_text CHANGING p_subtot_text TYPE slis_subtot_text.

BREAK-point.

ENDFORM. "subtotal_text

But the control is not coming to the above break-point.

ANY SUGGESTIONS FLOKS???

Srihari.

Dear ABAP ers,

I have a question for you.

I am dealing with the event SUTOTAL_TEXT in ALV, to change sub total text in the screen?

But the event is not triggered and the control is not going to that FORM.

*****************************************************************************

FORM eventtab_build CHANGING lt_events TYPE slis_t_event.

CONSTANTS: gc_formname_subtotal_text TYPE slis_formname value 'SUBTOTAL_TEXT',

DATA: ls_event TYPE slis_alv_event.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = lt_events.

READ TABLE lt_events WITH KEY name = slis_ev_subtotal_text into ls_event.

if sy-subrc = 0.

move 'gc_formname_subtotal_text to ls_event-form.

append ls_event to lt_events.

endif.

ENDFORM.

*****************************************************************************

FORM alv.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = g_repid

is_layout = gs_layout

it_fieldcat = gt_fieldcat[]

it_sort = gt_sort[]

it_events = gt_events[]

is_print = gs_print

tables

t_outtab = gt_output

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.

FORM subtotal_text CHANGING p_subtot_text TYPE slis_subtot_text.

BREAK-point.

ENDFORM. "subtotal_text

But the control is not coming to the above break-point.

ANY SUGGESTIONS FLOKS???

Srihari.

6 REPLIES 6
Read only

Former Member
0 Likes
867

Change the code as specified:

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = lt_events.

READ TABLE lt_events WITH KEY name = slis_ev_subtotal_text into ls_event.

if sy-subrc = 0.
move 'gc_formname_subtotal_text to ls_event-form.
*append ls_event to lt_events.
modify lt_events from ls_event index sy-tabix. " Not too sure of the syntax,
endif.

Not too sure of the Modify syntax, but you have to modify the lt_events itab and not append.

Regards,

Ravi

Read only

Former Member
0 Likes
867

Hi,

Need to Modify...

READ TABLE lt_events WITH KEY name = slis_ev_subtotal_text into ls_event.

if sy-subrc = 0.
move 'gc_formname_subtotal_text to ls_event-form.
MODIFY lt_events FROM  ls_event TRANSPORTING form INDEX SY-TABIX.
endif.

Read only

0 Likes
867

Sorry..

i m doing MODIFY in my code, and the internal table GT_EVENTS is updated with the respective FORM name against the event SUBTOTAL_TEXT.

Still Control is not going to that form.

Read only

0 Likes
867

There is one trick...

you need to have one extra dummy field, for that field populate fieldcatalog and set it as Tech field. and Populate the Sort For that field. then it will trigger..

Follow the thread...

Read only

0 Likes
867

I want to change the text for the subtotal..

Read only

0 Likes
867

yes even i am talking about that...did you check the above mentioned thread...