Code: Alles auswählen.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Report Z_CONSULTAS_REPARTOS
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT z_consultas_repartos NO STANDARD PAGE HEADING .
***************************INCLUDES***********************************
INCLUDE <icon>.
**************************DECLARACIONES*******************************
TABLES: vbrk, zcomcpz, kna1, tvfkt.
**************************SELECCIONES*********************************
SELECTION-SCREEN BEGIN OF BLOCK one WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_fkdat FOR vbrk-fkdat.
SELECTION-SCREEN END OF BLOCK one.
**************************PROGRAMACIÓN*********************************
SET PF-STATUS 'ZSTATUS'.
PERFORM listado.
***************************EVENTOS************************************
AT LINE-SELECTION.
SET PARAMETER ID 'VF' FIELD vbrk-vbeln.
CALL TRANSACTION 'ZREPA' AND SKIP FIRST SCREEN.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'ACTU'.
PERFORM listado.
WHEN 'CREAR'.
SET PARAMETER ID 'VF' FIELD vbrk-vbeln.
CALL TRANSACTION 'ZREPA' AND SKIP FIRST SCREEN.
ENDCASE.
***************************FORMS***************************************
*&---------------------------------------------------------------------*
*& Form listado
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM listado .
ULINE.
FORMAT COLOR 2 INTENSIFIED OFF.
WRITE: /10 'Cl. Factura',
30 'Fecha factura',
50 'Nº factura',
70 'Nº cliente',
80 'Nombre Cliente',
110 'Importe neto',
140 'Moneda',
150 'Factura anulada'.
FORMAT COLOR 2 OFF.
ULINE.
SELECT * FROM vbrk WHERE ( fkart = 'YFP'
OR fkart = 'ZSP'
OR fkart = 'ZFP'
OR fkart = 'YSP' )
AND fkdat IN s_fkdat.
IF sy-subrc = 0.
SELECT SINGLE * FROM zcomcpz WHERE vbeln = vbrk-vbeln.
IF sy-subrc <> 0.
SELECT SINGLE * FROM kna1 WHERE kunnr = vbrk-kunrg.
SELECT SINGLE * FROM tvfkt WHERE fkart = vbrk-fkart
AND spras = sy-langu.
FORMAT COLOR 6 INTENSIFIED OFF.
IF vbrk-fkart = 'YFP'
OR vbrk-fkart = 'ZFP'.
WRITE:/ icon_led_red AS ICON,
icon_positive AS ICON,
tvfkt-vtext UNDER 'Cl. Factura',
vbrk-fkdat UNDER 'Fecha factura',
vbrk-vbeln UNDER 'Nº factura',
vbrk-kunrg UNDER 'Nº cliente',
kna1-name1(25) UNDER 'Nombre Cliente',
vbrk-netwr UNDER 'Importe neto',
vbrk-stwae UNDER 'Moneda',
vbrk-sfakn UNDER 'Factura anulada',
' '.
* HIDE vbrk-vbeln.
ELSE.
WRITE:/ icon_led_red AS ICON,
icon_negative AS ICON,
tvfkt-vtext UNDER 'Cl. Factura',
vbrk-fkdat UNDER 'Fecha factura',
vbrk-vbeln UNDER 'Nº factura',
vbrk-kunrg UNDER 'Nº cliente',
kna1-name1(25) UNDER 'Nombre Cliente',
vbrk-netwr UNDER 'Importe neto',
vbrk-stwae UNDER 'Moneda',
vbrk-sfakn UNDER 'Factura anulada',
' '.
* HIDE vbrk-vbeln.
ENDIF.
ELSE.
FORMAT COLOR 4 INTENSIFIED OFF.
SELECT SINGLE * FROM kna1 WHERE kunnr = vbrk-kunrg.
SELECT SINGLE * FROM tvfkt WHERE fkart = vbrk-fkart
AND spras = sy-langu.
IF vbrk-fkart = 'YFP'
OR vbrk-fkart = 'ZFP'.
WRITE:/ icon_led_green AS ICON,
icon_positive AS ICON,
tvfkt-vtext UNDER 'Cl. Factura',
vbrk-fkdat UNDER 'Fecha factura',
vbrk-vbeln UNDER 'Nº factura',
vbrk-kunrg UNDER 'Nº cliente',
kna1-name1(25) UNDER 'Nombre Cliente',
vbrk-netwr UNDER 'Importe neto',
vbrk-stwae UNDER 'Moneda',
vbrk-sfakn UNDER 'Factura anulada',
' '.
* HIDE vbrk-vbeln.
ELSE.
WRITE:/ icon_led_red AS ICON,
icon_negative AS ICON,
tvfkt-vtext UNDER 'Cl. Factura',
vbrk-fkdat UNDER 'Fecha factura',
vbrk-vbeln UNDER 'Nº factura',
vbrk-kunrg UNDER 'Nº cliente',
kna1-name1(25) UNDER 'Nombre Cliente',
vbrk-netwr UNDER 'Importe neto',
vbrk-stwae UNDER 'Moneda',
vbrk-sfakn UNDER 'Factura anulada',
' '.
* HIDE vbrk-vbeln.
ENDIF.
ENDIF.
HIDE vbrk-vbeln.
ENDIF.
ENDSELECT.