SlideShare a Scribd company logo
ABAP 7.02 New Features
New String Functions




     Johann Fößleitner, Cadaxo GmbH   https://twitter.com/foessleitnerj
Table of Contents
  ➤   cmax/cmin – character like extreme value function
  ➤   condense – condensation function
  ➤   concate_lines_of – linking function
  ➤   escape – escape function
  ➤   insert – insert function
  ➤   match – match function
  ➤   repeat – repeat function
  ➤   replace – replace function
  ➤   reverse – reverse function
  ➤   shift_left/shift_right – shift function
  ➤   substring – substring function
  ➤   to_upper/to_lower/… - upper and lower case function
  ➤   translate – translate function
  ➤   distance – distance function
cmax/cmin – character like extreme value
function
•   comparison up to a value of 9 character like arguments
•   result is the smallest (cmin) or the biggest (cmax) delivered
    character
•   comparison is used codepage-based
cmax/cmin – character like extreme value
function

l_result = cmax(   val1 = 'AAAC' val2 = 'AAAB' val3 = 'AAAD' ).
result: AAAD
l_result = cmax(   val1 = 'AAAC' val2 = 'AZAB' val3 = 'AAAD' ).
result: AZAB
l_result = cmin(   val1 = 'AAAC' val2 = 'AAAB' val3 = 'AAAD' ).
result : AAAB
l_result = cmin(   val1 = 'AAAC' val2 = '0AAC' val3 = 'AAAD' ).
result : 0AAC
condense – condensation function
•   condensates the content of a string
•   provides more possibilities than the ABAP Command
    Condense
•   removes leading and ending character

l_string = condense( val = ‘XXXabcXXXdefXXX‘ del = ‘X‘ from = ‘X‘ to = ‘X‘ ).
result: abcXdef
concat_lines_of – linking function
•   links lines from an intern table in a string
•   additive sep enables the seperation by a seperator


L_string = concate_lines_of( table = tab sep = ‘;‘ ).
escape – escape function
• enables the rule-based replacing of a string with escape
  symbols
• usable rules are defined as constants in
  CL_ABAP_FORMAT
escape – escape function
DATA l_string0 TYPE string.
DATA l_string1 TYPE string.

l_string0 = 'http://www.cadaxo.com'.
l_string1 = escape( val = l_string0 format = cl_abap_format=>e_url_full ).

WRITE: / l_string0, / l_string1.

result:

http://www.cadaxo.com
http%3A%2F%2Fwww.cadaxo.com
insert – insert function
•    insert a string at any position of another string


L_string = ‘NewsABAP‘.
L_result = insert( val = l_string sub = ‘ in ‘ off = 5 ).
Write: l_string.

result:

news in ABAP
match – match function
•   searches for a text with a specific Regex accordance
•   more information of Regex can be gathered from SAP online
    documentation
repeat – repeat function
•    generates a string through repitition of another string


l_string = repeat( val = ‘ABC‘ occ = 5 ).
write: l_string.

result:

ABCABCABCABCABC
replace – replace function
•   replaces a section of a string
•   section can be determined by an offset-/length or by Regex


l_result = replace( val = 'ABAP xx GOOD' off = 6 len = 0 with = 'IS' ).
result: ‘ABAP xISx GOOD‘

l_result = replace( val = 'ABAP xx GOOD' off = 4 len = 4 with = 'IS' ).
result: ‘ABAPISGOOD‘
reverse – reverse function
                 •   reverses a complete string


                 L_string = ‘PABA‘.
                 L_string = reverse( l_string ).

                 result: ABAP




PS: If you know a useful application of this function, please let me know!
substring, substring_... – substring function
•   investigation of a section from a given character amount

