GoodleAds

OOPS ABAP ALV PROGRAM USING STRUCTURE


INCLUDE zoops_structure_top.    " internal table and objects declartion


 

START-OF-SELECTION.
**************************************************************************************
*CALL SCREEN 100 AND CLICK ON LAYOUT TAB AND CREATE CUSTOM CONTAINER AND ASSIGN A NAME
**************************************************************************************
CALL SCREEN 100.

 






 
 
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
*  SET PF-STATUS 'BACK_BUTTON'.
*  SET TITLEBAR 'xxx'.
  PERFORM create_objects.  "Creation of objects grid and display
  PERFORM get_data.        "fetching the data from likp
  PERFORM display_data.    " displaying the data

ENDMODULE.                 " STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*&      Form  CREATE_OBJECTS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*



 
FORM create_objects
CREATE OBJECT grid
  EXPORTING
    container_name              'GRID'.
CREATE OBJECT display
  EXPORTING
    i_parent          grid.
ENDFORM.                    " CREATE_OBJECTS
*&---------------------------------------------------------------------*
*&      Form  GET_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM get_data .
SELECT FROM likp
  INTO TABLE itab UP TO 300 ROWS.
ENDFORM.                    " GET_DATA
*&---------------------------------------------------------------------*
*&      Form  DISPLAY_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*


 
 
FORM display_data .
CALL METHOD display->set_table_for_first_display
  EXPORTING
    i_structure_name              'LIKP'
  CHANGING
    it_outtab                     itab.
ENDFORM.                    " DISPLAY_DATA



OUTPUT

 

No comments:

Post a Comment