SlideShare une entreprise Scribd logo
1  sur  47
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

Contenu connexe

Tendances (10)

3
33
3
 
Python - Lecture 4
Python - Lecture 4Python - Lecture 4
Python - Lecture 4
 
Problem Solving with Algorithms and Data Structure - Lists
Problem Solving with Algorithms and Data Structure - ListsProblem Solving with Algorithms and Data Structure - Lists
Problem Solving with Algorithms and Data Structure - Lists
 
(Very) Basic graphing with R
(Very) Basic graphing with R(Very) Basic graphing with R
(Very) Basic graphing with R
 
Array operators
Array operatorsArray operators
Array operators
 
High Performance Mysql - Friday Tech Talks at Squareboat
High Performance Mysql - Friday Tech Talks at SquareboatHigh Performance Mysql - Friday Tech Talks at Squareboat
High Performance Mysql - Friday Tech Talks at Squareboat
 
Functional Javascript, CVjs
Functional Javascript, CVjsFunctional Javascript, CVjs
Functional Javascript, CVjs
 
Python Day1
Python Day1Python Day1
Python Day1
 
9
99
9
 
Sql
SqlSql
Sql
 

Similaire à SITIST 2018 Part 1 - New ABAP Syntax

Aaron Ellison Keynote: Reaching the 99%
Aaron Ellison Keynote: Reaching the 99%Aaron Ellison Keynote: Reaching the 99%
Aaron Ellison Keynote: Reaching the 99%
David LeBauer
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
agnonchik
 
Underscore.js
Underscore.jsUnderscore.js
Underscore.js
timourian
 

Similaire à SITIST 2018 Part 1 - New ABAP Syntax (20)

R code for data manipulation
R code for data manipulationR code for data manipulation
R code for data manipulation
 
R code for data manipulation
R code for data manipulationR code for data manipulation
R code for data manipulation
 
Aaron Ellison Keynote: Reaching the 99%
Aaron Ellison Keynote: Reaching the 99%Aaron Ellison Keynote: Reaching the 99%
Aaron Ellison Keynote: Reaching the 99%
 
Morel, a Functional Query Language
Morel, a Functional Query LanguageMorel, a Functional Query Language
Morel, a Functional Query Language
 
第13回数学カフェ「素数!!」二次会 LT資料「乱数!!」
第13回数学カフェ「素数!!」二次会 LT資料「乱数!!」第13回数学カフェ「素数!!」二次会 LT資料「乱数!!」
第13回数学カフェ「素数!!」二次会 LT資料「乱数!!」
 
A brief introduction to apply functions
A brief introduction to apply functionsA brief introduction to apply functions
A brief introduction to apply functions
 
There's a Prolog in your Scala!
There's a Prolog in your Scala!There's a Prolog in your Scala!
There's a Prolog in your Scala!
 
Pengolahan Data Panel Logit di Stata: Penilaian Goodness of Fit, Uji Model, d...
Pengolahan Data Panel Logit di Stata: Penilaian Goodness of Fit, Uji Model, d...Pengolahan Data Panel Logit di Stata: Penilaian Goodness of Fit, Uji Model, d...
Pengolahan Data Panel Logit di Stata: Penilaian Goodness of Fit, Uji Model, d...
 
decision tree regression
decision tree regressiondecision tree regression
decision tree regression
 
library(sparkline)
library(sparkline)library(sparkline)
library(sparkline)
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
Survey Demo
Survey DemoSurvey Demo
Survey Demo
 
Hw09 Hadoop + Clojure
Hw09   Hadoop + ClojureHw09   Hadoop + Clojure
Hw09 Hadoop + Clojure
 
Underscore.js
Underscore.jsUnderscore.js
Underscore.js
 
Watch out: Observables are here to stay
Watch out: Observables are here to stayWatch out: Observables are here to stay
Watch out: Observables are here to stay
 
Tuples All the Way Down
Tuples All the Way DownTuples All the Way Down
Tuples All the Way Down
 
