SlideShare una empresa de Scribd logo
1 de 22
Lecture 5 Assigning Values, Calculations, Conversions, Control Statements, Debugging BCO5647 Applications Programming Techniques (ABAP)
Readings & Objectives ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Input Parameters ,[object Object]
Input Parameters ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Input Parameters
Changing variables: copy & initialisation ,[object Object],[object Object],[object Object]
Changing variables :  Initialisation ,[object Object],[object Object],[object Object]
Calculations
Calculations
Conversion Rules:  E lementary Types
Calculations with dates N N N
Control Statements ,[object Object],[object Object],[object Object]
Logical Expressions
Conditions: If / ElseIf ,[object Object],[object Object]
Logical Expressions & Operators IF statements may be joined using the  AND, OR or NOT operators. Logical expressions may use the following comparative operators : eq = ne <> >< gt > ge >= lt < le <= between co, ca, cs, cp (string comparisons) Examples.
Evaluating Field Contents: C ase/EndCase  Vs If/Endif
Loops :  Do/EndDo ,[object Object],[object Object],[object Object],[object Object],[object Object]
Loops :  While/EndWhile ,[object Object],[object Object],[object Object],[object Object]
Other control commands ,[object Object],[object Object],[object Object],[object Object]
Debugging a program ,[object Object],[object Object],[object Object],[object Object],[object Object]
Debugging Mode
Breakpoints in Debugging Mode

Más contenido relacionado

La actualidad más candente

S torage class in C
S torage class in CS torage class in C
S torage class in C
kash95
 

La actualidad más candente (19)

Chap 6(decision making-looping)
Chap 6(decision making-looping)Chap 6(decision making-looping)
Chap 6(decision making-looping)
 
Lab4 (pfl) 20_mdele136(ausaf)
Lab4 (pfl) 20_mdele136(ausaf)Lab4 (pfl) 20_mdele136(ausaf)
Lab4 (pfl) 20_mdele136(ausaf)
 
Flow of control ppt
Flow of control pptFlow of control ppt
Flow of control ppt
 
Looping Statement And Flow Chart
 Looping Statement And Flow Chart Looping Statement And Flow Chart
Looping Statement And Flow Chart
 
Types of loops in c language
Types of loops in c languageTypes of loops in c language
Types of loops in c language
 
Loops c++
Loops c++Loops c++
Loops c++
 
Looping statements
Looping statementsLooping statements
Looping statements
 
C++ loop
C++ loop C++ loop
C++ loop
 
Comp ppt (1)
Comp ppt (1)Comp ppt (1)
Comp ppt (1)
 
C++ chapter 4
C++ chapter 4C++ chapter 4
C++ chapter 4
 
Loops in c language
Loops in c languageLoops in c language
Loops in c language
 
Lab5 (pfl) 20_mdele136(ausaf)
Lab5 (pfl) 20_mdele136(ausaf)Lab5 (pfl) 20_mdele136(ausaf)
Lab5 (pfl) 20_mdele136(ausaf)
 
Understand Decision structures in c++ (cplusplus)
Understand Decision structures in c++ (cplusplus)Understand Decision structures in c++ (cplusplus)
Understand Decision structures in c++ (cplusplus)
 
lazy evaluation
lazy evaluationlazy evaluation
lazy evaluation
 
Notes: Verilog Part 5 - Tasks and Functions
Notes: Verilog Part 5 - Tasks and FunctionsNotes: Verilog Part 5 - Tasks and Functions
Notes: Verilog Part 5 - Tasks and Functions
 
S torage class in C
S torage class in CS torage class in C
S torage class in C
 
While loop
While loopWhile loop
While loop
 
Cd2 [autosaved]
Cd2 [autosaved]Cd2 [autosaved]
Cd2 [autosaved]
 
Cmis 212 module 2 assignment
Cmis 212 module 2 assignmentCmis 212 module 2 assignment
Cmis 212 module 2 assignment
 

Destacado

Lecture06 abap on line
Lecture06 abap on lineLecture06 abap on line
Lecture06 abap on line
Milind Patil
 
0100 welcome
0100 welcome0100 welcome
0100 welcome
vkyecc1
 
Lecture08 abap on line
Lecture08 abap on lineLecture08 abap on line
Lecture08 abap on line
Milind Patil
 
Lecture09 abap on line
Lecture09 abap on lineLecture09 abap on line
Lecture09 abap on line
Milind Patil
 
Lecture12 abap on line
Lecture12 abap on lineLecture12 abap on line
Lecture12 abap on line
Milind Patil
 
