PDA

Ver la Versión Completa : HELP !!! Error en tiempo de ejecucion con alv


aelma
06/10/06, 20:26:16
Hola a todos,

Tengo un prob, ejecutando un alv con subtotales, estoy usando la funcion grid_display, cuando no uso el parametro I_SORT, el ALV me aparece perfectamente, pero no me divide los subtotales, sino, que me hace una sumatoria final, pero cuando incluyo el parametro I_SORT con la tabla donde guardo los valores para el SORT, recibo un error en tiempo de ejecucion.

Diganme ustedes, que estoy haciendo mal?
Gracias por su ayuda.

------
Info posición de cancelación


The termination occurred in the ABAP program "SAPLSLVC " in
"LVC_SORT_COMPLETE".
The main program was "ZCORINF01 ".

The termination occurred in line 36 of the source code of the (Include)
program "LSLVCU10 "
of the source code of program "LSLVCU10 " (when calling the editor 360).


Para generar el ALV, estoy primero creando el catalogo de campos, tipo SLIS_T_FIELDCAT_ALV, por ejemplo:

CLEAR L_FIELDCAT.
L_FIELDCAT-TABNAME = 'IT_ALV'.
L_FIELDCAT-FIELDNAME = 'VALDESV01'.
L_FIELDCAT-SELTEXT_M = 'Desv. Enero'.
L_FIELDCAT-DO_SUM = 'X'.
APPEND L_FIELDCAT TO P_FIELDTAB.


Luego estoy generando el sort:

DATA: lt_sp_groups TYPE slis_t_sp_group_alv,
l_t_fieldcat TYPE slis_t_fieldcat_alv,
l_layout TYPE slis_layout_alv,
l_t_sort TYPE slis_t_sortinfo_alv,
l_sort TYPE slis_sortinfo_alv,
l_t_event TYPE slis_t_event,
l_event TYPE slis_alv_event,
l_repid LIKE sy-repid.

* SE FIJAN PARAMETROS DE LAYOUT
l_layout-colwidth_optimize = 'X'.
l_layout-get_selinfos = 'X'.
l_layout-f2code = 'DETAIL'.

* SE FIJAN PARAMETROS DE EVENTOS
l_event-name = slis_ev_top_of_page.
l_event-form = 'ALV_TOP_OF_PAGE'.
APPEND l_event TO l_t_event.

* SE FIJAN PARAMETROS DE SORT
CLEAR l_sort.
l_sort-fieldname = 'ORDEN'.
l_sort-spos = 1.
l_sort-up = 'X'.
l_sort-subtot = 'X'.
APPEND l_sort TO l_t_sort.

CLEAR l_sort.
l_sort-fieldname = 'KSTAR'.
l_sort-spos = 2.
l_sort-up = 'X'.
APPEND l_sort TO l_t_sort.

y por ultimo estoy llamando la funcion para generar el grid:

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPORTE
I_CALLBACK_USER_COMMAND = G_USER_COMMAND
* I_STRUCTURE_NAME = 'IT_ALV'
I_GRID_TITLE = TEXTO
IS_LAYOUT = IT_LAYOUT
IT_FIELDCAT = FIELDCAT
I_DEFAULT = 'A'
I_SAVE = G_SAVE
IS_VARIANT = G_VARIANT
IT_SORT = l_t_sort
IT_EVENTS = IT_EVENTS[]
TABLES
T_OUTTAB = IT_ALV
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
WRITE: 'SY-SUBRC: ', SY-SUBRC, 'REUSE_ALV_LIST_DISPLAY'.
ENDIF.