R Cheat Sheet for Data Analysts and Statisticians.pdf
R Cheat Sheet for Data Analysts and Statisticians.pdfR Cheat Sheet for Data Analysts and Statisticians.pdf
R Cheat Sheet for Data Analysts and Statisticians.pdf
 
Lispprograaming excercise
Lispprograaming excerciseLispprograaming excercise
Lispprograaming excercise
 
Linear discriminant analysis
Linear discriminant analysisLinear discriminant analysis
Linear discriminant analysis
 

Plus de sitist

SITIST 2018 Part 2 - Hyperledger Fabric Blockchain Development
SITIST 2018 Part 2 - Hyperledger Fabric Blockchain Development SITIST 2018 Part 2 - Hyperledger Fabric Blockchain Development
SITIST 2018 Part 2 - Hyperledger Fabric Blockchain Development
sitist
 
SITIST 2018 Part 2 - Speed up Test Data Creation Process in ABAP
SITIST 2018 Part 2 - Speed up Test Data Creation Process in ABAPSITIST 2018 Part 2 - Speed up Test Data Creation Process in ABAP
SITIST 2018 Part 2 - Speed up Test Data Creation Process in ABAP
sitist
 
SITIST 2018 Part 2 - SCP Open Connectors & Serverless Functions Demo
SITIST 2018 Part 2 - SCP Open Connectors & Serverless Functions DemoSITIST 2018 Part 2 - SCP Open Connectors & Serverless Functions Demo
SITIST 2018 Part 2 - SCP Open Connectors & Serverless Functions Demo
sitist
 
SITIST 2018 Part 2 - SAP S/4HANA Extensibility - Custom Fields and Logic Demo
SITIST 2018 Part 2 - SAP S/4HANA Extensibility - Custom Fields and Logic Demo SITIST 2018 Part 2 - SAP S/4HANA Extensibility - Custom Fields and Logic Demo
SITIST 2018 Part 2 - SAP S/4HANA Extensibility - Custom Fields and Logic Demo
sitist
 
SITIST 2018 Part 1 - Updates on SAP Analytics Cloud and Analytics Hub
SITIST 2018 Part 1 - Updates on SAP Analytics Cloud and Analytics HubSITIST 2018 Part 1 - Updates on SAP Analytics Cloud and Analytics Hub
SITIST 2018 Part 1 - Updates on SAP Analytics Cloud and Analytics Hub
sitist
 
SITIST 2018 Part 1 - Employee vs Freelancer vs Entrepreneur
SITIST 2018 Part 1 - Employee vs Freelancer vs EntrepreneurSITIST 2018 Part 1 - Employee vs Freelancer vs Entrepreneur
SITIST 2018 Part 1 - Employee vs Freelancer vs Entrepreneur
sitist
 
SITIST 2017 Dev - Alexa Custom Skill Development with SAP HANA XSA
SITIST 2017 Dev - Alexa Custom Skill Development with SAP HANA XSASITIST 2017 Dev - Alexa Custom Skill Development with SAP HANA XSA
SITIST 2017 Dev - Alexa Custom Skill Development with SAP HANA XSA
sitist
 

Plus de sitist (20)

SITIST 2018 Part 2 - Hyperledger Fabric Blockchain Development
SITIST 2018 Part 2 - Hyperledger Fabric Blockchain Development SITIST 2018 Part 2 - Hyperledger Fabric Blockchain Development
SITIST 2018 Part 2 - Hyperledger Fabric Blockchain Development
 
SITIST 2018 Part 2 - SAP 2019 Technology Agenda
SITIST 2018 Part 2 - SAP 2019 Technology AgendaSITIST 2018 Part 2 - SAP 2019 Technology Agenda
SITIST 2018 Part 2 - SAP 2019 Technology Agenda
 
