MUNDOSAP

Regresar   MUNDOSAP > DESARROLLO > Programación ABAP IV
Nombre de Usuario
Contraseña
Home Descargas Registrar FAQ Miembros Calendario Buscar Temas de Hoy Marcar Foros Como Leídos




 
 
 
Herramientas Buscar en Tema Desplegado
Prev Mensaje Previo   Próximo Mensaje Próx
  #2  
Viejo 19/11/07, 07:45:41
pafú pafú is offline
Member
 
Fecha de Ingreso: sep 2007
Mensajes: 49
Aqui te pongo un ejemplo

Con dos opciones:
- Con un boton que muestre los datos marcados
- Haciendo doble click sobre un registro.

Lo primero es la funcion que muestra el alv create un form 'user_command'.
Y creas el siguiente form.

FORM alv_user_command USING p_r_ucomm LIKE sy-ucomm
p_rs_selfield TYPE slis_selfield.

DATA: d_contador TYPE i.

CASE p_r_ucomm.

WHEN '&IC1'. -> Esto es para el doble click

READ TABLE i_salida INDEX p_rs_selfield-tabindex. -> itab del ALV

SELECT * FROM ziber_ta_np02
WHERE kblnr = i_salida-belnr
AND refbukrs = i_salida-bukrs
AND kblpos = i_salida-blpos
AND refgjahr = i_salida-gjahr.

IF sy-subrc = 0.

MOVE-CORRESPONDING ziber_ta_np02 TO i_detalle.

i_detalle-gjahr = i_salida-gjahr.
i_detalle-belnr = i_salida-belnr.
i_detalle-blpos = i_salida-blpos.
i_detalle-pspnr = i_salida-pspnr.
i_detalle-fistl = i_salida-fistl.
i_detalle-fipos = i_salida-fipos.
i_detalle-geber = i_salida-geber.
i_detalle-lifnr = i_salida-lifnr.
i_detalle-wtges = i_salida-wtges.
i_detalle-belnro = ziber_ta_np02-belnr.

IF NOT ziber_ta_np02-augdt IS INITIAL.

i_detalle-ejerp = ziber_ta_np02-augdt.

ELSE.

i_detalle-ejerp = ''.

ENDIF.

i_detalle-importp = ziber_ta_np02-dmbtr.

APPEND i_detalle.

ENDIF.

ENDSELECT.

PERFORM alv_detalle.

WHEN '&VER'. -> Este seria tu caso. Todos los registros seleccionados

CLEAR i_detalle. REFRESH i_detalle.

READ TABLE i_salida INDEX p_rs_selfield-tabindex.
* recorremos todos los registros que esten marcados
LOOP AT i_salida WHERE marca = 'X'.
** cada vez que entre contamos para saber si al menos hay uno pinchado
d_contador = d_contador + 1.

SELECT * FROM ziber_ta_np02
WHERE kblnr = i_salida-belnr
AND refbukrs = i_salida-bukrs
AND kblpos = i_salida-blpos
AND refgjahr = i_salida-gjahr.

IF sy-subrc = 0.

MOVE-CORRESPONDING ziber_ta_np02 TO i_detalle.

i_detalle-gjahr = i_salida-gjahr.
i_detalle-belnr = i_salida-belnr.
i_detalle-blpos = i_salida-blpos.
i_detalle-pspnr = i_salida-pspnr.
i_detalle-fistl = i_salida-fistl.
i_detalle-fipos = i_salida-fipos.
i_detalle-geber = i_salida-geber.
i_detalle-lifnr = i_salida-lifnr.
i_detalle-wtges = i_salida-wtges.
i_detalle-belnro = ziber_ta_np02-belnr.

IF NOT ziber_ta_np02-augdt IS INITIAL.

i_detalle-ejerp = ziber_ta_np02-augdt.

ELSE.

i_detalle-ejerp = ''.

ENDIF.

i_detalle-importp = ziber_ta_np02-dmbtr.


APPEND i_detalle.

ENDIF.

ENDSELECT.

ENDLOOP.

*si no hay ningun reg seleccionado para visualizar, mensaje!
IF ( d_contador = 0 ).

MESSAGE i002(z_mensa).
* sino al ALV para visualizar el detalle.
ELSE.

PERFORM alv_detalle.

ENDIF.

ENDCASE.

ENDFORM. " alv_user_command
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Reglas de Mensajes
no puedes crear nuevos temas
no puedes responder temas
no puedes adjuntar archivos
no puedes editar tus mensajes

El código vB está On
Las caritas están On
Código [IMG] está On
Código HTML está Off
Saltar a Foro


Husos Horarios son GMT. La hora en este momento es 11:07:25.


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