SlideShare a Scribd company logo
ABAP 7.x
Dr. Kerem Köseoğlu
www.keremkoseoglu.com
Variable definition
Data
go_bapi->create_doc(
EXPORTING
iv_var1 = ‘SAMPLE’
iv_var2 = ‘SAMPLE’
IMPORTING
ev_belnr = DATA(lv_belnr)
ev_gjahr = DATA(lv_gjahr)
ev_bukrs = DATA(lv_bukrs)
).
Data
DATA(lv_name) = class=>get_name( lv_kunnr ).
Field symbol
LOOP AT gt_itab
ASSIGNING FIELD-SYMBOL(<ls_itab>).
ENDLOOP.
Pointer
LOOP AT gt_itab
REFERENCE INTO DATA(lr_itab).
ENDLOOP.
Value assignment
Value
DATA(ls_kna1) = VALUE kna1(
kunnr = ‘1234567890’
name1 = ‘SAMPLE’
).
Value #
DATA ls_kna1 TYPE kna1.
ls_kna1 = VALUE #(
kunnr = ‘1234567890’
name1 = ‘SAMPLE’
).
Value # with method
DATA ls_kna1 TYPE kna1.
ls_kna1 = VALUE #(
kunnr = lv_kunnr1
name1 = get_name( kunnr = lv_kunnr1 )
).
Conv
check_doc(
iv_xblnr = CONV #( lv_aufnr )
).
Cond
get_date_interval(
IMPORTING
!ev_begin = DATA(lv_begin)
!ev_end = DATA(lv_end)
).
DATA(lv_status) = COND char5(
WHEN sy-datum LT lv_begin THEN ‘EARLY’
WHEN sy-datum GT lv_end THEN ‘LATE’
ELSE ‘OK’
).
Switch
DATA(lv_status) = SWITCH char10(
sy-msgty
WHEN ‘S’ THEN ‘PERFECT’
WHEN ‘W’ THEN ‘OK’
ELSE ‘ERROR’
).
String templates
DATA(lv_string) =
|Today is { sy-datum }| &&
| ,time is { sy-uzeit }| &&
| ,system status: { get_status( ) }|.
XSDBOOL
rv_result = XSDBOOL( sy-subrc eq 0 ).
Pointer
DATA(lr_ref) = REF #( lv_value ).
Internal tables
Assign / Index
ASSIGN lt_itab[ 3 ] TO FIELD-SYMBOL(<ls_itab>).
Assign / Key
ASSIGN lt_itab[
bukrs = ’1234’
belnr = ‘1234567890’
gjahr = ‘2018’
] TO FIELD-SYMBOL(<ls_itab>).
Assign / Hashed key
ASSIGN lt_itab[
KEY primary_key COMPONENTS
bukrs = ’1234’
belnr = ‘1234567890’
gjahr = ‘2018’
] TO FIELD-SYMBOL(<ls_itab>).
Reference
DATA(lr_ref) = REF #(
lt_itab[
bukrs = ’1234’
belnr = ‘1234567890’
gjahr = ‘2018’
]
).
Default
DATA(lv_name1) = CONV name1_gp(
lt_kna1[ kunnr = lv_kunnr ]-name1
DEFAULT space
).
Line check
IF line_exists( lt_itab[ kunnr = lv_kunnr ] ).
" ...
ENDIF.
Corresponding
DATA(lt_malzeme) = CORRESPONDING tt_malz( lt_mara ).
Corresponding / Mapping / Except
DATA(lt_malzeme) = CORRESPONDING tt_malz(
lt_mara
MAPPING material = matnr
EXCEPT meins
).
For
DATA(lt_liste) = VALUE tt_liste(
FOR ls_mara IN lt_mara
WHERE ( mtart EQ ‘ABCD’ )
(
material = ls_mara-matnr
text = ls_mara-maktx
)
).
For Groups
DATA(lt_bukrs) = VALUE tt_bukrs(
FOR GROUPS grp OF ls_bkpf IN lt_bkpf
WHERE ( gjahr EQ lv_gjahr )
GROUP BY ls_bkpf-bukrs
( bukrs = grp )
).
Reduce
lv_sum = REDUCE #(
INIT x TYPE menge_d
FOR ls_mseg IN lt_mseg
WHERE ( matnr EQ lv_matnr )
NEXT x = x + ls_mseg-menge
).
Secondary index
TYPES:
tt_bkpf
TYPE STANDARD TABLE OF bkpf
WITH DEFAULT KEY
WITH UNIQUE HASHED KEY k1 COMPONENTS bukrs belnr gjahr
WITH NON-UNIQUE SORTED KEY k2 COMPONENTS xblnr.
Queries
Select into dynamic itab
SELECT matnr, mtart, matkl
FROM mara
WHERE matnr IN @s_matnr
INTO TABLE @DATA(lt_mat).
Select into dynamic variable
SELECT SINGLE name1
FROM kna1
WHERE kunnr eq @lv_kunnr
INTO @DATA(lv_name1).
Literals
DATA lt_werks_rng TYPE RANGE OF werks_d.
SELECT
‘I’ AS sign,
‘EQ’ AS option,
werks AS low
FROM t001w
INTO CORRESPONDING FIELDS OF TABLE @lt_werks_rng.
Select all fields
SELECT
marc~*,
t001w~name1
FROM
marc
INNER JOIN t001w ON t001w~werks EQ marc~werks
INTO TABLE @DATA(lt_marc).
Select Case
SELECT
CASE
WHEN strkorr NE @space THEN strkorr
ELSE trkorr
END AS request_no
FROM e070
INTO TABLE @DATA(lt_request).
Select Calculation
SELECT
brgew,
ntgew,
gewei,
ABS( brgew – ntgew ) AS diff
FROM mara
INTO TABLE @DATA(lt_material).
Union All
SELECT name1
FROM kna1
WHERE loevm EQ @abap_false
UNION ALL
SELECT name1
FROM lfa1
WHERE loevm eq @abap_false
INTO TABLE @DATA(lt_names).
Union Distinct
SELECT stcd1, stcd2
FROM kna1
WHERE loevm EQ @abap_false
UNION DISTINCT
SELECT stcd1, stcd2
FROM lfa1
WHERE loevm eq @abap_false
INTO TABLE @DATA(lt_tax).
Object Oriented
New
DATA(lo_obj) = NEW zcl_class( ).
New #
DATA lo_obj TYPE REF TO zcl_class.
lo_obj = NEW #( ).
Cast
DATA(lo_obj2) = CAST zcl_002( lo_obj1 ).
Is Instance Of
IF lo_obj2 IS INSTANCE OF lo_obj1.
" ...
ENDIF.
Default Ignore
INTERFACE zif_demo PUBLIC.
METHODS:
method1 DEFAULT IGNORE,
method2.
Final
Yeni ABAP
Avantaj
• Kısa & net kod
• Hızlı geliştirme
• Hatalarda azalma
• Performans
Dezavantaj
• Acemilik
• Anlaşılırlık
• Taşınabilirlik
• IDE
Teşekkürler!
Dr. Kerem Köseoğlu
www.keremkoseoglu.com
Sunum: slideshare.net/DrKeremKoseoglu

