Call usual ABAP class in report using static method

Call class in report program.

Create class refer - Usual ABAP class with example using static 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_ekk1.

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

PARAMETERSp_vbeln TYPE ebeln.

START-OF-SELECTION.
  CALL METHOD zcl_ekko1=>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+ ).