Monday, September 15, 2014

ABAP TIP - Function of‘&’ symbol


ABAP TIP - Function of& symbol

& symbol has a meaning of parameter. Representative examples for & is when passing the parameter to MACRO like below program.

REPORT  z01_01.

DATA: gv_val1 TYPE c VALUE 'A',
       gv_val2 TYPE c VALUE 'B',
       gv_val3 TYPE char3.

DEFINE con.
  CONCATENATE &1 &2 INTO &3 SEPARATED BY space.
  dis &3.
END-OF-DEFINITION.

DEFINE dis.
  WRITE &1.
END-OF-DEFINITION.

con gv_val1 gv_val2 gv_val3.

& symbol also is useful when assigning the title of screen.






If you declare the & in title of screen, you can define the screen title with the below command.

  SET TITLEBAR 'T0001' WITH 'Title Test'.

 



Definitely, you can declare 2 parameter with &, the title of screen is named like below command.

  
SET TITLEBAR 'T0001' WITH 'Title' 'Test'.


 



No comments:

Post a Comment