More Related Content

PDF
Manipulating data with dates
PDF
Apache PIG Relational Operations
PDF
Functional es6
PDF
AP Calculus December 18, 2008
PDF
1.4 data cleaning and manipulation in r and excel
PDF
PDF
Groupwise comparison of continuous data
PDF
Clojure introduction by Jason Basanese
Manipulating data with dates
Apache PIG Relational Operations
Functional es6
AP Calculus December 18, 2008
1.4 data cleaning and manipulation in r and excel
Groupwise comparison of continuous data
Clojure introduction by Jason Basanese

What's hot (10)

PDF
Python - Lecture 4
PDF
Problem Solving with Algorithms and Data Structure - Lists
PDF
(Very) Basic graphing with R
TXT
Array operators
PDF
High Performance Mysql - Friday Tech Talks at Squareboat
PDF
Functional Javascript, CVjs
ODP
Python Day1
DOC
Python - Lecture 4
Problem Solving with Algorithms and Data Structure - Lists
(Very) Basic graphing with R
Array operators
High Performance Mysql - Friday Tech Talks at Squareboat
Functional Javascript, CVjs
Python Day1
Ad

Similar to SITIST 2018 Part 1 - New ABAP Syntax (20)

DOCX
How to sas codes and tricks
DOCX
SAS CODES AND TRICKS
PDF
Unit_3.pdf
PPTX
Sangam 18 - Great Applications with Great SQL
DOC
Report zcomprasreporte abap
PDF
Appendix A Tables
TXT
My All Codes of SAS
PDF
Appendix A Tables
PDF
ILOUG 2019 - SQL features for Developers
PPTX
Perth APAC Groundbreakers tour - SQL Techniques
PDF
lab.123456789123456789123456789123456789
 
DOCX
How to sas (informative codes) COMSATS
PDF
Very simple queries of DBMS
PDF
Dax queries.pdf
DOC
Zi fi final prog
PDF
Power BI Cheat Sheet help to improve your power BI
PPTX
SQL techniques for faster applications
DOCX
SAS codes and tricks Comprehensive all codes
PDF
KScope19 - SQL Features
DOCX
It6312 dbms lab-ex2
How to sas codes and tricks
SAS CODES AND TRICKS
Unit_3.pdf
Sangam 18 - Great Applications with Great SQL
Report zcomprasreporte abap
Appendix A Tables
My All Codes of SAS
Appendix A Tables
ILOUG 2019 - SQL features for Developers
Perth APAC Groundbreakers tour - SQL Techniques
lab.123456789123456789123456789123456789
 
