Types Begin of Type Type Type End of Data Type Standard Table of Data Type Ref To Type Ref To Data Type Type Parameters Type

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

*&---------------------------------------------------------------------*

*& Report  ZMR_OOALV_CUSTOMCONT
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZMR_OOALV_DOCKINGCONT.
types : begin of ty_ekko,
         ebeln type ebeln,
         bukrs type bukrs,
         aedat type aedat,
        end of ty_ekko.
data : lt_ekko type STANDARD TABLE OF ty_ekko. "ekko.
DATA : LR_DOCK TYPE REF TO CL_GUI_DOCKING_CONTAINER,
       LR_ALV TYPE REF TO CL_GUI_ALV_GRID.
data : lt_fldcat type lvc_t_fcat,
       wa_fldcat type lvc_s_fcat.
PARAMETERS : p_lifnr type lifnr.

START-OF-SELECTION.
select ebeln bukrs aedat from ekko into TABLE lt_ekko where lifnr = p_lifnr.
  if sy-subrc = 0.
     call screen 9000.
    else.

      endif.
*&---------------------------------------------------------------------*
*&      Module  STATUS_9000  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE STATUS_9000 OUTPUT.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.
* CREATE OBJECT FOR DOCKING CONTINER
CREATE OBJECT LR_DOCK
  EXPORTING
    SIDE                        = CL_GUI_DOCKING_CONTAINER=>DOCK_AT_RIGHT " C
ONSTANT
    EXTENSION                   = 500
  EXCEPTIONS
    CNTL_ERROR                  = 1
    CNTL_SYSTEM_ERROR           = 2
    CREATE_ERROR                = 3
    LIFETIME_ERROR              = 4
    LIFETIME_DYNPRO_DYNPRO_LINK = 5
    others                      = 6.

IF LR_dock IS NOT INITIAL.
* CREATE OBJECT FOR ALV GRID.
CREATE OBJECT LR_ALV
  EXPORTING
   I_PARENT          = LR_dock  "DOCKING CONTAINER OBJECT
  EXCEPTIONS
    ERROR_CNTL_CREATE = 1
    ERROR_CNTL_INIT   = 2
    ERROR_CNTL_LINK   = 3
    ERROR_DP_CREATE   = 4
    others            = 5.
IF LR_ALV IS NOT INITIAL. "IS BOUND
* Prepare field catalog.
  wa_fldcat-COL_POS = 1.
  wa_fldcat-FIELDNAME = 'EBELN'.
  wa_fldcat-TABNAME = 'LT_EKKO'.
  wa_fldcat-SCRTEXT_S = 'Pur Ord'.
  wa_fldcat-SCRTEXT_m = 'Purchase Ord'.
  wa_fldcat-SCRTEXT_l = 'Purchase Order'.
  append wa_fldcat to lt_fldcat.
  clear wa_fldcat.

  wa_fldcat-COL_POS = 2.
  wa_fldcat-FIELDNAME = 'AEDAT'.
  wa_fldcat-TABNAME = 'LT_EKKO'.
  wa_fldcat-REF_FIELD = 'AEDAT'.
  WA_FLDCAT-REF_TABLE = 'EKKO'.
  append wa_fldcat to lt_fldcat.
  clear wa_fldcat.

    wa_fldcat-COL_POS = 3.
  wa_fldcat-FIELDNAME = 'BUKRS'.
  wa_fldcat-TABNAME = 'LT_EKKO'.
  wa_fldcat-REF_FIELD = 'BUKRS'.
  WA_FLDCAT-REF_TABLE = 'T001'.
  append wa_fldcat to lt_fldcat.
  clear wa_fldcat.

*  CALL METHOD SET TABLE FOR FIRST DISPLAY
CALL METHOD LR_ALV->SET_TABLE_FOR_FIRST_DISPLAY
  CHANGING
    IT_OUTTAB                     = LT_EKKO
    IT_FIELDCATALOG               = LT_FLDCAT
  EXCEPTIONS
    INVALID_PARAMETER_COMBINATION = 1
    PROGRAM_ERROR                 = 2
    TOO_MANY_LINES                = 3
    others                        = 4
        .

  ENDIF.
  ENDIF.

ENDMODULE.                 " STATUS_9000  OUTPUT

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy