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: 

Total and non-total lines in ALV grid

Former Member
0 Kudos

Hi all,

Does anyone know if there is any standard SAP functionality for retrieving the non-total/raw item lines that lies beneath a total line in an ALV grid (after the user has selected the total line)?

All helpful answers will be rewarded!

Best regards,

MV

6 REPLIES 6

former_member745780
Active Participant
0 Kudos

hello

try this make ur fieldcatalog and make DO_SUM field X

WA_FIELDCAT-SELTEXT_M = 'Net Weight'.

WA_FIELDCAT-DO_SUM = 'X'.

APPEND WA_FIELDCAT TO I_FIELDC

Thanks

Former Member
0 Kudos

In layout u have that fields. u search layout field catalog. u wil get it.

0 Kudos

Hi,

I think you're misunderstanding...

I do not need to sum up the lines (time registration lines), they have already been aggregated in a total line. What I need is to retrieve (in the program code) the the item lines that makes up the total line/the lines that lies "hidden" behind the total line, so I can pass them on to time approval.

MV

0 Kudos

Try the ALV event AFTER-LINE-OUTPUT may be it can help u to achieve ur requirement.

Append AFTER-LINE-OUTPUT event to the internal table T_EVENT.

CLEAR W_EVENT.

W_EVENT-FORM = SLIS_EV_AFTER_LINE_OUTPUT.

W_EVENT-NAME = SLIS_EV_AFTER_LINE_OUTPUT.u201CAFTER_LINE_OUTPUT event

APPEND W_EVENT TO T_EVENT.

FORM AFTER_LINE_OUTPUT

USING P_RS_LINEINFO TYPE SLIS_LINEINFO.

  • Here you have to write the logic to retrieve the 'total' line

ENDFROM.

Now call the alv FM

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = L_REPID "Program Name

IS_LAYOUT = W_LAYOUT "Layout of the Report

IT_FIELDCAT = T_FIELDCAT "Field Catalog for Report

IT_EVENTS = T_EVENT "For setting the events

TABLES

T_OUTTAB = T_OUTPUT "Report data Internal Table

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

0 Kudos

Thank you!

But when is this event called...? For each line that is written to the screen, or...?

MV

0 Kudos

Yes..it is called for each line that is written to the screen.