SITIST 2018 Part 2 - Speed up Test Data Creation Process in ABAP
SITIST 2018 Part 2 - Speed up Test Data Creation Process in ABAPSITIST 2018 Part 2 - Speed up Test Data Creation Process in ABAP
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 - SCP Open Connectors & Serverless Functions DemoSITIST 2018 Part 2 - SCP Open Connectors & Serverless Functions Demo
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 - SAP S/4HANA Extensibility - Custom Fields and Logic Demo SITIST 2018 Part 2 - SAP S/4HANA Extensibility - Custom Fields and Logic 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 - Robotic Process Automation (RPA)SITIST 2018 Part 2 - Robotic Process Automation (RPA)
SITIST 2018 Part 2 - Robotic Process Automation (RPA)
 
SITIST 2018 Part 2 - abapGit & lint
SITIST 2018 Part 2 - abapGit & lintSITIST 2018 Part 2 - abapGit & lint
SITIST 2018 Part 2 - abapGit & lint
 
SITIST 2018 Part 2 - ABAP in SAP Cloud Platform
SITIST 2018 Part 2 - ABAP in SAP Cloud PlatformSITIST 2018 Part 2 - ABAP in SAP Cloud Platform
SITIST 2018 Part 2 - ABAP in SAP Cloud Platform
 
SITIST 2018 Part 2 - ABAP Career in Europe
SITIST 2018 Part 2 - ABAP Career in EuropeSITIST 2018 Part 2 - ABAP Career in Europe
SITIST 2018 Part 2 - ABAP Career in Europe
 
SITIST 2018 Part 1 - Updates on SAP Analytics Cloud and Analytics Hub
SITIST 2018 Part 1 - Updates on SAP Analytics Cloud and Analytics HubSITIST 2018 Part 1 - Updates on SAP Analytics Cloud and Analytics Hub
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 - Installation of custom CIC Certified Add-On client systemsSITIST 2018 Part 1 - Installation of custom CIC Certified Add-On client systems
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 - SAP HANA Spatial ProcessingSITIST 2018 Part 1 - SAP HANA Spatial Processing
SITIST 2018 Part 1 - SAP HANA Spatial Processing
 
SITIST 2018 Part 1 - Employee vs Freelancer vs Entrepreneur
SITIST 2018 Part 1 - Employee vs Freelancer vs EntrepreneurSITIST 2018 Part 1 - Employee vs Freelancer vs Entrepreneur
SITIST 2018 Part 1 - Employee vs Freelancer vs Entrepreneur
 
SITIST 2018 Part 1 - Gigya vs Hybris Marketing
SITIST 2018 Part 1 - Gigya vs Hybris MarketingSITIST 2018 Part 1 - Gigya vs Hybris Marketing
SITIST 2018 Part 1 - Gigya vs Hybris Marketing
 
SITIST 2018 Part 1 - Blockchain and Enterprise Use Cases
SITIST 2018 Part 1 - Blockchain and Enterprise Use CasesSITIST 2018 Part 1 - Blockchain and Enterprise Use Cases
SITIST 2018 Part 1 - Blockchain and Enterprise Use Cases
 
SITIST 2018 Part 1 - SAP CP Enterprise Messaging
SITIST 2018 Part 1 - SAP CP Enterprise MessagingSITIST 2018 Part 1 - SAP CP Enterprise Messaging
SITIST 2018 Part 1 - SAP CP Enterprise Messaging
 
SITIST 2017 Dev - Alexa Custom Skill Development with SAP HANA XSA
SITIST 2017 Dev - Alexa Custom Skill Development with SAP HANA XSASITIST 2017 Dev - Alexa Custom Skill Development with SAP HANA XSA
SITIST 2017 Dev - Alexa Custom Skill Development with SAP HANA XSA
 
HCI
HCIHCI
HCI
 
SITIST 2016 Dev - What's new at SAP
SITIST 2016 Dev - What's new at SAPSITIST 2016 Dev - What's new at SAP
SITIST 2016 Dev - What's new at SAP
 
SITIST 2016 Dev - What is new in SAP Analytics
SITIST 2016 Dev - What is new in SAP AnalyticsSITIST 2016 Dev - What is new in SAP Analytics
SITIST 2016 Dev - What is new in SAP Analytics
 

Dernier

Dernier (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

SITIST 2018 Part 1 - New ABAP Syntax