MUNDOSAP

Regresar   MUNDOSAP > DESARROLLO > Programación ABAP IV
Nombre de Usuario
Contraseña
Home Descargas Registrar FAQ Miembros Calendario Buscar Temas de Hoy Marcar Foros Como Leídos




 
Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Viejo 24/04/12, 21:20:36
Dany24 Dany24 is offline
Junior Member
 
Fecha de Ingreso: abr 2012
Mensajes: 10
Mis primeras lineas de un ALV

Hola, gracias por el apoyo esta algo complicado, pero nada imposible... estuve haciendo un ALV con ayuda de una buena persona de aqui mas o menos me guie... y llevo esto, ojala me puedan decir donde esta el error solo es mostrar los datos... gracias y linda semana a todos:

*&---------------------------------------------------------------------*
*& Report Z_REPORT
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

report z_report.

include z_report_top.
include z_report_rut.

start-of-selection.
perform selecciona_informacion.
if z_report[] is not initial.
perform report.
else.
endif.


*&---------------------------------------------------------------------*
*& Include Z_REPORT_TOP
*&--------------------------------------------------------------------*

TYPE-POOLS: slis.

form genera_titulos .

data: I_fieldcat type slis_fieldcat_vbrk.
data w_fieldcat like line of I_fieldcat.

TABLES: vbrk.

TYPES: BEGIN OF report,
vbeln TYPE vbeln,
fkart TYPE fkart,
fktyp TYPE fktyp,
vbtyp TYPE vbtyp,
waers TYPE waerk,
vkorg type vkorg,
vtweg type vtweg,
kalsm type kalms,
knumv type knumv,
vsbed type vsbed.
types end of report.
data it_report type standard table of t_report.
data w_report like line of it_report.

data vbrk like line of vbrk.

*&---------------------------------------------------------------------*
*& Include Z_REPORT_RUT
*&---------------------------------------------------------------------*
form procesa.
select VBELN FKART FKTYP VBTYP WAERK VKORG VTWEG KALSM KNUMV VSBED
into table vbkr
from z_report.
endform.


Form report.
data: l_fieldcat type slis_fieldcat_alv.
data w_fieldcat like line of i_fieldcat.

loop at i_fieldcat into w_fieldcat.
case w_fieldcat-fieldname.

when 'VBELN'.
w_fieldcat-reptext_ddic = 'FACTURA'.
when 'FKART'.
w_fieldcat-reptext_ddic = 'CLASE FACTURA'.
when 'FKTYP'.
w_fieldcat-reptext_ddic = 'TIPO FACTURA'.
when 'VBTYP'.
w_fieldcat-reptext_ddic = 'TIPO DOC.COM.'.
when 'WAERK'.
w_fieldcat-reptext_ddic = 'MONEDA DOC.'.
when 'VKORG'.
w_fieldcat-reptext_ddic = 'ORGANIZ.VENTAS'.
when 'VTWEG'.
w_fieldcat-reptext_ddic = 'CANAL DISTRIB.'.
when 'KALSM'.
w_fieldcat-reptext_ddic = 'ESQUEMA CALCULO'.
when 'KNUMV'.
w_fieldcat-reptext_ddic = 'CONDICION DOC'.
when 'VSBED'.
w_fieldcat-reptext_ddic = 'CONDIC.EXPED.'.

ENDCASE.

modify i_fieldcat from w_fieldcat.
endloop.

Ah i me manda un error en esta parte... I_fieldcat

Úlima edición por Dany24 fecha: 24/04/12 a las 22:01:35.
Responder Con Cita
  #2  
Viejo 25/04/12, 09:37:26
Dany24 Dany24 is offline
Junior Member
 
Fecha de Ingreso: abr 2012
Mensajes: 10
Si alguien me pudiera explicar si esta bien lo que hice o esta mal se los agradeceria chicos, jejejeje gracias... quiero ver si entendi y porque me sale ese mensaje de error en i_fielcat... :P
Responder Con Cita
  #3  
Viejo 25/04/12, 13:11:26
Avatar de hugoa77
hugoa77 hugoa77 is offline
Senior Member
 
