SAP MACRO

DEMO Macro from SAP DEMO

 

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. 


 

REPORT  DEMO_MACRO.

DATA: x TYPE i, y TYPE i, l TYPE i.

DEFINE write_frame.
  x = sy-colno. y = sy-linno.
  WRITE: '|' NO-GAP, &1 NO-GAP, '|' NO-GAP.
  l = sy-colno - x.
  y = y - 1. SKIP TO LINE y. POSITION x.
  ULINE AT x(l).
  y = y + 2. SKIP TO LINE y. POSITION x.
  ULINE AT x(l).
  y = y - 1. x = sy-colno. SKIP TO LINE y. POSITION x.
END-OF-DEFINITION.

SKIP.
write_frame 'In a frame!'.


 

你可能感兴趣的:(SAP,ABAP)