l_result = substring( val = 'ABCDEFGH' off = 3 len = 4 ).
result: ‘DEFG‘
l_result = substring_from( val = 'ABCDEFGH' sub = 'DEF' ).
result: ‘DEFGH‘
l_result = substring_after( val = 'ABCDEFGH' sub = 'DEF' ).
result: ‘GH‘
l_result = substring_before( val = 'ABCDEFGH' sub = 'DEF' ).
result: ‘ABC‘
l_result = substring_to( val = 'ABCDEFGH' sub = 'DEF' ).
result: ‘ABCDEF‘
to_upper, to_lower, to_mixed, from_mixed
upper and lower case function
•   to_upper/to_lower conforms the command TRANSLATE
    TO UPPER/LOWER CASE
•   to_mixed transforms all letters from the second position on
    in lower cases
•   from_mixed inserts from left to right from the second
    position on the first declared character from the additive sep
     •   further additives are case and min
to_upper, to_lower, to_mixed, from_mixed
upper and lower case function



l_result = to_mixed( val = 'CADAXO GMBH' ).

result: ‘Cadaxo gmbh‘
distance – distance function
                   •   investigates the edit distance (Levenshtein-distance) of to
                       strings
                         •   minimal amount of insert, delete or replace processes to get from string
                             1 to string 2

                   l_int = distance( val1 = 'CADAXO GMBH' val2 = 'ADAXOGMBH' ).
                   result: 2 („C“ and a blank have to be inserted)

                   l_int = distance( val1 = 'ABCD' val2 = 'EFGH' ).
                   result: 4 (all characters have to be replaced)




http://de.wikipedia.org/wiki/Levenshtein-Distanz
Cadaxo gmbh, founded in 2009, set out to simplify the SAP working
environment with small add-ons.

              SQL Cockpit 2.0 – the most efficient Analysis add on for
              SAP environments, business users, software developers and
              support alike. SQL Cockpit enable quick and flexible data
              retrievel (without report development and without
              transports) directly in the SAP productive system.

              http://www.cadaxo.com/content/en/products/sql-cockpit.html


                                                  http://com.slideshare.net/cadaxogmbh
                                                  http://www.youtube.com/CadaxoGmbH
                                                  http://www.linkedin.com/company/cadaxo-gmbh
                                                  https://twitter.com/cadaxo
The multiplication or the translation of this document or
sections out of it is without the expressively authorisation of
Cadaxo GmbH prohibited.

SAP®, ABAP™, R/3®, SAP NetWeaver® are brands or
registered brands of the SAP AG.

All other products are brands or registered brands of the
particular company.

© 2013 Cadaxo GesmbH. All rights reserved.

More Related Content

Viewers also liked

Qué es abap
Qué es abapQué es abap
Qué es abap
Diale Chavez
 
Abap query
Abap queryAbap query
Abap query
brtkow
 
Analista programador SAP ABAP IV
Analista programador SAP ABAP IVAnalista programador SAP ABAP IV
Analista programador SAP ABAP IV
★Patricia Rosso★ (LION)
 
Web dynpro for abap
Web dynpro for abapWeb dynpro for abap
Web dynpro for abap
Gabriel Magalhães
 
Icones - ABAP
Icones - ABAPIcones - ABAP
Icones - ABAP
Ricardo Ishida
 
Comandos e funções em abap
Comandos e funções em abapComandos e funções em abap
Comandos e funções em abap
alienscorporation
 
View - Tutorial ABAP
View - Tutorial ABAPView - Tutorial ABAP
View - Tutorial ABAP
Ricardo Ishida
 
Sap abap Q&A
Sap abap Q&A Sap abap Q&A
Sap abap Q&A
Kaustav Pyne
 
Funções - Tutorial ABAP
Funções - Tutorial ABAPFunções - Tutorial ABAP
Funções - Tutorial ABAP
Ricardo Ishida
 
Abap coding standards
Abap coding standardsAbap coding standards
Abap coding standards
surendra1579
 
Basic abap oo
Basic abap ooBasic abap oo
Basic abap oo
Gabriel Magalhães
 
Manikanta Sai Kumar Karri SAP ABAP and OO ABAP 3 Years.doc
Manikanta Sai Kumar Karri SAP ABAP and OO ABAP 3 Years.docManikanta Sai Kumar Karri SAP ABAP and OO ABAP 3 Years.doc
Manikanta Sai Kumar Karri SAP ABAP and OO ABAP 3 Years.doc
manikanta sai kumar karri
 
