MUNDOSAP

MUNDOSAP (foro/index.php)
-   Programación ABAP IV (foro/forumdisplay.php?f=4)
-   -   Error en ejecución (foro/showthread.php?t=71731)

minerva0112 26/05/14 20:30:59

Error en ejecución
 
Hola,

Estoy tratando de realizar una conexión de Sap a SQL para traerme los datos de una tabla de SQL y llenar una tabla interna de SAP, pero me da error y no tengo como comparar el codigo para corregir sintaxis, anexo el codigo, si me pueden indicar que debo corregir ,

gracias

*&---------------------------------------------------------------------*
*& Report ZHRP_ZVHR_RETAIN
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT zhrp_prueba_sql_sap.
TABLES: ztps_carga.
DATA: lv_dbs.

DATA: BEGIN OF it_output OCCURS 100.
INCLUDE STRUCTURE ztps_carga.
DATA: END OF it_output.



DATA: lv_exc_ref TYPE REF TO cx_sy_native_sql_error,

lv_error_text TYPE string.
**************************************************** here connect string
TRY.
EXEC SQL.
CONNECT to 'PRUEBA'
ENDEXEC.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE cx_sy_native_sql_error.
ENDIF.

CATCH cx_sy_native_sql_error INTO lv_exc_ref.
CLEAR: lv_error_text.
lv_error_text = lv_exc_ref->get_text( ).
MESSAGE lv_error_text TYPE 'I'.


ENDTRY.


EXEC SQL.

open dbcursor for
SELECT NRO_SAN FECHA_SAN HONORARIOS HORAS NRO_RIF TIPO_EMP LOB CLIENTE ZZSUB_SRVC COD_RAMO
FROM CARGA
ENDEXEC.

DO.
EXEC SQL.
FETCH NEXT cursor INTO :it_output-nro_san,
:it_output-fecha_san,
:it_output-honorarios,
:it_output-horas,
:it_output-nro_rif,
:it_output-tipo_emp,
:it_output-lob,
:it_output-cliente,
:it_output-zzsub_srvc,
:it_output-cod_ramo

if sy-subrc eq 0.
APPEND it_output. clear it_output.
else.
exit.
endif.
ENDEXEC.
ENDDO.

**************************************************************************************

TRY.
EXEC SQL.
DISCONNECT 'PRUEBA'
ENDEXEC.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE cx_sy_native_sql_error.
ENDIF.

CATCH cx_sy_native_sql_error INTO lv_exc_ref.
CLEAR: lv_error_text.
lv_error_text = lv_exc_ref->get_text( ).
MESSAGE lv_error_text TYPE 'I'.
ENDTRY.

:confused:


Husos Horarios son GMT. La hora en este momento es 21:36:37.

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