Posts

SUBROUTINES

Image
Module Objectives Define and call subroutines Define and use parameters Define global and local data Defining and Calling Subroutines  Defining a Subroutine: FORM subroutine USING lp1 lp2. ... ... ENDFORM. Calling a Subroutine: PERFORM subroutine USING f1 f2. Using Parameters to Pass Data CHANGING  Pass By Value & Result USING Pass By Reference   Pass By Value  TABLES   Pass By Reference  Parameters Example parameter  

ABAP UNIT

Image
Module Objectives Purpose of ABAP Unit Creating Unit Tests Fixture Methods ABAP Unit Test Class Wizard ABAP Unit Test Classes in ADT Purpose of ABAP Unit ABAP Unit is part of the test landscape for ABAP programs. ABAP Unit lets you implement unit tests. ABAP unit tests are methods of specially designated ABAP classes. Test methods work as scripts, with which code under test can be run, and with which the results of a test can be evaluated. ABAP unit lets you test the code at unit level, independent of the entire solution. Creating Unit Tests ABAP unit tests are implemented in the form of test methods in local test classes in any ABAP programs. The expected results are checked with static methods of help class CL_ABAP_UNIT_ASSERT or CL_AUNIT_ASSERT . Unit test Test Properties Risk Level Harmless – the test does not affect any existing processes and/or Database data. Dangerous– the test will change Database or Persistent Data Critical – the test will affect customizing data Duration Sh...

OOP

Image
OOP Understand the details of object-oriented syntax elements in ABAP Objects and use these effectively Create object-oriented models of business applications Use the tools in the ADT 2.70 to develop object-oriented applications what problems we were having in Procedural programming. Long code due to variable declaration Extensive processing after SQL statement Multiple Commands to perform simple operations Code reusability and Maintenance SAP’s solution In-line declaration SQL Expressions ABAP Expressions OOP Advantages of OOP over Procedural programming Improved software structure and consistency in the development process Reduced maintenance efforts and less susceptibility to errors Better integration of the customer/user into the analysis, design, and maintenance process Easier and safer possibilities for extending the software OOP in ABAP Essentially the same as those of other modern object-oriented languages like C++ or Java Some elements present in ABAP objects are not offered i...

BASIC ALV

Image
BASIC ALV •Define and describe ALV •Discuss and use the standard function module ‘REUSE_ALV_GRID_DISPLAY’ in ABAP program •ALV Navigation Define and Describe ALV The ALV (ABAP List Viewer) is a flexible tool for displaying lists in SAP. The tool provides common list operations as generic functions and can be enhanced by user-defined options. This allows you to use the ALV grid control in a wide range of application programs. For this module, the simplest way to use ALV will be discussed. Advanced topics in ALV may be discussed in the later part of the Training. Sample ALV Output Sample ALV output The ALV Field Catalog The field catalog is an internal table which contains information about the fields to be displayed on the ALV. The type is SLIS_T_FIELDCAT_ALV. We must first build the field catalog before displaying any output in the ALV. There are many fields in the field catalog but for a simple output, the only necessary fields are FIELDNAME and SELTEXT_L. Using the FM ‘REUSE_ALV_GRID...

FUNCTION MODULES

Image
FUNCTION MODULES Module Objectives Define Function Modules Define Function Groups Describe Function module Parameters Explain Exception Processing Define global data / local memory Use Remote Function Call (RFC) Search the Function Library Introduction to Function Modules •Function modules are procedures that are defined in special ABAP programs, so-called function groups, that can be called by all ABAP programs. •Function groups act as containers for function modules that logically belong together. •Function modules also play an important role during updating and in the interaction between different SAP systems, or between SAP systems and remote systems through remote communications. function module Navigating to Function Modules (SE37) Navigating to function Modules Navigating to Function Modules (ADT) Navigation to function Modules Function Groups Function Groups function groups Calling a Function Module Calling a function module Parameters Parameters Exception Processing Exceptions...

ABAP TRANSACTION CODE AND EVENTS

Image
Module Objectives •Create transaction codes to load custom programs •Utilize ABAP Events to manage program processing Creating a Custom Transaction Code Creating a Custom Transaction Code we will click on ABAP Repository object and search for Transaction and write the object name. Creating A transaction Code  we will enter the transaction code and select the Start object type and enter the transection text and program name ABAP Events Events are declared through the event keyword Events are triggered when the program encounters a particular scenario (i.e. program is loaded, execution after selection screen, etc.) Events are terminated when any of these scenarios are met           -Declaration of another event           -Declaration of a subroutine or local method           -End of source code ABAP Event Keywords ABAP Events ABAP Events LOAD-OF-PROGRAM •Occurs prior to the loading of the selection screen •Inf...

SAP ERP ABAP DEBUGGING

Image
Module Objectives •Define debugging •Describe branching to debugging mode •Define key debugging concepts and functions •Explain the debugging mode •Describe examining/changing variables •Debugging in ADT •Identify breakpoints and watchpoints •Debug internal tables What is Debugging? •Tool used to identify and eliminate errors in ABAP programs •Allows the verification of program logic in a step-by-step manner by examining the results of individual statements Branching to Debugging Mode ABAP Debugging Key Debugging Concepts •Debugger modes •Examining the value of variables •Changing the value of variables •Setting breakpoints •Setting watchpoints •Viewing contents of internal tables Classic Debugging Display Below is the screen shot of how the debugger looks like. Classic Debugging Display Important Debugging Functions Single Step   -Processes the next program line Execute        -Allows the change of data contents during debugging Continue      -Pr...