Code: Alles auswählen.
REPORT Z_DEMONSTRATOR.
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP 1.
**SELECTION-SCREEN BEGIN OF LINE.
**SELECTION-SCREEN COMMENT 2(25) FOR FIELD onchain.
**SELECTION-SCREEN COMMENT 79(10) FOR FIELD offchain.
*PARAMETERS offchain TYPE char30.
**SELECTION-SCREEN COMMENT 50(50) FOR FIELD InvID.
**PARAMETERS InvID TYPE char30.
**PARAMETERS Product TYPE char30.
************
PARAMETERS Field type char15.
PARAMETERS Field2 type char15.
PARAMETERS Field3 type char15.
************
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 1(20) text-010 USER-COMMAND button_001.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK a1.
SELECTION-SCREEN BEGIN OF BLOCK a2 WITH FRAME TITLE text-002.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 1(20) text-020 USER-COMMAND button_002.
SELECTION-SCREEN END OF LINE.
PARAMETERS ClientID TYPE char20.
PARAMETERS FlightID TYPE char20.
PARAMETERS Destina TYPE char20.
**SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN END OF BLOCK a2.
DATA:
docking TYPE REF TO cl_gui_docking_container .
*
*********
include <icon>.
data: ok_code like sy-ucomm,
gt_spfli type table of spfli,
gt_sflight type table of sflight,
g_repid like sy-repid,
g_max type i value 100,
gs_layout type lvc_s_layo,
gs_toolbar type stb_button,
grid1 type ref to cl_gui_alv_grid,
grid2 type ref to cl_gui_alv_grid,
custom_container1 type ref to cl_gui_custom_container,
custom_container2 type ref to cl_gui_custom_container.
AT SELECTION-SCREEN OUTPUT.
PERFORM build_gridviewer .
START-OF-SELECTION.
*&---------------------------------------------------------------------*
*& Form build_gridviewer
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM build_gridviewer .
DATA: repid LIKE sy-repid.
IF NOT grid1 IS INITIAL .
CALL METHOD grid1->free .
ENDIF .
repid = sy-repid.
if docking is initial .
CREATE OBJECT docking
EXPORTING
repid = repid
dynnr = sy-dynnr
side = cl_gui_docking_container=>dock_at_right
extension = '300'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
endif .
IF NOT docking IS INITIAL AND
grid1 IS INITIAL .
create object grid1
exporting i_parent = docking.
refresh gt_spfli .
select * from spfli into table gt_spfli.
* Set a titlebar for the grid control
*
call method grid1->set_table_for_first_display
exporting i_structure_name = 'SPFLI'
is_layout = gs_layout
changing it_outtab = gt_spfli.
ENDIF .
ENDFORM. " build_htmlviewer
Code: Alles auswählen.
IF NOT grid1 IS INITIAL .
CALL METHOD grid1->free .
ENDIF .
Code: Alles auswählen.
FREE grid1.
Code: Alles auswählen.
IF NOT grid1 IS INITIAL .
CALL METHOD grid1->free .
FREE grid1.
ENDIF .
Folgende Benutzer bedankten sich beim Autor PeterPaletti für den Beitrag:
danbrown_1999
Code: Alles auswählen.
SELECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE TEXT-001.
PARAMETERS field TYPE char15.
PARAMETERS field2 TYPE char15.
PARAMETERS field3 TYPE char15.
SELECTION-SCREEN END OF BLOCK a1.
SELECTION-SCREEN BEGIN OF BLOCK a2 WITH FRAME TITLE TEXT-002.
PARAMETERS clientid TYPE char20.
PARAMETERS flightid TYPE char20.
PARAMETERS destina TYPE char20.
SELECTION-SCREEN END OF BLOCK a2.
SELECTION-SCREEN END OF SCREEN 1100.
DATA:
docking TYPE REF TO cl_gui_docking_container .
DATA: okcode LIKE sy-ucomm,
saveok TYPE sy-ucomm,
spfli TYPE TABLE OF spfli,
sflight TYPE TABLE OF sflight,
grid1 TYPE REF TO cl_gui_alv_grid,
salv TYPE REF TO cl_salv_table.
START-OF-SELECTION.
REFRESH spfli .
SELECT * FROM spfli INTO TABLE spfli.
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*& Form build_gridviewer
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM build_gridviewer .
DATA: repid LIKE sy-repid.
repid = sy-repid.
IF docking IS INITIAL .
CREATE OBJECT docking
EXPORTING
repid = repid
dynnr = sy-dynnr
side = cl_gui_docking_container=>dock_at_right
extension = '300'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
* CREATE OBJECT grid1
* EXPORTING
* i_parent = docking.
*
*
*
* CALL METHOD grid1->set_table_for_first_display
* EXPORTING
* i_structure_name = 'SPFLI'
* is_layout = gs_layout
* CHANGING
* it_outtab = gt_spfli.
* ELSE.
* CALL METHOD grid1->refresh_table_display
** EXPORTING
** is_stable = " zeilen-/spaltenstabil
** i_soft_refresh = " Ohne Sortierung, Filter, etc.
* EXCEPTIONS
* finished = 1 " Display wurde beendet ( durch Export ).
* OTHERS = 2.
* IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
* ENDIF.
TRY.
cl_salv_table=>factory( EXPORTING
r_container = docking
IMPORTING
r_salv_table = salv
CHANGING
t_table = spfli ).
salv->display( ).
CATCH cx_root INTO DATA(e_txt).
ENDTRY.
ENDIF .
ENDFORM. " build_htmlviewer
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS '100'.
SET TITLEBAR '100'.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
saveok = okcode.
CLEAR okcode.
CASE saveok.
WHEN 'EXIT' OR 'BACK' OR 'CANC'.
IF NOT grid1 IS INITIAL .
CALL METHOD grid1->free .
FREE grid1.
ENDIF.
IF NOT docking IS INITIAL.
CALL METHOD docking->free .
FREE docking.
ENDIF.
LEAVE PROGRAM.
WHEN 'BUT01'.
REFRESH spfli .
SELECT * FROM spfli INTO TABLE spfli.
CALL METHOD salv->set_data
CHANGING
t_table = spfli.
CALL METHOD salv->refresh.
WHEN 'BUT02'.
REFRESH sflight .
SELECT * FROM sflight INTO TABLE sflight.
CALL METHOD salv->set_data
CHANGING
t_table = sflight.
CALL METHOD salv->refresh.
WHEN OTHERS.
ENDCASE.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module INIT_CONTROLS_100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE init_controls_100 OUTPUT.
PERFORM build_gridviewer.
ENDMODULE.
Code: Alles auswählen.
PROCESS BEFORE OUTPUT.
MODULE status_0100.
MODULE init_controls_100.
CALL SUBSCREEN area INCLUDING sy-repid '1100'.
PROCESS AFTER INPUT.
CALL SUBSCREEN area.
MODULE user_command_0100.
Folgende Benutzer bedankten sich beim Autor PeterPaletti für den Beitrag:
danbrown_1999
Du musst das grid nicht jedes Mal zerstören!
Code: Alles auswählen.
grid1->refresh_table_display( ).
Folgende Benutzer bedankten sich beim Autor ewx für den Beitrag:
danbrown_1999
Code: Alles auswählen.
CREATE OBJECT docking
EXPORTING
repid = repid
dynnr = sy-dynnr
side = cl_gui_docking_container=>dock_at_right
extension = '300'
Code: Alles auswählen.
gs_layout-cwidth_opt = 'X'.
Code: Alles auswählen.
gs_layout-cwidth_opt = 'X'.
call method grid1->set_table_for_first_display
exporting i_structure_name = 'YINVOICE_TAB'
is_layout = gs_layout
changing it_outtab = gt_ty_invoice_response.
Folgende Benutzer bedankten sich beim Autor a-dead-trousers für den Beitrag:
danbrown_1999