Submit Search
Upload
News in abap concepts to further increase the power of abap development 2
•
0 likes
•
604 views
Alexander Talac
Follow
Abap news from TechEd conf part 2
Read less
Read more
Technology
Report
Share
Report
Share
1 of 59
Download now
Download to read offline
Recommended
New features in abap
New features in abap
Srihari J
Sap scm apo debug in the cif
Sap scm apo debug in the cif
ExpertPlug
High Performance Haskell
High Performance Haskell
Harendra Kumar
Lesson 5.2 logical operators
Lesson 5.2 logical operators
MLG College of Learning, Inc
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
Bilal Amjad
Lesson 10
Lesson 10
MLG College of Learning, Inc
Alp 05
Alp 05
gswapnil86
ABAP Programming Overview
ABAP Programming Overview
sapdocs. info
Recommended
New features in abap
New features in abap
Srihari J
Sap scm apo debug in the cif
Sap scm apo debug in the cif
ExpertPlug
High Performance Haskell
High Performance Haskell
Harendra Kumar
Lesson 5.2 logical operators
Lesson 5.2 logical operators
MLG College of Learning, Inc
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 6 (Flow Control ...
Bilal Amjad
Lesson 10
Lesson 10
MLG College of Learning, Inc
Alp 05
Alp 05
gswapnil86
ABAP Programming Overview
ABAP Programming Overview
sapdocs. info
What is erp
What is erp
ashish Ashishkumardsmar
Lesson 9.2 guessing the game program
Lesson 9.2 guessing the game program
MLG College of Learning, Inc
IBM Amplify 2016 - Session 1651 - How standard IBM Campaign functions and uti...
IBM Amplify 2016 - Session 1651 - How standard IBM Campaign functions and uti...
Purple Square
Unit 4 assembly language programming
Unit 4 assembly language programming
Kartik Sharma
Unit 2 assembly language programming
Unit 2 assembly language programming
Kartik Sharma
cmp104 lec 8
cmp104 lec 8
kapil078
Flag control
Flag control
Robert Almazan
ERP Magazine April 2018 Issue 1
ERP Magazine April 2018 Issue 1
Rehan Zaidi
ERP Magazine April 2018 - The magazine for SAP ABAP Professionals
ERP Magazine April 2018 - The magazine for SAP ABAP Professionals
Rehan Zaidi
Matopt
Matopt
Afaf Soumia Medjden
MAIA tech.day - I
MAIA tech.day - I
Dhiren Gala
Abap for sd consultatnt
Abap for sd consultatnt
Sukumar Manickam
Abap training material
Abap training material
Mahmoud ELBestawy (Oracle Applications Manager )
Sap abap tutorials
Sap abap tutorials
Harshul Phadke
SAP performance testing & engineering courseware v01
SAP performance testing & engineering courseware v01
Argos
Capture Accurate Solution Requirements with Exploratory Modeling at SAP
Capture Accurate Solution Requirements with Exploratory Modeling at SAP
ESUG
Sap abap
Sap abap
Sri Nivas
Discovering the plan cache (sql sat175)
Discovering the plan cache (sql sat175)
Jason Strate
How to find user exits
How to find user exits
Mohammed Shoeb
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
IBMSystemzEvents
Abap sample
Abap sample
Marina de Pendragón
Basics SAP
Basics SAP
itplant
More Related Content
What's hot
What is erp
What is erp
ashish Ashishkumardsmar
Lesson 9.2 guessing the game program
Lesson 9.2 guessing the game program
MLG College of Learning, Inc
IBM Amplify 2016 - Session 1651 - How standard IBM Campaign functions and uti...
IBM Amplify 2016 - Session 1651 - How standard IBM Campaign functions and uti...
Purple Square
Unit 4 assembly language programming
Unit 4 assembly language programming
Kartik Sharma
Unit 2 assembly language programming
Unit 2 assembly language programming
Kartik Sharma
cmp104 lec 8
cmp104 lec 8
kapil078
Flag control
Flag control
Robert Almazan
What's hot
(7)
What is erp
What is erp
Lesson 9.2 guessing the game program
Lesson 9.2 guessing the game program
IBM Amplify 2016 - Session 1651 - How standard IBM Campaign functions and uti...
IBM Amplify 2016 - Session 1651 - How standard IBM Campaign functions and uti...
Unit 4 assembly language programming
Unit 4 assembly language programming
Unit 2 assembly language programming
Unit 2 assembly language programming
cmp104 lec 8
cmp104 lec 8
Flag control
Flag control
Similar to News in abap concepts to further increase the power of abap development 2
ERP Magazine April 2018 Issue 1
ERP Magazine April 2018 Issue 1
Rehan Zaidi
ERP Magazine April 2018 - The magazine for SAP ABAP Professionals
ERP Magazine April 2018 - The magazine for SAP ABAP Professionals
Rehan Zaidi
Matopt
Matopt
Afaf Soumia Medjden
MAIA tech.day - I
MAIA tech.day - I
Dhiren Gala
Abap for sd consultatnt
Abap for sd consultatnt
Sukumar Manickam
Abap training material
Abap training material
Mahmoud ELBestawy (Oracle Applications Manager )
Sap abap tutorials
Sap abap tutorials
Harshul Phadke
SAP performance testing & engineering courseware v01
SAP performance testing & engineering courseware v01
Argos
Capture Accurate Solution Requirements with Exploratory Modeling at SAP
Capture Accurate Solution Requirements with Exploratory Modeling at SAP
ESUG
Sap abap
Sap abap
Sri Nivas
Discovering the plan cache (sql sat175)
Discovering the plan cache (sql sat175)
Jason Strate
How to find user exits
How to find user exits
Mohammed Shoeb
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
IBMSystemzEvents
Abap sample
Abap sample
Marina de Pendragón
Basics SAP
Basics SAP
itplant
CO_TM_Controlling_co-om Master Data .pdf
CO_TM_Controlling_co-om Master Data .pdf
ssuser878ec2
R4ML: An R Based Scalable Machine Learning Framework
R4ML: An R Based Scalable Machine Learning Framework
Alok Singh
Sap erp
Sap erp
Wajdi Lahyani
SAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdf
KoushikGuna
PLSQL Advanced
PLSQL Advanced
Quang Minh Đoàn
Similar to News in abap concepts to further increase the power of abap development 2
(20)
ERP Magazine April 2018 Issue 1
ERP Magazine April 2018 Issue 1
ERP Magazine April 2018 - The magazine for SAP ABAP Professionals
ERP Magazine April 2018 - The magazine for SAP ABAP Professionals
Matopt
Matopt
MAIA tech.day - I
MAIA tech.day - I
Abap for sd consultatnt
Abap for sd consultatnt
Abap training material
Abap training material
Sap abap tutorials
Sap abap tutorials
SAP performance testing & engineering courseware v01
SAP performance testing & engineering courseware v01
Capture Accurate Solution Requirements with Exploratory Modeling at SAP
Capture Accurate Solution Requirements with Exploratory Modeling at SAP
Sap abap
Sap abap
Discovering the plan cache (sql sat175)
Discovering the plan cache (sql sat175)
How to find user exits
How to find user exits
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
Abap sample
Abap sample
Basics SAP
Basics SAP
CO_TM_Controlling_co-om Master Data .pdf
CO_TM_Controlling_co-om Master Data .pdf
R4ML: An R Based Scalable Machine Learning Framework
R4ML: An R Based Scalable Machine Learning Framework
Sap erp
Sap erp
SAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdf
PLSQL Advanced
PLSQL Advanced
Recently uploaded
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Principled Technologies
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
sudhanshuwaghmare1
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
The Digital Insurer
Slack Application Development 101 Slides
Slack Application Development 101 Slides
praypatel2
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
Enterprise Knowledge
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Katpro Technologies
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Radu Cotescu
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
apidays
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
Igalia
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
Pixlogix Infotech
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Igalia
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Miguel Araújo
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
HampshireHUG
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Delhi Call girls
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Safe Software
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Anna Loughnan Colquhoun
Recently uploaded
(20)
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Slack Application Development 101 Slides
Slack Application Development 101 Slides
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
News in abap concepts to further increase the power of abap development 2
1.
Page 1 COMP209 News In
ABAP – Concepts to Further Increase the Power of ABAP Development Chris Swanepoel, SAP AG NW F ABAP Horst Keller, SAP AG NW F ABAP September 08 © SAP 2008 / SAP TechEd 08 / COMP209 Page 2 Disclaimer This presentation outlines our general product direction and should not be relied on in making a purchase decision. This presentation is not subject to your license agreement or any other agreement with SAP. SAP has no obligation to pursue any course of business outlined in this presentation or to develop or release any functionality mentioned in this presentation. This presentation and SAP's strategy and possible future developments are subject to change and may be changed by SAP at any time for any reason without notice. This document is provided without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP assumes no responsibility for errors or omissions in this document, except if such damages were caused by SAP intentionally or grossly negligent.
2.
Page 2 © SAP
2008 / SAP TechEd 08 / COMP209 Page 3 Learning Objectives After this lecture you will have an overview of some of the many new ABAP features regarding: ABAP Language ABAP Workbench Tools ABAP Connectivity ABAP Analysis Tools © SAP 2008 / SAP TechEd 08 / COMP209 Page 4 Availability (1) These features are available with the SAP EHP1 for the SAP NetWeaver® Application Server ABAP 7.1, i.e.: SAP EHP1 for SAP NetWeaver Process Integration 7.1 SAP NetWeaver Mobile 7.1 Banking services from SAP 7.0 SAP Business ByDesign™ solution Feature Pack 2.0 and the rest? ...
3.
Page 3 © SAP
2008 / SAP TechEd 08 / COMP209 Page 5 Availability (2) ... because of the high demand for these new ABAP features: Most of the features presented in this lecture are being backported to SAP EHP2 for SAP NetWeaver AS ABAP 7.0 They will then be available in SAP Business Suite 2009 © SAP 2008 / SAP TechEd 08 / COMP209 Page 6 1. Language 2. Workbench Tools 3. Connectivity 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda
4.
Page 4 © SAP
2008 / SAP TechEd 08 / COMP209 Page 7 1. Language 1.1. Decimal Floating Point Numbers 1.2. Expressions 1.3. Internal Tables 1.4. Pragmas 1.5. Boxed Components 1.6. ABAP Compiler – On Demand Loading 1.7. String Processing 1.8. 12h Time Format 1.9. Strings in Database Tables 2. Workbench Tools 3. Connectivity 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda © SAP 2008 / SAP TechEd 08 / COMP209 Page 8 1. Language 1.1. Decimal Floating Point Numbers 1.2. Expressions 1.3. Internal Tables 1.4. Pragmas 1.5. Boxed Components 1.6. ABAP Compiler – On Demand Loading 1.7. String Processing 1.8. 12h Time Format 1.9. Strings in Database Tables 2. Workbench Tools 3. Connectivity 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda
5.
Page 5 © SAP
2008 / SAP TechEd 08 / COMP209 Page 9 Binary Floating Point Numbers – Shortcomings ABAP type f (binary floating point number) has a large value range, but cannot represent every decimal number precisely due to the internal binary representation: Binary floating point arithmetic can be surprising for decimal-orientated humans For users, binary floating point numbers are not WYSIWYG Results of calculations can depend on the platform No rounding to a specific number of decimal places Division by powers of 10 is inexact No uniform behavior across database systems DATA float TYPE f. float = '123456.15' – '123456'. 0.14999999999417923 © SAP 2008 / SAP TechEd 08 / COMP209 Page 10 Decimal Fixed Point Numbers – Shortcomings ABAP type p (based on BCD encoding) represents a decimal number precisely and enables precise calculations (apart from the unavoidable commercial rounding), but the value range is often too small. Various units can occur; you don't know them when writing the code, defining DB tables etc. You don't know how many decimal places may be required in a certain country/industry etc. Example: Convert milliliters to barrels and back* *1 barrel = 42 gallons = 9702 cubic inches = 158.987295 liters 1500.00000000000000 mL 0.00943471615138 bbl 1500.00000000071672 mL 5 decimal places are inexact
6.
Page 6 © SAP
2008 / SAP TechEd 08 / COMP209 Page 11 Decimal Floating Point Numbers New built-in numeric types decfloat16 and decfloat34 (decimal floating point numbers) based on forthcoming standard IEEE-754r: decfloat16: 8 bytes, 16 digits, exponent -383 to +384 (range 1E-383 through 9.999999999999999E+384 ) decfloat34: 16 bytes, 34 digits, exponent -6143 to +6144 (range 1E-6143 through 9.999999999999999999999999999999999E+6144) Exact representation of decimal numbers within range: Range larger than f Calculation accuracy like p Full support for new types which can be used everywhere where types i, f and p are used. This includes: New generic type decfloat New Dictionary types DF16_..., DF34_..., (... = DEC, RAW, SCL) New rounding functions round and rescale New methods in CL_ABAP_MATH New format options in WRITE [TO] and in string templates © SAP 2008 / SAP TechEd 08 / COMP209 Page 12 Decimal Floating Point Numbers – Examples DATA df34 TYPE decfloat34. df34 = '123456.15' – '123456'. 0.15 df34 = round( val = '1234.56789' dec = 3 ). 1234.568 df34 = round( val = '1234.56789' dec = 3 mode = cl_abap_math=>round_floor ). 1234.567 df34 = rescale( val = '2.0' prec = 4 ). 2.000 df34 = '-42'. WRITE df34 TO c12 STYLE cl_abap_math=>sign_as_postfix. 42-
7.
Page 7 © SAP
2008 / SAP TechEd 08 / COMP209 Page 13 Decimal Floating Point Numbers – Exact Calculations New addition EXACT for the COMPUTE statement The operations +, - *, / and the built-in function SQRT with decimal floating point numbers are exactly rounded operations: Error is at most 0.5 unit in the last place (ulp) Relative error is at most 5E-34 In general, rounding is done silently. The EXACT addition lets you detect if an expression cannot be evaluated exactly and if rounding was necessary. In case of rounding (inexactness) an exception is raised: TRY. COMPUTE EXACT result = 3 * ( 1 / 3 ). ... CATCH cx_sy_conversion_rounding INTO exception. ... result = exception->value. ENDTRY. 0.9999999999999999999999999999999999 © SAP 2008 / SAP TechEd 08 / COMP209 Page 14 Usage of ABAP Numeric Types – Recommendation 1. Type i For integers (whole numbers). If the value range of i is not sufficient, use data type p without decimal places. If that value range is not sufficient, use decimal floating point numbers. 2. Type p For fractional values that have a fixed number of decimal places. If the value range is not sufficient, use decimal floating point numbers. 3. Types decfloat16 and decfloat34 For fractional values that have a variable number of decimal places or a large value range. Data type decfloat16 needs less memory, but not less runtime than decfloat34. 4. Type f Only for algorithms that are critical with regard to performance (as, e.g., matrix operations) and if accuracy is not important.
8.
Page 8 © SAP
2008 / SAP TechEd 08 / COMP209 Page 15 1. Language 1.1. Decimal Floating Point Numbers 1.2. Expressions 1.3. Internal Tables 1.4. Pragmas 1.5. Boxed Components 1.6. ABAP Compiler – On Demand Loading 1.7. String Processing 1.8. 12h Time Format 1.9. Strings in Database Tables 2. Workbench Tools 3. Connectivity 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda © SAP 2008 / SAP TechEd 08 / COMP209 Page 16 Expressions – Before Two kinds of computational expressions: Arithmetic expressions Bit expressions that could be used behind COMPUTE only Logical expressions that could be used in control statements only Built-in functions that could be used in very few operand positions only Functional methods that could be used in very few operand positions only Littering of code with helper variables
9.
Page 9 © SAP
2008 / SAP TechEd 08 / COMP209 Page 17 Expressions – Enhancements Three kinds of computational expressions: Arithmetic expressions Bit expressions String expressions that can be used in various operand positions Enlarged set of Built-in functions including string functions and predicate functions that can be used in various operand positions Functional methods that can be used in various operand positions especially allowing nested and chained method calls Slim and efficient code with in-place expressions © SAP 2008 / SAP TechEd 08 / COMP209 Page 18 Expressions – Examples v1 = a + b. v2 = c - d. v3 = meth( v2 ). IF v1 > v3. ... IF a + b > meth( c – d ). ... idx = lines( itab ). READ TABLE itab INDEX idx ... READ TABLE itab INDEX lines( itab ) ... len = strlen( txt ) - 1. DO len TIMES. ... DO strlen( txt ) – 1 TIMES. ... regex = oref->get_regex( ... ). FIND REGEX regex IN txt. FIND REGEX oref->get_regex( ... ) IN txt. CONCATENATE txt1 txt2 INTO txt. CONDENSE txt. txt = condense( txt1 && txt2 ). DATA oref TYPE REF TO c1. oref = c2=>m2( ). oref->m1( ). c2=>m2( )->m1( ).
10.
Page 10 © SAP
2008 / SAP TechEd 08 / COMP209 Page 19 1. Language 1.1. Decimal Floating Point Numbers 1.2. Expressions 1.3. Internal Tables 1.4. Pragmas 1.5. Boxed Components 1.6. ABAP Compiler – On Demand Loading 1.7. String Processing 1.8. 12h Time Format 1.9. Strings in Database Tables 2. Workbench Tools 3. Connectivity 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda © SAP 2008 / SAP TechEd 08 / COMP209 Page 20 Internal Tables – Generic Programming Until now, support for generic programming with internal tables was limited: Program generation was necessary LOOP AT itab INTO <fs_any> WHERE col1 ... AND col2 ... No dynamic token specification! MODIFY itab FROM <fs_any> TRANSPORTING ('col3') WHERE col1 ... AND col2 ... DELETE itab WHERE col1 ... AND col2 ...
11.
Page 11 © SAP
2008 / SAP TechEd 08 / COMP209 Page 21 Internal Tables – Dynamic WHERE Clause Now you can effectively circumvent the static typing requirements for internal table statements by specifying the WHERE clause dynamically DATA cond_syntax TYPE string. cond_syntax = `col1 ... AND col2 ... `. LOOP AT <fs_any_table> INTO <fs_any> WHERE (cond_syntax). ... Dynamic token specification like for other statements! MODIFY <fs_any_table> FROM <fs_any> TRANSPORTING ('col3') WHERE (cond_syntax). DELETE <fs_any_table> WHERE (cond_syntax). © SAP 2008 / SAP TechEd 08 / COMP209 Page 22 Dynamic WHERE Clause – Examples LOOP AT itab WHERE (`col2 < ( i2 + 3 ) AND col3 CP 'Joshua'`). Relational operators and expressions LOOP AT itab WHERE (`table_line NOT IN seltab`). Boolean operators LOOP AT itab WHERE (`table_line = ceil( f1 )`). Built-in functions LOOP AT itab WHERE (`col1 < oref->get_val( ) OR col1 = if=>const`). Functional methods
12.
Page 12 © SAP
2008 / SAP TechEd 08 / COMP209 Page 23 Internal Tables – Key Access Until now: Three kinds of internal tables: Standard tables Sorted tables Hashed tables All kinds of internal tables have a primary table key ... UNIQUE | NON-UNIQUE KEY cols ... Problems: Key access is optimized for sorted (O(logn)) and hashed (O(1)) tables Key access is always linear (O(n)) for standard tables Only one kind of optimization per internal table size time O(n) O(log n) O(1) Large performance problems in productive systems © SAP 2008 / SAP TechEd 08 / COMP209 Page 24 Internal Tables – Secondary Keys Additional to the primary key, secondary keys can be defined for all kinds of internal tables You can define either sorted or hashed secondary keys Sorted secondary keys can be unique or non-unique, while hashed secondary keys are always unique In the statements for accessing internal tables, you can explicitly specify the key to be used Secondary keys can be specified dynamically Syntax warnings are issued if: Duplicate or conflicting secondary keys are defined Better-suited keys are identified Using secondary keys allows: Different key accesses to one internal table Real key access to standard tables Index access to hashed tables
13.
Page 13 © SAP
2008 / SAP TechEd 08 / COMP209 Page 25 Secondary Keys – Examples With READ DATA spfli_tab TYPE SORTED TABLE OF spfli WITH NON-UNIQUE KEY cityfrom cityto WITH UNIQUE HASHED KEY dbtab_key COMPONENTS carrid connid. FIELD-SYMBOLS <spfli> TYPE spfli. SELECT * FROM spfli INTO TABLE spfli_tab. LOOP AT spfli_tab ASSIGNING <spfli>. ... ENDLOOP. READ TABLE spfli_tab WITH TABLE KEY dbtab_key COMPONENTS carrid = 'LH' connid = '0400' ASSIGNING <spfli>. Primary non-unique sorted key Secondary unique hashed key Usage of secondary key Primary key is used implicitly Uniqueness of secondary key is checked © SAP 2008 / SAP TechEd 08 / COMP209 Page 26 Secondary Keys – Examples With LOOP REPORT demo_loop_at_itab_using_key. DATA spfli_tab TYPE HASHED TABLE OF spfli WITH UNIQUE KEY primary_key COMPONENTS carrid connid WITH NON-UNIQUE SORTED KEY city_from_to COMPONENTS cityfrom cityto WITH NON-UNIQUE SORTED KEY city_to_from COMPONENTS cityto cityfrom. SELECT * FROM spfli INTO TABLE spfli_tab ORDER BY carrid connid. LOOP AT spfli_tab ... ... ENDLOOP. LOOP AT spfli_tab ... USING KEY city_from_to. ... ENDLOOP. LOOP AT spfli_tab ... USING KEY city_to_from. ... ENDLOOP. Primary key can also be named explicitly Secondary keys Default loop processing Usage of secondary keys Sequence of loop processing is different
14.
Page 14 © SAP
2008 / SAP TechEd 08 / COMP209 Page 27 Usage of Secondary Keys – Recommendation Secondary keys introduced for boosting internal table performance But caution: Internal management can use a lot of memory Key updates can negatively affect performance – Unique secondary keys updated directly – Non-unique secondary keys created/updated when key is used (lazy create/update) Main rules for using secondary keys: Very large internal table that is constructed only once in the memory and whose content is rarely modified If mainly fast read access is required non-unique sorted secondary keys Only use unique (hashed) secondary keys if unique table entries with reference to particular components are a semantic issue © SAP 2008 / SAP TechEd 08 / COMP209 Page 28 1. Language 1.1. Decimal Floating Point Numbers 1.2. Expressions 1.3. Internal Tables 1.4. Pragmas 1.5. Boxed Components 1.6. ABAP Compiler – On Demand Loading 1.7. String Processing 1.8. 12h Time Format 1.9. Strings in Database Tables 2. Workbench Tools 3. Connectivity 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda
15.
Page 15 © SAP
2008 / SAP TechEd 08 / COMP209 Page 29 Pragmas – Motivation ABAP developers receive information about problems in their code from the syntax check (the ABAP compiler) the extended syntax check (SLIN) the Code Inspector (CI) Only the syntax check is fully integrated in the development process; other messages are easily overlooked Many new syntax warning introduced with secondary keys Must be able to suppress warnings if developer recognizes a construction to be unproblematic As many checks as possible in compiler (syntax warnings) Provide constructs for influencing compiler's behaviour (pragmas) © SAP 2008 / SAP TechEd 08 / COMP209 Page 30 Pragmas – Usage Pragmas: Begin with two characters and can have parameter tokens: ##PRAGMA[PAR1][PAR2] Pragmas can only occur: – At the start of a line; only preceded by optional whitespaces – At the end of a line; possibly followed by a sentence delimiter ( . , : ) and/or an end- of-line comment – But not after a statement delimiter Parameter tokens matched against syntax warnings Are case insensitive Applicable pragmas documented in long texts of syntax warnings DATA: spfli_tab TYPE HASHED TABLE OF spfli WITH UNIQUE KEY carrid connid WITH NON-UNIQUE SORTED KEY k_cityfrom COMPONENTS cityfrom. ... LOOP AT spfli_tab ... WHERE cityfrom = city ##PRIMKEY[K_CITYFROM]. Suppress warning: "Secondary key k_cityfrom is ... [better-suited]"
16.
Page 16 © SAP
2008 / SAP TechEd 08 / COMP209 Page 31 1. Language 1.1. Decimal Floating Point Numbers 1.2. Expressions 1.3. Internal Tables 1.4. Pragmas 1.5. Boxed Components 1.6. ABAP Compiler – On Demand Loading 1.7. String Processing 1.8. 12h Time Format 1.9. Strings in Database Tables 2. Workbench Tools 3. Connectivity 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda © SAP 2008 / SAP TechEd 08 / COMP209 Page 32 Boxed Components – Motivation (1) Memory wasted for sparsely filled structures: TYPES: BEGIN OF address, ... END OF address. TYPES: BEGIN OF order, ... post_addr TYPE address, alt_post_addr TYPE address, "alternative postal address END OF order. . . . post_addr alt_post_addr Memory chunk Often not used
17.
Page 17 © SAP
2008 / SAP TechEd 08 / COMP209 Page 33 Boxed Components – Motivation (2) Data references are cumbersome: Developer must ensure that data object exists before it is accessed (CREATE DATA ... ). Special dereferencing operator (->*) must be used to access data object Components behind data references cannot be part of a table key Structures with data references cannot be passed to RFC or be EXPORTed TYPES: BEGIN OF order, ... alt_post_addr TYPE REF TO address, END OF order. Must be created by developer alt_post_addr. . . post_addr © SAP 2008 / SAP TechEd 08 / COMP209 Page 34 Boxed Components – Concept Boxed components optimize memory consumption for initial structured components and initial structured attributes of classes by: Storing the components separately (not in place) Only allocating memory on demand, i.e.: Write access Referencing the boxed structure (ASSIGN / GET REFERENCE) Passing the boxed structure as a parameter Sharing initial values alt_post_addr alt_post_addr Initial record in type load alt_post_addr . . . post_addr Initial boxed component . . . post_addr
18.
Page 18 © SAP
2008 / SAP TechEd 08 / COMP209 Page 35 Boxed Components – Concept Boxed components optimize memory consumption for initial structured components and initial structured attributes of classes by: Storing the components separately (not in place) Only allocating memory on demand, i.e.: Write access Referencing the boxed structure (ASSIGN / GET REFERENCE) Passing the boxed structure as a parameter Sharing initial values alt_post_addr Initial record in type load alt_post_addr . . . post_addr Allocated boxed component . . . post_addr alt_post_addr © SAP 2008 / SAP TechEd 08 / COMP209 Page 36 Boxed Components – Language Integration Structured components and attributes can be defined as boxed. Example for classes: The boxed feature is also supported for dictionary structures and global classes. TYPES: BEGIN OF order, ... post_addr TYPE address, alt_post_addr TYPE address BOXED, END OF order. CLASS lcl_order DEFINITION. PUBLIC SECTION. ... DATA: post_addr TYPE address, alt_post_addr TYPE address BOXED. ENDCLASS.
19.
Page 19 © SAP
2008 / SAP TechEd 08 / COMP209 Page 37 Boxed Components – Advantages Boxed components offer all the advantages of data references, but: Memory is allocated automatically on demand They can be accessed like normal substructures or attributes using component selector They can be part of a table key They can be EXPORTed and passed to RFC (only with basXML) Boxed components: Must be structures Are deep structures with all the consequences (comparable to TYPE c vs. TYPE string) Are also supported for dictionary structures © SAP 2008 / SAP TechEd 08 / COMP209 Page 38 DEMO
20.
Page 20 © SAP
2008 / SAP TechEd 08 / COMP209 Page 39 1. Language 1.1. Decimal Floating Point Numbers 1.2. Expressions 1.3. Internal Tables 1.4. Pragmas 1.5. Boxed Components 1.6. ABAP Compiler – On Demand Loading 1.7. String Processing 1.8. 12h Time Format 1.9. Strings in Database Tables 2. Workbench Tools 3. Connectivity 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda © SAP 2008 / SAP TechEd 08 / COMP209 Page 40 On Demand Loading – Motivation Until now, the ABAP compiler could only load external definitions (e.g. TYPE-POOLs, classes and interfaces) at certain times: Definitions loaded "as soon as possible" to minimize compilation errors If definitions refer to other definitions, further definitions had to be loaded Consequence: Significant amount of the loaded definitions in ABAP sources not needed Very costly dependency administration High recompilation frequency (e.g. changes of DDIC types affected many ABAP loads that didn't really use the type) Code instability (syntax errors in definitions "far away" affected many programs that didn't really need these definitions) Workarounds to avoid dependencies bypassed static checks and negatively affected code robustness and maintainability: Unnecessary use of dynamic calls Use of unsafe types, e.g. parameter typed REF TO OBJECT
21.
Page 21 © SAP
2008 / SAP TechEd 08 / COMP209 Page 41 On Demand Loading – Benefits External definitions are only loaded when actually required (on demand): Consequences for ABAP language: TYPE POOLS statement is obsolete CLASS ... DEFINITION LOAD statement is obsolete INTERFACE ... LOAD statement is obsolete These statements are now ignored by the ABAP Compiler and can be deleted. ... DATA: obj TYPE REF TO iface. ... var = iface=>const. ... Definition not loaded Definition loaded © SAP 2008 / SAP TechEd 08 / COMP209 Page 42 1. Language 1.1. Decimal Floating Point Numbers 1.2. Expressions 1.3. Internal Tables 1.4. Pragmas 1.5. Boxed Components 1.6. ABAP Compiler – On Demand Loading 1.7. String Processing 1.8. 12h Time Format 1.9. Strings in Database Tables 2. Workbench Tools 3. Connectivity 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda
22.
Page 22 © SAP
2008 / SAP TechEd 08 / COMP209 Page 43 String Processing – Before Set of statements FIND SUBSTRING|REGEX ... REPLACE SUBSTRING|REGEX ... CONCATENATE ... SPLIT ... ... Set of logical operators CS, NS CA, NA CP, NP ... Set of built-in describing functions strlen( ... ) charlen( ... ) ... Substring access via offset/length specification ... text+off(len) ... © SAP 2008 / SAP TechEd 08 / COMP209 Page 44 String Processing – Enhancements New string expressions Concatenations ... txt1 && txt2 ... and String Templates ... |...{ txt format = ... }...| ... Can be used in expression positions New built-in string functions distance, condense, concat_lines_of, escape, find, find_end, find_any_of, find_any_not_of, insert, repeat, replace, reverse, segment, shift_left, shift_right, substring, substring_after substring_from, substring_before, substring_to, to_upper, to_lower, to_mixed, from_mixed, translate Can be used in functional positions New built-in predicate functions for strings contains, contains_any_of, contains_any_not_of Can be used as logical expressions
23.
Page 23 © SAP
2008 / SAP TechEd 08 / COMP209 Page 45 String Expressions – Concatenation Operator Concatenation operator ... txt1 && txt2 ... Replaces CONCATENATE statement and many auxiliary variables DATA text TYPE string. text = `Hello`. CONCATENATE text ` world!` INTO text. DATA text TYPE string. text = `Hello`. text = text && ` world!`. © SAP 2008 / SAP TechEd 08 / COMP209 Page 46 String Expressions – String Templates Very powerful, replaces WRITE TO statement and many auxiliaries ... |...{ txt format = ... }...| ... Literal Text Embedded Expression Format Options Literal Text result = |{ txt width = 20 align = left pad = pad }<---|. WRITE / result. result = |{ txt width = 20 align = center pad = pad }<---|. WRITE / result. result = |{ txt width = 20 align = right pad = pad }<---|. WRITE / result. Text „OOO“ and pad „x“ give
24.
Page 24 © SAP
2008 / SAP TechEd 08 / COMP209 Page 47 String Functions – Examples result = condense( val = ` Rock'xxx'Roller` del = `re ` from = `x` to = `n` ). gives "Rock'n'Roll" html = `<title>This is the <i>Title</i></title>`. repl = `i`. html = replace( val = html regex = repl && `(?![^<>]*>)` with = `<b>$0</b>` occ = 0 ). gives "<title>Th<b>i</b>s <b>i</b>s the <i>T<b>i</b>tle</i></title>" IF matches( val = email match = `w+(.w+)*@(w+.)+(w{2,4})` ). true if email contains a valid e-mail address © SAP 2008 / SAP TechEd 08 / COMP209 Page 48 1. Language 1.1. Decimal Floating Point Numbers 1.2. Expressions 1.3. Internal Tables 1.4. Pragmas 1.5. Boxed Components 1.6. ABAP Compiler – On Demand Loading 1.7. String Processing 1.8. 12h Time Format 1.9. Strings in Database Tables 2. Workbench Tools 3. Connectivity 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda
25.
Page 25 © SAP
2008 / SAP TechEd 08 / COMP209 Page 49 12h Time Format – Motivation Number and date output formatted according to language environment: Until now, only 24 hour format for time output: * 'DE' in user master records WRITE sy-datum TO c10 DD/MM/YYYY. SET COUNTRY 'US'. WRITE sy-datum TO c10 DD/MM/YYYY. 04/13/2008 13.04.2008 * 'DE' in user master records WRITE sy-uzeit TO c8. SET COUNTRY 'US'. WRITE sy-uzeit TO c8. 14:55:00 14:55:00 © SAP 2008 / SAP TechEd 08 / COMP209 Page 50 12h Time Format – Usage Four additional 12 hour formats have been introduced: 12-hour format (1 to 12) or (1 to 11), e.g. 12:59:59 PM or 00:59:59 PM am/pm or AM/PM, e.g. 01:00:00 AM or 01:00:00 am Default format can be specified in the user master records New: Addition ENVIRONMENT TIME FORMAT to the WRITE TO and WRITE statement Formating options COUNTRY and environment for string templates Class CL_ABAP_TIMEFM for converting between external and internal time * 'DE' in user master records time = |{ sy-uzeit time = environment }|. SET COUNTRY 'US'. time = |{ sy-uzeit time = environment }|. 02:55:00 PM 14:55:00
26.
Page 26 © SAP
2008 / SAP TechEd 08 / COMP209 Page 51 1. Language 1.1. Decimal Floating Point Numbers 1.2. Expressions 1.3. Internal Tables 1.4. Pragmas 1.5. Boxed Components 1.6. ABAP Compiler – On Demand Loading 1.7. String Processing 1.8. 12h Time Format 1.9. Strings in Database Tables 2. Workbench Tools 3. Connectivity 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda © SAP 2008 / SAP TechEd 08 / COMP209 Page 52 Strings in Database Tables – Shortcomings You can use Open SQL to store character strings and binary data in database columns, but: Short strings: Only available for character strings (DDIC type SSTRING) Length restricted to 255 characters Can not be used as key columns Long strings (LOBs): CLOBs (for character strings) and BLOBs (for binary data) No maximum length; can be very large How to store internal tables with string components in primary key? How to process LOBs quickly and efficiently without exhausting session memory?
27.
Page 27 © SAP
2008 / SAP TechEd 08 / COMP209 Page 53 Strings in Database Tables – Short Strings New: Short strings can be used as key columns of database tables Can be used in database indexes Maximum length 1333 © SAP 2008 / SAP TechEd 08 / COMP209 Page 54 Strings in Database Tables – Long Strings Locators and database streams to access LOBs in database tables: Locators: Linked to LOBs for read and write access (LOB handles) Access sub-sequences of LOBs or properties of LOBs on database Copy LOBs within the database without first copying data to application server Higher resource consumption on database server Database streams: Read and write streams linked to LOBs for read and write access respectively (LOB handles) LOB data can be sequentially processed using methods of streams No increased resource consumption No unnecessary data transports
28.
Page 28 © SAP
2008 / SAP TechEd 08 / COMP209 Page 55 Locators – Usage Copy a LOB column DATA: locator TYPE REF TO cl_abap_db_c_locator. SELECT SINGLE longtext FROM lob_table INTO locator WHERE key = key1. UPDATE lob_table SET longtext = locator WHERE key = key2. locator->close( ). Create locator Access data using locator Close locator © SAP 2008 / SAP TechEd 08 / COMP209 Page 56 Database Streams – Usage Read GIF picture from database and write to file DATA: reader TYPE REF TO cl_abap_db_x_reader. SELECT SINGLE picture FROM blob_table INTO reader WHERE name = pic_name. ... WHILE reader->data_available( ) = 'X'. TRANSFER reader->read( len ) TO pict_file. ENDWHILE. reader->close( ). Create stream reader Write data to file Close stream reader
29.
Page 29 © SAP
2008 / SAP TechEd 08 / COMP209 Page 57 1. Language 2. Workbench Tools 2.1. Overview 2.2. Splitter Control for Classical Dynpro 3. Connectivity 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda © SAP 2008 / SAP TechEd 08 / COMP209 Page 58 1. Language 2. Workbench Tools 2.1. Overview 2.2. Splitter Control for Classical Dynpro 3. Connectivity 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda
30.
Page 30 © SAP
2008 / SAP TechEd 08 / COMP209 Page 59 Workbench Tools – Overview The Workbench contains some hardly known tools and some new, very useful tools: New ABAP Editor: Code completion Configurable (font size, general options, formatting options, etc.) Code outlining Bookmarks Split view Extended cut & paste Advanced navigation Pattern insertion by drag & drop Code templates Refactoring assistant Source code based class editor Splitter control for classical Dynpro © SAP 2008 / SAP TechEd 08 / COMP209 Page 60 Workbench Tools – Source Code Based Class Editor
31.
Page 31 © SAP
2008 / SAP TechEd 08 / COMP209 Page 61 DEMO © SAP 2008 / SAP TechEd 08 / COMP209 Page 62 1. Language 2. Workbench Tools 2.1. Overview 2.2. Splitter Control for Classical Dynpro 3. Connectivity 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda
32.
Page 32 © SAP
2008 / SAP TechEd 08 / COMP209 Page 63 Workbench Tools – Splitter Control for Classical Dynpro © SAP 2008 / SAP TechEd 08 / COMP209 Page 64 1. Language 2. Workbench Tools 3. Connectivity 3.1. Overview 3.2. bgRFC & LDQ 3.3. Class Based Exceptions 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda
33.
Page 33 © SAP
2008 / SAP TechEd 08 / COMP209 Page 65 1. Language 2. Workbench Tools 3. Connectivity 3.1. Overview 3.2. bgRFC & LDQ 3.3. Class Based Exceptions 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda © SAP 2008 / SAP TechEd 08 / COMP209 Page 66 Connectivity – Overview Background RFC (bgRFC) replacing transactional RFC (tRFC) and queued RFC (qRFC): Delivered with SAP NetWeaver 7.0 EhP1 Local Data Queue (LDQ) replacing qRFC No-Send: Delivered with SAP NetWeaver 7.0 EhP1 New, additional RFC serialization in basXML: Delivered for all RFC types (ABAP ABAP) SAP NetWeaver RFC Library Delivered since April 2007 RFC support in SAP JEE 7.1 New JCo API Java Resource Adapter for SAP JCo Java IDoc Class Library New standalone JCo 3.0 Class based exceptions EHP1 SAP NW AS ABAP 7.1 SAP NW AS ABAP 7.1
34.
Page 34 © SAP
2008 / SAP TechEd 08 / COMP209 Page 67 1. Language 2. Workbench Tools 3. Connectivity 3.1. Overview 3.2. bgRFC & LDQ 3.3. Class Based Exceptions 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda © SAP 2008 / SAP TechEd 08 / COMP209 Page 68 bgRFC – Asynchronous Processing ABAP Program * Create bgRFC unit Function Modules Scheduler Target System Fetch Unit Process Unit SAP NetWeaver AS ABAP SAP NetWeaver AS ABAP Destination and Function Calls Save Unit Sender System
35.
Page 35 © SAP
2008 / SAP TechEd 08 / COMP209 Page 69 bgRFC – RFC Types Transactional bgRFC (Type T) replaces tRFC: Units executed "Exactly Once" (EO) Units executed in no guaranteed order Function modules in unit are executed in specified order Queued bgRFC (Type Q) replaces qRFC (not No-Send) Units executed "Exactly Once In Order" (EOIO): FIFO Queues used to order units; Function modules executed in specified order Putting same unit in different queues synchronizes queues 1 2 3 4 5 6 9 8 7 10 Same units several queues Processing order Queue1 Queue2 Queue3 45 23569 8 5 9 7 10 10 1 in out © SAP 2008 / SAP TechEd 08 / COMP209 Page 70 bgRFC – Example Create bgRFC unit type q Send the unit to a remote system DATA: dest TYPE REF TO if_bgrfc_destination_outbound, unit TYPE REF TO if_qrfc_unit_outbound. ... dest = cl_bgrfc_destination_outbound=>create( 'DEST_NAME' ). unit = dest->create_qrfc_unit( ). unit->add_queue_name_outbound( 'QUEUE_NAME' ). CALL FUNCTION 'FUNC1' IN BACKGROUND UNIT unit. COMMIT WORK. Create outbound destination Create unit and specify queue Add funtion call to unit
36.
Page 36 © SAP
2008 / SAP TechEd 08 / COMP209 Page 71 bgRFC – Advantages For the developer: Object-oriented and easy to use API Clear programming model, no implicit assumptions For the administrator: Effective tools support monitoring and error analysis Easy to apply load balancing Easy to configure system resources for bgRFC For the system workload: Lean and well-structured design Dependency handling optimized Support of load balancing Configurable number of schedulers Configurable load on system © SAP 2008 / SAP TechEd 08 / COMP209 Page 72 bgRFC vs. qRFC Free System Capacity Measured for bgRFC and qRFC 0 10 20 30 40 50 60 0 50 100 150 200 processing time in minutes numberoffreeworkprocesses Classic RFC bgRFC Average ± 1 std. dev.
37.
Page 37 © SAP
2008 / SAP TechEd 08 / COMP209 Page 73 Local Data Queue (LDQ) Allows applications to record data that can be read by a receiving application (pull principle) Replaces qRFC No-Send Data storage in local queues Character and binary data compressed before storage Each application has its own queues Applications do not affect each other Same data written to different queues only stored once Object-orientated API Q-A Q-B Q-C Local queues write read © SAP 2008 / SAP TechEd 08 / COMP209 Page 74 1. Language 2. Workbench Tools 3. Connectivity 3.1. Overview 3.2. bgRFC & LDQ 3.3. Class Based Exceptions 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda
38.
Page 38 © SAP
2008 / SAP TechEd 08 / COMP209 Page 75 Class Based Exceptions With SAP EHP1 for SAP NetWeaver AS ABAP 7.1 class based exceptions can be specified in the interfaces of remote enabled function modules Old-style exceptions can now be handled in TRY ... CATCH blocks: Predefined exceptions, e.g. SYSTEM_FAILURE, can be handled by catching CX_REMOTE_EXCEPTION Other old-style exceptions can be handled by catching CX_CLASSIC_EXCEPTION TRY. CALL FUNCTION 'FUNC1' DESTINATION 'NONE'. CATCH cx_my_exception INTO my_exception. msg = my_exception->get_text( ). ... CATCH cx_remote_exception INTO remote_exception. msg = remote_exception->get_text( ). ... ENDTRY. Catch class based exception Catch predefined old-style exceptions © SAP 2008 / SAP TechEd 08 / COMP209 Page 76 1. Language 2. Workbench Tools 3. Connectivity 4. Analysis Tools 4.1. ABAP Debugger 4.2. ABAP Runtime Analysis 4.3. SQL Stack Trace 5. ABAP Labs – Ideas That Work Agenda
39.
Page 39 © SAP
2008 / SAP TechEd 08 / COMP209 Page 77 1. Language 2. Workbench Tools 3. Connectivity 4. Analysis Tools 4.1. ABAP Debugger 4.2. ABAP Runtime Analysis 4.3. SQL Stack Trace 5. ABAP Labs – Ideas That Work Agenda © SAP 2008 / SAP TechEd 08 / COMP209 Page 78 ABAP Debugger - Overview New Dynpro analysis tool New Web Dynpro analysis tool Simple transformation debugging Automated debugging via debugger scripting Enhancement debugging Debugger console Layer debugging Miscellaneous: Upload internal tables Table View: view and configure sub-components of embedded structures Debug expressions and of multiple statements within one line Change long fields Call stack of the internal session of the caller Exception stack
40.
Page 40 © SAP
2008 / SAP TechEd 08 / COMP209 Page 79 Debugger Scripting – Overview Motivation Have you ever dreamt of a debugger which: Debugs a problem on its own – in a (semi-) automated way? Allows you to write all kinds of information to a trace file? The new scripting engine of the ABAP debugger allows you to Control the debugger by simply writing a small ABAP program Access the same information about the debuggee as the debugger itself Write various information to a trace file Standalone transaction for script trace analysis: SAS © SAP 2008 / SAP TechEd 08 / COMP209 Page 80 Debugger Scripting – Architecture (1) Session 1 - Debuggee ABAP VM Session 2 - Debugger UI Debugger Engine A D I … doDebugStep( SingleStep ) setBreakpoint ( ) setWatchpoint( ) getValue( ‘SY-SUBRC’ ) getStack ( ) …
41.
Page 41 © SAP
2008 / SAP TechEd 08 / COMP209 Page 81 Debugger Scripting – Architecture (2) Session 1 - Debuggee ABAP VM Session 2 - Debugger UI Debugger Engine A D I ABAP- Script … “doDebugStep( )” “setBreakpoint ( )” “setWatchpoint( )” “getValue( ‘SY-SUBRC’ )” “getStack ( )” “writeTrace( )” … © SAP 2008 / SAP TechEd 08 / COMP209 Page 82 Debugger Scripting – Automated Debugging Debugger is running application ABAP- Script Script- Trace T r i g g e r VALUE SY-SUBRC = 5, NEXT WER DAS LESEN KANN IST ZU NAHE, WER DAS KLESEN KANN IST ZU NAHE, SY-SUBRC = 5, NEXT WER DAS LESEN KANN IST ZU NAHE, WER DAS KLESEN KANN IST ZU NAHE, VALUE SY-SUBRC = 5, NEXT WER DAS LESEN KANN IST ZU NAHE, WER DAS KLESEN KANN IST ZU NAHE, SY-SUBRC = 5, NEXT WER DAS LESEN KANN IST ZU NAHE, WER DAS KLESEN KANN IST ZU NAHE, VALUE SY-SUBRC = 5, NEXT WER DAS LESEN KANN IST ZU NAHE, WER DAS KLESEN KANN IST ZU NAHE, SY-SUBRC = 5, NEXT WER DAS LESEN KANN IST ZU NAHE, WER DAS KLESEN KANN IST ZU NAHE,
42.
Page 42 © SAP
2008 / SAP TechEd 08 / COMP209 Page 83 Debugger Scripting – Usage Statement trace Conditional break-points „Stop only for special programs“ Whatever you can imagine … Use standard ABAP for a debugger script, which controls the debugger during the running application © SAP 2008 / SAP TechEd 08 / COMP209 Page 84 Layer Debugging – Motivation Kernel (C/C++) (ABAP / Dynp core functionality) Business applications(ABAP) System services (ABAP, system program) ( update, printing, controls …) Application framework layer I Application framework layer II System stuff – irrelevant for ABAP application developer My code Some other stuff My code … Debugging is a nightmare! My code is hidden under all the other stuff ! WEB Dynpro(ABAP)
43.
Page 43 © SAP
2008 / SAP TechEd 08 / COMP209 Page 85 Layer Debugging – Concept Solution: Layer Debugging Define your "layer" of interest and hide the rest during debugging Jump from layer to layer or from component to component instead of single stepping through the code Application UI DB © SAP 2008 / SAP TechEd 08 / COMP209 Page 86 Layer Debugging – Defining Layers Selection Set S2 Class: CL_1, CL_2 Selection Set S1 Packages: P1, P2, P3 Expression „S1 AND ( NOT S2 )“ Object Set („Layer“) L1 S1 S2 Expr Selection Set Criteria:Selection Set Criteria: •• Packages (w/ or w/o subPackages (w/ or w/o sub--packages)packages) •• Programs / ClassesPrograms / Classes •• Function ModulesFunction Modules •• Implementing interfaceImplementing interface Expression:Expression: •• Use selection set names as operandsUse selection set names as operands •• Use any logical operand, ABAPUse any logical operand, ABAP--likelike Object Set (Layer)Object Set (Layer) •• Transport ObjectTransport Object •• Global, Local, FavoritesGlobal, Local, Favorites
44.
Page 44 © SAP
2008 / SAP TechEd 08 / COMP209 Page 87 Layer Debugging – Defining Debugger Behaviour L1 <<REST>> L2 L3 Visible Point of Entry Point of Exit Incl. System Code S2 Expr S1 S1 Expr S6 S2 Expr S1 „Rest code“, not covererd by any other layer, can be excluded Normal debugger stepping: not visible = „system code“, line breakpoints not hidden „Layer stepping“: Stop at layer entry „Layer stepping“: Stop at layer exit What to do with system code inside layer © SAP 2008 / SAP TechEd 08 / COMP209 Page 88 Layer Debugging – Usage Change Profile After activating a debugger profile: Debugger will only stop in visible layers New button “Next object set” to jump from layer to layer
45.
Page 45 © SAP
2008 / SAP TechEd 08 / COMP209 Page 89 Expression Debugging After activating expression stepping: Step from one sub condition to the next Display the result of functional methods -> Understand which sub condition fails © SAP 2008 / SAP TechEd 08 / COMP209 Page 90 Web Dynpro Analysis Tool Use the brand new Web Dynpro tool to analyze your Web Dynpro application in the ABAP debugger
46.
Page 46 © SAP
2008 / SAP TechEd 08 / COMP209 Page 91 DEMO © SAP 2008 / SAP TechEd 08 / COMP209 Page 92 1. Language 2. Workbench Tools 3. Connectivity 4. Analysis Tools 4.1. ABAP Debugger 4.2. ABAP Runtime Analysis 4.3. SQL Stack Trace 5. ABAP Labs – Ideas That Work Agenda
47.
Page 47 © SAP
2008 / SAP TechEd 08 / COMP209 Page 93 ABAP Runtime Analysis – As You Know It Users . . . SAP System SAP NW AS ABAP VM Trace file . . . SAP NW AS ABAP VM Trace file Execute measurement Analyze resultsR R © SAP 2008 / SAP TechEd 08 / COMP209 Page 94 ABAP Runtime Analysis – What´s New? Users . . . SAP System SAP NW AS ABAP VM Trace file . . . Trace container Trace container. . . SAP NW AS ABAP VM Trace file Execute measurement Analyze results Database R R SAT Analyze results
48.
Page 48 © SAP
2008 / SAP TechEd 08 / COMP209 Page 95 ABAP Runtime Analysis – Analysis tools The new SAT (previously SE30) features: Modern and flexible UI Easy navigation between different tools (e.g. from call hierarchy to hit list etc.) Profile tool to find which package, layer, program consumes most of the time Call stack for each call hierarchy trace item Processing blocks tool is provided to get an aggregated view of the program flow Hotspot analysis to find performance and memory hotspots Diff tools to compare two hit lists and call hierarchies Central trace containers which can be accessed from all servers in the system © SAP 2008 / SAP TechEd 08 / COMP209 Page 96 1. Language 2. Workbench Tools 3. Connectivity 4. Analysis Tools 4.1. ABAP Debugger 4.2. ABAP Runtime Analysis 4.3. SQL Stack Trace 5. ABAP Labs – Ideas That Work Agenda
49.
Page 49 © SAP
2008 / SAP TechEd 08 / COMP209 Page 97 SQL Stack Trace – New ST05 With SAP EHP1 for SAP NetWeaver AS ABAP 7.1 the new Performance Analysis (ST05) offers: New accessible transaction Improved usability Layouts can be stored as user specific default Sorting, filtering, totals, subtotals, etc. on all fields Selections can be stored as report variant New operation LOBSTA (Large Object Statement) Set when DB manipulates BLOBs New SQL Stack Trace . . . © SAP 2008 / SAP TechEd 08 / COMP209 Page 98 SQL Stack Trace – Usage :: :
50.
Page 50 © SAP
2008 / SAP TechEd 08 / COMP209 Page 99 1. Language 2. Workbench Tools 3. Connectivity 4. Analysis Tools 5. ABAP Labs – Ideas That Work 5.1. Layer Awareness 5.2. Request Based Debugging Agenda © SAP 2008 / SAP TechEd 08 / COMP209 Page 100 1. Language 2. Workbench Tools 3. Connectivity 4. Analysis Tools 5. ABAP Labs – Ideas That Work 5.1. Layer Awareness 5.2. Request Based Debugging Agenda
51.
Page 51 © SAP
2008 / SAP TechEd 08 / COMP209 Page 101 Layer Awareness Many tools are already "layer aware": ABAP Debugger ABAP Runtime Analysis (SAT) Many will follow: ABAP Memory Inspector (under development) ... © SAP 2008 / SAP TechEd 08 / COMP209 Page 102 1. Language 2. Workbench Tools 3. Connectivity 4. Analysis Tools 5. ABAP Labs – Ideas That Work 5.1. Layer Awareness 5.2. Request Based Debugging Agenda
52.
Page 52 © SAP
2008 / SAP TechEd 08 / COMP209 Page 103 Breakpoints In ABAP How many different breakpoint kinds exist ? Debugger breakpoints Scope: debugging session set in : debugger Session breakpoints Scope: logon session Set in : development workbench External breakpoints Scope: all logon sessions (for one user on one server) Set in : development workbench Other breakpoints: break <User-Name>. break-point. break-point ID … . © SAP 2008 / SAP TechEd 08 / COMP209 Page 104 External Breakpoints – Problem With "One Server" Scope System XYZ HTTP Req. Hndl ... ... ... ... RFC Fct. Module ... ... ... ... RFC Fct. Module ... ... ... ... RFC Server 1 Server 2RFC HTTP Request Requests on other servers Load-balancing
53.
Page 53 © SAP
2008 / SAP TechEd 08 / COMP209 Page 105 External Breakpoints – Solution to "One Server" Scope External breakpoints Scope: all logon sessions (for one user on all servers) Set in : development workbench Network Enabled TPDA (Two Process Debugging Architecture) Debugger & Debuggee on two different servers (of two different systems) © SAP 2008 / SAP TechEd 08 / COMP209 Page 106 External Breakpoints – Problem With "One User" Scope ABAP Program ... ... ... ... System ABC System XYZ HTTP Req. Hndl ... ... ... ... RFC Fct. Module ... ... ... ... RFC Fct. Module ... ... ... ... RFC Server 1 Server 2RFC HTTP STOECK ANZEIGER INET_USER
54.
Page 54 © SAP
2008 / SAP TechEd 08 / COMP209 Page 107 External Breakpoints – Solution to "One User" Scope Sending “terminal ID” with EPP (Extended PassPort) “Terminal ID” represents windows logon session Stored in windows registry Tag breakpoint with “terminal ID” Send “terminal ID” with request SAP HTTP PlugIn for MS IE (SAP Solution Manager & stand-alone, note 1041556) SAP GUI (OK-Code: ”/htid”) External breakpoints scope: all logon sessions (for one request on all servers) set in : development workbench © SAP 2008 / SAP TechEd 08 / COMP209 Page 108 External Break-Points – Terminal ID System XYZ HTTP Req. Hndl ... ... ... ... RFC Fct. Module ... ... ... ... RFC Fct. Module ... ... ... ... RFC Server 1 Server 2RFC HTTP Request & tID tID tID & tIDtID tID
55.
Page 55 © SAP
2008 / SAP TechEd 08 / COMP209 Page 109 DEMO © SAP 2008 / SAP TechEd 08 / COMP209 Page 110 1. Language 2. Workbench Tools 3. Connectivity 4. Analysis Tools 5. ABAP Labs – Ideas That Work Agenda
56.
Page 56 © SAP
2008 / SAP TechEd 08 / COMP209 Page 111 Summary The new features in: ABAP Language offer: Decimal floating point numbers Extended expression handling Secondary keys for internal tables and pragmas Boxed components Enhanced string processing 12h time format Locators and database streams ABAP Workbench and Tools offer: New ABAP editor Splitter control for classical Dynpro Debugger scripting and layer debugging SQL stack trace ABAP Connectivity offer: bgRFC and LDQ Class based exceptions JCO 3.0 © SAP 2008 / SAP TechEd 08 / COMP209 Page 112 SDN Subscriptions offers developers and consultants like you, an annual license to the complete SAP NetWeaver platform software, related services, and educational content, to keep you at the top of your profession. SDN Software Subscriptions: (currently available in U.S. and Germany) A one year low cost, development, test, and commercialization license to the complete SAP NetWeaver software platform Automatic notification for patches and updates Continuous learning presentations and demos to build expertise in each of the SAP NetWeaver platform components A personal SAP namespace SAP NetWeaver Content Subscription: (available globally) An online library of continuous learning content to help build skills. Starter Kit Building Your Business with SDN Subscriptions To learn more or to get your own SDN Subscription, visit us at the Community Clubhouse or at www.sdn.sap.com/irj/sdn/subscriptions
57.
Page 57 © SAP
2008 / SAP TechEd 08 / COMP209 Page 113 Fuel your Career with SAP Certification What the industry is saying “Teams with certified architects and developers deliver projects on specification, on time, and on budget more often than other teams.” 2008 IDC Certification Analysis “82% of hiring managers use certification as a hiring criteria.” 2008 SAP Client Survey “SAP Certified Application Professional status is proof of quality, and that’s what matters most to customers.”* Conny Dahlgren, SAP Certified Professional Take advantage of the enhanced, expanded and multi tier certifications from SAP today! © SAP 2008 / SAP TechEd 08 / COMP209 Page 114 Further Information Related Workshops/Lectures at SAP TechEd 2008 COMP106, Next Generation: ABAP Performance and Trace Analysis, Lecture COMP267, ABAP Troubleshooting, Hands-on COMP269, Efficient Database Programming, Hands-on COMP271, Effective Utilization of bgRFC, Hands-on COMP272, Memory Efficient ABAP Programming, Hands-on COMP273, Test-Driven and Bulletproof ABAP Development, Hands-on COMP274, State-of-the-Art ABAP – Modern Business Programming with ABAP Objects, Hands-on COMP360, Enhancement and Switch Framework, Hands-on COMP361, Advanced ABAP Programming, Hands-on Related SAP Education and Certification Opportunities http://www.sap.com/education/ SAP Public Web: SAP Developer Network (SDN): www.sdn.sap.com Business Process Expert (BPX) Community: www.bpx.sap.com
58.
Page 58 © SAP
2008 / SAP TechEd 08 / COMP209 Page 115 Thank you! © SAP 2008 / SAP TechEd 08 / COMP209 Page 116 Please complete your session evaluation. Be courteous — deposit your trash, and do not take the handouts for the following session. Thank You ! Feedback
59.
Page 59 © SAP
2008 / SAP TechEd 08 / COMP209 Page 117 Copyright 2008 SAP AG All Rights Reserved No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. SAP, R/3, xApps, xApp, SAP NetWeaver, Duet, SAP Business ByDesign, ByDesign, PartnerEdge and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned and associated logos displayed are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. The information in this document is proprietary to SAP. No part of this document may be reproduced, copied, or transmitted in any form or for any purpose without the express prior written permission of SAP AG. This document is a preliminary version and not subject to your license agreement or any other agreement with SAP. This document contains only intended strategies, developments, and functionalities of the SAP® product and is not intended to be binding upon SAP to any particular course of business, product strategy, and/or development. Please note that this document is subject to change and may be changed by SAP at any time without notice. SAP assumes no responsibility for errors or omissions in this document. SAP does not warrant the accuracy or completeness of the information, text, graphics, links, or other items contained within this material. This document is provided without a warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP shall have no liability for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. This limitation shall not apply in cases of intent or gross negligence. The statutory liability for personal injury and defective products is not affected. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Web pages. Weitergabe und Vervielfältigung dieser Publikation oder von Teilen daraus sind, zu welchem Zweck und in welcher Form auch immer, ohne die ausdrückliche schriftliche Genehmigung durch SAP AG nicht gestattet. In dieser Publikation enthaltene Informationen können ohne vorherige Ankündigung geändert werden. Einige von der SAP AG und deren Vertriebspartnern vertriebene Softwareprodukte können Softwarekomponenten umfassen, die Eigentum anderer Softwarehersteller sind. SAP, R/3, xApps, xApp, SAP NetWeaver, Duet, SAP Business ByDesign, ByDesign, PartnerEdge und andere in diesem Dokument erwähnte SAP-Produkte und Services sowie die dazugehörigen Logos sind Marken oder eingetragene Marken der SAP AG in Deutschland und in mehreren anderen Ländern weltweit. Alle anderen in diesem Dokument erwähnten Namen von Produkten und Services sowie die damit verbundenen Firmenlogos sind Marken der jeweiligen Unternehmen. Die Angaben im Text sind unverbindlich und dienen lediglich zu Informationszwecken. Produkte können länderspezifische Unterschiede aufweisen. Die in dieser Publikation enthaltene Information ist Eigentum der SAP. Weitergabe und Vervielfältigung dieser Publikation oder von Teilen daraus sind, zu welchem Zweck und in welcher Form auch immer, nur mit ausdrücklicher schriftlicher Genehmigung durch SAP AG gestattet. Bei dieser Publikation handelt es sich um eine vorläufige Version, die nicht Ihrem gültigen Lizenzvertrag oder anderen Vereinbarungen mit SAP unterliegt. Diese Publikation enthält nur vorgesehene Strategien, Entwicklungen und Funktionen des SAP®-Produkts. SAP entsteht aus dieser Publikation keine Verpflichtung zu einer bestimmten Geschäfts- oder Produktstrategie und/oder bestimmten Entwicklungen. Diese Publikation kann von SAP jederzeit ohne vorherige Ankündigung geändert werden. SAP übernimmt keine Haftung für Fehler oder Auslassungen in dieser Publikation. Des Weiteren übernimmt SAP keine Garantie für die Exaktheit oder Vollständigkeit der Informationen, Texte, Grafiken, Links und sonstigen in dieser Publikation enthaltenen Elementen. Diese Publikation wird ohne jegliche Gewähr, weder ausdrücklich noch stillschweigend, bereitgestellt. Dies gilt u. a., aber nicht ausschließlich, hinsichtlich der Gewährleistung der Marktgängigkeit und der Eignung für einen bestimmten Zweck sowie für die Gewährleistung der Nichtverletzung geltenden Rechts. SAP haftet nicht für entstandene Schäden. Dies gilt u. a. und uneingeschränkt für konkrete, besondere und mittelbare Schäden oder Folgeschäden, die aus der Nutzung dieser Materialien entstehen können. Diese Einschränkung gilt nicht bei Vorsatz oder grober Fahrlässigkeit. Die gesetzliche Haftung bei Personenschäden oder Produkthaftung bleibt unberührt. Die Informationen, auf die Sie möglicherweise über die in diesem Material enthaltenen Hotlinks zugreifen, unterliegen nicht dem Einfluss von SAP, und SAP unterstützt nicht die Nutzung von Internetseiten Dritter durch Sie und gibt keinerlei Gewährleistungen oder Zusagen über Internetseiten Dritter ab. Alle Rechte vorbehalten.
Download now