Lecture01 abap on line
Lecture01 abap on lineLecture01 abap on line
Lecture01 abap on line
Milind Patil
 
Abap course chapter 6 specialities for erp software
Abap course   chapter 6 specialities for erp softwareAbap course   chapter 6 specialities for erp software
Abap course chapter 6 specialities for erp software
Milind Patil
 
Abap course chapter 5 dynamic programs
Abap course   chapter 5 dynamic programsAbap course   chapter 5 dynamic programs
Abap course chapter 5 dynamic programs
Milind Patil
 
ABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP Installationen
ABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP InstallationenABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP Installationen
ABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP Installationen
Virtual Forge
 
SAP ABAP Proxy Objects: Configuración del entorno
SAP ABAP Proxy Objects: Configuración del entornoSAP ABAP Proxy Objects: Configuración del entorno
SAP ABAP Proxy Objects: Configuración del entorno
Oreka IT
 
Usability in ABAP Programs - SITSP2011
Usability in ABAP Programs - SITSP2011Usability in ABAP Programs - SITSP2011
Usability in ABAP Programs - SITSP2011
Mauricio Cruz
 
SAP Inside Track Sao Paulo '09 - ABAP Objects Overview
SAP Inside Track Sao Paulo '09 - ABAP Objects OverviewSAP Inside Track Sao Paulo '09 - ABAP Objects Overview
SAP Inside Track Sao Paulo '09 - ABAP Objects Overview
Marcelo Ramos
 

Viewers also liked (19)

Qué es abap
Qué es abapQué es abap
Qué es abap
 
Abap query
Abap queryAbap query
Abap query
 
Analista programador SAP ABAP IV
Analista programador SAP ABAP IVAnalista programador SAP ABAP IV
Analista programador SAP ABAP IV
 
Web dynpro for abap
Web dynpro for abapWeb dynpro for abap
Web dynpro for abap
 
Icones - ABAP
Icones - ABAPIcones - ABAP
Icones - ABAP
 
Comandos e funções em abap
Comandos e funções em abapComandos e funções em abap
Comandos e funções em abap
 
View - Tutorial ABAP
View - Tutorial ABAPView - Tutorial ABAP
View - Tutorial ABAP
 
Sap abap Q&A
Sap abap Q&A Sap abap Q&A
Sap abap Q&A
 
Funções - Tutorial ABAP
Funções - Tutorial ABAPFunções - Tutorial ABAP
Funções - Tutorial ABAP
 
Abap coding standards
Abap coding standardsAbap coding standards
Abap coding standards
 
Basic abap oo
Basic abap ooBasic abap oo
Basic abap oo
 
Manikanta Sai Kumar Karri SAP ABAP and OO ABAP 3 Years.doc
Manikanta Sai Kumar Karri SAP ABAP and OO ABAP 3 Years.docManikanta Sai Kumar Karri SAP ABAP and OO ABAP 3 Years.doc
Manikanta Sai Kumar Karri SAP ABAP and OO ABAP 3 Years.doc
 
Lecture01 abap on line
Lecture01 abap on lineLecture01 abap on line
Lecture01 abap on line
 
Abap course chapter 6 specialities for erp software
Abap course   chapter 6 specialities for erp softwareAbap course   chapter 6 specialities for erp software
Abap course chapter 6 specialities for erp software
 
Abap course chapter 5 dynamic programs
Abap course   chapter 5 dynamic programsAbap course   chapter 5 dynamic programs
Abap course chapter 5 dynamic programs
 
ABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP Installationen
ABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP InstallationenABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP Installationen
ABAP Qualitäts-Benchmark: Eine Analyse von über 200 SAP Installationen
 
SAP ABAP Proxy Objects: Configuración del entorno
SAP ABAP Proxy Objects: Configuración del entornoSAP ABAP Proxy Objects: Configuración del entorno
SAP ABAP Proxy Objects: Configuración del entorno
 
