Ver Mensaje Individual
  #3  
Viejo 01/12/09, 08:49:37
romario2 romario2 is offline
Senior Member
 
Fecha de Ingreso: abr 2006
Mensajes: 233
Exclamation Informa Muchos Registros En Lugar De 1 Solo

Hola Foro,

gracias David, pero persiste el error. Yo solo quiero informar un registro del Table control y me informa un montón con el mismo valor.

He metido EXITS i añadí CLEARS sin resultado.

Publico el código:


LOGICA PROCESO Dynpro
*******************************************
LOOP AT TAB_ZPS_TC with control TABLA CURSOR TABLA-CURRENT_LINE.

MODULE inserir_taula.

ENDLOOP.


PROCESS AFTER INPUT.

*Primer es fal un LOOP a TAB_ZPS_TC que degut a que està associada a
*TABLE_CONTROL equival a recorre el table control de la pantalla
*recuperant les dades introduides.


LOOP AT TAB_ZPS_TC.
CHAIN.
FIELD: TAB_ZPS_TC-POSID,
TAB_ZPS_TC-POST1,
TAB_ZPS_TC-TXT30.

*La opció ON CHAIN-REQUEST ens determina que només s’executatarà el
*modul si hem modificat un registre.
MODULE validacions ON CHAIN-REQUEST.
ENDCHAIN.

MODULE informar_camps.

ENDLOOP.

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


MODULE inserir_taula OUTPUT.

REFRESH CONTROL 'TABLA' FROM SCREEN '9001'.
CLEAR tab_zps_tc.
REFRESH tab_zps_tc.
CLEAR: posid, post1, txt30.


tab_zps_tc-posid = p_posid2.
tab_zps_tc-post1 = p_post12.
tab_zps_tc-txt30 = p_txt302.


posid = tab_zps_tc-posid.
post1 = tab_zps_tc-post1.
txt30 = tab_zps_tc-txt30.


LOOP AT SCREEN.
IF screen-name = 'POSID'.
screen-input = space.
MODIFY SCREEN.
EXIT.
ENDIF.

ENDLOOP.



ENDMODULE.



MODULE informar_camps INPUT.

DATA l_zps_tc TYPE est_zps_tc.
CLEAR l_zps_tc.
CLEAR tab_zps_tc.
REFRESH tab_zps_tc.


tab_zps_tc-posid = posid.
tab_zps_tc-post1 = post1.
tab_zps_tc-txt30 = txt30.

READ TABLE tab_zps_tc INTO l_zps_tc
INDEX tabla-current_line.
IF sy-subrc <> 0.

INSERT table tab_zps_tc.

ELSE.
MODIFY tab_zps_tc INDEX tabla-current_line.

ENDIF.

ENDMODULE. " INFORMAR_CAMPS INPUT
Responder Con Cita