Call usual ABAP class in report using instance method.

 Call class in report program.

Refer Create class - Usual ABAP class with example using instance method. (abappractice.blogspot.com)

1. Goto SE38.

2. Give program name and click on create.

3. Give title and click on save.

4. Write code.

    REPORT zrp_cl_ekko.

    DATA:
          bukrs TYPE bukrs,
          bstyp TYPE bstyp,
          bsart TYPE bsart,
          spras TYPE spras.

    PARAMETERSp_vbeln TYPE ebeln.

    START-OF-SELECTION.
      DATAobj TYPE REF TO zcl_ekko.
      CREATE OBJECT obj.

      CALL METHOD obj->display
        EXPORTING
          pebeln p_vbeln
        IMPORTING
          pbukrs bukrs
          pbstyp bstyp
          pbsart = bsart
          pspras spras.

      IF sy-subrc 0.
        WRITE/ bukrs,
               / bstyp,
               / bsart,
               / spras.
      ELSE.
        MESSAGE 'Pls Give Correct Input' TYPE 'E'.

      ENDIF.

Input


Output


********************************Thank You***************************

Comments

Popular posts from this blog

New syntax for append- VALUE (new syntax 7.4+) in ABAP

Read statement new syntax in ABAP. (7.4+).

Concatenation new syntax( 7.4+ ).