MUNDOSAP

MUNDOSAP (foro/index.php)
-   Programación ABAP IV (foro/forumdisplay.php?f=4)
-   -   ALV tree (foro/showthread.php?t=9608)

karasap 07/12/07 11:55:39

ALV tree
 
Hola, buenas. Soy novato en este mundo y estoy mirando un poco lo del tema de orientacion a objetos. Quiero hacer un como un explorador con sus carpetas y subcarpetas. La cosa es que me aparece el docking pero dentro no me aparece nada. El codigo no es largo, lo pongo aqui a ver si alguno ve lo que me falta,porque yo no lo veo. Muchas gracias.

REPORT ZGOTZON17.

TABLES : ZCCSALTP.

DATA: PRUEBA,
*DATA: CLAVE, NODE.
hierarchy_header TYPE treev_hhdr.


*&---------------------------------------------------------------------*
*& Module DECLARACION OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE DECLARACION OUTPUT.

DATA: begin of i_resul occurs 0,
* clave(4) type c value '0000',
clave type tv_nodekey,
padre type tv_nodekey,
cta71 like zccsaltp-cta71,
fecmov like zccsaltp-fecmov,
impant like zccsaltp-impant,
impent like zccsaltp-impent,
impsal like zccsaltp-impsal,
impact like zccsaltp-impact,
saldo(17) type c,
end of i_resul.
BREAK XE02951.

data: begin of gt_arbol occurs 0,
clave(3) type c,
padre(3) type c,
end of gt_arbol.

IF I_resul[] IS initial.

select * from zccsaltp.

move-corresponding zccsaltp to i_resul.

append i_resul.

add '1' to i_resul-clave.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = I_resul-CLAVE
IMPORTING
output = I_resul-CLAVE.

endselect.

ENDIF.

ENDMODULE. " DECLARACION OUTPUT
DATA gr_tree TYPE REF TO ZCL_UT_TREE_SIMPLE .

*--- Nombre del control custom del screen.

DATA gc_nombre_custom_control TYPE scrfname VALUE 'CC_ARBOL'.

*--- Referencia a la instancia del container custom.

DATA gr_ccontainer TYPE REF TO cl_gui_custom_container .

*--- Tabla del catalogo de campos (field catalog)
DATA gt_fieldcat TYPE lvc_t_fcat .

*--- Estructura layout. (aparencia del alv)
DATA gs_layout TYPE lvc_s_layo .

*&---------------------------------------------------------------------*
*& Module CREAR_ARBOL OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE CREAR_ARBOL OUTPUT.

*_______Creo container______________________

CREATE OBJECT GR_CCONTAINER
EXPORTING
CONTAINER_NAME = 'CC_ARBOL' .

*________Creo arbol_________________________________

CREATE OBJECT GR_TREE
EXPORTING
I_PARENT = GR_CCONTAINER.

**_________Crear scroll_______________________
*
CALL METHOD GR_TREE->CREAR_NODOS.
**___________________________________________________

data: l_primero.
clear l_primero.

loop at i_resul.

i_resul-clave = i_resul-clave + 1.

if not l_primero is initial.

i_resul-padre = '1'.

endif.

l_primero = 'X'.

CALL METHOD GR_TREE->ADD_NODO_TABLA
EXPORTING
I_CLAVE = i_resul-clave
I_PADRE = i_resul-padre
I_TEXTO = 'prueba'.

ENDLOOP.

ENDMODULE. " CREAR_ARBOL OUTPUT


Husos Horarios son GMT. La hora en este momento es 01:17:52.

www.mundosap.com 2006 - Spain
software crm, crm on demand, software call center, crm act, crm solutions, crm gratis, crm web