Lecture16 abap on line
Lecture16 abap on lineLecture16 abap on line
Lecture16 abap on line
Milind Patil
 
Lecture04 abap on line
Lecture04 abap on lineLecture04 abap on line
Lecture04 abap on line
Milind Patil
 
Lecture13 abap on line
Lecture13 abap on lineLecture13 abap on line
Lecture13 abap on line
Milind Patil
 
Lecture14 abap on line
Lecture14 abap on lineLecture14 abap on line
Lecture14 abap on line
Milind Patil
 
Chapter 04 sap script - output program
Chapter 04 sap script - output programChapter 04 sap script - output program
Chapter 04 sap script - output program
Kranthi Kumar
 
Abap slide lockenqueuedataclustersauthchecks
Abap slide lockenqueuedataclustersauthchecksAbap slide lockenqueuedataclustersauthchecks
Abap slide lockenqueuedataclustersauthchecks
Milind Patil
 
Abap slide exceptionshandling
Abap slide exceptionshandlingAbap slide exceptionshandling
Abap slide exceptionshandling
Milind Patil
 
0103 navigation
0103 navigation0103 navigation
0103 navigation
vkyecc1
 
Abap slide lock Enqueue data clusters auth checks
Abap slide lock Enqueue data clusters auth checksAbap slide lock Enqueue data clusters auth checks
Abap slide lock Enqueue data clusters auth checks
Milind Patil
 
0106 debugging
0106 debugging0106 debugging
0106 debugging
vkyecc1
 
Lecture11 abap on line
Lecture11 abap on lineLecture11 abap on line
Lecture11 abap on line
Milind Patil
 
Abap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfilesAbap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfiles
Milind Patil
 

Destacado (20)

Lecture06 abap on line
Lecture06 abap on lineLecture06 abap on line
Lecture06 abap on line
 
0100 welcome
0100 welcome0100 welcome
0100 welcome
 
Lecture08 abap on line
Lecture08 abap on lineLecture08 abap on line
Lecture08 abap on line
 
Lecture09 abap on line
Lecture09 abap on lineLecture09 abap on line
Lecture09 abap on line
 
control techniques
control techniquescontrol techniques
control techniques
 
Lecture12 abap on line
Lecture12 abap on lineLecture12 abap on line
Lecture12 abap on line
 
Lecture16 abap on line
Lecture16 abap on lineLecture16 abap on line
Lecture16 abap on line
 
Lecture04 abap on line
Lecture04 abap on lineLecture04 abap on line
Lecture04 abap on line
 
Lecture13 abap on line
Lecture13 abap on lineLecture13 abap on line
Lecture13 abap on line
 
Lecture14 abap on line
Lecture14 abap on lineLecture14 abap on line
Lecture14 abap on line
 
Chapter 04 sap script - output program
Chapter 04 sap script - output programChapter 04 sap script - output program
Chapter 04 sap script - output program
 
Abap slide lockenqueuedataclustersauthchecks
Abap slide lockenqueuedataclustersauthchecksAbap slide lockenqueuedataclustersauthchecks
Abap slide lockenqueuedataclustersauthchecks
 
Abap slide exceptionshandling
Abap slide exceptionshandlingAbap slide exceptionshandling
Abap slide exceptionshandling
 
0103 navigation
0103 navigation0103 navigation
0103 navigation
 
Abap slide class3
Abap slide class3Abap slide class3
Abap slide class3
 
Abap slide lock Enqueue data clusters auth checks
Abap slide lock Enqueue data clusters auth checksAbap slide lock Enqueue data clusters auth checks
Abap slide lock Enqueue data clusters auth checks
 
Abap slides set1
Abap slides set1Abap slides set1
Abap slides set1
 
0106 debugging
0106 debugging0106 debugging
0106 debugging
 
Lecture11 abap on line
Lecture11 abap on lineLecture11 abap on line
Lecture11 abap on line
 
Abap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfilesAbap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfiles
 

Similar a Lecture05 abap on line

[C++][a] tutorial 2
[C++][a] tutorial 2[C++][a] tutorial 2
[C++][a] tutorial 2
yasir_cesc
 
detail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdfdetail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdf
ssuserf86fba
 

Similar a Lecture05 abap on line (20)

Control Structures in C
Control Structures in CControl Structures in C
Control Structures in C
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Pl sql programme
Pl sql programmePl sql programme
Pl sql programme
 
