Friday, February 10, 2012

Defining Macros in abap program

*&---------------------------------------------------------------------*
*& Report  YSAP_MACRO
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ysap_macro.

DATA: result TYPE i,
      n1 TYPE i VALUE 5,
      n2 TYPE i VALUE 6.

DEFINE operation.
  result = &1 &2 &3.
  output &1 &2 &3 result.
END-OF-DEFINITION.

DEFINE output.
  write: / 'The result of &1 &2 &3 is', &4.
END-OF-DEFINITION.

operation 4 + 3.
operation 2 ** 7.
operation n2 - n1.

ULINE.


 

No comments:

Post a Comment