Usability in ABAP Programs - SITSP2011
Usability in ABAP Programs - SITSP2011Usability in ABAP Programs - SITSP2011
Usability in ABAP Programs - SITSP2011
 
SAP Inside Track Sao Paulo '09 - ABAP Objects Overview
SAP Inside Track Sao Paulo '09 - ABAP Objects OverviewSAP Inside Track Sao Paulo '09 - ABAP Objects Overview
SAP Inside Track Sao Paulo '09 - ABAP Objects Overview
 

Similar to Abap 7 02 new features - new string functions

Matlab Functions
Matlab FunctionsMatlab Functions
Matlab Functions
Umer Azeem
 
Syntactic analysis in NLP
Syntactic analysis in NLPSyntactic analysis in NLP
Syntactic analysis in NLP
kartikaVashisht
 
Php
PhpPhp
Abap 7.40
Abap 7.40Abap 7.40
New features in abap
New features in abapNew features in abap
New features in abap
Srihari J
 
Compiler Construction for DLX Processor
Compiler Construction for DLX Processor Compiler Construction for DLX Processor
Compiler Construction for DLX Processor
Soham Kulkarni
 
Scilab as a calculator
Scilab as a calculatorScilab as a calculator
Scilab as a calculator
Scilab
 
JavaScript.pptx
JavaScript.pptxJavaScript.pptx
JavaScript.pptx
Govardhan Bhavani
 
Matlab commands
Matlab commandsMatlab commands
Matlab commands
avinashkumer
 
Matlab commands
Matlab commandsMatlab commands
Java 8
Java 8Java 8
Java 8
vilniusjug
 
CSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and ConsCSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and Cons
Sanjoy Kr. Paul
 
Complete list of all sap abap keywords
Complete list of all sap abap keywordsComplete list of all sap abap keywords
Complete list of all sap abap keywords
Prakash Thirumoorthy
 
2 R Tutorial Programming
2 R Tutorial Programming2 R Tutorial Programming
2 R Tutorial Programming
Sakthi Dasans
 
DEBUGGING FUZZY XPATH QUERIES
DEBUGGING FUZZY XPATH QUERIESDEBUGGING FUZZY XPATH QUERIES
DEBUGGING FUZZY XPATH QUERIES
Jornadas SISTEDES 2012 {JISBD; PROLE; JCIS}
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
Mufaddal Haidermota
 
Applicative Functor - Part 2
Applicative Functor - Part 2Applicative Functor - Part 2
Applicative Functor - Part 2
Philip Schwarz
 
Sap sapscripts tips and tricks
Sap sapscripts tips and tricksSap sapscripts tips and tricks
Sap sapscripts tips and tricks
Kranthi Kumar
 
Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)
James Titcumb
 
Real life-coffeescript
Real life-coffeescriptReal life-coffeescript
Real life-coffeescript
David Furber
 

Similar to Abap 7 02 new features - new string functions (20)

Matlab Functions
Matlab FunctionsMatlab Functions
Matlab Functions
 
Syntactic analysis in NLP
Syntactic analysis in NLPSyntactic analysis in NLP
Syntactic analysis in NLP
 
Php
PhpPhp
Php
 
Abap 7.40
Abap 7.40Abap 7.40
Abap 7.40
 
New features in abap
New features in abapNew features in abap
New features in abap
 
Compiler Construction for DLX Processor
Compiler Construction for DLX Processor Compiler Construction for DLX Processor
Compiler Construction for DLX Processor
 
Scilab as a calculator
Scilab as a calculatorScilab as a calculator
Scilab as a calculator
 
JavaScript.pptx
JavaScript.pptxJavaScript.pptx
JavaScript.pptx
 
Matlab commands
Matlab commandsMatlab commands
Matlab commands
 
Matlab commands
Matlab commandsMatlab commands
Matlab commands
 
Java 8
Java 8Java 8
Java 8
 
CSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and ConsCSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and Cons
 