Fecha de Ingreso: may 2010
Mensajes: 130
la verdad que veo varios problemas en el código (a mi parecer...)
cual es el mensaje de error que te da? copialo completo para poder ayudarte...
slds,
Responder Con Cita
  #4  
Viejo 25/04/12, 13:43:49
Conchis Conchis is offline
Junior Member
 
Fecha de Ingreso: may 2008
Localización: Mérida, Yucatán, México
Mensajes: 4
Hola,

Este es parte de código que utilizo y a mi me funciona.

TYPE-POOLS: slis.

DATA : gt_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
gs_layout TYPE slis_layout_alv.

gt_fieldcat-fieldname = 'VBELN'.
gt_fieldcat-ref_fieldname = 'VBELN'.
gt_fieldcat-reptext_ddic = 'FACTURA'.
gt_fieldcat-seltext_l = 'FACTURA'.
gt_fieldcat-seltext_m = 'FACTURA'.
gt_fieldcat-seltext_s = 'FACTURA'.
gt_fieldcat-ddictxt(1) = 'L'.
gt_fieldcat-ref_tabname = 'VBRK'.
APPEND gt_fieldcat .
CLEAR gt_fieldcat.

Saludos.
__________________
Conchis
Responder Con Cita
  #5  
Viejo 25/04/12, 14:09:54
Dany24 Dany24 is offline
Junior Member
 
Fecha de Ingreso: abr 2012
Mensajes: 10
Hola... :D


