Ver Mensaje Individual
  #4  
Viejo 23/07/10, 09:57:46
jarabas jarabas is offline
Senior Member
 
Fecha de Ingreso: ene 2010
Mensajes: 109
evita los into corresponding field. create estructuras internas con los campos en el mismo orden en el que los pongas en la select.

TYPES: BEGIN OF ty_ejemplo,
campo1 TYPE el_que_sea,
campo2 type el_que_sea,
....
END OF ty_ejemplo.

data: it_ejemplo type standard table of ty_ejemplo.

select campo1 campo2 ...
into table it_ejemplo
from tabla
where condicion.

Evita las tablas con cabeceras, procura utilizar workings.

no uses los Select ... endselect.


tú código:
SELECT *
FROM eket
WHERE ebeln = t_eban-ebeln AND
ebelp = t_eban-ebelp AND
banfn = t_eban-banfn AND
bnfpo = t_eban-bnfpo.
MOVE eket-eindt TO w_eindt.
EXIT.
ENDSELECT.

si sólo quieres el campo "eindt", haz lo siguiente:
SELECT eindt
INTO w_eindt
FROM eket
WHERE ebeln = t_eban-ebeln AND
ebelp = t_eban-ebelp AND
banfn = t_eban-banfn AND
bnfpo = t_eban-bnfpo.

tú código:
SELECT SINGLE * FROM ekpo WHERE ebeln = t_eban-ebeln AND
ebelp = t_eban-ebelp.
IF sy-subrc EQ 0.
MOVE ekpo-ebeln TO w_ebeln.
MOVE ekpo-ebelp TO w_ebelp.
MOVE ekpo-txz01 TO w_txz01.
MOVE ekpo-netwr TO w_netwr.
MOVE ekpo-loekz TO w_loekz.

Mejor así:
TYPES: BEGIN OF ty_ekpo,
ebeln TYPE EBELN,
ebelp TYPE EBELP,
txz01 TYPE TXZ01,
netwr TYPE BWERT,
loekz TYPE eloek,
END OF ty_ekpo.

data: wa_ekpo type ty_ekpo.

SELECT SINGLE ebeln ebelp txz01 netwr loekz
INTO wa_ekpo
FROM ekpo
WHERE ebeln = t_eban-ebeln AND
ebelp = t_eban-ebelp.

IF sy-subrc EQ 0.
ya tienes los datos en la working area (WA_EKPO)
ENDIF.


Espero haberte ayudado.

Úlima edición por jarabas fecha: 23/07/10 a las 10:07:12.
Responder Con Cita