Report-Vorlage mit Form-Routinen

Aus SAP-Wiki
Wechseln zu:Navigation, Suche

Siehe Reporting.

Siehe Report-Vorlage mit Form-Routinen.

Siehe Report-Vorlage mit Lokaler Klasse.

Siehe ALV-Vorlage CL GUI ALV GRID.

Siehe ALV-Vorlage REUSE ALV GRID DISPLAY LVC.

siehe ALV-Vorlage CL SALV*.

"Data & Types

************************************************************************
* Programmname...............:                                         *
* Autor......................:  René Eberstein                         *
* Firma......................:  Eberstein Consulting                   *
* Projekt....................:                                         *
* Ticket.....................:                                         *
* Ansprechpartner Fachabt....:                                         *
* Erstellt am................:                                         *
* Kopiert von................:                                         *
* Online/Batch/USER-EXIT ....:  Online                                 *
* Funktionsbeschreibung .....:                                         *
*                                                                      *
*                                                                      *
*                                                                      *
*----------------------------------------------------------------------*
*& Änderungen:                                                         *
*&                                                                     *
*----------------------------------------------------------------------*
*& <uname>, <datum>, <ticket>, <beschreibung>                          *
*&                                                                     *
*&---------------------------------------------------------------------*
report yz.

*include z.._top.

****************
* DATA & TYPES *
****************
Types: begin of ty_itab,
       kunnr type kna1-kunnr,
       end of ty_itab.

Types: tty_itab type standard table of ty_itab. 

Data: gt_itab type Standard table of ty_itab.

Constants: true  type xfeld value 'X',
           false type xfeld value space.

Tables: vbak.

"Parameters

**************
* PARAMETERS *
**************
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: p_vkorg TYPE vbak-vkorg.

SELECTION-SCREEN END OF BLOCK b1.

"Initialization

******************
* INITIALIZATION *
******************
INITIALIZATION.
 PERFORM initialization.

"At Selection-Screen

***********************
* AT SELECTION-SCREEN *
***********************
at selection-screen.

"Start-of-Selection

**********************
* START-OF-SELECTION *
**********************
start-of-selection.

************
* get data *
************
perform get_data
  changing gt_itab.

"Form initialization

*&---------------------------------------------------------------------*
*&      Form  INITIALIZATION
*&---------------------------------------------------------------------*
*       Default Routinen
*----------------------------------------------------------------------*
FORM initialization.
  DATA: lv_report  TYPE  rsvar-report,
        lv_variant TYPE  rsvar-variant.

* Variante STANDARD wird automatisch gezogen
  lv_report  = sy-repid.
  lv_variant = 'STANDARD'.

  CALL FUNCTION 'RS_SUPPORT_SELECTIONS'
    EXPORTING
      report               = lv_report
      variant              = lv_variant
    EXCEPTIONS
      variant_not_existent = 1
      variant_obsolete     = 2
      OTHERS               = 3.

  IF sy-subrc <> 0.
*   Variante & ist nicht vorhanden
    MESSAGE i809(00) WITH lv_variant.
  ENDIF.

ENDFORM.                    "INITIALIZATION

"Form get_data

*&---------------------------------------------------------------------*
*&      Form  GET_DATA
*&---------------------------------------------------------------------*
*       Lesen Daten
*----------------------------------------------------------------------*
FORM get_data
  CHANGING ct_itab type tty_itab.

if sy-subrc <> 0.
  MESSAGE i550(fre). "Keine Datensätze gefunden
  leave list-processing.
endif.

ENDFORM.