Complete list of all sap abap keywords
Complete list of all sap abap keywordsComplete list of all sap abap keywords
Complete list of all sap abap keywords
 
2 R Tutorial Programming
2 R Tutorial Programming2 R Tutorial Programming
2 R Tutorial Programming
 
DEBUGGING FUZZY XPATH QUERIES
DEBUGGING FUZZY XPATH QUERIESDEBUGGING FUZZY XPATH QUERIES
DEBUGGING FUZZY XPATH QUERIES
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Applicative Functor - Part 2
Applicative Functor - Part 2Applicative Functor - Part 2
Applicative Functor - Part 2
 
Sap sapscripts tips and tricks
Sap sapscripts tips and tricksSap sapscripts tips and tricks
Sap sapscripts tips and tricks
 
Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)Diving into HHVM Extensions (php[tek] 2016)
Diving into HHVM Extensions (php[tek] 2016)
 
Real life-coffeescript
Real life-coffeescriptReal life-coffeescript
Real life-coffeescript
 

More from Cadaxo GmbH

Webinar SAP/ABAP und Microsoft
Webinar  SAP/ABAP und MicrosoftWebinar  SAP/ABAP und Microsoft
Webinar SAP/ABAP und Microsoft
Cadaxo GmbH
 
Webinar - ABAP Releasenotes 7.53/7.54
Webinar - ABAP Releasenotes 7.53/7.54Webinar - ABAP Releasenotes 7.53/7.54
Webinar - ABAP Releasenotes 7.53/7.54
Cadaxo GmbH
 
Webinar ABAP Managed Database Procedures
Webinar ABAP Managed Database ProceduresWebinar ABAP Managed Database Procedures
Webinar ABAP Managed Database Procedures
Cadaxo GmbH
 
Webinar - ABAP Development Tools
Webinar - ABAP Development ToolsWebinar - ABAP Development Tools
Webinar - ABAP Development Tools
Cadaxo GmbH
 
Webinar - Entwurfsmuster in ABAP
Webinar - Entwurfsmuster in ABAPWebinar - Entwurfsmuster in ABAP
Webinar - Entwurfsmuster in ABAP
Cadaxo GmbH
 
Webinar Modern ABAP
Webinar Modern ABAPWebinar Modern ABAP
Webinar Modern ABAP
Cadaxo GmbH
 
Webinar ABAP 7.51 Releaseinformationen
Webinar ABAP 7.51 ReleaseinformationenWebinar ABAP 7.51 Releaseinformationen
Webinar ABAP 7.51 Releaseinformationen
Cadaxo GmbH
 
Webinar - SAP Gateway
Webinar  - SAP GatewayWebinar  - SAP Gateway
Webinar - SAP Gateway
Cadaxo GmbH
 
Webinar - ABAP CDS Views
Webinar - ABAP CDS ViewsWebinar - ABAP CDS Views
Webinar - ABAP CDS Views
Cadaxo GmbH
 
ABAP CodeRetreat 20.5.2017 Vienna - Refactoring
ABAP CodeRetreat 20.5.2017 Vienna - RefactoringABAP CodeRetreat 20.5.2017 Vienna - Refactoring
ABAP CodeRetreat 20.5.2017 Vienna - Refactoring
Cadaxo GmbH
 
SQL Cockpit 3.1 - Overview
SQL Cockpit 3.1 - OverviewSQL Cockpit 3.1 - Overview
SQL Cockpit 3.1 - Overview
Cadaxo GmbH
 
Webinar - SAP BOPF
Webinar - SAP BOPFWebinar - SAP BOPF
Webinar - SAP BOPF
Cadaxo GmbH
 
Webinar - ABAP 7.50 Releaseabhängige Änderungen
Webinar - ABAP 7.50 Releaseabhängige ÄnderungenWebinar - ABAP 7.50 Releaseabhängige Änderungen
Webinar - ABAP 7.50 Releaseabhängige Änderungen
Cadaxo GmbH
 
