메뉴 건너뛰기

SAP 한국 커뮤니티

REPORT z18_006

sapjoy 2007.03.06 21:28 조회 수 : 2423


REPORT  z18_006                                                     .

DATA : con1_ref TYPE REF TO cl_gui_custom_container.

DATA : grid1  TYPE REF TO cl_gui_alv_grid,
       gs_variant     LIKE disvariant,
       gs_cs_variant  LIKE disvariant,
       gs_layout     TYPE lvc_s_layo,
       gt_sflight   TYPE TABLE OF sflight.


PARAMETERS:     p_vari   LIKE disvariant-variant.


INITIALIZATION.
  gs_variant-report = sy-repid.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.



  CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
    EXPORTING
      is_variant    = gs_variant
      i_save        = 'A'
    IMPORTING
      es_variant    = gs_cs_variant
    EXCEPTIONS
      not_found     = 1
      program_error = 2
      OTHERS        = 3.
  IF sy-subrc EQ 0.
    p_vari = gs_cs_variant-variant.
  ENDIF.


START-OF-SELECTION.
  SELECT * FROM sflight INTO TABLE gt_sflight.

  CALL SCREEN 100.





*---------------------------------------------------------------------*
*  MODULE init_con OUTPUT
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
MODULE init_con OUTPUT.

  IF con1_ref IS INITIAL.
    CREATE OBJECT con1_ref
    EXPORTING container_name = 'CON1'.


    CREATE OBJECT grid1
           EXPORTING
                i_parent = con1_ref.


*    PERFORM setting_layout  USING gs_layout.


    CALL METHOD grid1->set_table_for_first_display
      EXPORTING
        i_structure_name = 'SFLIGHT'
        i_save           = 'A'
        is_variant       = gs_variant  " variant display
        i_default        = ' '
        is_layout        = gs_layout
      CHANGING
        it_outtab        = gt_sflight.



  ENDIF.
ENDMODULE.                 " init_con  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'G100'.
*  SET TITLEBAR 'xxx'.

ENDMODULE.                 " STATUS_0100  OUTPUT

*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.

  CASE sy-ucomm.
    WHEN 'BACK' OR 'EXIT' OR 'CANC'.
      LEAVE TO SCREEN 0.
  ENDCASE.

ENDMODULE.                 " USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*&      Form  setting_layout
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_GS_LAYOCAT  text
*----------------------------------------------------------------------*
FORM setting_layout   USING  p_layout TYPE lvc_s_layo.
*- General display options
  p_layout-cwidth_opt = 'X'.
* TITLE BAR
  p_layout-grid_title = 'LAYOUT TEST'.
* Selection modes for SEL_MODE
  p_layout-sel_mode = 'D'.
* Grid pattern
  p_layout-zebra      = 'X'.
ENDFORM.                    " setting_layout
번호 제목 글쓴이 날짜 조회 수
91 REPORT z19_003 sapjoy 2007.03.27 2473
90 REPORT z19_002 sapjoy 2007.03.24 2362
89 REPORT z19_001 sapjoy 2007.03.23 2552
88 REPORT z18_022 sapjoy 2007.03.17 2464
87 REPORT z18_019 sapjoy 2007.03.13 2473
86 REPORT z18_018 [4] sapjoy 2007.03.12 2463
85 REPORT z18_014 sapjoy 2007.03.10 2844
84 REPORT z18_013 [1] sapjoy 2007.03.09 2585
83 REPORT z18_012 [1] sapjoy 2007.03.09 2404
82 REPORT Z15_045 sapjoy 2007.03.09 2388
81 REPORT z18_011 [1] sapjoy 2007.03.08 2326
80 REPORT z18_008 sapjoy 2007.03.07 2359
79 REPORT z18_007 sapjoy 2007.03.07 2206
» REPORT z18_006 sapjoy 2007.03.06 2423
77 REPORT z18_005 sapjoy 2007.03.06 2157
76 REPORT z18_004 [1] sapjoy 2007.03.06 2348
75 REPORT Z18_002 sapjoy 2007.03.06 3083
74 Z18_001_PBO sapjoy 2007.03.03 2585
73 REPORT Z18_001 sapjoy 2007.03.03 2774
72 REPORT Z02_016 sapjoy 2007.02.27 2294