Pl sql programme
Pl sql programmePl sql programme
Pl sql programme
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
[C++][a] tutorial 2
[C++][a] tutorial 2[C++][a] tutorial 2
[C++][a] tutorial 2
 
detail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdfdetail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdf
 
Algorithm Flowchart Manual ALGORITHM FLOWCHART MANUAL For STUDENTS
Algorithm   Flowchart Manual ALGORITHM   FLOWCHART MANUAL For STUDENTSAlgorithm   Flowchart Manual ALGORITHM   FLOWCHART MANUAL For STUDENTS
Algorithm Flowchart Manual ALGORITHM FLOWCHART MANUAL For STUDENTS
 
Algorithm manual
Algorithm manualAlgorithm manual
Algorithm manual
 
Programming-in-C
Programming-in-CProgramming-in-C
Programming-in-C
 
Programming in Arduino (Part 2)
Programming in Arduino  (Part 2)Programming in Arduino  (Part 2)
Programming in Arduino (Part 2)
 
Ch05
Ch05Ch05
Ch05
 
Verilog Lecture2 thhts
Verilog Lecture2 thhtsVerilog Lecture2 thhts
Verilog Lecture2 thhts
 
Presentation 2
Presentation 2Presentation 2
Presentation 2
 
C Programming Unit-2
C Programming Unit-2C Programming Unit-2
C Programming Unit-2
 
Programming Fundamentals lecture 7
Programming Fundamentals lecture 7Programming Fundamentals lecture 7
Programming Fundamentals lecture 7
 
C programming(Part 1)
C programming(Part 1)C programming(Part 1)
C programming(Part 1)
 
Control Structures.pptx
Control Structures.pptxControl Structures.pptx
Control Structures.pptx
 
3. control statements
3. control statements3. control statements
3. control statements
 
Lect 3-4 Zaheer Abbas
Lect 3-4 Zaheer AbbasLect 3-4 Zaheer Abbas
Lect 3-4 Zaheer Abbas
 

Más de Milind Patil

Step by step abap_input help or lov
Step by step abap_input help or lovStep by step abap_input help or lov
Step by step abap_input help or lov
Milind Patil
 
Step bystep abap_fieldhelpordocumentation
Step bystep abap_fieldhelpordocumentationStep bystep abap_fieldhelpordocumentation
Step bystep abap_fieldhelpordocumentation
Milind Patil
 
Step bystep abap_field help or documentation
Step bystep abap_field help or documentationStep bystep abap_field help or documentation
Step bystep abap_field help or documentation
Milind Patil
 
Abap slides user defined data types and data
Abap slides user defined data types and dataAbap slides user defined data types and data
Abap slides user defined data types and data
Milind Patil
 
Step bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordStep bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecord
Milind Patil
 
Step bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordStep bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecord
Milind Patil
 
Lecture10 abap on line
Lecture10 abap on lineLecture10 abap on line
Lecture10 abap on line
Milind Patil
 
Lecture07 abap on line
Lecture07 abap on lineLecture07 abap on line
Lecture07 abap on line
Milind Patil
 
Lecture03 abap on line
Lecture03 abap on lineLecture03 abap on line
Lecture03 abap on line
Milind Patil
 
Lecture02 abap on line
Lecture02 abap on lineLecture02 abap on line
Lecture02 abap on line
Milind Patil
 
Lecture01 abap on line
Lecture01 abap on lineLecture01 abap on line
Lecture01 abap on line
Milind Patil
 
Lecture15 abap on line
Lecture15 abap on lineLecture15 abap on line
Lecture15 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
 

Más de Milind Patil (15)

Step by step abap_input help or lov
Step by step abap_input help or lovStep by step abap_input help or lov
Step by step abap_input help or lov
 
Step bystep abap_fieldhelpordocumentation
Step bystep abap_fieldhelpordocumentationStep bystep abap_fieldhelpordocumentation
Step bystep abap_fieldhelpordocumentation
 
Step bystep abap_field help or documentation
Step bystep abap_field help or documentationStep bystep abap_field help or documentation
Step bystep abap_field help or documentation
 
Abap slides user defined data types and data
Abap slides user defined data types and dataAbap slides user defined data types and data
Abap slides user defined data types and data
 
Step bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordStep bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecord
 
Step bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordStep bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecord
 
Abap reports
Abap reportsAbap reports
Abap reports
 
Lecture10 abap on line
Lecture10 abap on lineLecture10 abap on line
Lecture10 abap on line
 