TDD mit ABAP Units
TDD mit ABAP UnitsTDD mit ABAP Units
TDD mit ABAP Units
Cadaxo GmbH
 
Clean code in ABAP
Clean code in ABAPClean code in ABAP
Clean code in ABAP
Cadaxo GmbH
 
Webinar - Boost your ABAP
Webinar - Boost your ABAPWebinar - Boost your ABAP
Webinar - Boost your ABAP
Cadaxo GmbH
 
SQL Cockpit - Releasenotes 3.0
SQL Cockpit - Releasenotes 3.0SQL Cockpit - Releasenotes 3.0
SQL Cockpit - Releasenotes 3.0
Cadaxo GmbH
 
Webinar ABAP 7.40 sp5/sp8 Releaseinformationen
Webinar ABAP 7.40 sp5/sp8 ReleaseinformationenWebinar ABAP 7.40 sp5/sp8 Releaseinformationen
Webinar ABAP 7.40 sp5/sp8 Releaseinformationen
Cadaxo GmbH
 
Prüfen Sie Ihre ABAP SQL Abfragen auf SAP HANA Tauglichkeit
Prüfen Sie Ihre ABAP SQL Abfragen auf SAP HANA TauglichkeitPrüfen Sie Ihre ABAP SQL Abfragen auf SAP HANA Tauglichkeit
Prüfen Sie Ihre ABAP SQL Abfragen auf SAP HANA Tauglichkeit
Cadaxo GmbH
 
Cadaxo SQL Cockpit 2.0 - Neue Features im Detail
Cadaxo SQL Cockpit 2.0 - Neue Features im DetailCadaxo SQL Cockpit 2.0 - Neue Features im Detail
Cadaxo SQL Cockpit 2.0 - Neue Features im Detail
Cadaxo GmbH
 

More from Cadaxo GmbH (20)

Webinar SAP/ABAP und Microsoft
Webinar  SAP/ABAP und MicrosoftWebinar  SAP/ABAP und Microsoft
Webinar SAP/ABAP und Microsoft
 
Webinar - ABAP Releasenotes 7.53/7.54
Webinar - ABAP Releasenotes 7.53/7.54Webinar - ABAP Releasenotes 7.53/7.54
Webinar - ABAP Releasenotes 7.53/7.54
 
Webinar ABAP Managed Database Procedures
Webinar ABAP Managed Database ProceduresWebinar ABAP Managed Database Procedures
Webinar ABAP Managed Database Procedures
 
Webinar - ABAP Development Tools
Webinar - ABAP Development ToolsWebinar - ABAP Development Tools
Webinar - ABAP Development Tools
 
Webinar - Entwurfsmuster in ABAP
Webinar - Entwurfsmuster in ABAPWebinar - Entwurfsmuster in ABAP
Webinar - Entwurfsmuster in ABAP
 
Webinar Modern ABAP
Webinar Modern ABAPWebinar Modern ABAP
Webinar Modern ABAP
 
Webinar ABAP 7.51 Releaseinformationen
Webinar ABAP 7.51 ReleaseinformationenWebinar ABAP 7.51 Releaseinformationen
Webinar ABAP 7.51 Releaseinformationen
 
Webinar - SAP Gateway
Webinar  - SAP GatewayWebinar  - SAP Gateway
Webinar - SAP Gateway
 
Webinar - ABAP CDS Views
Webinar - ABAP CDS ViewsWebinar - ABAP CDS Views
Webinar - ABAP CDS Views
 
ABAP CodeRetreat 20.5.2017 Vienna - Refactoring
ABAP CodeRetreat 20.5.2017 Vienna - RefactoringABAP CodeRetreat 20.5.2017 Vienna - Refactoring
ABAP CodeRetreat 20.5.2017 Vienna - Refactoring
 
SQL Cockpit 3.1 - Overview
SQL Cockpit 3.1 - OverviewSQL Cockpit 3.1 - Overview
SQL Cockpit 3.1 - Overview
 
