MUNDOSAP

MUNDOSAP (foro/index.php)
-   Programación ABAP IV (foro/forumdisplay.php?f=4)
-   -   Batchinput con Call transaction (foro/showthread.php?t=43883)

Carlitros36 21/06/11 07:02:32

Batchinput con Call transaction
 
Hola alguien tiene un ejemplo de un batchinput con Call transaction por favor ya que no encuentro buenos ejemplos en google, de antemano muchas gracias....:)

mialma 21/06/11 11:31:02

*OPCIONES
DATA opt TYPE ctu_params.

opt-dismode = v_mode.
opt-defsize = 'X'.
opt-updmode = 'S'.

* Errores
DATA: BEGIN OF t_err OCCURS 0.
INCLUDE STRUCTURE bdcmsgcoll.
DATA: END OF t_err.

CLEAR t_err.REFRESH t_err.

* Batch Input
DATA: BEGIN OF tabla OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA: END OF tabla.

CALL TRANSACTION v_tcode USING tabla OPTIONS FROM opt
MESSAGES INTO t_err.

* Manejaremos los errores del call transaction en t_errores
LOOP AT t_err WHERE msgtyp = 'E'.
DATA: l_text(255),
numero LIKE sy-msgno.

numero = t_err-msgnr.
CALL FUNCTION 'RPY_MESSAGE_COMPOSE'
EXPORTING
language = sy-langu
message_id = t_err-msgid
message_number = numero
message_var1 = t_err-msgv1(50)
message_var2 = t_err-msgv2(50)
message_var3 = t_err-msgv3(50)
message_var4 = t_err-msgv4(50)
IMPORTING
message_text = l_text.

MOVE-CORRESPONDING i_datos TO i_errores.
i_errores-dyname = t_err-dyname+2(4).
i_errores-fldname = t_err-fldname.
MOVE l_text TO i_errores-texto.
APPEND i_errores.
CLEAR i_errores.
ENDLOOP.
ELSE.
* Si el call transaction se ha ejecutado correctamente
REFRESH tabla. CLEAR tabla.
ENDIF.


Husos Horarios son GMT. La hora en este momento es 11:42:27.

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