Blog

  • ABAP Report Events: Selection Screen Events

    Preface – This post is part of the ABAP Beginner series.

    In this article, we have discussed a type of ABAP Report Events i.e. Selection Screen Events. To learn all about ABAP Report Events click here.

    Introduction

    In ABAP Report Events after ABAP Reporting Events of ABAP, we have Selection Screen Events which occur in a predefined manner. These events are called in similar a way of Dynpro sequence (PBO and PAI). These events are processed during selection screen processing.

    In simple words, selection screen events are the events that are called after a selection screen block is opened and it is used to manipulate the selection screen block based on user interaction at runtime.

    Basic Dynpro Events

    Before we discuss Selection screen events, let us learn basic Dynpro events first:

    PBO: Process Before Output

    This event is triggered before a screen is sent to presentation layer (output screen).

    PAI: Process After Input

    This event is triggered by a user action on ABAP GUI.

    POH: Process On Help Request

    This event is triggered when F1 (Field Help) of an input field on the screen is requested.

    POV: Process On Value Request

    This event is triggered when F4 (Input Help) of an input field on the screen is requested.

    Types of Selection Screen Events

    Following are the types of Selection Screen Events:

    Event

    Description

    ·         AT SELECTION-SCREEN OUTPUT ·         It is raised by PBO event. Thus anything that needs to be changed dynamically on screen uses this event.

    ·         This event is also useful in case we need to initialize something every time the selection screen code of a program is called because INITIALIZATION is loaded only once but AT SELECTION-SCREEN OUTPUT is loaded every time.

    ·         MODIFY SCREEN can be used to manipulate screens during AT SELECTION-SCREEN OUTPUT event.

    ·         AT SELECTION-SCREEN ON { Parameter | Selection Criteria } ·         It is raised by PAI event. This event is triggered if content of Parameter or Selection Criteria is passed to ABAP program.

    ·         A selection criterion (selection table) is generated using SELECT-OPTIONS. And for each line of selection table, different calls are made to AT SELECTION-SCREEN ON {Parameter | Selection Criteria} is made.

    ·         If a warning or an error message is raised, the input parameters of this event blocks become ready for input again.

    AT SELECTION-SCREEN ON END OF selcrit ·         Unlike above event, call to this event is made with entire selection table.

    ·         It is mainly used to mark the end of Selection Screen event calls.

    AT SELECTION-SCREEN ON BLOCK block ·         It is raised by PAI event. This event is triggered when all the inputs of a block is passed to the ABAP program.

    ·         If a warning or an error message is raised, the input parameters of this event blocks become ready for input again.

    AT SELECTION-SCREEN ON RADIOBUTTON GROUP group ·         It is raised by PAI event. This event is triggered when all the inputs of a block is passed to the ABAP program.

    ·         If a warning or an error message is raised, the input parameters of this event blocks become ready for input again.

    AT SELECTION-SCREEN ·         This is the last event raised in selection screen processing

    ·         All input values are passed to this event; hence we can perform all types of validations here.

    ·         If a warning or an error message is raised, the input parameters of this event blocks become ready for input again.

    AT SELECTION-SCREEN ON HELP-REQUEST|VALUE-REQUEST FOR {para|selcrit-low|selcrit-high} } ·         This event is triggered on F1 or F4 Help request from screen.

    ·         It is raised by POH and POV event.

    AT SELECTION-SCREEN ON EXIT-COMMAND ·         This event is triggered if any of the following actions are called on the screen: Back, Exit, or Cancel.

    ·         Any cleanup activities can be taken care here.

     

    Examples

    AT SELECTION-SCREEN OUTPUT

    In given example, if in Parameter ‘EXIT’ is passed, then the whole screen is hidden.

    PARAMETERS: EXIT (10) TYPE c.

    AT SELECTION-SCREEN OUTPUT.

    LOOP AT SCREEN INTO DATA (wa_screen).

    IF wa_screen -name = ‘ EXIT ‘.

    wa-invisible = ‘1’.

    MODIFY screen FROM wa_screen.

    ENDIF.

    ENDLOOP.

    *** Note: We will update examples for other events very soon.

  • ABAP Report Events: Reporting Events

    Preface – This post is part of the ABAP Beginner series.

    In this article, we have discussed a type of ABAP Report Events i.e. Reporting Events. To learn all about ABAP Report Events click here.

    Introduction

    In ABAP Report Events after Program Constructor Event of ABAP, we have ABAP Reporting Events which occur in a predefined manner. These events are called in a predefined sequence (as mentioned later in this post). These events are only called in Executable reports.

    Types of Reporting Events

    Following are the types of Reporting Events:

    Event Description Status
    INITIALIZATION This event is called just after LOAD-OF-PROGRAM and used to fix default values and initialize fields
    START-OF-SELECTION This event is called after the Standard Screens are once processed and is used to write all the functional statements
    GET node These are used in reports associated with only logical database and are used to read events of logical database Obsolete
    END-OF-SELECTION These are used in reports associated with only logical database and is raised when:

    • When logical database has completed its work

    • Just after START-OF-SELECTION

    Obsolete

     

    INITIALIZATION

    As discussed above, this event is called just after LOAD-OF-PROGRAM and before any selection screen events; and it is used to fix default values and initialize fields.

    Example

    PARAMETERS:  p_lan TYPE string.

    INITIALIZATION.

    p_lan = sy-langu.

    ***Note: In case a standard selection screen is there, multiple calls are made to the same program based upon user input and interaction. INITIALIZATION is ignored after the first call to the program and in this case to initialize the selection screen explicitly for each call we will have to use the event AT SELECTION-SCREEN OUTPUT.

    START-OF-SELECTION

    As discussed above, this event is called after the Standard Screens are once processed and it is used to write all the functional statements. By functional statements we mean the actual code/ business logic.

    Example

    REPORT ztest_report.

    DATA:  text TYPE string.

    START-OF-SELECTION.

    text = ‘Hello World!’.

    Write: text.

    *** Note: If I will not write START-OF-SELECTION in above program, still the program will construct a block of START-OF-SELECTION implicitly just before the actual code. Thus we can skip writing START-OF-SELECTION, but it is a good practise to use it as it

  • ABAP Report Events: List events

    Preface – This post is part of the ABAP Beginner series.

    In this article, we have discussed a type of ABAP Report Events i.e. List events. To learn all about ABAP Report Events click here.

    Introduction

    In ABAP Report List means ABAP table. Using List events we can manipulate or perform actions on a list. Interactive report uses list events to interact with a table output.

    Types of List events

    Following are the types of List events:

    Event

    Description

    TOP-OF-PAGE

    [DURING LINE-SELECTION]
    It is used to write constants in the header of a page. The header remains fixed against scrolling.

    If used without [DURING LINE-SELECTION], TOP-OF-PAGE is triggered as soon the list is created else it loads during particular line selection.

    END-OF-PAGE It is used to write constants in the header of a page. It appears at the end of a page and is generally used to print page number.

    It only works in case of LINE-COUNT is defined (will be explained via example).

    AT LINE-SELECTION It is triggered whenever a line of a list is double clicked. The main purpose of this event is in Interactive report where on click of a line item creates details lists.
    AT USER-COMMAND It is triggered whenever a custom button is clicked on UI.
    AT PF It is triggered whenever a function key is pressed on a keyboard.
    SET USER-COMMAND It can be used to auto trigger a button key by setting an fcode to the USER-COMMAND. These fcodes are predefined and you can find them here.

     

    Examples

    *** Note: We will update examples for all the events very soon.

     

  • Interactive Report in SAP ABAP

    Preface – This post is part of the ABAP Beginner series.

    Interactive Report in SAP ABAP is a report where user can interact with the output page of report. They can click on an item of a list to get its details. For example, On first page you have been provided basic details of employees and on click of  a line item i.e. Employee ID, you are navigated to another page where you can see the employee Annual Salary. If you still want to know further, you again clicked on Employee ID here and now you are navigated to third page where you see employee’s salary structure. These all things are possible using Interactive Report in SAP ABAP.

    Introduction

    An Interactive Report uses a basic list [list number 0] to show basic information and uses secondary list [1 to 20] to show detailed information. Thus, there are total 21 lists. We use SY-LSIND [System Variable] to get the index number of the list.

    Events in ABAP

    Before, we learn about events of Interactive report, it is advisable to learn all the ABAP events, because it is common across all the programs. ABAP is an event driven Programming language. ABAP Report Events are used to handle different kinds of events during runtime. It starts with the event name, followed by the programming codes belonging to that event.

    It is advisable to use Comment line to declare the end of an event, since Events do not have a closing Keyword and it ends as soon any other Event starts.

    There are different kinds of events in ABAP, SAP has categorized these events together.

    Categories of Events in ABAP:

    There are four categories of Events in ABAP. Among them List Events are the one that helps us to make Interactive Reports:

     

    Event Category

     

    Explanation

     

    Events in the Category

     

    Program Constructor Events

     

    Except Pool programs it occurs in every programs.

     

    LOAD-OF-PROGRAM

     

    Reporting Events

     

    These events occur only in Executable Reports.

     

    INITIALIZATION

    START-OF-SELECTION

    END-OF-SELECTION (obsolete)

     

    Selection Screen Events

     

    These events occur during Selection Screen Processing

     

    AT SELECTION-SCREEN OUTPUT

    AT SELECTION-SCREEN

     

    List Events

     

    These events occur during Classical List Processing [List can be a table or consecutive Write statements, etc.]

     

    TOP-OF-PAGE

    END-OF-PAGE

    AT-LINE-SELECTION

    AT USER-COMMAND

    AT PFnn

    SET USER-COMMAND

     

    Events in Classical Report [Used in Interactive Reports too]:

    Classical Reports have following events, these events are common for Interactive Reports:

    • LOAD-OF-PROGRAM : First event fired, loads program in memory
    • INITIALIZATION: Initialize variable
    • START-OF-SELECTION : Actual Business Logic (After START-OF-SELECTION)
    • END-OF-SELECTION : To end above
    • AT SELECTION-SCREEN : To validate Multiple Input fields (After Initialization and before START-OF-SELECTION) (After
    • AT SELECTION-SCREEN OUTPUT: To manipulate Dynamic screen
    • AT SELECTION-SCREEN ON
    • AT SELECTION-SCREEN ON END OF
    • AT SELECTION-SCREEN ON BLOCK
    • AT SELECTION-SCREEN ON RADIOBUTTON GROUP
    • AT SELECTION-SCREEN ON VALUE REQUEST
    • TOP-OF-PAGE : To print heading
    • END-OF-PAGE: To print footer
    Interactive Reports in SAP ABAP
    Events in Interactive Reports in SAP ABAP – Image Illustration

    Events of Interactive Report in SAP ABAP:

    • TOP-OF-PAGE
    • END-OF-PAGE
    • AT-LINE-SELECTION
    • AT USER-COMMAND
    • AT PFnn
    • SET USER-COMMAND

    Note: To know more about these events, click here.

    Example of Interactive Report in SAP ABAP:

    TABLES zBarry_emp.
    TABLES zBarry_sal.
    
    PARAMETERS: ip type char20.
    
    DATA : it_emp1 TYPE TABLE OF zBarry_emp,
           it_emp2 TYPE TABLE OF zBarry_sal,
           wa_emp  TYPE zBarry_emp,
           wa_emp2 TYPE zBarry_sal,
           it_emp3 TYPE TABLE OF zBarry_add,
           wa_emp3 TYPE zBarry_add,
           fnam    TYPE char20,
           fval    TYPE char8,
           fnam1   TYPE char20,
           fval1   TYPE char8..
    set PF-STATUS 'PFSTATUS'.
    SELECT-OPTIONS : p_empid FOR zBarry_emp-empid.
    AT USER-COMMAND.
    
    CASE SY-UCOMM.
    
        WHEN 'MAIN'.
    
         sy-lsind = 1.
         PERFORM display_data.
      ENDCASE.
    
    AT SELECTION-SCREEN.
      PERFORM validate_input.
    
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM display_data.
    
    TOP-OF-PAGE.
      FORMAT COLOR COL_HEADING INVERSE.
      WRITE 'BASIC EMPLOYEE DETAILS'.
    
    TOP-OF-PAGE DURING LINE-SELECTION.
      IF sy-lsind = 1.
        FORMAT COLOR COL_HEADING INVERSE.
        WRITE 'EMPLOYEE SALARY DETAILS'.
      ELSEIF sy-lsind = 2.
    
        FORMAT COLOR COL_HEADING INVERSE.
        WRITE 'EMPLOYEE ADDRESS DETAILS'.
      ENDIF.
    
    AT LINE-SELECTION.
      PERFORM primary_list.
      PERFORM secondary_list.
    
    
    
    
    
    *&---------------------------------------------------------------------*
    *&      Form  VALIDATE_INPUT
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM validate_input . "validating input
      IF p_empid  IS INITIAL.
        MESSAGE 'Please Enter Employee Number' TYPE 'E'. "if the employee id field is left blank
    
      ELSE.
        SELECT empid FROM zBarry_emp INTO TABLE it_emp1 WHERE empid IN p_empid.
        IF sy-subrc <> 0.
          MESSAGE 'Please Enter Correct Employee Number' TYPE 'E'. "if wrong employee id is entered
        ENDIF.
      ENDIF.
    ENDFORM.
    *&---------------------------------------------------------------------*
    *&      Form  GET_DATA
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM get_data . "fetching basic employee details from table
      SELECT * FROM zBarry_emp INTO TABLE it_emp1 WHERE empid IN p_empid.
    ENDFORM.
    *&---------------------------------------------------------------------*
    *&      Form  DISPLAY_DATA
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM display_data . "displaying data
      FORMAT COLOR COL_NEGATIVE INVERSE.
      WRITE:/,3 'Employee ID',
          20 'First NAME',
          35 'Last NAME'.
      SKIP.
      LOOP AT it_emp1 INTO wa_emp.
        FORMAT COLOR COL_POSITIVE INVERSE.
        WRITE : /3 wa_emp-empid,20 wa_emp-emp_fname,35 wa_emp-emp_lname.
      ENDLOOP.
    ENDFORM.
    *&---------------------------------------------------------------------*
    *&      Form  PRIMARY_LIST
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM primary_list . "fetching employee salary details on list 1
      IF sy-lsind = 1.
        GET CURSOR FIELD fnam VALUE fval.
    
        IF fnam =  'WA_EMP-EMPID'. "if employee id is selected
          SELECT * FROM zBarry_sal INTO TABLE it_emp2 WHERE empid = fval .
          FORMAT COLOR COL_NEGATIVE INVERSE.
          WRITE:/,3 'Employee ID',
                   20 'Transaction ID',
                   35 'Month',
                   55 'Date Of Salary'.
          SKIP.
          LOOP AT it_emp2 INTO wa_emp2.
            FORMAT COLOR COL_POSITIVE INVERSE.
    
            WRITE : /3 wa_emp2-empid,20 wa_emp2-tid,35 wa_emp2-mon,55 wa_emp2-dos.
    
          ENDLOOP.
    
        ENDIF.
    
        IF  fnam = 'WA_EMP-EMP_FNAME'. "if employee name is selected
    
          WRITE: / 'name'.
        ENDIF.
      ENDIF.
    ENDFORM.
    *&---------------------------------------------------------------------*
    *&      Form  SECONDARY_LIST
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    FORM secondary_list . "fetching employee address details on list 2
      IF sy-lsind = 2.
        GET CURSOR FIELD fnam1 VALUE fval1.
        IF fnam =  'WA_EMP-EMPID'. "if employee id is selected
          SELECT * FROM zBarry_add INTO TABLE it_emp3 WHERE empid = fval1 .
          FORMAT COLOR COL_NEGATIVE INVERSE.
          WRITE:/,3 'Employee ID',
                   20 'Flat No.',
                   35 'Street Name',
                   55 'City Name'.
          SKIP.
          LOOP AT it_emp3 INTO wa_emp3.
            FORMAT COLOR COL_POSITIVE INVERSE.
            WRITE : /3 wa_emp3-empid,20 wa_emp3-flat_no,35 wa_emp3-street_name,55 wa_emp3-city_name.
          ENDLOOP.
    
        ENDIF.
    
      ENDIF.
    ENDFORM.
    

    Note: To learn more about how this program is functioning, click here.

    Programming Guidelines:

    1. Never use Selection Screen Events in Function Module
    2. Use LOAD-OF-SCREEN to load default values  for the type of Reports executed via SUBMIT or using a transaction code
    3. Use INITIALIZATION to load default values  for the executable type of Reports
    4. It is advised not to specify an event more than once [Except AT-SELECTION-SCREEN & GET event, all other can be specified multiple times.]
    5. If you are not specifying any event name, still specify START-OF-SELECTION to improve readability
    6. After every execution of events NEW-LINE event is executed automatically.
  • Classical Reports in SAP ABAP

    Preface – This post is part of the ABAP Beginner series.

    ABAP is an event driven Programming language. ABAP Report Events are used to handle different kinds of events during runtime. It starts with the event name, followed by the programming codes belonging to that event. Classical reports in SAP ABAP are the reports which contain both selection screens and output screens.

    It is advisable to use Comment line to declare the end of an event, since Events do not have a closing Keyword and it ends as soon any other Event starts.

    There are different kinds of events in ABAP; SAP has categorized these events together.

    Categories of Classical Report Events in SAP ABAP:

    There are four categories of Events in ABAP:

     

    Event Category

     

    Explanation

     

    Events in the Category

     

    Program Constructor Events

     

    Except Pool programs it occurs in every programs.

     

    LOAD-OF-PROGRAM

     

    Reporting Events

     

    These events occur only in Executable Reports.

     

    INITIALIZATION

    START-OF-SELECTION

    END-OF-SELECTION (obsolete)

     

    Selection Screen Events

     

    These events occur during Selection Screen Processing

     

    AT SELECTION-SCREEN OUTPUT

    AT SELECTION-SCREEN

     

    List Events

     

    These events occur during Classical List Processing [List can be a table or consecutive Write statements, etc.]

     

    TOP-OF-PAGE

    END-OF-PAGE

    AT-LINE-SELECTION

    AT USER-COMMAND

    AT PFnn

    SET USER-COMMAND

     

    Events of Classical Reports in SAP ABAP:

    Classical Reports have following events:

    • LOAD-OF-PROGRAM : First event fired, loads program in memory
    • INITIALIZATION: Initialize variable
    • START-OF-SELECTION : Actual Business Logic (After START-OF-SELECTION)
    • END-OF-SELECTION : To end above
    • AT SELECTION-SCREEN : To validate Multiple Input fields (After Initialization and before START-OF-SELECTION) (After
    • AT SELECTION-SCREEN OUTPUT: To manipulate Dynamic screen
    • AT SELECTION-SCREEN ON
    • AT SELECTION-SCREEN ON END OF
    • AT SELECTION-SCREEN ON BLOCK
    • AT SELECTION-SCREEN ON RADIOBUTTON GROUP
    • AT SELECTION-SCREEN ON VALUE REQUEST
    • TOP-OF-PAGE : To print heading
    • END-OF-PAGE: To print footer
    Classical Reports in SAP ABAP
    Classical Reports in SAP ABAP – Image Illustration

    Programming Guidelines:

    1. Never use Selection Screen Events in Function Module
    2. Use LOAD-OF-SCREEN to load default values  for the type of Reports executed via SUBMIT or using a transaction code
    3. Use INITIALIZATION to load default values  for the executable type of Reports
    4. It is advised not to specify an event more than once [Except AT-SELECTION-SCREEN & GET event, all other can be specified multiple times.]
    5. If you are not specifying any event name, still specify START-OF-SELECTION to improve readability
    6. After every execution of events NEW-LINE event is executed automatically.
  • ABAP Report: Executable Program in ABAP

    Preface – This post is part of the ABAP Beginner series.

    ABAP report is an old term for executable program in ABAP and it is a program that can be executed using the SUBMIT statement. This SUBMIT statement is always executed internally as we execute it using F8 user command or via a Transaction code.

    Types of ABAP Report

    A report in ABAP is of two types:

    1. Classical Reports
    2. Interactive Reports

    Both these Reports are event driven. The only thing that divides them is the use of different events.

    Classical Report

    A classical report is a report which contains both selection screens and output screens.

    Events in Classical Report

    Classical Reports have following events:

    • LOAD-OF-PROGRAM : First event fired, loads program in memory
    • INITIALIZATION: Initialize variable
    • START-OF-SELECTION : Actual Business Logic (After START-OF-SELECTION)
    • END-OF-SELECTION : To end above
    • AT SELECTION-SCREEN : To validate Multiple Input fields (After Initialization and before START-OF-SELECTION) (After
    • AT SELECTION-SCREEN OUTPUT: To manipulate Dynamic screen
    • AT SELECTION-SCREEN ON
    • AT SELECTION-SCREEN ON END OF
    • AT SELECTION-SCREEN ON BLOCK
    • AT SELECTION-SCREEN ON RADIOBUTTON GROUP
    • AT SELECTION-SCREEN ON VALUE REQUEST
    • TOP-OF-PAGE : To print heading
    • END-OF-PAGE: To print footer
    Events in Classical Report
    Events in Classical Report – Image Illustration

    Interactive Report

    An interactive report is a report in which the information are shown using basic and secondary lists. An interactive report has total 21 lists including the basic list. The first list is numbered as 0 and other are from 1 to 20.

    To get the current page number, we can use system variable SY-LSIND.

    Events in Interactive Report

    *** Will be updated soon

  • ABAP Report Events

    Preface – This post is part of the ABAP Beginner series.

    ABAP Report Events: Reporting Events

    In ABAP Report Events after Program Constructor Event of ABAP, we have ABAP Reporting Events which occur in a predefined manner. These events are called in a predefined sequence (as mentioned later in this post). These events are only called in Executable reports.

    Following are the types of Reporting Events:

    Event Description Status
    INITIALIZATION This event is called just after LOAD-OF-PROGRAM and used to fix default values and initialize fields
    START-OF-SELECTION This event is called after the Standard Screens are once processed and is used to write all the functional statements
    GET node These are used in reports associated with only logical database and are used to read events of logical database Obsolete
    END-OF-SELECTION These are used in reports associated with only logical database and is raised when:

    ·         When logical database has completed its work

    ·         Just after START-OF-SELECTION

    Obsolete

    INITIALIZATION

    As discussed above, this event is called just after LOAD-OF-PROGRAM and before any selection screen events; and it is used to fix default values and initialize fields.

    Example

    PARAMETERS:  p_lan TYPE string.

    INITIALIZATION.

    p_lan = sy-langu.

    ***Note: In case a standard selection screen is there, multiple calls are made to the same program based upon user input and interaction. INITIALIZATION is ignored after the first call to the program and in this case to initialize the selection screen explicitly for each call we will have to use the event AT SELECTION-SCREEN OUTPUT.

    START-OF-SELECTION

    As discussed above, this event is called after the Standard Screens are once processed and it is used to write all the functional statements. By functional statements we mean the actual code/ business logic.

    Example

    REPORT ztest_report.

    DATA:  text TYPE string.

    START-OF-SELECTION.

    text = ‘Hello World!’.

    Write: text.

    *** Note: If I will not write START-OF-SELECTION in above program, still the program will construct a block of START-OF-SELECTION implicitly just before the actual code. Thus we can skip writing START-OF-SELECTION, but it is a good practise to use it as it makes the code readable.

  • LOAD-OF-PROGRAM: Program Constructor Event

    Preface – This post is part of the ABAP Beginner series.

    Program Constructor Event

    A Program Constructor event in SAP ABAP is used to load global constant value or data of a program. It consist only one Event: LOAD-OF-PROGRAM

    LOAD-OF-PROGRAM

    Load of Program is Just like a Class Constructor or Static Constructor of a Class.

    Now if you don’t know class constructor, then simply understand this thing, A Load of Program loads default values for a session e.g. Language.

    Now you may say, we can load default values using INITIALIZATION, yes you can but it will be executed for every run, while Load of Program is executed once for a session.

    LOAD OF PROGRAM is useful only in case of a report called using SUBMIT or the one that run using a transaction code else it will perform same as INITIALIZATION.

     

    Example of LOAD-OF-PROGRAM:

    LOAD-OF-PROGRAM.
    
    DATA global_langu TYPE sy-langu.
    global_langu = COND #( WHEN sy-langu = 'D' THEN 'German' ELSE 'English' ).

    Explanation:

    The above program have two statements.

    • The first statement is declaring a variable g_langu (A global variable for language) of type sy-langu (it fetches system language that is based on the system location).
    • The second statement is checking a condition, if the system language is D (i.e. German) then assign g_langu as ‘German’ and assign ‘English’ for any other system language.

    Notes:

    • It is the first even executed by SAP ABAP
    • It is used to initialize global default values
    • If in a program, LOAD-OF-PROGRAM is only used for initialization and there is no executable lines after that, then LOAD-OF-PROGRAM event is not raised

    Flow of an Executable Program

    The statement SUBMIT is used to load the program in a separate internal session and based upon the following sequence calls different events as mention below:

    1. LOAD-OF-PROGRAM
    2. INITIALIZATION
    3. AT SELECTION-SCREEN OUTPUT
    4. START-OF-SELECTION
    5. END-OF-SELECTION
  • SAP FICO (Financial Accounting and Controlling)

    Preface – This post is part of the ABAP Beginner series.

    SAP FICO (Financial Accounting and Controlling)

    SAP FICO is used to store and control the financial information of the organization. FICO is one of the most important modules as it is used to analyze the financial condition of the company in the market. It can integrate with other SAP modules such as SAP MM, SAP SD, SAP PP, SAP SCM, etc.

    SAP FICO

    The sub components of SAP FICO are as follows:

    1. Financial accounting General Ledger: It is a set of accounts a business uses to keep track of its financial transactions and create reports.
    2. Financial accounting Accounts receivable and payable: Accounts payable is the amounts the company owes for buying goods or services from a vendor and accounts receivable is the amount the company has to receive for supplying goods and services to a customer.
    3. Financial accounting asset: It is managing and supervising the fixed assets the company owns.
    4. Financial accounting bank accounting: This component is used to handle transactions that you process with your bank.
    5. Financial accounting Travel management: This has a complete integrated management of all processes involved in a business trip.
    6. Financial accounting Fund Management: It interacts with various modules of SAP to get fund details.
    7. Financial accounting Legal Consolidation: for a company with multiple units, legal consolidation helps to view all details in a single financial statement.

     

    Below are some transaction codes for SAP FICO module:

    F110 -> Parameters for automatic payment

    FB60 -> Enter incoming invoices

    PR00 -> Travel expenses

    FB01 -> Post document

    FTXP -> Maintain tax code

    Below are some basic tables SAP FICO module:

    SKA1 -> General Ledger accounts (Chart of Accounts)

    SKAT -> General Ledger accounts (Chart of accounts: Description)

    SKB1 -> General Ledger accounts (Company codes)

    KNBK -> Bank details

    KNVP -> Customer partners

    KNVK -> Contact persons

     

  • SAP Production Planning (PP)

    Preface – This post is part of the ABAP Beginner series.

    SAP Production Planning (PP)

    SAP Production planning as the name suggests deals with planning processes such as material planning, capacity planning, production order, and bill of material and goods movement. It is the process of fulfilling demands with the manufacturing capacity. It tracks and makes a note of the manufacturing process flows, for example the target and actual costs. It is integrated with other SAP modules such as MM, SD, FI, QM and PM.

    There are two types of production processes in SAP PP:

    1. Discrete Production: In this kind of production, the product and costs keep changing according to the orders and lots.
    2. Repetitive Production or Production industries: In this kind of production, the product does not change for a long period of time. It is not dependent on orders as production takes place in total quantity.

    The process of production execution is as follows:

    1. Convert planned order to production order: This is the first step. When a production order is created, its SAP is defined in the system
    2. Issue the production order: Unless the issuing of the production order is done, it cannot be executed.
    3. Issue goods for production order: after the order is issued, the goods need to be issued for execution of the order. Once it is done, the document number is updated in the system.
    4. Production order confirmation: All the remaining sub processes are executed according to the required operations to finish the production as per the order
    5. Goods receipt with respect to Production order: Once the production order is complete, the produced goods are placed the storage area.

    SAP Production Planning

    Some important tables in SAP Production Planning are:

    MDKP -> Document header Data

    MDTB -> Table structure

    S094 -> Stock analysis

    PLAF -> Planned order details

    S026 -> Material Usage

    Some basic Transaction codes in SAP Production Planning module are:

     MD25 -> Create planning calendar

    MD26 -> Change planning calendar

    MD27 -> Display planning calendar

    MEQ1 -> Maintain quota file