Code: Alles auswählen.
*&---------------------------------------------------------------------*
*& Report ZNKUE_LISTE *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
REPORT ZNKUE_LISTE MESSAGE-ID N5.
*&---------------------------------------------------------------------*
*& Includes *
*&---------------------------------------------------------------------*
INCLUDE RNDATA00.
INCLUDE MNCOLOUR.
*&---------------------------------------------------------------------*
*& Global Declarations *
*&---------------------------------------------------------------------*
DATA: inksa Type table of nksa,
wa_nksa TYPE nksa,
ambulStatio type i.
DATA: fieldcat type lvc_t_fcat.
DATA: event_receiver TYPE REF TO lcl_event_receiver.
types: begin of list,
Name(40),
AMBSTAT(6),
LandesCode(5),
AblGrund type string,
end of list.
data: liste type standard table of list,
wa_liste type list.
*--- Anwendungstabellen ----------------------------------------------*
TABLES: nksa,
npat,
nvvf,
nfal,
nehic,
tn19h,
nbew.
* --- Selektion (erstellen der Eingabemaske---------------------------*
SELECTION-SCREEN SKIP. "für die leerzeile am screen
PARAMETERS einri TYPE nbew-einri DEFAULT '1'.
SELECTION-SCREEN SKIP.
SELECT-OPTIONS datum FOR nbew-bwidt. "von bis feld für datum
SELECTION-SCREEN SKIP.
PARAMETERS ablg TYPE NKSA-ABLGR.
SELECTION-SCREEN SKIP.
PARAMETERS kostentr TYPE NKSA-KOSTR DEFAULT '00035'.
SELECTION-SCREEN SKIP.
PARAMETERS: STATI DEFAULT 'X' AS CHECKBOX, "checkboxen
AMBUL DEFAULT 'X' AS CHECKBOX.
*&----Abfrage dass nur x oder X in der checkbox erlaubt sind----------*
*???????? für was man kann eh nur hinklicken ???
AT SELECTION-SCREEN ON STATI.
IF STATI CN 'xX '.
SET CURSOR FIELD 'STATI'.
MESSAGE E002. " Als Ankreuzzeichen sind nur x oder X zulaessig
ENDIF.
AT SELECTION-SCREEN ON AMBUL.
IF AMBUL CN 'xX '.
SET CURSOR FIELD 'AMBUL'.
MESSAGE E002. " Als Ankreuzzeichen sind nur x oder X zulaessig
ENDIF.
CLASS lcl_event_receiver DEFINITION DEFERRED.
*---------------------------------------------------------------------*
* CLASS lcl_event_receiver DEFINITION
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_double_click
FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row e_column.
PRIVATE SECTION.
ENDCLASS.
*---------------------------------------------------------------------*
* CLASS lcl_event_receiver IMPLEMENTATION
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_double_click.
MESSAGE E005. " testnachricht
ENDMETHOD.
ENDCLASS.
*&---------------------------------------------------------------------*
*& Processing Blocks called by the JRE *
*&---------------------------------------------------------------------*
START-OF-SELECTION.
IF STATI EQ SPACE AND AMBUL EQ SPACE.
SET CURSOR FIELD 'STATI'.
MESSAGE E007. " Bitte mindestens eine Auswahl (A/E) ankreuzen
EXIT.
ENDIF.
*&---Abfragen welche Checkboxen angehackelt sind ----------------------*
IF STATI EQ SPACE AND AMBUL <> SPACE.
ambulStatio = '2'.
ELSE.
ambulStatio = '1'.
ENDIF.
IF STATI <> SPACE AND AMBUL <> SPACE.
ambulStatio = '3'.
ENDIF.
SELECT * FROM nksa INTO TABLE inksa
WHERE einri = einri AND
KUBD1 IN datum AND
ABLGR = ablg AND
KOSTR = kostentr.
PERFORM getKostentr.
call screen 0100.
*---------------------------------------------------------------------*
* FORM getKostentr *
*---------------------------------------------------------------------*
FORM getKostentr.
*------------Lokale Deklaration der Work-Areas------------------------*
DATA: wa_npat Type npat,
wa_nfal Type nfal,
wa_nehic Type nehic,
wa_tn19h type tn19h,
wa_nvvf TYPE nvvf.
LOOP AT inksa INTO wa_nksa.
IF ambulStatio = '1' OR ambulStatio = '2'.
SELECT single * FROM nfal INTO wa_nfal
WHERE falnr = wa_nksa-falnr AND
falar = ambulStatio.
ELSE.
SELECT single * FROM nfal INTO wa_nfal
WHERE falnr = wa_nksa-falnr.
ENDIF.
IF wa_nfal-falar = 1.
wa_liste-AMBSTAT = 'stat.'.
ELSE.
wa_liste-AMBSTAT = 'amb.'.
ENDIF.
* ->>> eventuell dann noch in INNER JOIN umändern !!!!!!!!!!!!!!
SELECT single * FROM npat INTO wa_npat
WHERE patnr = wa_nfal-patnr.
SELECT single * FROM nvvf INTO wa_nvvf
WHERE falnr = wa_nksa-falnr AND
kostr = kostentr.
SELECT single * FROM nehic INTO wa_nehic
WHERE lfdnr = wa_nvvf-lfdnr.
wa_liste-LandesCode = wa_nehic-STCODE.
SELECT single * FROM tn19h INTO wa_tn19h
WHERE ABLGR = wa_nksa-ablgr.
wa_liste-AblGrund = wa_tn19h-AGTXT.
*-----zusammenführen des titel namen und nachname in eine variable----*
concatenate wa_npat-titel wa_npat-nname wa_npat-vname
into wa_liste-name
separated by space.
append wa_liste to liste.
clear wa_liste.
ENDLOOP.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form fill_fieldcat
*&---------------------------------------------------------------------*
* Fieldcat muss die struktur der Daten übergeben werden
*----------------------------------------------------------------------*
form fill_fieldcat.
data: wa_fc type line of lvc_t_fcat.
wa_fc-fieldname = 'NAME'.
wa_fc-inttype = 'C'.
wa_fc-outputlen = '40'.
wa_fc-coltext = 'Patient'.
append wa_fc to fieldcat.
wa_fc-fieldname = 'AMBSTAT'.
wa_fc-inttype = 'C'.
wa_fc-outputlen = '6'.
wa_fc-coltext = 'Fallart'.
append wa_fc to fieldcat.
wa_fc-fieldname = 'LANDESCODE'.
wa_fc-inttype = 'C'.
wa_fc-outputlen = '5'.
wa_fc-coltext = 'Land'.
append wa_fc to fieldcat.
wa_fc-fieldname = 'ABLGRUND'.
wa_fc-inttype = 'C'.
wa_fc-outputlen = '50'.
wa_fc-coltext = 'Ablehnungsgrund'.
append wa_fc to fieldcat.
endform. " fill_fieldcat
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.
IF sy-ucomm = 'BACK' OR
sy-ucomm = 'EXIT' OR
sy-ucomm = 'CANCEL'.
LEAVE PROGRAM.
ENDIF.
ENDMODULE. " USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
SET TITLEBAR 'TIT_100'.
data: container type ref to cl_gui_custom_container,
alv_list type ref to cl_gui_alv_grid.
* Um die ICONS in der ALV-Liste anzusprechen
DATA: excl_tb TYPE ui_functions.
data: layout type lvc_s_layo.
perform fill_fieldcat.
*
APPEND cl_gui_alv_grid=>mc_mb_filter TO excl_tb.
APPEND cl_gui_alv_grid=>mc_mb_variant TO excl_tb.
APPEND cl_gui_alv_grid=>mc_fc_sort_asc TO excl_tb.
if container is initial.
create object container
exporting container_name = 'LIST_AREA'.
create object alv_list
exporting i_parent = container
i_name = 'Belegung'.
* Layout des ALV definieren
layout-zebra = 'X'. "Streifenmuster
layout-cwidth_opt = 'X'. "Spaltenbreite optimieren
call method alv_list->set_table_for_first_display
exporting
is_layout = layout
*um die ICONS bearbeiten zu können
it_toolbar_excluding = excl_tb
* i_structure_name = 'ZNSTATISTIK'
changing it_fieldcatalog = fieldcat
it_outtab = liste.
call method alv_list->set_frontend_layout
exporting
is_layout = layout.
else.
call method alv_list->refresh_table_display.
endif.
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->handle_double_click FOR alv_list.
ENDMODULE. " STATUS_0100 OUTPUT