This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1
COMP209News In ABAP –Concepts to Further Increase the Power of ABAP Development
Chris Swanepoel, SAP AG NW F ABAPHorst Keller, SAP AG NW F ABAPSeptember 08
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.
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.1SAP NetWeaver Mobile 7.1Banking services from SAP 7.0SAP Business ByDesign™ solution Feature Pack 2.0
... because of the high demand for these new ABAP features:
Most of the features presented in this lecture are being backported toSAP EHP2 for SAP NetWeaver AS ABAP 7.0They will then be available in SAP Business Suite 2009
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 humansFor users, binary floating point numbers are not WYSIWYGResults of calculations can depend on the platformNo rounding to a specific number of decimal placesDivision by powers of 10 is inexactNo uniform behavior across database systems
DATA float TYPE f. float = '123456.15' – '123456'.
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.
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 fCalculation 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 rescaleNew methods in CL_ABAP_MATHNew format options in WRITE [TO] and in string templates
Decimal Floating Point Numbers – Exact Calculations
New addition EXACT for the COMPUTE statementThe 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:
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.
Two kinds of computational expressions:Arithmetic expressionsBit expressions
that could be used behind COMPUTE onlyLogical expressionsthat could be used in control statements onlyBuilt-in functionsthat could be used in very few operand positions onlyFunctional methodsthat could be used in very few operand positions only
Three kinds of computational expressions:Arithmetic expressionsBit expressionsString expressions
that can be used in various operand positionsEnlarged set of Built-in functionsincluding string functions and predicate functions that can be used in variousoperand positionsFunctional methodsthat can be used in various operand positions especially allowing nested and chained method calls
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)) tablesKey access is always linear (O(n)) for standardtablesOnly one kind of optimization per internal table
Secondary keys introduced for boosting internal table performance
But caution:Internal management can use a lot of memoryKey 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 modifiedIf 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
ABAP developers receive information about problems in their code fromthe 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 keysMust 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)
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 delimiterParameter tokens matched against syntax warningsAre case insensitiveApplicable pragmas documented in long texts of syntax warnings
Developer must ensure that data object exists before it is accessed (CREATE DATA ... ).Special dereferencing operator (->*) must be used to access data objectComponents behind data references cannot be part of a table keyStructures with data references cannot be passed to RFC or be EXPORTed
TYPES: BEGIN OF order,...alt_post_addr TYPE REF TO address,
Boxed components offer all the advantages of data references, but:
Memory is allocated automatically on demandThey can be accessed like normal substructures or attributes using component selectorThey can be part of a table keyThey can be EXPORTed and passed to RFC (only with basXML)
Boxed components:
Must be structuresAre deep structures with all the consequences (comparable to TYPE c vs. TYPE string)Are also supported for dictionary structures
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 errorsIf definitions refer to other definitions, further definitions had to be loaded
Consequence:Significant amount of the loaded definitions in ABAP sources not neededVery costly dependency administrationHigh 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 coderobustness and maintainability:
Unnecessary use of dynamic callsUse of unsafe types, e.g. parameter typed REF TO OBJECT
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 PMam/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 statementFormating options COUNTRY and environment for string templatesClass CL_ABAP_TIMEFM for converting between external and internal time
* 'DE' in user master recordstime = |{ sy-uzeit time = environment }|.
SET COUNTRY 'US'.time = |{ sy-uzeit time = environment }|.
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 databaseCopy LOBs within the database without first copying data to application serverHigher 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 streamsNo increased resource consumption
Transactional bgRFC (Type T) replaces tRFC:Units executed "Exactly Once" (EO)Units executed in no guaranteed orderFunction 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 orderPutting same unit in different queues synchronizes queues
For the developer:Object-oriented and easy to use APIClear programming model, no implicit assumptions
For the administrator:Effective tools support monitoring and error analysisEasy to apply load balancingEasy to configure system resources for bgRFC
For the system workload:Lean and well-structured designDependency handling optimizedSupport of load balancingConfigurable number of schedulersConfigurable load on system
Allows applications to record data that can be read by a receiving application (pull principle)Replaces qRFC No-SendData storage in local queuesCharacter and binary data compressed before storageEach application has its own queues Applications do not affect each otherSame data written to different queues only stored onceObject-orientated API
With SAP EHP1 for SAP NetWeaver AS ABAP 7.1 class based exceptions can bespecified 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 catchingCX_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( )....
New Dynpro analysis toolNew Web Dynpro analysis toolSimple transformation debuggingAutomated debugging via debugger scriptingEnhancement debuggingDebugger consoleLayer debugging Miscellaneous:
Upload internal tablesTable View: view and configure sub-components of embedded structuresDebug expressions and of multiple statements within one line Change long fieldsCall stack of the internal session of the callerException stack
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 programAccess the same information about the debuggee as the debugger itselfWrite various information to a trace file
Standalone transaction for script trace analysis: SAS
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
The new SAT (previously SE30) features:Modern and flexible UIEasy 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 timeCall stack for each call hierarchy trace itemProcessing blocks tool is provided to get an aggregated view of the program flowHotspot analysis to find performance and memory hotspotsDiff tools to compare two hit lists and call hierarchiesCentral trace containers which can be accessed from all servers in the system
Decimal floating point numbersExtended expression handlingSecondary keys for internal tables and pragmasBoxed componentsEnhanced string processing12h time formatLocators and database streams
ABAP Workbench and Tools offer:New ABAP editorSplitter control for classical DynproDebugger scripting and layer debuggingSQL stack trace
ABAP Connectivity offer:bgRFC and LDQClass based exceptionsJCO 3.0
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 updatesContinuous learning presentations and demos to build expertise in each of the SAP NetWeaver platform componentsA 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
“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!
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.