/:IF condition
..
ELSE
..
/:ENDIF
CASE ... ENDCASE
It si similar to multiple IF.. ENDIF's
but is much cleaner.
/:CASE condition
/:WHEN value1
...
/:WHEN value2
...
...
/:ENDCASE
TIME/DATE/COUNTRY Formats
These commands are
used for specifying the format of date and
time and setting the default country.
/:SET DATE MASK = 'MM.DD.YYYY'
/:SET TIME MASK = 'HH:MM'
/:SET COUNTRY 'DN'
PERFORM ... IN PROGRAM .... USING..
CHANGING ..
ENDPERFORM
To call ABAP subroutines from within a form
we use the
PERFORM... IN PROGRAM ... statement , the advantage of
using it is that the print program is not required
to cahnge and we
can get the new data from the subroutine which is placed
in a Z
report . To pass and get the values from th subroutine the
parameters are passed which are of type structure
ITCSY.
e.g. /:PERFORM get_date IN PROGRAM zreport
/:USING &SALESORDER&
/:CHANGING
&S_DATE&
/:ENDPERFORM
The date &S_DATE& ....
The ABAP Code would be
REPORT zreport.
TABLES ztab.
FORM get_date TABLES in_tab STRUCTURE ITCSY out_tab
STRUCTURE ITCSY .
READ TABLE in_tab INDEX 1.
SELECT some_date FROM ztab WHERE salesorder = in_tab-value.
IF sy-subrc EQ 0.
READ TABLE out-tab INDEX 1.
MOVE ztab-somedate TO out_tab-value
MODIFY out_tab INDEX 1.
ENDIF.
ENDFORM.
In the above code USING is used to pass the value
to the
subroutine while changing is used to recieve the value from th
subroutine ,for further paramters we can use either USING
or
CHANGING .
In the subroutine the type of paramter is always an internal
table of
type ITCSY irrespective of the value passed.The
VALUE field
of the internal table is used to fill and recieve the
values .