How to sas (informative codes) COMSATS
Very simple queries of DBMS
Dax queries.pdf
Zi fi final prog
Power BI Cheat Sheet help to improve your power BI
SQL techniques for faster applications
SAS codes and tricks Comprehensive all codes
KScope19 - SQL Features
It6312 dbms lab-ex2
Ad

More from sitist (20)

PPT
SITIST 2018 Part 2 - Hyperledger Fabric Blockchain Development
PPTX
SITIST 2018 Part 2 - SAP 2019 Technology Agenda
PPTX
SITIST 2018 Part 2 - Speed up Test Data Creation Process in ABAP
PDF
SITIST 2018 Part 2 - SCP Open Connectors & Serverless Functions Demo
PPTX
SITIST 2018 Part 2 - SAP S/4HANA Extensibility - Custom Fields and Logic Demo
PPTX
SITIST 2018 Part 2 - Robotic Process Automation (RPA)
PPTX
SITIST 2018 Part 2 - abapGit & lint
PPTX
SITIST 2018 Part 2 - ABAP in SAP Cloud Platform
PPTX
SITIST 2018 Part 2 - ABAP Career in Europe
PDF
SITIST 2018 Part 1 - Updates on SAP Analytics Cloud and Analytics Hub
PPTX
SITIST 2018 Part 1 - Installation of custom CIC Certified Add-On client systems
PPTX
SITIST 2018 Part 1 - SAP HANA Spatial Processing
PPSX
SITIST 2018 Part 1 - Employee vs Freelancer vs Entrepreneur
PDF
SITIST 2018 Part 1 - Gigya vs Hybris Marketing
PDF
SITIST 2018 Part 1 - Blockchain and Enterprise Use Cases
PPTX
SITIST 2018 Part 1 - SAP CP Enterprise Messaging
PPTX
SITIST 2017 Dev - Alexa Custom Skill Development with SAP HANA XSA
PPTX
HCI
PPTX
SITIST 2016 Dev - What's new at SAP
PDF
SITIST 2016 Dev - What is new in SAP Analytics
SITIST 2018 Part 2 - Hyperledger Fabric Blockchain Development
SITIST 2018 Part 2 - SAP 2019 Technology Agenda
SITIST 2018 Part 2 - Speed up Test Data Creation Process in ABAP
SITIST 2018 Part 2 - SCP Open Connectors & Serverless Functions Demo
SITIST 2018 Part 2 - SAP S/4HANA Extensibility - Custom Fields and Logic Demo
SITIST 2018 Part 2 - Robotic Process Automation (RPA)
SITIST 2018 Part 2 - abapGit & lint
SITIST 2018 Part 2 - ABAP in SAP Cloud Platform
SITIST 2018 Part 2 - ABAP Career in Europe
SITIST 2018 Part 1 - Updates on SAP Analytics Cloud and Analytics Hub
SITIST 2018 Part 1 - Installation of custom CIC Certified Add-On client systems
SITIST 2018 Part 1 - SAP HANA Spatial Processing
SITIST 2018 Part 1 - Employee vs Freelancer vs Entrepreneur
SITIST 2018 Part 1 - Gigya vs Hybris Marketing
SITIST 2018 Part 1 - Blockchain and Enterprise Use Cases
SITIST 2018 Part 1 - SAP CP Enterprise Messaging
SITIST 2017 Dev - Alexa Custom Skill Development with SAP HANA XSA
HCI
SITIST 2016 Dev - What's new at SAP
SITIST 2016 Dev - What is new in SAP Analytics

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Encapsulation theory and applications.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
sap open course for s4hana steps from ECC to s4
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
A Presentation on Artificial Intelligence
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
Cloud computing and distributed systems.
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Spectral efficient network and resource selection model in 5G networks
Encapsulation_ Review paper, used for researhc scholars
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Encapsulation theory and applications.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Network Security Unit 5.pdf for BCA BBA.
Programs and apps: productivity, graphics, security and other tools
sap open course for s4hana steps from ECC to s4
The AUB Centre for AI in Media Proposal.docx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A Presentation on Artificial Intelligence
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
A comparative analysis of optical character recognition models for extracting...
Cloud computing and distributed systems.
Mobile App Security Testing_ A Comprehensive Guide.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
“AI and Expert System Decision Support & Business Intelligence Systems”
Spectral efficient network and resource selection model in 5G networks

SITIST 2018 Part 1 - New ABAP Syntax