Sie sind auf Seite 1von 5

1.

Introduction of real expression oriented feature


Suppose we have to output a value of column of an internal table for a particular row along with a string. In earlier releases code look like this

In SAP 7.40 code is

a.

In-line expression with helper variable, which removes concatenate statement.

b.

Table expression with helper variable, which removes READ TABLE statement.

2.

New style of data declarations


In Prior releases values cannot be assigned in line with data declaration, but possible with release 7.40

3.

New Constructor Operators


3.1. Instantiation Operator NEW
The instantiation operator NEW is a constructor operator that creates an object reference of class or data. a. Syntax ->

. NEW dTyp | # ( val) Creates a data object of data type dTyp or data type of value val having value val Example ->

b. Syntax -> . NEW my_class | #( p1 = v1 p2 = v2 ) Creates an instance of class my_classor depending on the operand type and passes parameter list to instance constructor. Example ->

3.2.

Constructor Operator VALUE

The value operator VALUE is a constructor operator that constructs a value for the type specified with type.

... VALUE dTyp|#( ) ...


Constructs an initial value for any data type. ... VALUE dTyp|#( comp1 = a1 comp2 = a2 ... ) ...

Constructs a structure where for each component a value can be assigned.

... VALUE dTyp|#( ( ... ) ( ... ) ... ) ...


Constructs an internal table, where for each line a value can be assigned.

3.3.
Syntax ->

Reference Operator REF

REF Operator is an alternative to the following abap statement.

GET REFERENCE OF dobj INTO r_obj. ... REF dTyp|#( dobj ) ...

3.4.

Casting Operator CAST

CAST Operator performs the narrow or wide cast

3.5.

Conditional Operator COND

New Conditional operator which assigns the value to an object based on some condition. Syntax -> ... COND dTyp|#(WHEN log_exp1 THEN result1

[ WHEN log_exp2 THEN result2 ] ... [ ELSE resultn ] ) ... Example ->

3.6.

Conditional Operator SWITCH

New Conditional operator which assigns the value to an object based on some condition. Syntax -> ... SWITCH dTyp|#( operand

WHEN const1 THEN result1 [ WHEN const2 THEN result2 ] ... [ ELSE resultn ] ) ...

Das könnte Ihnen auch gefallen