ABAP 7.5 New Syntax Latest
ABAP 7.5 New Syntax Latest
2.Table Expression:
In SAP whenever the data is to be taken from Internal Table to any
variable in Code for further processing, Loop or Read Table are
generally used to get that data from Internal Table to work area and
then move to another variable, so this effort can be lessened by using
the new syntax.
Note: While Using these Syntaxes in case of Table Expression use with
Try Catch with cx_sy_itab_line_not_found and Entry.
3.Data Operations:
Here are some of the new Syntax which can be used for manipulating,
changing, and storing data according to requirement.
Case Endcase.
Old Syntax.
CASE var1.
WHEN cond1.
var1 = fld1.
WHEN cond2.
var1 = fld2.
ENDCASE.
New Syntax.
var1 = SWITCH #( var1 WHEN cond1 THEN fld1
WHEN cond2 THEN fld2 ).
Using Above Syntax only fields which are identical in the container will
be moved to move it to other fields this new syntax can be used.
itab2 = CORRESPONDING #( itab1 MAPPING t1_fld1 = t2_fld1
t1_fld2 = t2_fld2 ).
Object-Oriented.
Old Syntax.
DATA: binary_content TYPE solix_tab.
DATA: xl_content TYPE xstring .CALL METHOD
cl_document_bcs=>xstring_to_solix
EXPORTING
ip_xstring = xl_content
receiving
rt_solix = binary_content
New Syntax.
binary_content = cl_bcs_convert=>xstring_to_solix( ip_xstring =
xl_content ).