Lecture07 abap on line
Lecture07 abap on lineLecture07 abap on line
Lecture07 abap on line
 
Lecture03 abap on line
Lecture03 abap on lineLecture03 abap on line
Lecture03 abap on line
 
Lecture02 abap on line
Lecture02 abap on lineLecture02 abap on line
Lecture02 abap on line
 
Lecture01 abap on line
Lecture01 abap on lineLecture01 abap on line
Lecture01 abap on line
 
Lecture15 abap on line
Lecture15 abap on lineLecture15 abap on line
Lecture15 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
 

Último

Último (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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 Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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...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...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Lecture05 abap on line

Notas del editor

  1. Input Parameters A Parameter is a special type of variable. It requires the value of the variable to be input from a selection screen. Parameters are defined using the parameters statement. Parameter names can be no more than 8 characters. Why is ABC on the selection screen? (It has been set as the default of PAR2) What will be printed as a result of the write statement? (whatever values the user has input) How can the appearance of the screen be improved? ==&gt; use meaningful labels. HOW? ==&gt; assign the attributes of a table field to the parameter. HOW WILL THIS IMPROVE THE SCREEN? ==&gt; The data element of the table field will give the parameter a label and F1 help, also if a check table is involved it will ensure data integrity of input.
  2. Input Parameters parameters: carr like spfli-carrid default ‘LH’. What is the effect of the “like” clause? &gt;&gt; carr is assigned the same field attributes as spfli-carrid - field type and length (CHAR &amp; 3 from domain) - label (from data element - note extra steps required to assign DD field label to parameter - steps outlined in workshop ex. ) - F1 help (from data element) - if check table used in spfli-carrid then a n icon appears at the end of the parameter’s input field - if you click, a list of valid values for the field is displayed
  3. What is a CONSTANT? Note: Type s_carr_id reference has been made to the Data Element so that the variable is assigned the DD object attribute (type &amp; length). Each elementary field comes as standard with an initial value appropriate to its type. You can set an start value for an elementary field yourself using the VALUE addition. After VALUES you may only specify a fixed data object. If you want to copy the field contents of variable var1 to a second variable var2 , you can choose one of two syntax variants: MOVE var1 TO var2. var2 = var1. If the two data objects have different types, the type is automatically converted if there is a conversion rule. You can find detailed information about copying and about the conversion rules in the keyword documentation for MOVE The CLEAR statement resets the field contents of a variable to the initial value for the particular type. You can find detailed information about the initial values for a particular type in the keyword documentation about CLEAR .
  4. Assignment statements: clear What is the result of the write statement? a1 bb where b is a blank a2 0 a3 0 a4 000 a5 00000000 a6 000000 g1-a1 XXX g1-a2 0
  5. Note: TYPE statement in slide example references a STRUCTURE called SBC400FOCC and defined in the Data Dictionary. (Emerald does not have SBC400FOCC but has structure YCHSTRUK_SFLIGHT ) You can precede calculations with the COMPUTE statement. This statement is optional.
  6. Calculations COMPUTE is optional See online documentation for COMPUTE for further explanation of functions and DIV &amp; MOD. Note the brackets have spaces except the first when used with a function. What is unusual about the compute lines for SUM, RESULT, ROOT? ==&gt; use of a data field type c What has happened? ==&gt; ABAP/4 automatically carries out a conversion based on a set of conversion rules.
  7. Conversion Rules: Elementary Types Conversion rules exits for all combinations of elementary types. A comprehensive overview of conversion rules is contained on the online documentation for the DATA statement. Type c fields are saved left justified. When you convert to type c fields, the field is filled up with blanks if it is too short, and truncated if it is too long. See example 1 &amp; 2 above When you convert a type c field to a type p field, only digits, a plus or minus sign and a decimal point are permitted. (see example 3 above) When you convert a type p field to a type c field, the leading zeros are converted to spaces. (see example 4 above)
  8. Calculations with dates What is the result of the program above? today’s day = no of days e.g. 19990113 as sy-datum then DIFF = 13 Why not just display DATEREC-DAY as answer? Program illustrates how dates can be used in calculations. For example, How would you work out the number of days in the current month? Or the number of days from a particular date until today?
  9. Other control commands : LOOP ….. ENDLOOP for reading internal tables. AT ….. ENDAT for control level processing within a LOOP statement. Covered later?
  10. Logical expressions can be linked with NOT, AND, and OR. You can nest parenthetical expressions as deeply as you want. The parentheses which denote sub-expressions always count as one word. They must therefore be separated by spaces. If you compare two type C fields with unequal length, the shorter field is lengthened to match the length of the longer one when the comparison is made. It is filled from the right-hand end with spaces.
  11. The ELSE and ELSEIF statements are optional. Examples : i) if value1 = 22. add 25 to value1. endif. ii) if value1 = 22. add 25 to value1. else. write value1. endif. iii) if w_year1 &gt; w_year2. write ‘Year1’. elseif w_year1 &lt; w_year2. write ‘Year2’. else. write ‘Equal’. endif.
  12. co - contains only &lt;f1&gt; co &lt;f2&gt; (case sensitive) is true if &lt;f1&gt; contains only chars from &lt;f2&gt;. ‘ BD___’ co ‘ABCD_’ True ‘ BD___’ co ‘ABCDE’ False ca - contains any &lt;f1&gt; ca &lt;f2&gt; (case sensitive) is true if &lt;f1&gt; contains at least one char from &lt;f2&gt;. ‘ ABcde’ ca ‘Bd___’ True ‘ ABcde’ ca ‘bD___’ False cs - contains string &lt;f1&gt; cs &lt;f2&gt; (not-case sensitive) is true if &lt;f1&gt; contains the char string in (trailing spaces ignored) &lt;f2&gt;. ‘ ABcde’ cs ‘bC___’ True ‘ ABcde’ cs ‘ce____’ False cp - contains pattern &lt;f1&gt; cp &lt;f2&gt; (not-case sensitive) is true if &lt;f1&gt; contains the pattern in &lt;f2&gt;. (* any char, + single char) ‘ABcde’ cp ‘*b*’ True
  13. IF and CASE statements allow you to make case distinctions: CASE ... ENDCASE: Only one of the sequences of statements is executed. The WHEN OTHERS statement is optional. IF ... ENDIF: The logical expressions that are supported are described in the documentation about IF . The ELSE and ELSEIF statements are optional. If the logical expression is fulfilled, the following sequence of statements is executed. If the logical expression is not fulfilled, the ELSE or ELSEIF section is processed. If there is no ELSE or no further ELSEIF statement, the program continues after the ENDIF statement. You can include any number of ELSEIF statements between IF and ENDIF . A maximum of one of the sequences of statements will be executed. data: w_year type i. w_year = 1997. case w_year. when 1996. write ‘The year is 1996’. when 1997. write ‘The year is 1997’. when 1998. write ‘The year is 1998.’ when others. write ‘The year is undefined.’ endcase.
  14. Examples : i) data n type i, square type i, count type i. n = 100. count = 0. do n times. count = count + 1. square = count ** 2. write square. enddo. ii) n = 100. do n times. square = sy-index ** 2. write square. enddo.
  15. Example : A binary search. min = 0. max = 1000. while key &lt;&gt; search_key. key = ( min + max ) div 2. (integer division) if key &gt; search_key. max = key - 1. else. min = key + 1. endif. endwhile.
  16. Examples : do 4 times. If sy-index = 2. Continue. Endif. Write sy-index. Enddo. This produces the following output: 1 3 4 The system terminates the second loop pass without processing the write statement. do 4 times. Check sy-index between 2 and 3. Write sy-index. Enddo. This produces the following output: 2 3 The system terminates the first and fourth loop pass without processing the write statement because sy-index does not fall between 2 and 3. do 4 times. If sy-index = 3. exit. Endif. Write sy-index. Enddo. This produces the following output: 1 2 The system terminates the entire loop processing in the thirdloop pass without processing the write statement or the fourth loop pass.
  17. Debugging can be invoked by : Start a program by calling the Debugging function from the ABAP Editor initial screen. Enter /h in the command field, press ENTER and choose Execute. From the Object Browser access debugging mode by right-clicking program name and selecting: Execute &gt;&gt; Debugging. When in debugging mode, the program lines appear in the upper half of the screen with the contents of the fields in the lower half. Breakpoints can be line-oriented, field-oriented (watchpoint) or command oriented.
  18. Starting the program in the debugging mode allows you to execute the program line by line using the &apos;Single Step&apos; icon. You can display up to eight variables. To trace the variable values, enter the field names in the left input field. You can also see this entry by double-clicking on the field name in the code displayed.
  19. You can set a breakpoint by double-clicking in front of a line of source code in the debugging mode. If you then click on the &apos;Continue&apos; icon, the program will be executed up to the point where the next breakpoint is defined. You can find information on content-related breakpoints in the ABAP Statements and Data Declarations unit.