Es gibt verschiedene Möglichkeiten eine View aufzurufen aus einem Programm heraus
Hier werden über 5 Pushbuttons der gleiche View anderst aufgerufen.
Pushbutton 1
View aufrufen (FUBA: VIEW_MAINTENANCE_CALL)
Pushbutton 2
View über eine Transaktion aufrufen (CALL TRANSACTION)
Pushbutton 3
Im View bestimmte Zeilen anzeigen (FUBA: VIEW_MAINTENANCE_CALL)
Pushbutton 4
Im View bestimmte Zeilen bearbeiten (FUBA: VIEW_MAINTENANCE_CALL)
Pushbutton 5
Im View genau eine Zeile bearbeiten (FUBA: VIEW_MAINTENANCE_SINGLE_ENTRY)
Pushbutton 6
Viewcluster aufrufen (FUBA: VIEW_MAINTENANCE_CALL)
Pushbutton 7
Im Viewcluster bestimmte Zeilen aufrufen (FUBA: VIEW_MAINTENANCE_CALL)
*&---------------------------------------------------------------------*
*& Report Z_TABELLEN_ANZEIGEN
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT z_tabellen_anzeigen.
*----------------------------------------------------------------------*
* Datendeklaration
*----------------------------------------------------------------------*
DATA: gf_name LIKE zzbzv-aename.
Data: gf_nachname LIKE zbook_areasv-area VALUE 'HARDWARE',
gf_vorname LIKE zbook_areasv-area VALUE 'SOFTWARE'.
DATA: gs_zzbzv TYPE zzbzv.
Data: gt_sellist TYPE STANDARD TABLE OF vimsellist.
FIELD-SYMBOLS <sellist> TYPE vimsellist.
*----------------------------------------------------------------------*
* Selektionsscreen
*----------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-tia.
SELECTION-SCREEN PUSHBUTTON /1(50) text-p01 USER-COMMAND p01.
SELECTION-SCREEN PUSHBUTTON /1(50) text-p02 USER-COMMAND p02.
SELECTION-SCREEN PUSHBUTTON /1(50) text-p03 USER-COMMAND p03.
SELECTION-SCREEN PUSHBUTTON /1(50) text-p04 USER-COMMAND p04.
SELECTION-SCREEN PUSHBUTTON /1(50) text-p05 USER-COMMAND p05.
SELECTION-SCREEN PUSHBUTTON /1(50) text-p06 USER-COMMAND p06.
SELECTION-SCREEN PUSHBUTTON /1(50) text-p07 USER-COMMAND p07.
SELECTION-SCREEN END OF BLOCK a.
*----------------------------------------------------------------------*
* AT SELECTION-SCREEN
*----------------------------------------------------------------------*
AT SELECTION-SCREEN.
CASE sy-ucomm.
"View aufrufen
WHEN 'P01'.
CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
EXPORTING
action = 'S' " S = Show, U = Update, T = Transport
view_name = 'ZZBZV'
EXCEPTIONS
OTHERS = 15.
"Transaktion aufrufen
WHEN 'P02'.
CALL TRANSACTION 'ZZBZ'.
"Im View nur eine Bestimmte Zeilen anzeigen
WHEN 'P03'(001).
gf_name = 'MREGOTZ'.
APPEND INITIAL LINE TO gt_sellist ASSIGNING <sellist>.
<sellist>-viewfield = 'AENAME'.
<sellist>-operator = 'EQ'.
<sellist>-value = gf_name.
"Tabellenpflegedialog ausführen also SM30
CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
EXPORTING
action = 'S'
view_name = 'ZZBZV'
TABLES
dba_sellist = gt_sellist
EXCEPTIONS
OTHERS = 15.
CLEAR: gt_sellist, gf_name.
"Im View nur eine Bestimmte Zeilen bearbeiten
WHEN 'P04'.
gf_name = ''.
APPEND INITIAL LINE TO gt_sellist ASSIGNING <sellist>.
<sellist>-viewfield = 'AENAME'.
<sellist>-operator = 'EQ'.
<sellist>-value = gf_name.
"Tabellenpflegedialog ausführen also SM30
CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
EXPORTING
action = 'U'
view_name = 'ZZBZV'
TABLES
dba_sellist = gt_sellist
EXCEPTIONS
OTHERS = 15.
CLEAR: gt_sellist, gf_name.
"Genau eine Zeile bearbeiten
WHEN 'P05'.
gf_name = 'MREGOTZ'.
"Eine Zeile Selektieren
SELECT SINGLE * FROM zzbz
INTO CORRESPONDING FIELDS OF gs_zzbzv
WHERE aename = gf_name.
CHECK sy-subrc = 0.
"View aufrufen
CALL FUNCTION 'VIEW_MAINTENANCE_SINGLE_ENTRY'
EXPORTING
action = 'UPD'
view_name = 'ZZBZV'
CHANGING
entry = gs_zzbzv
EXCEPTIONS
OTHERS = 15.
CLEAR: gs_zzbzv, gf_name.
"Genau eine Zeile bearbeiten
"Viewcluster aufrufen.
WHEN 'P06'.
CALL FUNCTION 'VIEWCLUSTER_MAINTENANCE_CALL'
EXPORTING
viewcluster_name = 'ZZBZVC'
maintenance_action = 'U' "Update
show_selection_popup = ' '
TABLES
dba_sellist = gt_sellist
EXCEPTIONS
OTHERS = 16.
"Im Viewcluster bestimmte zeilen aufrufen
WHEN 'P07'.
"Erste Zeile selektieren
APPEND INITIAL LINE TO gt_sellist ASSIGNING <sellist>.
<sellist>-viewfield = 'AENAME'.
<sellist>-operator = 'EQ'.
<sellist>-value = gf_vorname.
<sellist>-and_or = 'OR'.
"Zweite Zeile selektieren
APPEND INITIAL LINE TO gt_sellist ASSIGNING <sellist>.
<sellist>-viewfield = 'AENAME'.
<sellist>-operator = 'EQ'.
<sellist>-value = gf_nachname.
"Viewcluster aufrufen
CALL FUNCTION 'VIEWCLUSTER_MAINTENANCE_CALL'
EXPORTING
viewcluster_name = 'ZZBZVC'
maintenance_action = 'S' "SHOW
show_selection_popup = ' '
TABLES
dba_sellist = gt_sellist
EXCEPTIONS
OTHERS = 16.
ENDCASE.