Webinar - SAP BOPF
Webinar - SAP BOPFWebinar - SAP BOPF
Webinar - SAP BOPF
 
Webinar - ABAP 7.50 Releaseabhängige Änderungen
Webinar - ABAP 7.50 Releaseabhängige ÄnderungenWebinar - ABAP 7.50 Releaseabhängige Änderungen
Webinar - ABAP 7.50 Releaseabhängige Änderungen
 
TDD mit ABAP Units
TDD mit ABAP UnitsTDD mit ABAP Units
TDD mit ABAP Units
 
Clean code in ABAP
Clean code in ABAPClean code in ABAP
Clean code in ABAP
 
Webinar - Boost your ABAP
Webinar - Boost your ABAPWebinar - Boost your ABAP
Webinar - Boost your ABAP
 
SQL Cockpit - Releasenotes 3.0
SQL Cockpit - Releasenotes 3.0SQL Cockpit - Releasenotes 3.0
SQL Cockpit - Releasenotes 3.0
 
Webinar ABAP 7.40 sp5/sp8 Releaseinformationen
Webinar ABAP 7.40 sp5/sp8 ReleaseinformationenWebinar ABAP 7.40 sp5/sp8 Releaseinformationen
Webinar ABAP 7.40 sp5/sp8 Releaseinformationen
 
Prüfen Sie Ihre ABAP SQL Abfragen auf SAP HANA Tauglichkeit
Prüfen Sie Ihre ABAP SQL Abfragen auf SAP HANA TauglichkeitPrüfen Sie Ihre ABAP SQL Abfragen auf SAP HANA Tauglichkeit
Prüfen Sie Ihre ABAP SQL Abfragen auf SAP HANA Tauglichkeit
 
Cadaxo SQL Cockpit 2.0 - Neue Features im Detail
Cadaxo SQL Cockpit 2.0 - Neue Features im DetailCadaxo SQL Cockpit 2.0 - Neue Features im Detail
Cadaxo SQL Cockpit 2.0 - Neue Features im Detail
 

