You are on page 1of 5

1

ABAP PROGRAMMING FOR BEGINNERS & FUNCTIONAL CONSULTANTS

Day 5
New ABAP Syntax
All New Syntaxes

In-Line data declaration

Comma in SELECT query along with @ Escape Host Variables

Concatenate using PIPE operator

COND, VALUE Expression, FOR Operator, TABLE Expression, NEW Operator

COL2 OF ITAB3 -> ITBA2 -> ITAB1 -> STRUC

Getting familiar with ADT and Programming in ABAP Perspective

Basic Editor Tasks such as Syntax Check and activating ABAP objects. Ctrl + F2 And Ctrl + F3.
To open SAP GUI use the Open SAP GUI icon or Ctrl + 6.
Creating an ABAP object; Editing an ABAP object; Ctrl + Space for Code Completion along with
Code Templates.
While using Ctrl + Space for FM/ Class use Shift + Enter for playing around with the signature.

Page | 1 ©https://sapyard.com/ TRAINER'S NOTES


2
ABAP PROGRAMMING FOR BEGINNERS & FUNCTIONAL CONSULTANTS

All New Syntaxes in Modern ABAP as in In-Line Data Declaration, Comma in SELECT query along with @
Escape Host Variables, Concatenation using PIPE operator, VALUE Expression, FOR Operator, TABLE
Expression, NEW Operator and so on.

"Chained Table Expression -> A fun example


TYPES:
BEGIN OF struc1,
col1 TYPE i,
col2 TYPE i,
END OF struc1,
itab1 TYPE TABLE OF struc1 WITH EMPTY KEY,
itab2 TYPE TABLE OF itab1 WITH EMPTY KEY,
BEGIN OF struc2,
col1 TYPE i,
col2 TYPE itab2,
END OF struc2,
itab3 TYPE TABLE OF struc2 WITH EMPTY KEY.

DATA(ITAB) = VALUE ITAB3( ( COL1 = 3 COL2 = VALUE ITAB2( ( VALUE ITAB1( ( COL1 = 4 COL2 = 5 )
( COL1 = 6 COL2 = 7 ) ) )"END OF ITAB1
( VALUE ITAB1( ( COL1 = 8 COL2 = 9 )
( COL1 = 10 COL2 = 11 ) ) )"END OF ITAB1
) )"END OF ITAB2
( COL1 = 12 COL2 = VALUE ITAB2( ( VALUE ITAB1( ( COL1 = 13 COL2 = 14 )
( COL1 = 15 COL2 = 16 ) ) )"END OF ITAB1
( VALUE ITAB1( ( COL1 = 17 COL2 = 18 )
( COL1 = 19 COL2 = 20 ) ) )"END OF ITAB1
) )"END OF ITAB2
).
* Reading the column with value 13 with READ TABLE statements

READ TABLE itab INTO DATA(wa1) INDEX 2.


READ TABLE wa1-col2 INTO DATA(wa2) INDEX 1.
READ TABLE wa2 INTO DATA(wa3) INDEX 1.
DATA(num1) = wa3-col1.
WRITE:/ 'The value using READ statements:', num1.

* Reading the column with value 13 with chained table expressions

DATA(num2) = itab[ 2 ]-col2[ 1 ][ 1 ]-col1.


WRITE:/ 'The value using chained Table Expression:', num2.

Page | 2 ©https://sapyard.com/ TRAINER'S NOTES


3
ABAP PROGRAMMING FOR BEGINNERS & FUNCTIONAL CONSULTANTS

Refer to the Program ZABAP_NEW_SYNTAX for reference and understanding of class concepts w.r.t
New Syntaxes

Page | 3 ©https://sapyard.com/ TRAINER'S NOTES


4
ABAP PROGRAMMING FOR BEGINNERS & FUNCTIONAL CONSULTANTS

Quizzes & Assignments


Development in ADT is performed using the same online Development Model used in the ABAP
Workbench.
• True
• False

When you work with ADT you log on to the ABAP backend system and remain logged on for your entire
session.
• True
• False

Which of the following are the perspectives in ADT?


• ABAP
• Transport Organizer
• Debug
• Package

Where can you set the preferences for working with ADT?

Which keyboard shortcut do we use to copy a FM and its signature on to our code after using Ctrl +
Space?
• Shift + Enter
• Alt + Enter
• Ctrl + Enter
• Ctrl + Shift+ Enter

What is the shortcut for Activating all ABAP objects?

How do you search for any development object in the ABAP perspective?

Exercise –

❖ Convert the ALV Report using New ABAP Syntax


❖ Create Local Types and fill in the data for Structures and Internal Table and with the use of
CORRESPONDING operator try to pass the data to structures and Internal Tables and also make
use of BASE, MAPPING and EXCEPT.

Page | 4 ©https://sapyard.com/ TRAINER'S NOTES


5
ABAP PROGRAMMING FOR BEGINNERS & FUNCTIONAL CONSULTANTS

❖ If you are using Table Expression for Reading Internal Tables what is the exception that gets
raised incase table line is not found?

Page | 5 ©https://sapyard.com/ TRAINER'S NOTES

You might also like