Hola buenas , a todos de nuevo , sigo probando esto de abap , ahora el problema que me da es el siguiente , con el codigo de abajo no consigo carga la tabla it_datos_res .
Mas abajo en el codigo , en negrita esta el resultado del debbuing, porque parece que todo va bien . hay datos en la tabla it_sflight y it_spfli, pero cuando igualos sus campos a los de la it_datos_res , resultan que esta sus campos sin datos, alguna ayuda , y gracias
*----------------------------------------------------------------------*
***INCLUDE ZINCLUDE_FRAN .
*----------------------------------------------------------------------*
*DECLARACION DE LOS OBJETOS ALV
DATA: OBJECT_USU TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
OBJECT_ALV_USU TYPE REF TO CL_GUI_ALV_GRID,
OBJECT_RES TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
OBJECT_ALV_RES TYPE REF TO CL_GUI_ALV_GRID.
DATA: it_layout type lvc_s_layo.
data: IT_TABLA TYPE LVC_T_FCAT,
HE_TABLA LIKE LINE OF IT_TABLA.
data: it_fieldcatalog type slis_t_fieldcat_alv,
it_fcat TYPE lvc_t_fcat,
it_fcat2 TYPE lvc_t_fcat,
wa_fcat LIKE LINE OF it_fcat,
wa_fcat2 like line of it_fcat2.
*TABLA DE CLIENTE
*DECLARACIÓN DE ESTRUCTURA PARA LAS RESERVAS.
TYPES: BEGIN OF str_datos_res,
cod_res LIKE Z15REVUSU-CODIGO_RESERVA,
cod_vue LIKE SFLIGHT-CONNID,
dat_sal LIKE SFLIGHT-FLDATE,
hor_sal LIKE SPFLI-DEPTIME,
hor_lle LIKE SPFLI-ARRTIME,
ciu_sal LIKE SPFLI-CITYFROM,
ciu_lle LIKE SPFLI-CITYTO,
precio LIKE SFLIGHT-PRICE,
END OF str_datos_res.
*TABLA DE RESERVA DEL TIPO DE LA ESTRUCTURA.
DATA: it_datos_res TYPE TABLE OF str_datos_res,
wa_datos_res LIkE LINE OF it_datos_res.
data: it_tab_usu TYPE TABLE OF z15usuarios,
it_tab_res_usu TYPE TABLE OF z15revusu WITH HEADER LINE,
it_tab_res_vue TYPE TABLE OF z15revvue ,
wa_tab_res_vue LIKE LINE OF it_tab_res_vue,
it_sflight TYPE TABLE OF sflight WITH HEADER LINE,
it_spfli TYPE TABLE OF spfli WITH HEADER LINE.
DATA :VAR_NIF LIKE Z15USUARIOS-NIF_PASAPORTE.
*&---------------------------------------------------------------------*
*& Module PBO_160 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module PBO_160 output.
SET PF-STATUS 'STATUS_GUI_PROJ'.
*SET TITLEBAR 'TITLEBAR'.
*check object_usu is initial.
*check object_res is initial.
*CREACION DE OBJECTOS DE CONTENEDOR
create object object_usu
exporting
container_name = 'CONTENEDOR_USU'.
create object object_res
exporting
container_name = 'CONTENEDOR_RES'.
*CREACION DE OBJETOS ALV
create object object_alv_usu
exporting
i_parent = object_usu.
create object object_alv_res
exporting
i_parent = object_res.
it_layout-zebra = 'X'.
it_layout-sel_mode = 'D'.
* BUSQUEDA DE LOS DATOS DEL CLIENTE ATRAVES DEL CODRESERVA
it_tab_res_usu-CODIGO_RESERVA = '1111'.
select * from z15revvue into table it_tab_res_vue where
codigo_reserva = it_tab_res_usu-CODIGO_RESERVA.
if it_tab_res_usu-CODIGO_RESERVA = wa_tab_res_vue-codigo_reserva.
loop at it_tab_res_usu.
select * from z15revvue into table it_tab_res_vue
WHERE carrid = wa_tab_res_vue-carrid
AND connid = wa_tab_res_vue-connid.
append wa_tab_res_vue to it_tab_res_vue.
clear wa_tab_res_vue.
endloop.
endif.
*
*BÚSQUEDA EN LAS TABLAS DE SISTEMA DE LOS VUELOS
*RESTRINGIDA POR EL CODIGO DE VUELO, EL CODIGO DE AEROLINEA
*Y EL LA FECHA DEL VUELO;
*DATOS CARGADOS EN EL ANTERIOR LOOP.
LOOP AT it_tab_res_vue into wa_tab_res_vue.
SELECT * INTO table it_sflight FROM sflight * aqui las tabla it_sflight esta cargada
WHERE carrid = wa_tab_res_vue-carrid
AND connid = wa_tab_res_vue-connid
AND fldate = wa_tab_res_vue-fldate.
SELECT * INTO TABLE it_spfli FROM spfli * aqui las tabla it_spfli esta cargada con datos
WHERE carrid = wa_tab_res_vue-carrid
AND connid = wa_tab_res_vue-connid.
wa_datos_res-dat_sal = it_sflight-fldate.**** pero aqui los datos no se cargan en wa_datos
wa_datos_res-precio = it_sflight-price.
wa_datos_res-cod_res = wa_tab_res_vue-codigo_reserva.
wa_datos_res-cod_vue = wa_tab_res_vue-connid.
wa_datos_res-hor_sal = it_spfli-deptime.
wa_datos_res-hor_lle = it_spfli-arrtime.
wa_datos_res-ciu_sal = it_spfli-cityfrom.
wa_datos_res-ciu_lle = it_spfli-cityto.
*
*
APPEND wa_datos_res to it_datos_res.**** la tabla it_datos no se carga
clear wa_DATOS_RES.
endloop.
*****
*CARGA DE LOS CAMPOS EN LA TABLA INTERNA FIELDCATALOG DE LOS DATOS DE
*RESERVA,
*DONDE EL CAMPO scrtext_s EXPRESA LO QUE SE VISUALIZA EN LA ALV.
******
wa_fcat-fieldname = 'COD_RES'.
wa_fcat-scrtext_s = 'Cód. Reserva'.
wa_fcat-ref_table = 'STR_DATOS_RES'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
wa_fcat-fieldname = 'COD_VUE'.
wa_fcat-scrtext_s = 'Cód. Vuelo'.
wa_fcat-ref_table = 'STR_DATOS_RES'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
wa_fcat-fieldname = 'DAT_SAL'.
wa_fcat-scrtext_s = 'Día Salida'.
wa_fcat-ref_table = 'STR_DATOS_RES'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
wa_fcat-fieldname = 'HOR_SAL'.
wa_fcat-scrtext_s = 'Salida'.
wa_fcat-ref_table = 'STR_DATOS_RES'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
wa_fcat-fieldname = 'CIU_SAL'.
wa_fcat-scrtext_s = 'Origen'.
wa_fcat-ref_table = 'STR_DATOS_RES'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
wa_fcat-fieldname = 'CIU_LLE'.
wa_fcat-scrtext_s = 'Destino'.
wa_fcat-ref_table = 'STR_DATOS_RES'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
wa_fcat-fieldname = 'PRECIO'.
wa_fcat-scrtext_s = 'Precio'.
wa_fcat-ref_table = 'STR_DATOS_RES'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
CALL METHOD object_alv_res->set_table_for_first_display
EXPORTING
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
* I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'it_datos_res'
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
IS_LAYOUT = it_layout
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
CHANGING
it_outtab = it_datos_res
it_fieldcatalog = it_fcat.
*
endmodule. " PBO_160 OUTPUT
*&---------------------------------------------------------------------*
*& Module PAI_160 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module PAI_160 input.
sa_code = ok_code.
clear ok_code.
* DECLARACION DE BOTONES Y DE POPUP.
case sa_code.
when 'BACK' OR 'EXIT' OR 'CANCEL'.
LEAVE PROGRAM.
WHEN 'INTERNET'.
CALL TRANSACTION 'ZWEBABAP17'.
WHEN 'CALCULAR'.
CALL FUNCTION 'FITRV_CALCULATOR'
EXCEPTIONS
invalid_input = 1
calculation_canceled = 2
OTHERS = 3.
when 'BOT_IMPRIMIR'.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
* DEFAULTOPTION = 'Y'
textline1 = 'SI, PARA IMPRINIR ARCHIVO'
* TEXTLINE2 = ' '
titel = 'ACEPTAR'
* START_COLUMN = 25
* START_ROW = 6
* CANCEL_DISPLAY = 'X'
* IMPORTING
ANSWER = L_RESP.
OTHERS = 1.
IF L_RESP = 'J'. "SI
LEAVE PROGRAM.
ENDIF.
WHEN 'BOT_ANULAR'.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
* DEFAULTOPTION = 'Y'
textline1 = 'SI,PARA CANCELAR LA RESERVA'
* TEXTLINE2 = ' '
titel = 'ACEPTAR'
* START_COLUMN = 25
* START_ROW = 6
* CANCEL_DISPLAY = 'X'
IMPORTING
ANSWER = L_RESP.
OTHERS = 1.
IF L_RESP = 'J'. "SI
LEAVE PROGRAM.
ENDIF.
ENDCASE.
endmodule. " PAI_160 INPUT
Mas abajo en el codigo , en negrita esta el resultado del debbuing, porque parece que todo va bien . hay datos en la tabla it_sflight y it_spfli, pero cuando igualos sus campos a los de la it_datos_res , resultan que esta sus campos sin datos, alguna ayuda , y gracias
*----------------------------------------------------------------------*
***INCLUDE ZINCLUDE_FRAN .
*----------------------------------------------------------------------*
*DECLARACION DE LOS OBJETOS ALV
DATA: OBJECT_USU TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
OBJECT_ALV_USU TYPE REF TO CL_GUI_ALV_GRID,
OBJECT_RES TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
OBJECT_ALV_RES TYPE REF TO CL_GUI_ALV_GRID.
DATA: it_layout type lvc_s_layo.
data: IT_TABLA TYPE LVC_T_FCAT,
HE_TABLA LIKE LINE OF IT_TABLA.
data: it_fieldcatalog type slis_t_fieldcat_alv,
it_fcat TYPE lvc_t_fcat,
it_fcat2 TYPE lvc_t_fcat,
wa_fcat LIKE LINE OF it_fcat,
wa_fcat2 like line of it_fcat2.
*TABLA DE CLIENTE
*DECLARACIÓN DE ESTRUCTURA PARA LAS RESERVAS.
TYPES: BEGIN OF str_datos_res,
cod_res LIKE Z15REVUSU-CODIGO_RESERVA,
cod_vue LIKE SFLIGHT-CONNID,
dat_sal LIKE SFLIGHT-FLDATE,
hor_sal LIKE SPFLI-DEPTIME,
hor_lle LIKE SPFLI-ARRTIME,
ciu_sal LIKE SPFLI-CITYFROM,
ciu_lle LIKE SPFLI-CITYTO,
precio LIKE SFLIGHT-PRICE,
END OF str_datos_res.
*TABLA DE RESERVA DEL TIPO DE LA ESTRUCTURA.
DATA: it_datos_res TYPE TABLE OF str_datos_res,
wa_datos_res LIkE LINE OF it_datos_res.
data: it_tab_usu TYPE TABLE OF z15usuarios,
it_tab_res_usu TYPE TABLE OF z15revusu WITH HEADER LINE,
it_tab_res_vue TYPE TABLE OF z15revvue ,
wa_tab_res_vue LIKE LINE OF it_tab_res_vue,
it_sflight TYPE TABLE OF sflight WITH HEADER LINE,
it_spfli TYPE TABLE OF spfli WITH HEADER LINE.
DATA :VAR_NIF LIKE Z15USUARIOS-NIF_PASAPORTE.
*&---------------------------------------------------------------------*
*& Module PBO_160 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module PBO_160 output.
SET PF-STATUS 'STATUS_GUI_PROJ'.
*SET TITLEBAR 'TITLEBAR'.
*check object_usu is initial.
*check object_res is initial.
*CREACION DE OBJECTOS DE CONTENEDOR
create object object_usu
exporting
container_name = 'CONTENEDOR_USU'.
create object object_res
exporting
container_name = 'CONTENEDOR_RES'.
*CREACION DE OBJETOS ALV
create object object_alv_usu
exporting
i_parent = object_usu.
create object object_alv_res
exporting
i_parent = object_res.
it_layout-zebra = 'X'.
it_layout-sel_mode = 'D'.
* BUSQUEDA DE LOS DATOS DEL CLIENTE ATRAVES DEL CODRESERVA
it_tab_res_usu-CODIGO_RESERVA = '1111'.
select * from z15revvue into table it_tab_res_vue where
codigo_reserva = it_tab_res_usu-CODIGO_RESERVA.
if it_tab_res_usu-CODIGO_RESERVA = wa_tab_res_vue-codigo_reserva.
loop at it_tab_res_usu.
select * from z15revvue into table it_tab_res_vue
WHERE carrid = wa_tab_res_vue-carrid
AND connid = wa_tab_res_vue-connid.
append wa_tab_res_vue to it_tab_res_vue.
clear wa_tab_res_vue.
endloop.
endif.
*
*BÚSQUEDA EN LAS TABLAS DE SISTEMA DE LOS VUELOS
*RESTRINGIDA POR EL CODIGO DE VUELO, EL CODIGO DE AEROLINEA
*Y EL LA FECHA DEL VUELO;
*DATOS CARGADOS EN EL ANTERIOR LOOP.
LOOP AT it_tab_res_vue into wa_tab_res_vue.
SELECT * INTO table it_sflight FROM sflight * aqui las tabla it_sflight esta cargada
WHERE carrid = wa_tab_res_vue-carrid
AND connid = wa_tab_res_vue-connid
AND fldate = wa_tab_res_vue-fldate.
SELECT * INTO TABLE it_spfli FROM spfli * aqui las tabla it_spfli esta cargada con datos
WHERE carrid = wa_tab_res_vue-carrid
AND connid = wa_tab_res_vue-connid.
wa_datos_res-dat_sal = it_sflight-fldate.**** pero aqui los datos no se cargan en wa_datos
wa_datos_res-precio = it_sflight-price.
wa_datos_res-cod_res = wa_tab_res_vue-codigo_reserva.
wa_datos_res-cod_vue = wa_tab_res_vue-connid.
wa_datos_res-hor_sal = it_spfli-deptime.
wa_datos_res-hor_lle = it_spfli-arrtime.
wa_datos_res-ciu_sal = it_spfli-cityfrom.
wa_datos_res-ciu_lle = it_spfli-cityto.
*
*
APPEND wa_datos_res to it_datos_res.**** la tabla it_datos no se carga
clear wa_DATOS_RES.
endloop.
*****
*CARGA DE LOS CAMPOS EN LA TABLA INTERNA FIELDCATALOG DE LOS DATOS DE
*RESERVA,
*DONDE EL CAMPO scrtext_s EXPRESA LO QUE SE VISUALIZA EN LA ALV.
******
wa_fcat-fieldname = 'COD_RES'.
wa_fcat-scrtext_s = 'Cód. Reserva'.
wa_fcat-ref_table = 'STR_DATOS_RES'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
wa_fcat-fieldname = 'COD_VUE'.
wa_fcat-scrtext_s = 'Cód. Vuelo'.
wa_fcat-ref_table = 'STR_DATOS_RES'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
wa_fcat-fieldname = 'DAT_SAL'.
wa_fcat-scrtext_s = 'Día Salida'.
wa_fcat-ref_table = 'STR_DATOS_RES'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
wa_fcat-fieldname = 'HOR_SAL'.
wa_fcat-scrtext_s = 'Salida'.
wa_fcat-ref_table = 'STR_DATOS_RES'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
wa_fcat-fieldname = 'CIU_SAL'.
wa_fcat-scrtext_s = 'Origen'.
wa_fcat-ref_table = 'STR_DATOS_RES'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
wa_fcat-fieldname = 'CIU_LLE'.
wa_fcat-scrtext_s = 'Destino'.
wa_fcat-ref_table = 'STR_DATOS_RES'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
wa_fcat-fieldname = 'PRECIO'.
wa_fcat-scrtext_s = 'Precio'.
wa_fcat-ref_table = 'STR_DATOS_RES'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
CALL METHOD object_alv_res->set_table_for_first_display
EXPORTING
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
* I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'it_datos_res'
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
IS_LAYOUT = it_layout
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
CHANGING
it_outtab = it_datos_res
it_fieldcatalog = it_fcat.
*
endmodule. " PBO_160 OUTPUT
*&---------------------------------------------------------------------*
*& Module PAI_160 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module PAI_160 input.
sa_code = ok_code.
clear ok_code.
* DECLARACION DE BOTONES Y DE POPUP.
case sa_code.
when 'BACK' OR 'EXIT' OR 'CANCEL'.
LEAVE PROGRAM.
WHEN 'INTERNET'.
CALL TRANSACTION 'ZWEBABAP17'.
WHEN 'CALCULAR'.
CALL FUNCTION 'FITRV_CALCULATOR'
EXCEPTIONS
invalid_input = 1
calculation_canceled = 2
OTHERS = 3.
when 'BOT_IMPRIMIR'.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
* DEFAULTOPTION = 'Y'
textline1 = 'SI, PARA IMPRINIR ARCHIVO'
* TEXTLINE2 = ' '
titel = 'ACEPTAR'
* START_COLUMN = 25
* START_ROW = 6
* CANCEL_DISPLAY = 'X'
* IMPORTING
ANSWER = L_RESP.
OTHERS = 1.
IF L_RESP = 'J'. "SI
LEAVE PROGRAM.
ENDIF.
WHEN 'BOT_ANULAR'.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
* DEFAULTOPTION = 'Y'
textline1 = 'SI,PARA CANCELAR LA RESERVA'
* TEXTLINE2 = ' '
titel = 'ACEPTAR'
* START_COLUMN = 25
* START_ROW = 6
* CANCEL_DISPLAY = 'X'
IMPORTING
ANSWER = L_RESP.
OTHERS = 1.
IF L_RESP = 'J'. "SI
LEAVE PROGRAM.
ENDIF.
ENDCASE.
endmodule. " PAI_160 INPUT
Comentario