Abap 7 02 new features - new string functions

  • 1. ABAP 7.02 New Features New String Functions Johann Fößleitner, Cadaxo GmbH https://twitter.com/foessleitnerj
  • 2. Table of Contents ➤ cmax/cmin – character like extreme value function ➤ condense – condensation function ➤ concate_lines_of – linking function ➤ escape – escape function ➤ insert – insert function ➤ match – match function ➤ repeat – repeat function ➤ replace – replace function ➤ reverse – reverse function ➤ shift_left/shift_right – shift function ➤ substring – substring function ➤ to_upper/to_lower/… - upper and lower case function ➤ translate – translate function ➤ distance – distance function
  • 3. cmax/cmin – character like extreme value function • comparison up to a value of 9 character like arguments • result is the smallest (cmin) or the biggest (cmax) delivered character • comparison is used codepage-based
  • 4. cmax/cmin – character like extreme value function l_result = cmax( val1 = 'AAAC' val2 = 'AAAB' val3 = 'AAAD' ). result: AAAD l_result = cmax( val1 = 'AAAC' val2 = 'AZAB' val3 = 'AAAD' ). result: AZAB l_result = cmin( val1 = 'AAAC' val2 = 'AAAB' val3 = 'AAAD' ). result : AAAB l_result = cmin( val1 = 'AAAC' val2 = '0AAC' val3 = 'AAAD' ). result : 0AAC
  • 5. condense – condensation function • condensates the content of a string • provides more possibilities than the ABAP Command Condense • removes leading and ending character l_string = condense( val = ‘XXXabcXXXdefXXX‘ del = ‘X‘ from = ‘X‘ to = ‘X‘ ). result: abcXdef
  • 6. concat_lines_of – linking function • links lines from an intern table in a string • additive sep enables the seperation by a seperator L_string = concate_lines_of( table = tab sep = ‘;‘ ).
  • 7. escape – escape function • enables the rule-based replacing of a string with escape symbols • usable rules are defined as constants in CL_ABAP_FORMAT
  • 8. escape – escape function DATA l_string0 TYPE string. DATA l_string1 TYPE string. l_string0 = 'http://www.cadaxo.com'. l_string1 = escape( val = l_string0 format = cl_abap_format=>e_url_full ). WRITE: / l_string0, / l_string1. result: http://www.cadaxo.com http%3A%2F%2Fwww.cadaxo.com
  • 9. insert – insert function • insert a string at any position of another string L_string = ‘NewsABAP‘. L_result = insert( val = l_string sub = ‘ in ‘ off = 5 ). Write: l_string. result: news in ABAP
  • 10. match – match function • searches for a text with a specific Regex accordance • more information of Regex can be gathered from SAP online documentation
  • 11. repeat – repeat function • generates a string through repitition of another string l_string = repeat( val = ‘ABC‘ occ = 5 ). write: l_string. result: ABCABCABCABCABC
  • 12. replace – replace function • replaces a section of a string • section can be determined by an offset-/length or by Regex l_result = replace( val = 'ABAP xx GOOD' off = 6 len = 0 with = 'IS' ). result: ‘ABAP xISx GOOD‘ l_result = replace( val = 'ABAP xx GOOD' off = 4 len = 4 with = 'IS' ). result: ‘ABAPISGOOD‘
  • 13. reverse – reverse function • reverses a complete string L_string = ‘PABA‘. L_string = reverse( l_string ). result: ABAP PS: If you know a useful application of this function, please let me know!
  • 14. substring, substring_... – substring function • investigation of a section from a given character amount l_result = substring( val = 'ABCDEFGH' off = 3 len = 4 ). result: ‘DEFG‘ l_result = substring_from( val = 'ABCDEFGH' sub = 'DEF' ). result: ‘DEFGH‘ l_result = substring_after( val = 'ABCDEFGH' sub = 'DEF' ). result: ‘GH‘ l_result = substring_before( val = 'ABCDEFGH' sub = 'DEF' ). result: ‘ABC‘ l_result = substring_to( val = 'ABCDEFGH' sub = 'DEF' ). result: ‘ABCDEF‘
  • 15. to_upper, to_lower, to_mixed, from_mixed upper and lower case function • to_upper/to_lower conforms the command TRANSLATE TO UPPER/LOWER CASE • to_mixed transforms all letters from the second position on in lower cases • from_mixed inserts from left to right from the second position on the first declared character from the additive sep • further additives are case and min
  • 16. to_upper, to_lower, to_mixed, from_mixed upper and lower case function l_result = to_mixed( val = 'CADAXO GMBH' ). result: ‘Cadaxo gmbh‘
  • 17. distance – distance function • investigates the edit distance (Levenshtein-distance) of to strings • minimal amount of insert, delete or replace processes to get from string 1 to string 2 l_int = distance( val1 = 'CADAXO GMBH' val2 = 'ADAXOGMBH' ). result: 2 („C“ and a blank have to be inserted) l_int = distance( val1 = 'ABCD' val2 = 'EFGH' ). result: 4 (all characters have to be replaced) http://de.wikipedia.org/wiki/Levenshtein-Distanz
  • 18. Cadaxo gmbh, founded in 2009, set out to simplify the SAP working environment with small add-ons. SQL Cockpit 2.0 – the most efficient Analysis add on for SAP environments, business users, software developers and support alike. SQL Cockpit enable quick and flexible data retrievel (without report development and without transports) directly in the SAP productive system. http://www.cadaxo.com/content/en/products/sql-cockpit.html http://com.slideshare.net/cadaxogmbh http://www.youtube.com/CadaxoGmbH http://www.linkedin.com/company/cadaxo-gmbh https://twitter.com/cadaxo
  • 19. The multiplication or the translation of this document or sections out of it is without the expressively authorisation of Cadaxo GmbH prohibited. SAP®, ABAP™, R/3®, SAP NetWeaver® are brands or registered brands of the SAP AG. All other products are brands or registered brands of the particular company. © 2013 Cadaxo GesmbH. All rights reserved.