OO ALV By CL_SALV_TABLE


REPORT zsalv_table_diaplay.

CLASS sales_order_disp DEFINITION.

  PUBLIC SECTION.

    DATA o_salv TYPE REF TO cl_salv_table.

    METHODS build_salesorder,

                           disp_salesorder.

  PRIVATE SECTION.

    DATA lt_vbak TYPE TABLE OF vbak.

ENDCLASS.

CLASS sales_order_disp IMPLEMENTATION.


  METHOD build_salesorder.

    SELECT FROM vbak INTO TABLE lt_vbak UP TO 50 ROWS.

  ENDMETHOD.

  METHOD disp_salesorder.

    try.

    cl_salv_table=>factory(

      IMPORTING

        r_salv_table   o_salv    ” Basis Class Simple ALV Tables

      CHANGING

        t_table        lt_vbak ).


     CATCH cx_salv_msg

     endtry.

 o_salv->display).

  ENDMETHOD.

ENDCLASS.

START-OF-SELECTION.

  DATAo_salesord TYPE REF TO sales_order_disp.

  CREATE OBJECT o_salesord.

  o_salesord->build_salesorder).

  o_salesord->disp_salesorder).


 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s