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.
PARAMETERS: p_vbeln TYPE ebeln.
START-OF-SELECTION.
DATA: obj 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
Comments
Post a Comment