Ver la Versión Completa : Tablas Internas
belen6183
22/02/09, 11:06:49
HOla Gente:
Tengo daclarado en el include TOP lo sig:
types: begin of ty_vbap ,
vbeln type vbap-vbeln,
posnr type vbap-posnr,
matnr type vbap-matnr,
matwa type vbap-matwa,
end of ty_vbap.
types: tt_ty_vbap type ty_vbap.
y necesito pasar por parametro de una rutina una tabla del tipo tt_ty_vbap
osea esto:
form f_cargar tables t_vbap type tt_ty_vbap.
pero me da error de tipos y no se con que tipo pasar la tabla.
Gracias!!!
Jonathan Barrio Rodriguez
22/02/09, 15:27:37
Conozco la tabla standar vbap pero Desconozco que tipo de tabla es la tt_ty_vbap, supongo que has comprobado que existe... de todos modos mira que la tabla (tt_ty_vbap) no sea una vista, osea pueda llevar varios registros, no vaya a ser que solo pueda ser para una línea.
No estoy seguro pero me suena qué el "FORM nombre_form TABLE tabla_interna TYPE tabla_referenciada" se hace en el PERFORM:
"PERFORM nombre_form TABLE tabla_interna TYPE tabla_referenciada", no?
Tal vez tengas que declarar también la tabla en el include:
"TABLES: tt_ty_vbap"
ó
"TABLES: v_bap" --> supongo que son la misma estructuras.
Comprueba a ver si algo de esto funciona y nos cuantas.
Saludos y suerte.
Mauricio Hidalgo
22/02/09, 17:21:47
Con que cambies
types: tt_ty_vbap type ty_vbap.
por
types: tt_ty_vbap type table of ty_vbap.
es suficiente.
DavidXD_XD
22/02/09, 21:15:14
Comparto la opinion de Mauricio, tbm hay otra forma :D
*&---------------------------------------------------------------------*
*& Report ZPRUEBA_1
*&
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ZPRUEBA_1.
TYPES: BEGIN OF ty_itab,
campo1,
campo2,
campo3,
END OF ty_itab.
TYPES: tab_itab TYPE TABLE OF ty_itab.
DATA: gt_itab TYPE tab_itab.
START-OF-SELECTION.
* Primera Forma
PERFORM rutina_1 TABLES gt_itab.
* Segunda Forma
PERFORM rutina_2 TABLES gt_itab.
*&---------------------------------------------------------------------*
*& Form rutina_1
*&---------------------------------------------------------------------*
* Primera forma
*----------------------------------------------------------------------*
* -->PT_ITAB text
*----------------------------------------------------------------------*
FORM rutina_1 TABLES pt_itab TYPE tab_itab.
...
ENDFORM. " rutina_1
*&---------------------------------------------------------------------*
*& Form rutina_2
*&---------------------------------------------------------------------*
* Segunda forma
*----------------------------------------------------------------------*
* -->P_GT_ITAB text
*----------------------------------------------------------------------*
FORM rutina_2 TABLES pt_itab LIKE gt_itab[].
...
ENDFORM. " rutina_2
www.mundosap.com 2006 - Spain
software crm, crm on demand, software call center, crm act, crm solutions, crm gratis, crm web