Hola Hugito, mira le doy guardar y luego activar y me manda error y dice
Error en sintaxis
Descripción Linea Clase
Include Z_REPORT_TOP 10 (botón rojo)
"I_FIELDCAT" is not an internal table
Include Z_REPORT_TOP 7 (BOTÓN AMARILLO)
There should only be definitions in the TOP include (or nested includes
within it). This means that all kinds of implementation (CLASS...
IMPLEMENTATION, not meaningful. is not meaningful.

*&---------------------------------------------------------------------*
*& Report Z_REPORT
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

report z_report.

include z_report_top.
include z_report_rut.

start-of-selection.
perform selecciona_informacion.
if z_report[] is not initial.
perform report.
else.
endif.
Responder Con Cita
  #6  
Viejo 25/04/12, 14:16:11
Dany24 Dany24 is offline
Junior Member
 
Fecha de Ingreso: abr 2012
Mensajes: 10

Hola si como le comentaba a Hugo, le doy en guardar y luego activar pero me sale error y bueno es una prueba pero me guié con el ejemplo que me mandaste y de otros programas de los consultores, pero son woow mounstruos de programas... me refiero que los admiro woow tanto codigo ojala pronto pueda estar haciendo algo como ustedes... el mensaje es este...


Error en sintaxis
Descripción Linea Clase
Include Z_REPORT_TOP 10 (botón rojo)
"I_FIELDCAT" is not an internal table
Include Z_REPORT_TOP 7 (BOTÓN AMARILLO)
There should only be definitions in the TOP include (or nested includes
within it). This means that all kinds of implementation (CLASS...
IMPLEMENTATION, not meaningful. is not meaningful.

*&---------------------------------------------------------------------*
*& Report Z_REPORT
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

report z_report.

include z_report_top.
include z_report_rut.

start-of-selection.
perform selecciona_informacion.
if z_report[] is not initial.
perform report.
else.
endif.
Responder Con Cita
  #7  
Viejo 25/04/12, 14:33:13
Mauricio Hidalgo Mauricio Hidalgo is offline
Senior Member
 
Fecha de Ingreso: may 2006
Localización: Santiago, Chile
Mensajes: 481
Respecto del mensaje original.

Tienes declarado l_fieldcat como

data: l_fieldcat type slis_fieldcat_alv

deberia ser

data: l_fieldcat type table of slis_fieldcat_alv

Saludos
Responder Con Cita
  #8  
Viejo 25/04/12, 14:50:48
Dany24 Dany24 is offline
Junior Member
 
Fecha de Ingreso: abr 2012
Mensajes: 10
Gracias


Gracias que amable eres Mau... lo checo... lindo dia.
Responder Con Cita
  #9  
Viejo 25/04/12, 15:10:14
Avatar de hugoa77
hugoa77 hugoa77 is offline
Senior Member
 
Fecha de Ingreso: may 2010
Mensajes: 130
hasta lo que escribiste ahora... tu codigo deberia quedar mas o menos asi...
REPORT YTEST.
include ytest_top.
include ytest_rut.

start-of-selection.
perform procesa.
perform report .
if it_report is not initial.
perform report.
else.
endif.

*&---------------------------------------------------------------------*
*& Include YTEST_TOP
*&---------------------------------------------------------------------*
TYPE-POOLS: slis.

*form genera_titulos .

data: I_fieldcat type slis_t_fieldcat_alv WITH HEADER LINE.
data w_fieldcat like line of I_fieldcat.

TABLES: vbrk.

TYPES: BEGIN OF t_report,
vbeln TYPE vbeln,
fkart TYPE fkart,
fktyp TYPE fktyp,
vbtyp TYPE vbtyp,
waers TYPE waerk,
vkorg type vkorg,
vtweg type vtweg,
kalsm type kalsm,
knumv type knumv,
vsbed type vsbed.
types end of t_report.
data it_report type standard table of t_report.
data w_report like line of it_report.

*data vbrk like line of vbrk.

*&---------------------------------------------------------------------*
*& Include YTEST_RUT
*&---------------------------------------------------------------------*
form procesa.
select VBELN FKART FKTYP VBTYP WAERK VKORG VTWEG KALSM KNUMV VSBED
from vbrk
into table it_report.
endform.


Form report.
data: l_fieldcat type slis_fieldcat_alv.
data w_fieldcat like line of i_fieldcat.

loop at i_fieldcat into w_fieldcat.
case w_fieldcat-fieldname.

when 'VBELN'.
w_fieldcat-reptext_ddic = 'FACTURA'.
when 'FKART'.
w_fieldcat-reptext_ddic = 'CLASE FACTURA'.
when 'FKTYP'.
w_fieldcat-reptext_ddic = 'TIPO FACTURA'.
when 'VBTYP'.
w_fieldcat-reptext_ddic = 'TIPO DOC.COM.'.
when 'WAERK'.
w_fieldcat-reptext_ddic = 'MONEDA DOC.'.
when 'VKORG'.
w_fieldcat-reptext_ddic = 'ORGANIZ.VENTAS'.
when 'VTWEG'.
w_fieldcat-reptext_ddic = 'CANAL DISTRIB.'.
when 'KALSM'.
w_fieldcat-reptext_ddic = 'ESQUEMA CALCULO'.
when 'KNUMV'.
w_fieldcat-reptext_ddic = 'CONDICION DOC'.
when 'VSBED'.
w_fieldcat-reptext_ddic = 'CONDIC.EXPED.'.

ENDCASE.

modify i_fieldcat from w_fieldcat.
endloop.
ENDFORM.

donde armas el catologo del ALV tendrias que tener mas o menos esta estructura:
i_fieldcat-seltext_l = ''. nombre del campo
i_fieldcat-fieldname = ''. campo de tu tabla interna "it_report"
i_fieldcat-outputlen = ''. opcional
i_fieldcat-just = ''. opcional
i_fieldcat-tabname = ''. tabla interna. en tu caso "it_report"
append i_fieldcat. clear i_fieldcat.

esto haces por cada campo que quieras mostrar en el ALV.

bueno... espero te sirva..
fijate que comente algunas lineas en otras cambie algunos datos de lugar y esas cosas... compara el tu codigo con el que te envío para que puedas ver las diferencias y saber lo que estaba mal...
slds
Responder Con Cita
  #10  
Viejo 25/04/12, 15:22:19
Dany24 Dany24 is offline
Junior Member
 
Fecha de Ingreso: abr 2012
Mensajes: 10
:d

Gracias que lindo eres y que amable por ayudarme... lo checare en este momento...
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Reglas de Mensajes
no puedes crear nuevos temas
no puedes responder temas
no puedes adjuntar archivos
no puedes editar tus mensajes

El código vB está On
Las caritas están On
Código [IMG] está On
Código HTML está Off
Saltar a Foro


Husos Horarios son GMT. La hora en este momento es 19:22:56.


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