SAP R/3

Formatting Options in SAPscript: Symbol Length

In SAPscript you can define a part of symbol value by this option.

Syntax

&VAR(n)&

Example


&VAR&  =     ABCDEFGHIJK
&VAR(2)& = AB
&VAR+2(3)& = CDE

Formatting Options in SAPscript: Offset

In SAPscript if you want to present the value of data by offset n characters to the right (n left characters symbols will not be displayed), you can apply offset format to it.

Syntax

&VAR+n&

Example


&VAR&    =     ABCDEFGHIJK
&VAR+2& = CDEFGHIJK

Convert Date <-> Timestamp in ABAP/4

Date to Timestamp

Example

*&---------------------------------------------------------------------*
*&    Form convert_date_to_timestamp
*&---------------------------------------------------------------------*
form convert_date_to_timestamp using par_date
                                   par_time
                                   par_time_zone
                             changing par_timestamp.
clear par_timestamp.
CONVERT DATE par_date TIME par_time INTO
        TIME STAMP par_timestamp TIME ZONE par_time_zone.
endform.                  " convert_date_to_timestamp

Timestamp to Date

Chained Statement in ABAP/4

The statements that same keyword can be chained by colon (:). Between the statements separated by ",". When you apply this method, ensure that the chained statement ended by ".".

Example

Normal Statement

PARAMETERS p1(10) TYPE C.
PARAMETERS p2 TYPE D.

Chained Statement

PARAMETERS: p1(10) TYPE C,
p2 TYPE D.

Normal Statement

WRITE ’First’.
WRITE ’Second’.