PDA

Ver la Versión Completa : Problemas con llamada a rfc dinamica


cesar_omar
11/11/09, 12:48:00
Hola

Estoy realizando una programa que llame a rfc dinamica
y tengo el siguiente codigo:

DATA: p_tab type tabname.
data PARA_TAB type ABAP_FUNC_PARMBIND_TAB.
data PARA_LINE like line of PARA_TAB.
DATA: TABPRUEBA LIKE LINE OF PARA_TAB.


*-------Creacion de los field FIELD-SYMBOLS------*

FIELD-SYMBOLS: <apun_tab1> TYPE ANY.

*------------Creacion de tablas dinamicas--------*

DATA: lv_tabla TYPE dd02l-tabname,
generic_table TYPE REF TO data,
generic_line TYPE REF TO data.


FIELD-SYMBOLS: <table> TYPE ANY TABLE,
<wa> TYPE ANY.
FIELD-SYMBOLS: <f1> TYPE ANY, <campo> TYPE ANY, <f3> TYPE ANY.

mas adelante en el codigo tengo lo siguiente

ASSIGN nomcamp TO <f1>.

PARA_LINE-NAME = IT_ZCTLARGU-NOMBARGUMENTO.
PARA_LINE-KIND = IT_ZCTLARGU-TIPOARGUMENTO.


en otra parte del codigo tengo

ASSIGN COMPONENT <f1> OF STRUCTURE <wa> TO <campo>.
IF SY-SUBRC EQ 0.
get reference of <campo> into PARA_LINE-VALUE.

get reference of ESTRUC_TABLA-PRETURN into PARA_LINE-VALUE


INSERT PARA_LINE INTO TABLE PARA_TAB.


finalmente hago el llamado

call function IT_ZCTLRUT2-RUTINA_HIJA
parameter-table PARA_TAB.


mi duda es como hago para leer los valores de uan tabla de errores PARA_TAB o si es un export para leer el valor del export y obtener ese dato


Agradeciendo de antemano su colaboracion y ayuda

Saludos
Cesar

ballan
11/11/09, 13:26:55
data: lo_tabla type ref to data,
lo_linea type ref to data.

field-symbols: <tabla> type ABAP_FUNC_PARMBIND_TAB,
<linea> like line of <tabla>.

create object lo_tabla type 'ABAP_FUNC_PARMBIND_TAB'.

assign lo_tabla->* to <tabla>.

create objet lo_linea like line of <tabla>.

assign lo_linea->* to <linea>.

<tabla> = "aqui le asignarias la tabla por ejemplo <tabla> = lt_datos[].

loop at <tabla> assigning <linea>.

.
.
.
.

endloop.

Quiza algo falle y no compile bien pero mas o menos esta seria la idea

cesar_omar
13/11/09, 18:12:58
Siguiendo la idea del codigo que dejastes en el post, realice el siguiente codigo para obtener los valores de la tabla TABLA_ERROR

A continuacion el codigo en abap

data: lop_table type ref TO OBJECT.
data: lop_line like lop_table.

field-symbols: <tabla1> type ABAP_FUNC_PARMBIND_TAB,
<linea> like line of <tabla1>.

CREATE OBJECT LOP_TABLE TYPE STANDARD TABLE OF (TABLA_ERROR).


Al crear objeto lop_table me da error en el tipo si lo declaro tipo data, el error es el siguiente:
LOP_TABLE must be an object, an interface or TYPE ANY.

Por eso esta la declaracion tipo object


Agradeciendo nuevamente tu ayuda

Saludos
Cesar