SlideShare a Scribd company logo
1 of 68
Download to read offline
ABAP Reports
Report Components
• Report Input Fields (Values)
• Report Selection Screens (Visuals)
• Report Selection Screen Events
Report Input Fields (Values)
• PARAMETERS
 – TEXT Field
 – CHECKBOX
 – RADIOBUTTON

• SELECT-OPTIONS
 – Enables us to create value range and
   complex selections for an input field instead of
   just one single input value an input field .
Report Input Fields (Values)
DATA wa_flight TYPE dv_flights.
PARAMETERS country LIKE wa_flight-countryfr.
SELECT-OPTIONS so_car FOR wa_flight-carrid.

Parameter: one
value only

  Select-Options: range and complex selection
  (example: value = CO or between AA and BA …)
Report Input Fields (Values)
To change the Labels use Goto > Text elements > Selection Texts
PARAMETERS
   DATA wa_flight TYPE dv_flights.
   PARAMETERS pa_carr LIKE wa_flight-carrid.
   PARAMETERS: pa_name AS CHECKBOX DEFAULT 'X',
                   pa_curr AS CHECKBOX DEFAULT 'X'.
   PARAMETERS: pa_lim_1 RADIOBUTTON GROUP lim,
                   pa_lim_2 RADIOBUTTON GROUP lim DEFAULT 'X' ,
                   pa_lim_3 RADIOBUTTON GROUP lim.


            1 input field

2 checkboxes, each can
be checked or unchecked
independently
                                                 Reference:
1 set of radiobuttons, only                      See T-Code: BIBS
one can be selected at                           for more examples
a time from the GROUP
PARAMETERS
* Check if any checkbox has been selected
CONSTANTS mark VALUE ‘X’.
IF pa_name EQ mark
…
ENDIF.
* Check which RADIOBUTTON has been selected
CASE mark.
 WHEN pa_lim_1. …
 WHEN pa_lim_2. …
 WHEN pa_lim_3. …
ENDCASE.
SELECT-OPTIONS
SELECT-OPTIONS so_car FOR wa_flight-carrid
  DEFAULT ‘AA’.
This creates an internal table (with a header)
  having the name so_car. The internal table has 4
  columns SIGN, OPTION, LOW and HIGH.
SIGN     I (Include), E (Exclude)
OPTION EQ (Equal), NE (Not equal), LE (Less
  than or equal), LT (Less than), GE (Greater than
  or equal), GT (Greater than), BT (Between), NB
  (Not between), CP (Contains pattern), NP
  (Contains pattern not)
LOW or both LOW & HIGH contain values
  depending on OPTION value
SELECT-OPTIONS
         SIGN     OPTION    LOW      HIGH
         I        EQ        CO
         I        BT        AA       BA
         E        EQ        AB
         E        BT        AF       AZ


The selection is union of all Includes minus the union of all Excludes.
= Union of (Value = ‘CO’, Value between ‘AA’ and ‘BA’)
Minus
Union of (Value = ‘AB’, Value between ‘AF’ and ‘AZ’)
= (‘AA’, ‘AB’, ‘AC’, ‘AF’, ‘AZ’, ‘BA’, ‘CO’) Minus (‘AB’, ‘AF’, ‘AZ’)
= (‘AA’, ’AC’, ’BA’, ’CO’)

Will select-options make query’s ‘where’ clause complicated for
programmer? No – it is easy to use in any ‘where’ clause as shown below –
SAP takes care of the logic.
SELECT * FROM dv_flights INTO wa_flight WHERE carrid IN so_car.
SELECT-OPTIONS
OPTIONS (during definition of select-options)
DEFAULT ‘AA’ [defaults the low value]
DEFAULT ‘AA’ TO ‘BA’ [defaults the low & high values]
MEMORY ID <pid> [saves selection screen input field value to memory
  for later retrieval of the value to screen]
LOWER CASE [suppresses the conversion of input to upper case]
OBLIGATORY [makes the field a required field]
NO-EXTENSION [suppresses the possibility of multiple selections]
NO INTERVELS [suppresses the interval limit – high]
MODIF ID <mod> [The name of modification group <mod> is a three-
  character variable name without quotation marks. Parameters
  assigned to a modification group can be processed as an entire
  group with the LOOP AT SCREEN and MODIFY SCREEN
  statements – Used for dynamic modifications to selection screen at
  run time]
Report Selection Screens (Visuals)
• SELECTION-SCREEN BEGIN OF BLOCK (block can be
  set of parameter fields, select-option fields, radio buttons
  or any other combination)
• SELECTION-SCREEN BEGIN OF LINE
• SELECTION-SCREEN BEGIN OF SCREEN (defines
  another screen that may be called later)
• SELECTION-SCREEN BEGIN OF SCREEN <name> AS
  SUBSCREEN (defines sub screens that may be used on
  Tab pages)
• SELECTION-SCREEN BEGIN OF TABBED BLOCK
  <name>
• SELECTION-SCREEN PUSHBUTTON …
Report Selection Screens (Visuals)
DATA wa_flight TYPE dv_flights.

SELECTION-SCREEN BEGIN OF BLOCK b_one
        WITH FRAME TITLE text-tld.

PARAMETERS country LIKE wa_flight-countryfr.
SELECT-OPTIONS so_car FOR wa_flight-carrid DEFAULT 'AA' TO 'BA'.

SELECTION-SCREEN END OF BLOCK b_one.


                                          Selection-screen block
         Title                            (the colored/highlighted box)
Report Selection Screens (Visuals)
  To change the Labels use Goto > Text elements > Text Symbols




       SELECTION-SCREEN BEGIN OF BLOCK b_one
               WITH FRAME TITLE text-tld.
SELECTION-
              SCREEN PUSHBUTTON
* Structure for pushbutton command
TABLES: sscrfields.
SELECTION-SCREEN PUSHBUTTON pos_low(20) push_det
       USER-COMMAND details.


INITIALIZATION.
    * Text for pushbuttons
      push_det = 'Hide details'(p02).

AT SELECTION-SCREEN.
    * Evaluate pushbutton command
      CASE sscrfields-ucomm.
       WHEN 'DETAILS'.
        CHECK sy-dynnr = 1100.
        IF switch = '1'.
         switch = '0'.
        ELSE.
         switch = '1'.
        ENDIF.
      ENDCASE.
Report Selection Screen Events
•   LOAD-OF-PROGRAM (when program is loaded in memory)
•   INITIALIZATION (after the program load, but before the display of
    selection screen – values may be defaulted here)
•   AT SELECTION-SCREEN OUTPUT (executed immediately before
    the selection screen is displayed – PBO – Process Before “Output”)
•   AT SELECTION-SCREEN (executed immediately after the selection
    screen is displayed – PAI – Process After “Input” (after “Input” from
    user)
     –   AT SELECTION-SCREEN
     –   AT SELECTION-SCREEN ON <field>
     –   AT SELECTION-SCREEN ON <select-table>
     –   AT SELECTION-SCREEN ON RADIOBUTTON GROUP <group>
     –   AT SELECTION-SCREEN ON BLOCK <block>
     –   AT SELECTION-SCREEN ON HELP-REQUEST (F1)
     –   AT SELECTION-SCREEN ON VALUE-REQUEST (F4)
•   START-OF-SELECTION (report logic to run the actual program after
    inputs are validated)

                            ("AT" screen selection ... -
                           remember "AT" as an event)
Report Selection Screen Events
         (continued)
LOAD-OF-PROGRAM.
  This event keyword defines an event block whose event is triggered
    by the ABAP-runtime environment when an executable program, a
    module pool, a function group or a sub-routine pool is loaded in the
    internal session. When a program is called using SUBMIT or using
    a transaction code, then – at every call – a new internal session is
    opened and the event block is executed once at every call. You can
    initialize global data objects of the program here. The event block
    must be executed completely; otherwise, a runtime error will occur.
    Therefore, no statements are allowed to be executed that leave the
    event block without returning. At the first call of an external
    Procedure (sub-program or function module), the framework
    program of the called procedure is loaded into the internal session
    of the caller, thus triggering the event LOAD-OF-PROGRAM. The
    event block is executed before the called procedure. At any further
    call of a procedure of the same framework program by a caller of
    the same internal session, the event LOAD-OF-PROGRAM is
    triggered no longer.
Report Selection Screen Events
         (continued)
INITIALIZATION.
  This event keyword defines an event block whose
   event is triggered by the ABAP runtime
   environment during the flow of an executable
   program, directly after LOAD-OF-PROGRAM and
   before the selection screen processing of any
   existing standard selection screen. This gives you
   the one-time opportunity to initialize the input fields
   of the selection screen, including those defined in
   the logical database linked with the program.
Report Selection Screen Events
         (continued)
START-OF-SELECTION.
  This event keyword defines an event block for which the event
    is triggered by the ABAP runtime environment during the flow
    of an executable program and before any selection screens
    are processed. In an executable program, all statements that
    are not declarations and that are listed before the first explicit
    processing block, or if the program does not contain any
    explicit processing blocks, then all functional statements of
    the program, are assigned to an implicit event block START-
    OF-SELECTION, which is inserted before any START-OF-
    SELECTION event blocks. If the program is linked to a
    logical database, preparatory tasks can be performed at
    START-OF-SELECTION before the logical database imports
    the data. If the program is not linked to a logical database,
    this event block becomes a type of “main program” from
    which procedures or screens are called.
Report Selection Screen Events
         (continued)
END-OF-SELECTION.
  This statement defines an event block, whose event
   is raised by the ABAP-runtime environment during
   the calling of an executable program , if the logical
   database, with which the program is linked, has
   completely finished its work.
Report Selection Screen Events
         (continued)
AT LINE-SELECTION.
  This statement defines an event block whose event
   is triggered by the ABAP runtime environment
   during the display of a screen list – provided the
   screen cursor is on a list line and you select a
   function using the function code PICK. Through the
   definition of this event block, the standard list
   status is automatically enhanced in such a way
   that the function code F2 and, with it, the double-
   click mouse function is linked up to the function
   code PICK.
Report Selection Screen Events
         (continued)
END-OF-PAGE.
  This statement defines an event block that is raised
   by the ABAP-runtime during creation of a basic list,
   if there is a line reservation in the addition LINE-
   COUNT of the initiating statement for a page
   footer, which was reached while writing to this
   page. A list output that takes place in the event
   block, is placed in this area. Output statements
   that exceed the reserved area will be ignored.
Report Selection Screen Events
            (continued)
TOP-OF-PAGE [DURING LINE-SELECTION].

   This statement using the option DURING LINE-SELECTION defines an event block
       whose event is triggered by the ABAP runtime environment during the creation of
       a list. This occurs when a new page is started – that is, immediately before the
       first line in a new page is to be output. All list outputs that take place in the event
       block are placed below the standard page header of the list. You cannot output
       more lines than are available in the page within the event block. The NEW-PAGE
       statement is ignored within this event block. The entire output written to the list in
       the event block belongs to the page header of the current list page. The top page
       header cannot be moved when you scroll vertically in a list displayed on the
       screen. For each TOP-OF-PAGE event, the placeholders “&1″ – “&9″ are
       replaced with the contents of system fields sy-tvar0 – sy-tvar9 in the standard
       heading and the column headings of the standard page header during creation of
       a basic list. You can assign values to these system fields in the program.
   If you do not use an addition, an event block is triggered for event TOP-OF-PAGE
       during the creation of a basic list. If you use the addition DURING LINE-
       SELECTION, an event block is triggered for the corresponding events during the
       creation of details lists. You have to use system fields like sy-lsind to distinguish
       between the individual details lists.
Report Selection Screen Events
          (continued)
AT USER-COMMAND.
 This statement defines an event block whose
  event is triggered by the ABAP runtime
  environment if, during the display of a screen
  list, a function with a self-defined function
  code was chosen.
Report Selection Screen Events
          (continued)
AT PF##.
  This statement defines an event block whose
   event is triggered by the ABAP runtime
   environment during list display – provided the
   screen cursor is on a list line and a function is
   selected using the function code PF##. Here
   ## stands for a number between 01 and 24. In
   the= standard list status, these function codes
   are assigned to the function keys of the input
   device.
Report Selection Screen Events
         (continued)
– AT SELECTION-SCREEN
   • If an error message or warning message is displayed during this
     event, the system makes “all” selection screen fields ready for input
– AT SELECTION-SCREEN ON <field>
   • If an error message or warning message is displayed during this
     event, the system makes “only” the above screen fields ready for
     input
– AT SELECTION-SCREEN ON <block>
   • This is available to check entry combinations of a logical group. All
     fields in this “block” are made ready for input when an error
     message is issued
– AT SELECTION-SCREEN ON END OF <sel>
   • For selections where you can enter any number of single values
     and ranges, a different screen is displayed where multiple
     selections (values and ranges) can be entered, the AT
     SELECTION-SCREEN ON END OF <sel> is executed when this
     screen is processed. See next page for visual
   Note: AT SELECTION-SCREEN is Executed last, if below specific one like AT
     SELECTION-SCREEN ON <field> exists. Both are executed unless the first message is
     of type error
Report Selection Screen Events
         (continued)




AT SELECTION-SCREEN ON END OF so_car.
CHECK <condition>.
MESSAGE e003(bc405).
Report Selection Screen Events
         (continued)
– AT SELECTION-SCREEN ON HELP-REQUEST (F1)
   • When the user presses F1 on the relevant field, the subsequent processing
     block is executed. You can thus implement a self-programmed help for the
     input/output fields of the selection screen

     AT SELECTION-SCREEN ON HELP-REQUEST FOR so_car.
      CALL SCREEN 100 STARTING AT 30 03 ENDING AT 70 10.

– AT SELECTION-SCREEN ON VALUE-REQUEST (F4)
   • When the user selects this pushbutton or presses F4 for the field, the event
     is executed. You can thus implement a self-programmed possible entries
     routine for the input/output fields of the selection screen. If the program
     contains such an event and the user presses F4 , the system processes this
     rather than displaying the check table or the fixed values of the Dictionary
     field

   Note: It is recommended that instead of creating these events for F1 and F4, it
     is better to use the system F1 and F4 help that retrieves the values from
     Dictionary. This way F1 and F4 provides uniform look and feel application
     wide.
Event Blocks for Selection Screens
Event Blocks for Lists
Event Blocks for Executable Programs (Reports)
ABAP Statements for Screen
           Display
WRITE
 – A very important keyword in the reporting area is the
   WRITE statement. You use WRITE to output literals
   or fields on the screen or printer. Subsequent WRITE
   statements appear on the same output line, unless a
   line feed occurs. If a line is full, the system continues
   the output in the next line.
 – The simplest form of the WRITE statement outputs a
   literal. Remember always to include literals in
   quotation marks. A simple WRITE statement may be:
 – WRITE 'My first program'.
ABAP Statements for Screen
           Display
• NEW-PAGE
  – Use the NEW-PAGE statement to create a page
    break in your list. Page breaks improve the clarity of
    the page layout of your list
• SKIP
  – Use the SKIP statement to create a line feed. To
    create several line feeds, specify the desired number
    behind SKIP. SKIP 5 (This line creates five line feeds)
• ULINE
  – Use the ULINE statement to create a line feed first
    and then draw a horizontal line. This statement also
    helps to make lists easier to read
Terminal (user), External and Internal Sessions
• When you logon using the SAP Logon icon on desktop you
  create a brand new terminal session.
• Generally each GUI window is one external session
• You create new external sessions by choosing System >
  Create session or entering /o in the command field
• Each time a new window opens a new external session is
  created, unless you use the SAP Logon icon to create a
  session which will create a new terminal (or user session)
• You can have up to six external sessions opened
  simultaneously in one terminal session
• External sessions are subdivided into internal sessions

                             Create new External Session
       Create New
       Terminal or
       User                        Create new Internal Session
       Session       CALL TRANSACTION <t-code>.
Terminal (user), External and Internal
            Sessions (continued)
• Each program occupies its own internal session
• Each time a new program is called its data must be stored
  somewhere in memory depending on the requirements
• Generally each of the called program consists of one internal
  session each. You can go back to the calling programs internal
  session after the called program completes (or overlay and never
  return)
• We do not observe internal sessions in any visual way because
  they are “internal sessions”- all we see is one external session
  generally represented by one GUI window
• Each external session can contain up to nine internal sessions
• When a different user logs on a new terminal session is created.
  The new terminal session starts a new (or first) external session.
  When the first program is run new (or first) internal session is
  started for that user
Terminal (user), External and Internal
         Sessions (continued)
                       To create new Terminal or
                       User Sessions (or new Logon) use
                       SAP Logon icon on same or
                       different workstation. SAP licensing
                       may not allow one user to have
                       multiple Terminal Sessions
                       (i.e., multiple logons)



Terminal Session 1



Different SAP Memory


                       Terminal Session 2
Terminal (user), External and Internal
        Sessions (continued)
Here the author is trying to create multiple logons ( or terminal sessions
or user sessions). SAP MEMORY [GET/SET Parameters] area is
NOT common across multiple logons
ABAP and SAP Memory
ABAP memory
• ABAP memory is a memory area that all ABAP programs
  within the same internal session can access using the
  EXPORT and IMPORT statements
• Data within this ABAP memory remains intact during a
  whole sequence of program calls
• To pass data to a program which you are calling, the
  data needs to be placed in ABAP memory before the call
  is made
• The internal session of the called program then replaces
  that of the calling program. The program called can then
  read from the ABAP memory
• If control is then returned to the program which made the
  initial call, the same process operates in reverse
ABAP Memory
REPORT Z_EXPORT_ABAP_MEM.
PARAMETERS: myparam TYPE c LENGTH 4.
DATA: mydata(4) TYPE C.

START-OF-SELECTION.
mydata = myparam.
export mydata to memory id 'MYABAP_MEMORY'.

WRITE 'Value exported'.
WRITE mydata.

*SUBMIT Z_IMPORT_ABAP_MEM.
ABAP Memory
REPORT Z_IMPORT_ABAP_MEM.
*PARAMETERS: myparam TYPE c LENGTH 4.
DATA: mydata(4) TYPE C.

START-OF-SELECTION.
import mydata from memory id 'MYABAP_MEMORY'.

WRITE 'mydata = '.
WRITE mydata.
ABAP Memory
Notes:
After the export program is run, if the import program is run
1)    In the same window – ABAP memory values are read
2)    Import program is called from the export program (SUBMIT) –
      ABAP memory values are read
3)    Called from a new session (external) created using the ‘Creates
      New Session’ button on the top menu - ABAP memory values are
      NOT read
4)    Called from a new user logon (SAPgui) from the same or different
      PC for the same user - ABAP memory values are NOT read
5)    Called from a new user logon (SAPgui) from the same or different
      PC for a different user - ABAP memory values are NOT read
ABAP and SAP Memory
             (continued)
SAP Memory
• SAP memory is a memory area to which all main
  sessions within a SAPgui (login or user session)
  have access
• Use SAP memory either to pass data from one
  program to another within a session, or to pass
  data from one session to another.
• Application programs that use SAP memory
  must do so using SPA/GPA parameters (also
  known as SET/GET parameters)
GET/SET parameters
• These are also called SPA/GPA parameters
• The most frequent use of GET/SET parameters
  is to fill input fields on screens
• These parameters are reset when you logoff the
  sessions (exit)
• These parameters can be set either for a
  particular user or for a particular program using
  the SET PARAMETER statement
• Other ABAP programs can then retrieve the set
  parameters using the GET PARAMETER
  statement
GET/SET parameters
REPORT Z_SET_PARAMETER.
PARAMETERS: myparam1 TYPE c LENGTH 4 MEMORY ID ZMYID1.
PARAMETERS: myparam2 TYPE c LENGTH 4.

* INITIALIZATION.
* note: since there is no GET parameter here no values will be initialized (read)
* for myparam2 (myparam1 is fine as it is defined with MEMORY ID option).

START-OF-SELECTION.
* note: myparam2 but not myparam1 needs SET parameter cmd
* because myparam1 is defined with MEMORY ID option.
* SET PARAMETER ID 'ZMYID1' FIELD myparam1.
SET PARAMETER ID 'ZMYID2' FIELD myparam2.

WRITE 'Parameter [myparam1/myparam2]: '.
WRITE: myparam1, '/', myparam2.

*SUBMIT Z_GET_PARAMETER VIA SELECTION-SCREEN AND RETURN.
GET/SET parameters
REPORT Z_GET_PARAMETER.
PARAMETERS: myparam1 TYPE c LENGTH 4 MEMORY ID ZMYID1.
PARAMETERS: myparam2 TYPE c LENGTH 4.

INITIALIZATION.
* note: only myparam2 (but not myparam1) needs GET parameter
* command because myparam1 is defined with MEMORY ID option.
* GET PARAMETER ID 'ZMYID1' FIELD myparam1.
GET PARAMETER ID 'ZMYID2' FIELD myparam2.

* note: since there is no SET parameter here
* no values will be set for myparam2 (myparam1 is fine).
START-OF-SELECTION.
WRITE 'Parameter [myparam1/myparam2]: '.
WRITE: myparam1, '/', myparam2.
GET/SET parameters
Notes:
After the Set program is run, if the Get program is run
1)    In the same window – SAP memory values are read
2)    Get program is called from the Set program (SUBMIT) – SAP
      memory values are read
3)    Get program called from a new session (external) created using the
      ‘Creates New Session’ button on the top menu - SAP memory
      values are read
4)    Called from a new user logon (SAPgui) from the same or different
      PC for the same user - SAP memory values are NOT read
5)    Called from a new user logon (SAPgui) from the same or different
      PC for a different user - SAP memory values are NOT read
GET/SET DEMO with Line
             Selection Event
REPORT Z_CALLINGPGM.

DATA: carrier TYPE spfli-carrid,
        connection TYPE spfli-connid.

START-OF-SELECTION.
SELECT carrid connid
         FROM spfli
         INTO (carrier, connection).
      WRITE: / carrier HOTSPOT, connection HOTSPOT.
      HIDE: carrier, connection.
ENDSELECT.

AT LINE-SELECTION.
SET PARAMETER ID: 'CAR' FIELD carrier,
               'CON' FIELD connection.
SUBMIT Z_CALLEDPGM AND RETURN.
*SUBMIT Z_CALLEDPGM2 VIA SELECTION-SCREEN AND RETURN.
GET/SET DEMO with Line
         Selection Event (continued)
REPORT Z_CALLEDPGM.
DATA: carrier TYPE spfli-carrid,
        connection TYPE spfli-connid.

INITIALIZATION.
*GET PARAMETER ID: 'CAR' FIELD carrier, 'CON' FIELD connection.

START-OF-SELECTION.
GET PARAMETER ID: 'CAR' FIELD carrier,
                    'CON' FIELD connection.
IF sy-subrc <> 0.
       MESSAGE 'Parameter not found' TYPE 'I'.
ELSE.
       write: / 'Details of carrier/connection are: '.
       write: / carrier, '/', connection.
ENDIF.
END-OF-SELECTION.
GET/SET DEMO with Line
       Selection Event (continued)
REPORT Z_CALLEDPGM2.

PARAMETER: p_carr TYPE spfli-carrid,
     p_conn TYPE spfli-connid.

INITIALIZATION.
GET PARAMETER ID: 'CAR' FIELD p_carr, 'CON' FIELD
    p_conn.

START-OF-SELECTION.
    write: / 'Details of carrier/connection are: '.
    write: / p_carr, '/', p_conn.
END-OF-SELECTION.
Variants
• Variants allow you to reuse values entered
  once on the selection screens. These are
  helpful when:
  – The program is started frequently with same
    values
  – The program is run in the background
Variants (continued)
• A variant consists of two parts:
    The values entered on the selection screen (example:
    Value “AA” for airlines)
    The attributes and display attributes of the
    parameters and select-options (example: Making
    some fields read-only or some not visible, etc)

    Note: If you use the INITIALIZATION event to initialize
     any variables in the program, the variant will not have
     any effect on them (will get overwritten by the
     initialization)
Variable Values in Variants
•   Variable date calculations – D option (this option is used when a
    date is in a variant - today's date, first day of month, or the last day
    of the previous month)

•   User-specific values – B option (this option is used to enter user-
    specific values in a selection field)

•   Values defined in table TVARVC – T option (To fill selection fields
    for a specific task using a variant you can save fixed values in table
    TVARVC. To avoid having to create new variants for each minor
    change in the selection values, you can assign a value in table
    TVARVC to a selection and then just change this value. This is
    particularly important if the corresponding value on the selection
    screen is write-protected)
       * TVARV (client dependent table) TVARVC (client independent)
Variable Values in Variants
Variable date calculations
Example:
    ZBC405_C027393_SSCS_3E01
•   *&------------------------------------------------
    *&------------------------------------------------
    *& Event INITIALIZATION
    *&------------------------------------------------
    INITIALIZATION.
    * Initialize select-options for CARRID" OPTIONAL
      MOVE: 'AA' TO so_car-low,
           'QF' TO so_car-high,
           'BT' TO so_car-option,
           'I' TO so_car-sign.
      APPEND so_car.
      CLEAR so_car.
     MOVE: 'AZ' TO so_car-low,
        'EQ' TO so_car-option,
        'E' TO so_car-sign.
     APPEND so_car.
    * Set texts for tabstrip pushbuttons
      tab1 = 'Connections'(tl1).
      tab2 = 'Date'(tl2).
      tab3 = 'Type of flight'(tl3).
    * Set second tab page as initial tab
      airlines-activetab = 'DATE'.
      airlines-dynnr = '1200'.
    * Text for pushbuttons
      push_det = 'Hide details'(p02).
Example:
    ZBC405_C027393_SSCS_3E01
•   *&------------------------------------------------
    *& Event START-OF-SELECTION
    *&------------------------------------------------
    START-OF-SELECTION.
    * Checking the output parameters
      CASE mark.
       WHEN all.
    * Radiobutton ALL is marked
        SELECT * FROM dv_flights INTO wa_flight
         WHERE carrid IN so_car
          AND connid IN so_con
          AND fldate IN so_fdt
          AND cityfrom IN so_start
          AND cityto IN so_dest.
         WRITE: / wa_flight-carrid,
             wa_flight-connid,
             wa_flight-fldate,
             wa_flight-countryfr,
             wa_flight-cityfrom,
             wa_flight-airpfrom,
             wa_flight-countryto,
             wa_flight-cityto,
             wa_flight-airpto,
             wa_flight-seatsmax,
             wa_flight-seatsocc.
        ENDSELECT.
Example:
    ZBC405_C027393_SSCS_3E01
•   WHEN national.
    * Radiobutton NATIONAL is marked
        SELECT * FROM dv_flights INTO wa_flight
         WHERE carrid IN so_car
          AND connid IN so_con
          AND fldate IN so_fdt
          AND cityfrom IN so_start
          AND cityto IN so_dest
          AND countryto = dv_flights~countryfr
          AND countryto = country.
        WRITE: / wa_flight-carrid,
            wa_flight-connid,
            wa_flight-fldate,
            wa_flight-countryfr,
            wa_flight-cityfrom,
            wa_flight-airpfrom,
            wa_flight-countryto,
            wa_flight-cityto,
            wa_flight-airpto,
            wa_flight-seatsmax,
            wa_flight-seatsocc.
       ENDSELECT.
Example:
    ZBC405_C027393_SSCS_3E01
•      WHEN internat.
    * Radiobutton INTERNAT is marked
        SELECT * FROM dv_flights INTO wa_flight
         WHERE carrid IN so_car
          AND connid IN so_con
          AND fldate IN so_fdt
          AND cityfrom IN so_start
          AND cityto IN so_dest
          AND countryto <> dv_flights~countryfr.
        WRITE: / wa_flight-carrid,
            wa_flight-connid,
            wa_flight-fldate,
            wa_flight-countryfr,
            wa_flight-cityfrom,
            wa_flight-airpfrom,
            wa_flight-countryto,
            wa_flight-cityto,
            wa_flight-airpto,
            wa_flight-seatsmax,
            wa_flight-seatsocc.
       ENDSELECT.
     ENDCASE.
Example:
    ZBC405_C027393_SSCS_3E01
•   *&------------------------------------------------
    *& Event AT SELECTION-SCREEN ON BLOCK PARAM
    *&------------------------------------------------
    AT SELECTION-SCREEN ON BLOCK param. " OPTIONAL
    * check country for national flights is not empty
      CHECK national = 'X' AND country = space.
      MESSAGE e003(bc405).
    *&------------------------------------------------
    *& Event at selection-screen output
    *&------------------------------------------------
    AT SELECTION-SCREEN OUTPUT.
     CASE sy-dynnr.
       WHEN 1100.
        LOOP AT SCREEN.
         IF screen-group1 = 'DET'.
          screen-active = switch.
          MODIFY SCREEN.
         ENDIF.
        ENDLOOP.
         IF switch = '1'.
          push_det = text-p02.
         ELSE.
          push_det = text-p01.
    * clear additional select-options to avoid unwanted
    * influence at selection from database
          REFRESH: so_start,
                so_dest.
         ENDIF.
      ENDCASE.
Example:
   ZBC405_C027393_SSCS_3E01
• *&------------------------------------------------
  *& Event at selection-screen
  *&------------------------------------------------
  AT SELECTION-SCREEN.
  * Evaluate pushbutton command
    CASE sscrfields-ucomm.
     WHEN 'DETAILS'.
      CHECK sy-dynnr = 1100.
      IF switch = '1'.
       switch = '0'.
      ELSE.
       switch = '1'.
      ENDIF.
    ENDCASE.
Example: BC405_SSCS_3TOP
•   *&------------------------------------------------
    *& Include BC405_SSCS_3TOP
    *&
    *&------------------------------------------------
    REPORT bc405_sscs_3.
    * Workarea for data fetch
    DATA: wa_flight TYPE dv_flights.
    * Constant for CASE statement
    CONSTANTS mark VALUE 'X'.
    * Structure for pushbutton command
    TABLES: sscrfields.
    * flag to control hiding / showing
    * of detail select-options
    DATA: switch TYPE n VALUE '1'.
    * Selections for connections
    SELECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN.
    SELECT-OPTIONS: so_car FOR wa_flight-carrid,
               so_con FOR wa_flight-connid.
    SELECTION-SCREEN SKIP 2.
    SELECTION-SCREEN PUSHBUTTON pos_low(20) push_det
      USER-COMMAND details.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF BLOCK bl_det
      WITH FRAME TITLE text-tld.
    SELECT-OPTIONS:
      so_start FOR wa_flight-cityfrom MODIF ID det,
      so_dest FOR wa_flight-cityto MODIF ID det.
    SELECTION-SCREEN END OF BLOCK bl_det.
    SELECTION-SCREEN END OF SCREEN 1100.
Example: BC405_SSCS_3TOP

•
    * Selections for flights
    SELECTION-SCREEN BEGIN OF SCREEN 1200 AS SUBSCREEN.
    SELECT-OPTIONS so_fdt FOR wa_flight-fldate NO-EXTENSION.
    SELECTION-SCREEN END OF SCREEN 1200.
    * Output parameter
    SELECTION-SCREEN BEGIN OF SCREEN 1300 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK param WITH FRAME
      TITLE text-tl3.
    SELECTION-SCREEN BEGIN OF BLOCK radio WITH FRAME.
    PARAMETERS:
      all RADIOBUTTON GROUP rbg1,
      national RADIOBUTTON GROUP rbg1,
      internat RADIOBUTTON GROUP rbg1 DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK radio.
    PARAMETERS: country LIKE wa_flight-countryfr.
    SELECTION-SCREEN END OF BLOCK param.
    SELECTION-SCREEN END OF SCREEN 1300.
    SELECTION-SCREEN BEGIN OF TABBED BLOCK airlines
     FOR 10 LINES.
    SELECTION-SCREEN TAB (20) tab1 USER-COMMAND conn
     DEFAULT SCREEN 1100.
    SELECTION-SCREEN TAB (20) tab2 USER-COMMAND date
     DEFAULT SCREEN 1200.
    SELECTION-SCREEN TAB (20) tab3 USER-COMMAND type
     DEFAULT SCREEN 1300.
    SELECTION-SCREEN END OF BLOCK airlines .
Calling programs using Transaction
               Code
Method 1
LEAVE TO TRANSACTION <t-code>.
• The system terminates the current program and starts the program with
  transaction code . The statement is the equivalent of entering /n in the
  command field followed by the transaction code. After the called program
  the user returns to the application menu and NOT to the calling program
  (When using LEAVE TO TRANSACTION, the current call sequence is
  exited completely. Upon completion of the called transaction, the runtime
  environment returns to the position where the first program in the call
  sequence was called)
LEAVE TO CURRENT TRANSACTION.
• The system terminates the current program and restarts the same program
  (This transaction code is contained in the system field sy-tcode)
LEAVE TO TRANSACTION <t-code> AND SKIP FIRST SCREEN.
• If you use the …AND SKIP FIRST SCREEN addition, the system does not
  display the screen contents of the first screen in the transaction. However, it
  does process the flow logic
Calling programs using Transaction
         Code (continued)
Method 2
CALL TRANSACTION <t-code>.
• The system calls the ABAP program with a transaction code and
  when the called program completes or encounters a LEAVE
  PROGRAM statement, the system resumes processing at the next
  statement after the call in the calling program
CALL TRANSACTION <t-code> AND SKIP FIRST SCREEN.
• If you use the …AND SKIP FIRST SCREEN addition, the system
  does not display the screen contents of the first screen in the
  transaction. However, it does process the flow logic
• If you started a transaction using CALL TRANSACTION that uses
  update techniques, you can use the UPDATE… addition to specify
  the update technique (asynchronous (default), synchronous, or
  local) that the program should use (See data transfer method)
Calling programs using Transaction
         Code (continued)
LEAVE TO TRANSACTION 'ZBC405_1'.
CALL TRANSACTION 'ZBC405_1' [AND SKIP FIRST SCREEN .]

                            Provide selection values in Variant.
                            If values are different each time,
                            use Variable date calculations - D option
                            Or Values defined in table
                            TVARVC - T option, etc.
                            Update table TVARVC with new values
                            before calling the transaction
Calling programs using
            Program/Report Name
SUBMIT <programname>.
After the called program the user returns to the application menu and
   NOT to the calling program. Here users do not see the selection
   screen, therefore selection values will have to be populated using
   WITH options shown in the next few slides
SUBMIT <programname> AND RETURN.
After the called program is completed the user returns to the calling
   program. Here too users do not see the selection screen, therefore
   selection values will have to be populated using WITH options
   shown in the next few slides
SUBMIT <programname> VIA SELECTION-SCREEN.
Shows the selection screen (first screen) of the called program, where
   user may enter the selection values. If selection values are
   populated using the WITH options, the users will see these values
   and can modify them if required or just execute the report
Calling programs using
 Program/Report Name (continued)
SUBMIT <programname> WITH <p_param1> =
 'value1‘ WITH <p_param2> = 'value2'.

Use the above syntax to pass/populate parameters
  from the calling program to the called program.
Example:
SUBMIT ZBC405_C027393_SSCS_2
   WITH COUNTRY = 'ZZZ'
   WITH COUNTRY2 = 'YYY' VIA SELECTION-SCREEN.
Calling programs using
 Program/Report Name (continued)
SUBMIT <programname> WITH
 SELECTION-TABLE rspar [VIA
 SELECTION-SCREEN].
If you specify this addition, parameters and selection criteria on the selection screen are
     supplied from an internal table rspar. The row type for this internal table is
     RSPARAMS. The structured data type RSPARAMS is defined in the ABAP Dictionary
     and has the following components, all of which are data type CHAR:
     –   SELNAME length 8 – must contain the name of a parameter or selection criterion [select-
         options] for the selection screen in block capitals
     –   KIND length 1 – must contain the type of selection screen component (P for parameters, S
         for selection criteria)
     –   SIGN length 1 – specifies whether the result of the row condition needs to be included for
         each row (I – Inclusive, E – Exclusive)
     –   OPTION length 2 – specifies the comparison operators EQ (equal), NE (not equal), GT
         (greater than), BT (between) and NB (not between)
     –   LOW length 45 – this is the lower limit of the range (in the case of parameters, the value
         must be specified in LOW and all other components are ignored)
     –   HIGH length 45 – this is the lower limit of the range
Calling programs using
 Program/Report Name (continued)
Example showing “WITH SELECTION-TABLE”
DATA: MY_RSPAR LIKE STANDARD TABLE OF RSPARAMS
   WITH HEADER LINE.

MOVE: 'SO_CAR' TO MY_RSPAR-SELNAME,
        'S' TO MY_RSPAR-KIND,                    You can pass parameters
        'I' TO MY_RSPAR-SIGN,                    and/or select-options by
        'BT' TO MY_RSPAR-OPTION,
        'CO' TO MY_RSPAR-LOW,
        'DL' TO MY_RSPAR-HIGH.
                                                 specifying correct value in the
APPEND MY_RSPAR.                                 KIND field (P for parameters,
CLEAR MY_RSPAR.
MOVE: 'SO_CAR' TO MY_RSPAR-SELNAME,
                                                 S for select-options)
        'S' TO MY_RSPAR-KIND,
        'I' TO MY_RSPAR-SIGN,
        'EQ' TO MY_RSPAR-OPTION,
        'LH' TO MY_RSPAR-LOW,
        ' ' TO MY_RSPAR-HIGH.
APPEND MY_RSPAR.
CLEAR MY_RSPAR.
      MOVE: 'COUNTRY' TO MY_RSPAR-SELNAME,
        'P' TO MY_RSPAR-KIND,
        ‘I' TO MY_RSPAR-SIGN,
        'EQ' TO MY_RSPAR-OPTION,
        'FR' TO MY_RSPAR-LOW.
    APPEND MY_RSPAR.
SUBMIT ZBC405_C027393_SSCS_2 WITH SELECTION-
   TABLE MY_RSPAR VIA SELECTION-SCREEN.
Calling programs using
Program/Report Name (continued)
SUBMIT <programname> USING SELECTION-
 SET 'VARIANT1‘

If you specify this option, the parameters and
   selection criteria for the selection screen are
   supplied with values from a variant. Provide the
   name of the variant in single quotes. If the
   variant does not exist, the system sends an error
   message. If the variant belongs to a different
   selection screen, it is ignored.

More Related Content

What's hot

ABAP Programming Overview
ABAP Programming OverviewABAP Programming Overview
ABAP Programming Overviewsapdocs. info
 
Sap User Exit for Functional Consultant
Sap User Exit for Functional ConsultantSap User Exit for Functional Consultant
Sap User Exit for Functional ConsultantAnkit Sharma
 
ABAP for Beginners - www.sapdocs.info
ABAP for Beginners - www.sapdocs.infoABAP for Beginners - www.sapdocs.info
ABAP for Beginners - www.sapdocs.infosapdocs. info
 
Object oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPObject oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPNoman Mohamed Hanif
 
Introduction to ABAP
Introduction to ABAPIntroduction to ABAP
Introduction to ABAPsapdocs. info
 
Ab1011 module pool programming
Ab1011   module pool programmingAb1011   module pool programming
Ab1011 module pool programmingSatheesh Kanna
 
Sap abap interview questions
Sap abap interview questionsSap abap interview questions
Sap abap interview questionskssr99
 
Dialog Programming Overview
Dialog Programming OverviewDialog Programming Overview
Dialog Programming Overviewsapdocs. info
 
Ooabap notes with_programs
Ooabap notes with_programsOoabap notes with_programs
Ooabap notes with_programsKranthi Kumar
 
Abap data dictionary
Abap data dictionaryAbap data dictionary
Abap data dictionarySmartGokul4
 
List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAPsapdocs. info
 
1000 solved questions
1000 solved questions1000 solved questions
1000 solved questionsKranthi Kumar
 
Chapter 01 user exits
Chapter 01 user exitsChapter 01 user exits
Chapter 01 user exitsKranthi Kumar
 
Bdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATIONBdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATIONHitesh Gulani
 

What's hot (20)

Module pool programming
Module pool programmingModule pool programming
Module pool programming
 
Sap abap material
Sap abap materialSap abap material
Sap abap material
 
ABAP Programming Overview
ABAP Programming OverviewABAP Programming Overview
ABAP Programming Overview
 
Sap User Exit for Functional Consultant
Sap User Exit for Functional ConsultantSap User Exit for Functional Consultant
Sap User Exit for Functional Consultant
 
ABAP for Beginners - www.sapdocs.info
ABAP for Beginners - www.sapdocs.infoABAP for Beginners - www.sapdocs.info
ABAP for Beginners - www.sapdocs.info
 
Object oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPObject oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAP
 
Introduction to ABAP
Introduction to ABAPIntroduction to ABAP
Introduction to ABAP
 
Ab1011 module pool programming
Ab1011   module pool programmingAb1011   module pool programming
Ab1011 module pool programming
 
Sap abap interview questions
Sap abap interview questionsSap abap interview questions
Sap abap interview questions
 
Dialog Programming Overview
Dialog Programming OverviewDialog Programming Overview
Dialog Programming Overview
 
Ooabap notes with_programs
Ooabap notes with_programsOoabap notes with_programs
Ooabap notes with_programs
 
Abap data dictionary
Abap data dictionaryAbap data dictionary
Abap data dictionary
 
List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAP
 
SAP Adobe forms
SAP Adobe formsSAP Adobe forms
SAP Adobe forms
 
Badis
Badis Badis
Badis
 
1000 solved questions
1000 solved questions1000 solved questions
1000 solved questions
 
Chapter 01 user exits
Chapter 01 user exitsChapter 01 user exits
Chapter 01 user exits
 
Sap scripts
Sap scriptsSap scripts
Sap scripts
 
Bdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATIONBdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATION
 
Sap abap tutorials
Sap abap tutorialsSap abap tutorials
Sap abap tutorials
 

Viewers also liked

Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answersUttam Agrawal
 
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
SAP ABAP Latest Interview Questions with Answers by Garuda TrainingsSAP ABAP Latest Interview Questions with Answers by Garuda Trainings
SAP ABAP Latest Interview Questions with Answers by Garuda TrainingsGaruda Trainings
 
Sap abap real time questions
Sap abap real time questionsSap abap real time questions
Sap abap real time questionstechie_gautam
 
Step by Step guide for creating first ABAP report in SAP
Step by Step guide for creating first ABAP report in SAPStep by Step guide for creating first ABAP report in SAP
Step by Step guide for creating first ABAP report in SAPnityaabap
 
Yash technologies interview questions and answers
Yash technologies interview questions and answersYash technologies interview questions and answers
Yash technologies interview questions and answersGarySpeed1234
 
Beginner’s guide to sap abap 1
Beginner’s guide to sap abap 1Beginner’s guide to sap abap 1
Beginner’s guide to sap abap 1Panduka Bandara
 
User exit training
User exit trainingUser exit training
User exit trainingJen Ringel
 
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 dataMilind Patil
 
Chapter 06 printing sap script forms
Chapter 06 printing sap script formsChapter 06 printing sap script forms
Chapter 06 printing sap script formsKranthi Kumar
 
Sap abap ppt
Sap abap pptSap abap ppt
Sap abap pptvonline
 
Structuring An ABAP Report In An Optimal Way
Structuring An ABAP Report In An Optimal WayStructuring An ABAP Report In An Optimal Way
Structuring An ABAP Report In An Optimal WayBlackvard
 
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 checksMilind Patil
 

Viewers also liked (16)

Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answers
 
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
SAP ABAP Latest Interview Questions with Answers by Garuda TrainingsSAP ABAP Latest Interview Questions with Answers by Garuda Trainings
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
 
SAP ABAP Material
SAP ABAP MaterialSAP ABAP Material
SAP ABAP Material
 
Sap abap real time questions
Sap abap real time questionsSap abap real time questions
Sap abap real time questions
 
Step by Step guide for creating first ABAP report in SAP
Step by Step guide for creating first ABAP report in SAPStep by Step guide for creating first ABAP report in SAP
Step by Step guide for creating first ABAP report in SAP
 
Yash technologies interview questions and answers
Yash technologies interview questions and answersYash technologies interview questions and answers
Yash technologies interview questions and answers
 
Beginner’s guide to sap abap 1
Beginner’s guide to sap abap 1Beginner’s guide to sap abap 1
Beginner’s guide to sap abap 1
 
SAP ABAP data dictionary
SAP ABAP data dictionarySAP ABAP data dictionary
SAP ABAP data dictionary
 
User exit training
User exit trainingUser exit training
User exit training
 
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
 
Chapter 06 printing sap script forms
Chapter 06 printing sap script formsChapter 06 printing sap script forms
Chapter 06 printing sap script forms
 
Sap abap ppt
Sap abap pptSap abap ppt
Sap abap ppt
 
Abap hr programing
Abap hr programingAbap hr programing
Abap hr programing
 
Structuring An ABAP Report In An Optimal Way
Structuring An ABAP Report In An Optimal WayStructuring An ABAP Report In An Optimal Way
Structuring An ABAP Report In An Optimal Way
 
Abap slides set1
Abap slides set1Abap slides set1
Abap slides set1
 
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
 

Similar to ABAP Report Events

Complete reference to_abap_basics
Complete reference to_abap_basicsComplete reference to_abap_basics
Complete reference to_abap_basicsAbhishek Dixit
 
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 keywordsPrakash Thirumoorthy
 
0106 debugging
0106 debugging0106 debugging
0106 debuggingvkyecc1
 
Modularization & Catch Statement
Modularization & Catch StatementModularization & Catch Statement
Modularization & Catch Statementsapdocs. info
 
Chapter 5 modularization & catch statement (paradiso-a45b1d's conflicted co...
Chapter 5   modularization & catch statement (paradiso-a45b1d's conflicted co...Chapter 5   modularization & catch statement (paradiso-a45b1d's conflicted co...
Chapter 5 modularization & catch statement (paradiso-a45b1d's conflicted co...marco_paradiso
 
Abap function module help
Abap function module helpAbap function module help
Abap function module helpKranthi Kumar
 
Step bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordStep bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordMilind Patil
 
Step bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordStep bystep abap_changinga_singlerecord
Step bystep abap_changinga_singlerecordMilind Patil
 
Hechsp 001 Chapter 2
Hechsp 001 Chapter 2Hechsp 001 Chapter 2
Hechsp 001 Chapter 2Brian Kelly
 
Debugger & Profiler in NetBeans
Debugger & Profiler in NetBeansDebugger & Profiler in NetBeans
Debugger & Profiler in NetBeansHuu Bang Le Phan
 
Sure Outputs
Sure OutputsSure Outputs
Sure OutputsSAP Sure
 

Similar to ABAP Report Events (20)

Complete reference to_abap_basics
Complete reference to_abap_basicsComplete reference to_abap_basics
Complete reference to_abap_basics
 
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
 
Abap slide class3
Abap slide class3Abap slide class3
Abap slide class3
 
0106 debugging
0106 debugging0106 debugging
0106 debugging
 
Abap ppt
Abap pptAbap ppt
Abap ppt
 
Abap ppt2
Abap ppt2Abap ppt2
Abap ppt2
 
258lec11
258lec11258lec11
258lec11
 
Dcs operator training
Dcs operator trainingDcs operator training
Dcs operator training
 
Csd01
Csd01Csd01
Csd01
 
Modularization & Catch Statement
Modularization & Catch StatementModularization & Catch Statement
Modularization & Catch Statement
 
PROGRAMSc
PROGRAMScPROGRAMSc
PROGRAMSc
 
Chapter 5 modularization & catch statement (paradiso-a45b1d's conflicted co...
Chapter 5   modularization & catch statement (paradiso-a45b1d's conflicted co...Chapter 5   modularization & catch statement (paradiso-a45b1d's conflicted co...
Chapter 5 modularization & catch statement (paradiso-a45b1d's conflicted co...
 
Abap function module help
Abap function module helpAbap function module help
Abap function module help
 
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
 
Interview Preparation
Interview PreparationInterview Preparation
Interview Preparation
 
Hechsp 001 Chapter 2
Hechsp 001 Chapter 2Hechsp 001 Chapter 2
Hechsp 001 Chapter 2
 
Debugger & Profiler in NetBeans
Debugger & Profiler in NetBeansDebugger & Profiler in NetBeans
Debugger & Profiler in NetBeans
 
Sure Outputs
Sure OutputsSure Outputs
Sure Outputs
 
Unit 7 Java
Unit 7 JavaUnit 7 Java
Unit 7 Java
 

More from Milind Patil

Abap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfilesAbap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfilesMilind 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 lovMilind Patil
 
Step bystep abap_fieldhelpordocumentation
Step bystep abap_fieldhelpordocumentationStep bystep abap_fieldhelpordocumentation
Step bystep abap_fieldhelpordocumentationMilind 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 documentationMilind Patil
 
Abap slide lockenqueuedataclustersauthchecks
Abap slide lockenqueuedataclustersauthchecksAbap slide lockenqueuedataclustersauthchecks
Abap slide lockenqueuedataclustersauthchecksMilind Patil
 
Abap slide exceptionshandling
Abap slide exceptionshandlingAbap slide exceptionshandling
Abap slide exceptionshandlingMilind Patil
 
Lecture16 abap on line
Lecture16 abap on lineLecture16 abap on line
Lecture16 abap on lineMilind Patil
 
Lecture14 abap on line
Lecture14 abap on lineLecture14 abap on line
Lecture14 abap on lineMilind Patil
 
Lecture13 abap on line
Lecture13 abap on lineLecture13 abap on line
Lecture13 abap on lineMilind Patil
 
Lecture12 abap on line
Lecture12 abap on lineLecture12 abap on line
Lecture12 abap on lineMilind Patil
 
Lecture11 abap on line
Lecture11 abap on lineLecture11 abap on line
Lecture11 abap on lineMilind Patil
 
Lecture10 abap on line
Lecture10 abap on lineLecture10 abap on line
Lecture10 abap on lineMilind Patil
 
Lecture09 abap on line
Lecture09 abap on lineLecture09 abap on line
Lecture09 abap on lineMilind Patil
 
Lecture08 abap on line
Lecture08 abap on lineLecture08 abap on line
Lecture08 abap on lineMilind Patil
 
Lecture07 abap on line
Lecture07 abap on lineLecture07 abap on line
Lecture07 abap on lineMilind Patil
 
Lecture06 abap on line
Lecture06 abap on lineLecture06 abap on line
Lecture06 abap on lineMilind Patil
 
Lecture05 abap on line
Lecture05 abap on lineLecture05 abap on line
Lecture05 abap on lineMilind Patil
 
Lecture04 abap on line
Lecture04 abap on lineLecture04 abap on line
Lecture04 abap on lineMilind Patil
 
Lecture03 abap on line
Lecture03 abap on lineLecture03 abap on line
Lecture03 abap on lineMilind Patil
 
Lecture02 abap on line
Lecture02 abap on lineLecture02 abap on line
Lecture02 abap on lineMilind Patil
 

More from Milind Patil (20)

Abap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfilesAbap slide class4 unicode-plusfiles
Abap slide class4 unicode-plusfiles
 
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 slide lockenqueuedataclustersauthchecks
Abap slide lockenqueuedataclustersauthchecksAbap slide lockenqueuedataclustersauthchecks
Abap slide lockenqueuedataclustersauthchecks
 
Abap slide exceptionshandling
Abap slide exceptionshandlingAbap slide exceptionshandling
Abap slide exceptionshandling
 
Lecture16 abap on line
Lecture16 abap on lineLecture16 abap on line
Lecture16 abap on line
 
Lecture14 abap on line
Lecture14 abap on lineLecture14 abap on line
Lecture14 abap on line
 
Lecture13 abap on line
Lecture13 abap on lineLecture13 abap on line
Lecture13 abap on line
 
Lecture12 abap on line
Lecture12 abap on lineLecture12 abap on line
Lecture12 abap on line
 
Lecture11 abap on line
Lecture11 abap on lineLecture11 abap on line
Lecture11 abap on line
 
Lecture10 abap on line
Lecture10 abap on lineLecture10 abap on line
Lecture10 abap on line
 
Lecture09 abap on line
Lecture09 abap on lineLecture09 abap on line
Lecture09 abap on line
 
Lecture08 abap on line
Lecture08 abap on lineLecture08 abap on line
Lecture08 abap on line
 
Lecture07 abap on line
Lecture07 abap on lineLecture07 abap on line
Lecture07 abap on line
 
Lecture06 abap on line
Lecture06 abap on lineLecture06 abap on line
Lecture06 abap on line
 
Lecture05 abap on line
Lecture05 abap on lineLecture05 abap on line
Lecture05 abap on line
 
Lecture04 abap on line
Lecture04 abap on lineLecture04 abap on line
Lecture04 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
 

Recently uploaded

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Recently uploaded (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

ABAP Report Events

  • 2. Report Components • Report Input Fields (Values) • Report Selection Screens (Visuals) • Report Selection Screen Events
  • 3. Report Input Fields (Values) • PARAMETERS – TEXT Field – CHECKBOX – RADIOBUTTON • SELECT-OPTIONS – Enables us to create value range and complex selections for an input field instead of just one single input value an input field .
  • 4. Report Input Fields (Values) DATA wa_flight TYPE dv_flights. PARAMETERS country LIKE wa_flight-countryfr. SELECT-OPTIONS so_car FOR wa_flight-carrid. Parameter: one value only Select-Options: range and complex selection (example: value = CO or between AA and BA …)
  • 5. Report Input Fields (Values) To change the Labels use Goto > Text elements > Selection Texts
  • 6. PARAMETERS DATA wa_flight TYPE dv_flights. PARAMETERS pa_carr LIKE wa_flight-carrid. PARAMETERS: pa_name AS CHECKBOX DEFAULT 'X', pa_curr AS CHECKBOX DEFAULT 'X'. PARAMETERS: pa_lim_1 RADIOBUTTON GROUP lim, pa_lim_2 RADIOBUTTON GROUP lim DEFAULT 'X' , pa_lim_3 RADIOBUTTON GROUP lim. 1 input field 2 checkboxes, each can be checked or unchecked independently Reference: 1 set of radiobuttons, only See T-Code: BIBS one can be selected at for more examples a time from the GROUP
  • 7. PARAMETERS * Check if any checkbox has been selected CONSTANTS mark VALUE ‘X’. IF pa_name EQ mark … ENDIF. * Check which RADIOBUTTON has been selected CASE mark. WHEN pa_lim_1. … WHEN pa_lim_2. … WHEN pa_lim_3. … ENDCASE.
  • 8. SELECT-OPTIONS SELECT-OPTIONS so_car FOR wa_flight-carrid DEFAULT ‘AA’. This creates an internal table (with a header) having the name so_car. The internal table has 4 columns SIGN, OPTION, LOW and HIGH. SIGN I (Include), E (Exclude) OPTION EQ (Equal), NE (Not equal), LE (Less than or equal), LT (Less than), GE (Greater than or equal), GT (Greater than), BT (Between), NB (Not between), CP (Contains pattern), NP (Contains pattern not) LOW or both LOW & HIGH contain values depending on OPTION value
  • 9. SELECT-OPTIONS SIGN OPTION LOW HIGH I EQ CO I BT AA BA E EQ AB E BT AF AZ The selection is union of all Includes minus the union of all Excludes. = Union of (Value = ‘CO’, Value between ‘AA’ and ‘BA’) Minus Union of (Value = ‘AB’, Value between ‘AF’ and ‘AZ’) = (‘AA’, ‘AB’, ‘AC’, ‘AF’, ‘AZ’, ‘BA’, ‘CO’) Minus (‘AB’, ‘AF’, ‘AZ’) = (‘AA’, ’AC’, ’BA’, ’CO’) Will select-options make query’s ‘where’ clause complicated for programmer? No – it is easy to use in any ‘where’ clause as shown below – SAP takes care of the logic. SELECT * FROM dv_flights INTO wa_flight WHERE carrid IN so_car.
  • 10. SELECT-OPTIONS OPTIONS (during definition of select-options) DEFAULT ‘AA’ [defaults the low value] DEFAULT ‘AA’ TO ‘BA’ [defaults the low & high values] MEMORY ID <pid> [saves selection screen input field value to memory for later retrieval of the value to screen] LOWER CASE [suppresses the conversion of input to upper case] OBLIGATORY [makes the field a required field] NO-EXTENSION [suppresses the possibility of multiple selections] NO INTERVELS [suppresses the interval limit – high] MODIF ID <mod> [The name of modification group <mod> is a three- character variable name without quotation marks. Parameters assigned to a modification group can be processed as an entire group with the LOOP AT SCREEN and MODIFY SCREEN statements – Used for dynamic modifications to selection screen at run time]
  • 11. Report Selection Screens (Visuals) • SELECTION-SCREEN BEGIN OF BLOCK (block can be set of parameter fields, select-option fields, radio buttons or any other combination) • SELECTION-SCREEN BEGIN OF LINE • SELECTION-SCREEN BEGIN OF SCREEN (defines another screen that may be called later) • SELECTION-SCREEN BEGIN OF SCREEN <name> AS SUBSCREEN (defines sub screens that may be used on Tab pages) • SELECTION-SCREEN BEGIN OF TABBED BLOCK <name> • SELECTION-SCREEN PUSHBUTTON …
  • 12. Report Selection Screens (Visuals) DATA wa_flight TYPE dv_flights. SELECTION-SCREEN BEGIN OF BLOCK b_one WITH FRAME TITLE text-tld. PARAMETERS country LIKE wa_flight-countryfr. SELECT-OPTIONS so_car FOR wa_flight-carrid DEFAULT 'AA' TO 'BA'. SELECTION-SCREEN END OF BLOCK b_one. Selection-screen block Title (the colored/highlighted box)
  • 13. Report Selection Screens (Visuals) To change the Labels use Goto > Text elements > Text Symbols SELECTION-SCREEN BEGIN OF BLOCK b_one WITH FRAME TITLE text-tld.
  • 14. SELECTION- SCREEN PUSHBUTTON * Structure for pushbutton command TABLES: sscrfields. SELECTION-SCREEN PUSHBUTTON pos_low(20) push_det USER-COMMAND details. INITIALIZATION. * Text for pushbuttons push_det = 'Hide details'(p02). AT SELECTION-SCREEN. * Evaluate pushbutton command CASE sscrfields-ucomm. WHEN 'DETAILS'. CHECK sy-dynnr = 1100. IF switch = '1'. switch = '0'. ELSE. switch = '1'. ENDIF. ENDCASE.
  • 15. Report Selection Screen Events • LOAD-OF-PROGRAM (when program is loaded in memory) • INITIALIZATION (after the program load, but before the display of selection screen – values may be defaulted here) • AT SELECTION-SCREEN OUTPUT (executed immediately before the selection screen is displayed – PBO – Process Before “Output”) • AT SELECTION-SCREEN (executed immediately after the selection screen is displayed – PAI – Process After “Input” (after “Input” from user) – AT SELECTION-SCREEN – AT SELECTION-SCREEN ON <field> – AT SELECTION-SCREEN ON <select-table> – AT SELECTION-SCREEN ON RADIOBUTTON GROUP <group> – AT SELECTION-SCREEN ON BLOCK <block> – AT SELECTION-SCREEN ON HELP-REQUEST (F1) – AT SELECTION-SCREEN ON VALUE-REQUEST (F4) • START-OF-SELECTION (report logic to run the actual program after inputs are validated) ("AT" screen selection ... - remember "AT" as an event)
  • 16. Report Selection Screen Events (continued) LOAD-OF-PROGRAM. This event keyword defines an event block whose event is triggered by the ABAP-runtime environment when an executable program, a module pool, a function group or a sub-routine pool is loaded in the internal session. When a program is called using SUBMIT or using a transaction code, then – at every call – a new internal session is opened and the event block is executed once at every call. You can initialize global data objects of the program here. The event block must be executed completely; otherwise, a runtime error will occur. Therefore, no statements are allowed to be executed that leave the event block without returning. At the first call of an external Procedure (sub-program or function module), the framework program of the called procedure is loaded into the internal session of the caller, thus triggering the event LOAD-OF-PROGRAM. The event block is executed before the called procedure. At any further call of a procedure of the same framework program by a caller of the same internal session, the event LOAD-OF-PROGRAM is triggered no longer.
  • 17. Report Selection Screen Events (continued) INITIALIZATION. This event keyword defines an event block whose event is triggered by the ABAP runtime environment during the flow of an executable program, directly after LOAD-OF-PROGRAM and before the selection screen processing of any existing standard selection screen. This gives you the one-time opportunity to initialize the input fields of the selection screen, including those defined in the logical database linked with the program.
  • 18. Report Selection Screen Events (continued) START-OF-SELECTION. This event keyword defines an event block for which the event is triggered by the ABAP runtime environment during the flow of an executable program and before any selection screens are processed. In an executable program, all statements that are not declarations and that are listed before the first explicit processing block, or if the program does not contain any explicit processing blocks, then all functional statements of the program, are assigned to an implicit event block START- OF-SELECTION, which is inserted before any START-OF- SELECTION event blocks. If the program is linked to a logical database, preparatory tasks can be performed at START-OF-SELECTION before the logical database imports the data. If the program is not linked to a logical database, this event block becomes a type of “main program” from which procedures or screens are called.
  • 19. Report Selection Screen Events (continued) END-OF-SELECTION. This statement defines an event block, whose event is raised by the ABAP-runtime environment during the calling of an executable program , if the logical database, with which the program is linked, has completely finished its work.
  • 20. Report Selection Screen Events (continued) AT LINE-SELECTION. This statement defines an event block whose event is triggered by the ABAP runtime environment during the display of a screen list – provided the screen cursor is on a list line and you select a function using the function code PICK. Through the definition of this event block, the standard list status is automatically enhanced in such a way that the function code F2 and, with it, the double- click mouse function is linked up to the function code PICK.
  • 21. Report Selection Screen Events (continued) END-OF-PAGE. This statement defines an event block that is raised by the ABAP-runtime during creation of a basic list, if there is a line reservation in the addition LINE- COUNT of the initiating statement for a page footer, which was reached while writing to this page. A list output that takes place in the event block, is placed in this area. Output statements that exceed the reserved area will be ignored.
  • 22. Report Selection Screen Events (continued) TOP-OF-PAGE [DURING LINE-SELECTION]. This statement using the option DURING LINE-SELECTION defines an event block whose event is triggered by the ABAP runtime environment during the creation of a list. This occurs when a new page is started – that is, immediately before the first line in a new page is to be output. All list outputs that take place in the event block are placed below the standard page header of the list. You cannot output more lines than are available in the page within the event block. The NEW-PAGE statement is ignored within this event block. The entire output written to the list in the event block belongs to the page header of the current list page. The top page header cannot be moved when you scroll vertically in a list displayed on the screen. For each TOP-OF-PAGE event, the placeholders “&1″ – “&9″ are replaced with the contents of system fields sy-tvar0 – sy-tvar9 in the standard heading and the column headings of the standard page header during creation of a basic list. You can assign values to these system fields in the program. If you do not use an addition, an event block is triggered for event TOP-OF-PAGE during the creation of a basic list. If you use the addition DURING LINE- SELECTION, an event block is triggered for the corresponding events during the creation of details lists. You have to use system fields like sy-lsind to distinguish between the individual details lists.
  • 23. Report Selection Screen Events (continued) AT USER-COMMAND. This statement defines an event block whose event is triggered by the ABAP runtime environment if, during the display of a screen list, a function with a self-defined function code was chosen.
  • 24. Report Selection Screen Events (continued) AT PF##. This statement defines an event block whose event is triggered by the ABAP runtime environment during list display – provided the screen cursor is on a list line and a function is selected using the function code PF##. Here ## stands for a number between 01 and 24. In the= standard list status, these function codes are assigned to the function keys of the input device.
  • 25. Report Selection Screen Events (continued) – AT SELECTION-SCREEN • If an error message or warning message is displayed during this event, the system makes “all” selection screen fields ready for input – AT SELECTION-SCREEN ON <field> • If an error message or warning message is displayed during this event, the system makes “only” the above screen fields ready for input – AT SELECTION-SCREEN ON <block> • This is available to check entry combinations of a logical group. All fields in this “block” are made ready for input when an error message is issued – AT SELECTION-SCREEN ON END OF <sel> • For selections where you can enter any number of single values and ranges, a different screen is displayed where multiple selections (values and ranges) can be entered, the AT SELECTION-SCREEN ON END OF <sel> is executed when this screen is processed. See next page for visual Note: AT SELECTION-SCREEN is Executed last, if below specific one like AT SELECTION-SCREEN ON <field> exists. Both are executed unless the first message is of type error
  • 26. Report Selection Screen Events (continued) AT SELECTION-SCREEN ON END OF so_car. CHECK <condition>. MESSAGE e003(bc405).
  • 27. Report Selection Screen Events (continued) – AT SELECTION-SCREEN ON HELP-REQUEST (F1) • When the user presses F1 on the relevant field, the subsequent processing block is executed. You can thus implement a self-programmed help for the input/output fields of the selection screen AT SELECTION-SCREEN ON HELP-REQUEST FOR so_car. CALL SCREEN 100 STARTING AT 30 03 ENDING AT 70 10. – AT SELECTION-SCREEN ON VALUE-REQUEST (F4) • When the user selects this pushbutton or presses F4 for the field, the event is executed. You can thus implement a self-programmed possible entries routine for the input/output fields of the selection screen. If the program contains such an event and the user presses F4 , the system processes this rather than displaying the check table or the fixed values of the Dictionary field Note: It is recommended that instead of creating these events for F1 and F4, it is better to use the system F1 and F4 help that retrieves the values from Dictionary. This way F1 and F4 provides uniform look and feel application wide.
  • 28. Event Blocks for Selection Screens
  • 30. Event Blocks for Executable Programs (Reports)
  • 31. ABAP Statements for Screen Display WRITE – A very important keyword in the reporting area is the WRITE statement. You use WRITE to output literals or fields on the screen or printer. Subsequent WRITE statements appear on the same output line, unless a line feed occurs. If a line is full, the system continues the output in the next line. – The simplest form of the WRITE statement outputs a literal. Remember always to include literals in quotation marks. A simple WRITE statement may be: – WRITE 'My first program'.
  • 32. ABAP Statements for Screen Display • NEW-PAGE – Use the NEW-PAGE statement to create a page break in your list. Page breaks improve the clarity of the page layout of your list • SKIP – Use the SKIP statement to create a line feed. To create several line feeds, specify the desired number behind SKIP. SKIP 5 (This line creates five line feeds) • ULINE – Use the ULINE statement to create a line feed first and then draw a horizontal line. This statement also helps to make lists easier to read
  • 33. Terminal (user), External and Internal Sessions • When you logon using the SAP Logon icon on desktop you create a brand new terminal session. • Generally each GUI window is one external session • You create new external sessions by choosing System > Create session or entering /o in the command field • Each time a new window opens a new external session is created, unless you use the SAP Logon icon to create a session which will create a new terminal (or user session) • You can have up to six external sessions opened simultaneously in one terminal session • External sessions are subdivided into internal sessions Create new External Session Create New Terminal or User Create new Internal Session Session CALL TRANSACTION <t-code>.
  • 34. Terminal (user), External and Internal Sessions (continued) • Each program occupies its own internal session • Each time a new program is called its data must be stored somewhere in memory depending on the requirements • Generally each of the called program consists of one internal session each. You can go back to the calling programs internal session after the called program completes (or overlay and never return) • We do not observe internal sessions in any visual way because they are “internal sessions”- all we see is one external session generally represented by one GUI window • Each external session can contain up to nine internal sessions • When a different user logs on a new terminal session is created. The new terminal session starts a new (or first) external session. When the first program is run new (or first) internal session is started for that user
  • 35. Terminal (user), External and Internal Sessions (continued) To create new Terminal or User Sessions (or new Logon) use SAP Logon icon on same or different workstation. SAP licensing may not allow one user to have multiple Terminal Sessions (i.e., multiple logons) Terminal Session 1 Different SAP Memory Terminal Session 2
  • 36. Terminal (user), External and Internal Sessions (continued) Here the author is trying to create multiple logons ( or terminal sessions or user sessions). SAP MEMORY [GET/SET Parameters] area is NOT common across multiple logons
  • 37. ABAP and SAP Memory ABAP memory • ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements • Data within this ABAP memory remains intact during a whole sequence of program calls • To pass data to a program which you are calling, the data needs to be placed in ABAP memory before the call is made • The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory • If control is then returned to the program which made the initial call, the same process operates in reverse
  • 38. ABAP Memory REPORT Z_EXPORT_ABAP_MEM. PARAMETERS: myparam TYPE c LENGTH 4. DATA: mydata(4) TYPE C. START-OF-SELECTION. mydata = myparam. export mydata to memory id 'MYABAP_MEMORY'. WRITE 'Value exported'. WRITE mydata. *SUBMIT Z_IMPORT_ABAP_MEM.
  • 39. ABAP Memory REPORT Z_IMPORT_ABAP_MEM. *PARAMETERS: myparam TYPE c LENGTH 4. DATA: mydata(4) TYPE C. START-OF-SELECTION. import mydata from memory id 'MYABAP_MEMORY'. WRITE 'mydata = '. WRITE mydata.
  • 40. ABAP Memory Notes: After the export program is run, if the import program is run 1) In the same window – ABAP memory values are read 2) Import program is called from the export program (SUBMIT) – ABAP memory values are read 3) Called from a new session (external) created using the ‘Creates New Session’ button on the top menu - ABAP memory values are NOT read 4) Called from a new user logon (SAPgui) from the same or different PC for the same user - ABAP memory values are NOT read 5) Called from a new user logon (SAPgui) from the same or different PC for a different user - ABAP memory values are NOT read
  • 41. ABAP and SAP Memory (continued) SAP Memory • SAP memory is a memory area to which all main sessions within a SAPgui (login or user session) have access • Use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. • Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters)
  • 42. GET/SET parameters • These are also called SPA/GPA parameters • The most frequent use of GET/SET parameters is to fill input fields on screens • These parameters are reset when you logoff the sessions (exit) • These parameters can be set either for a particular user or for a particular program using the SET PARAMETER statement • Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement
  • 43. GET/SET parameters REPORT Z_SET_PARAMETER. PARAMETERS: myparam1 TYPE c LENGTH 4 MEMORY ID ZMYID1. PARAMETERS: myparam2 TYPE c LENGTH 4. * INITIALIZATION. * note: since there is no GET parameter here no values will be initialized (read) * for myparam2 (myparam1 is fine as it is defined with MEMORY ID option). START-OF-SELECTION. * note: myparam2 but not myparam1 needs SET parameter cmd * because myparam1 is defined with MEMORY ID option. * SET PARAMETER ID 'ZMYID1' FIELD myparam1. SET PARAMETER ID 'ZMYID2' FIELD myparam2. WRITE 'Parameter [myparam1/myparam2]: '. WRITE: myparam1, '/', myparam2. *SUBMIT Z_GET_PARAMETER VIA SELECTION-SCREEN AND RETURN.
  • 44. GET/SET parameters REPORT Z_GET_PARAMETER. PARAMETERS: myparam1 TYPE c LENGTH 4 MEMORY ID ZMYID1. PARAMETERS: myparam2 TYPE c LENGTH 4. INITIALIZATION. * note: only myparam2 (but not myparam1) needs GET parameter * command because myparam1 is defined with MEMORY ID option. * GET PARAMETER ID 'ZMYID1' FIELD myparam1. GET PARAMETER ID 'ZMYID2' FIELD myparam2. * note: since there is no SET parameter here * no values will be set for myparam2 (myparam1 is fine). START-OF-SELECTION. WRITE 'Parameter [myparam1/myparam2]: '. WRITE: myparam1, '/', myparam2.
  • 45. GET/SET parameters Notes: After the Set program is run, if the Get program is run 1) In the same window – SAP memory values are read 2) Get program is called from the Set program (SUBMIT) – SAP memory values are read 3) Get program called from a new session (external) created using the ‘Creates New Session’ button on the top menu - SAP memory values are read 4) Called from a new user logon (SAPgui) from the same or different PC for the same user - SAP memory values are NOT read 5) Called from a new user logon (SAPgui) from the same or different PC for a different user - SAP memory values are NOT read
  • 46. GET/SET DEMO with Line Selection Event REPORT Z_CALLINGPGM. DATA: carrier TYPE spfli-carrid, connection TYPE spfli-connid. START-OF-SELECTION. SELECT carrid connid FROM spfli INTO (carrier, connection). WRITE: / carrier HOTSPOT, connection HOTSPOT. HIDE: carrier, connection. ENDSELECT. AT LINE-SELECTION. SET PARAMETER ID: 'CAR' FIELD carrier, 'CON' FIELD connection. SUBMIT Z_CALLEDPGM AND RETURN. *SUBMIT Z_CALLEDPGM2 VIA SELECTION-SCREEN AND RETURN.
  • 47. GET/SET DEMO with Line Selection Event (continued) REPORT Z_CALLEDPGM. DATA: carrier TYPE spfli-carrid, connection TYPE spfli-connid. INITIALIZATION. *GET PARAMETER ID: 'CAR' FIELD carrier, 'CON' FIELD connection. START-OF-SELECTION. GET PARAMETER ID: 'CAR' FIELD carrier, 'CON' FIELD connection. IF sy-subrc <> 0. MESSAGE 'Parameter not found' TYPE 'I'. ELSE. write: / 'Details of carrier/connection are: '. write: / carrier, '/', connection. ENDIF. END-OF-SELECTION.
  • 48. GET/SET DEMO with Line Selection Event (continued) REPORT Z_CALLEDPGM2. PARAMETER: p_carr TYPE spfli-carrid, p_conn TYPE spfli-connid. INITIALIZATION. GET PARAMETER ID: 'CAR' FIELD p_carr, 'CON' FIELD p_conn. START-OF-SELECTION. write: / 'Details of carrier/connection are: '. write: / p_carr, '/', p_conn. END-OF-SELECTION.
  • 49. Variants • Variants allow you to reuse values entered once on the selection screens. These are helpful when: – The program is started frequently with same values – The program is run in the background
  • 50. Variants (continued) • A variant consists of two parts: The values entered on the selection screen (example: Value “AA” for airlines) The attributes and display attributes of the parameters and select-options (example: Making some fields read-only or some not visible, etc) Note: If you use the INITIALIZATION event to initialize any variables in the program, the variant will not have any effect on them (will get overwritten by the initialization)
  • 51. Variable Values in Variants • Variable date calculations – D option (this option is used when a date is in a variant - today's date, first day of month, or the last day of the previous month) • User-specific values – B option (this option is used to enter user- specific values in a selection field) • Values defined in table TVARVC – T option (To fill selection fields for a specific task using a variant you can save fixed values in table TVARVC. To avoid having to create new variants for each minor change in the selection values, you can assign a value in table TVARVC to a selection and then just change this value. This is particularly important if the corresponding value on the selection screen is write-protected) * TVARV (client dependent table) TVARVC (client independent)
  • 52. Variable Values in Variants Variable date calculations
  • 53. Example: ZBC405_C027393_SSCS_3E01 • *&------------------------------------------------ *&------------------------------------------------ *& Event INITIALIZATION *&------------------------------------------------ INITIALIZATION. * Initialize select-options for CARRID" OPTIONAL MOVE: 'AA' TO so_car-low, 'QF' TO so_car-high, 'BT' TO so_car-option, 'I' TO so_car-sign. APPEND so_car. CLEAR so_car. MOVE: 'AZ' TO so_car-low, 'EQ' TO so_car-option, 'E' TO so_car-sign. APPEND so_car. * Set texts for tabstrip pushbuttons tab1 = 'Connections'(tl1). tab2 = 'Date'(tl2). tab3 = 'Type of flight'(tl3). * Set second tab page as initial tab airlines-activetab = 'DATE'. airlines-dynnr = '1200'. * Text for pushbuttons push_det = 'Hide details'(p02).
  • 54. Example: ZBC405_C027393_SSCS_3E01 • *&------------------------------------------------ *& Event START-OF-SELECTION *&------------------------------------------------ START-OF-SELECTION. * Checking the output parameters CASE mark. WHEN all. * Radiobutton ALL is marked SELECT * FROM dv_flights INTO wa_flight WHERE carrid IN so_car AND connid IN so_con AND fldate IN so_fdt AND cityfrom IN so_start AND cityto IN so_dest. WRITE: / wa_flight-carrid, wa_flight-connid, wa_flight-fldate, wa_flight-countryfr, wa_flight-cityfrom, wa_flight-airpfrom, wa_flight-countryto, wa_flight-cityto, wa_flight-airpto, wa_flight-seatsmax, wa_flight-seatsocc. ENDSELECT.
  • 55. Example: ZBC405_C027393_SSCS_3E01 • WHEN national. * Radiobutton NATIONAL is marked SELECT * FROM dv_flights INTO wa_flight WHERE carrid IN so_car AND connid IN so_con AND fldate IN so_fdt AND cityfrom IN so_start AND cityto IN so_dest AND countryto = dv_flights~countryfr AND countryto = country. WRITE: / wa_flight-carrid, wa_flight-connid, wa_flight-fldate, wa_flight-countryfr, wa_flight-cityfrom, wa_flight-airpfrom, wa_flight-countryto, wa_flight-cityto, wa_flight-airpto, wa_flight-seatsmax, wa_flight-seatsocc. ENDSELECT.
  • 56. Example: ZBC405_C027393_SSCS_3E01 • WHEN internat. * Radiobutton INTERNAT is marked SELECT * FROM dv_flights INTO wa_flight WHERE carrid IN so_car AND connid IN so_con AND fldate IN so_fdt AND cityfrom IN so_start AND cityto IN so_dest AND countryto <> dv_flights~countryfr. WRITE: / wa_flight-carrid, wa_flight-connid, wa_flight-fldate, wa_flight-countryfr, wa_flight-cityfrom, wa_flight-airpfrom, wa_flight-countryto, wa_flight-cityto, wa_flight-airpto, wa_flight-seatsmax, wa_flight-seatsocc. ENDSELECT. ENDCASE.
  • 57. Example: ZBC405_C027393_SSCS_3E01 • *&------------------------------------------------ *& Event AT SELECTION-SCREEN ON BLOCK PARAM *&------------------------------------------------ AT SELECTION-SCREEN ON BLOCK param. " OPTIONAL * check country for national flights is not empty CHECK national = 'X' AND country = space. MESSAGE e003(bc405). *&------------------------------------------------ *& Event at selection-screen output *&------------------------------------------------ AT SELECTION-SCREEN OUTPUT. CASE sy-dynnr. WHEN 1100. LOOP AT SCREEN. IF screen-group1 = 'DET'. screen-active = switch. MODIFY SCREEN. ENDIF. ENDLOOP. IF switch = '1'. push_det = text-p02. ELSE. push_det = text-p01. * clear additional select-options to avoid unwanted * influence at selection from database REFRESH: so_start, so_dest. ENDIF. ENDCASE.
  • 58. Example: ZBC405_C027393_SSCS_3E01 • *&------------------------------------------------ *& Event at selection-screen *&------------------------------------------------ AT SELECTION-SCREEN. * Evaluate pushbutton command CASE sscrfields-ucomm. WHEN 'DETAILS'. CHECK sy-dynnr = 1100. IF switch = '1'. switch = '0'. ELSE. switch = '1'. ENDIF. ENDCASE.
  • 59. Example: BC405_SSCS_3TOP • *&------------------------------------------------ *& Include BC405_SSCS_3TOP *& *&------------------------------------------------ REPORT bc405_sscs_3. * Workarea for data fetch DATA: wa_flight TYPE dv_flights. * Constant for CASE statement CONSTANTS mark VALUE 'X'. * Structure for pushbutton command TABLES: sscrfields. * flag to control hiding / showing * of detail select-options DATA: switch TYPE n VALUE '1'. * Selections for connections SELECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN. SELECT-OPTIONS: so_car FOR wa_flight-carrid, so_con FOR wa_flight-connid. SELECTION-SCREEN SKIP 2. SELECTION-SCREEN PUSHBUTTON pos_low(20) push_det USER-COMMAND details. SELECTION-SCREEN SKIP. SELECTION-SCREEN BEGIN OF BLOCK bl_det WITH FRAME TITLE text-tld. SELECT-OPTIONS: so_start FOR wa_flight-cityfrom MODIF ID det, so_dest FOR wa_flight-cityto MODIF ID det. SELECTION-SCREEN END OF BLOCK bl_det. SELECTION-SCREEN END OF SCREEN 1100.
  • 60. Example: BC405_SSCS_3TOP • * Selections for flights SELECTION-SCREEN BEGIN OF SCREEN 1200 AS SUBSCREEN. SELECT-OPTIONS so_fdt FOR wa_flight-fldate NO-EXTENSION. SELECTION-SCREEN END OF SCREEN 1200. * Output parameter SELECTION-SCREEN BEGIN OF SCREEN 1300 AS SUBSCREEN. SELECTION-SCREEN BEGIN OF BLOCK param WITH FRAME TITLE text-tl3. SELECTION-SCREEN BEGIN OF BLOCK radio WITH FRAME. PARAMETERS: all RADIOBUTTON GROUP rbg1, national RADIOBUTTON GROUP rbg1, internat RADIOBUTTON GROUP rbg1 DEFAULT 'X'. SELECTION-SCREEN END OF BLOCK radio. PARAMETERS: country LIKE wa_flight-countryfr. SELECTION-SCREEN END OF BLOCK param. SELECTION-SCREEN END OF SCREEN 1300. SELECTION-SCREEN BEGIN OF TABBED BLOCK airlines FOR 10 LINES. SELECTION-SCREEN TAB (20) tab1 USER-COMMAND conn DEFAULT SCREEN 1100. SELECTION-SCREEN TAB (20) tab2 USER-COMMAND date DEFAULT SCREEN 1200. SELECTION-SCREEN TAB (20) tab3 USER-COMMAND type DEFAULT SCREEN 1300. SELECTION-SCREEN END OF BLOCK airlines .
  • 61. Calling programs using Transaction Code Method 1 LEAVE TO TRANSACTION <t-code>. • The system terminates the current program and starts the program with transaction code . The statement is the equivalent of entering /n in the command field followed by the transaction code. After the called program the user returns to the application menu and NOT to the calling program (When using LEAVE TO TRANSACTION, the current call sequence is exited completely. Upon completion of the called transaction, the runtime environment returns to the position where the first program in the call sequence was called) LEAVE TO CURRENT TRANSACTION. • The system terminates the current program and restarts the same program (This transaction code is contained in the system field sy-tcode) LEAVE TO TRANSACTION <t-code> AND SKIP FIRST SCREEN. • If you use the …AND SKIP FIRST SCREEN addition, the system does not display the screen contents of the first screen in the transaction. However, it does process the flow logic
  • 62. Calling programs using Transaction Code (continued) Method 2 CALL TRANSACTION <t-code>. • The system calls the ABAP program with a transaction code and when the called program completes or encounters a LEAVE PROGRAM statement, the system resumes processing at the next statement after the call in the calling program CALL TRANSACTION <t-code> AND SKIP FIRST SCREEN. • If you use the …AND SKIP FIRST SCREEN addition, the system does not display the screen contents of the first screen in the transaction. However, it does process the flow logic • If you started a transaction using CALL TRANSACTION that uses update techniques, you can use the UPDATE… addition to specify the update technique (asynchronous (default), synchronous, or local) that the program should use (See data transfer method)
  • 63. Calling programs using Transaction Code (continued) LEAVE TO TRANSACTION 'ZBC405_1'. CALL TRANSACTION 'ZBC405_1' [AND SKIP FIRST SCREEN .] Provide selection values in Variant. If values are different each time, use Variable date calculations - D option Or Values defined in table TVARVC - T option, etc. Update table TVARVC with new values before calling the transaction
  • 64. Calling programs using Program/Report Name SUBMIT <programname>. After the called program the user returns to the application menu and NOT to the calling program. Here users do not see the selection screen, therefore selection values will have to be populated using WITH options shown in the next few slides SUBMIT <programname> AND RETURN. After the called program is completed the user returns to the calling program. Here too users do not see the selection screen, therefore selection values will have to be populated using WITH options shown in the next few slides SUBMIT <programname> VIA SELECTION-SCREEN. Shows the selection screen (first screen) of the called program, where user may enter the selection values. If selection values are populated using the WITH options, the users will see these values and can modify them if required or just execute the report
  • 65. Calling programs using Program/Report Name (continued) SUBMIT <programname> WITH <p_param1> = 'value1‘ WITH <p_param2> = 'value2'. Use the above syntax to pass/populate parameters from the calling program to the called program. Example: SUBMIT ZBC405_C027393_SSCS_2 WITH COUNTRY = 'ZZZ' WITH COUNTRY2 = 'YYY' VIA SELECTION-SCREEN.
  • 66. Calling programs using Program/Report Name (continued) SUBMIT <programname> WITH SELECTION-TABLE rspar [VIA SELECTION-SCREEN]. If you specify this addition, parameters and selection criteria on the selection screen are supplied from an internal table rspar. The row type for this internal table is RSPARAMS. The structured data type RSPARAMS is defined in the ABAP Dictionary and has the following components, all of which are data type CHAR: – SELNAME length 8 – must contain the name of a parameter or selection criterion [select- options] for the selection screen in block capitals – KIND length 1 – must contain the type of selection screen component (P for parameters, S for selection criteria) – SIGN length 1 – specifies whether the result of the row condition needs to be included for each row (I – Inclusive, E – Exclusive) – OPTION length 2 – specifies the comparison operators EQ (equal), NE (not equal), GT (greater than), BT (between) and NB (not between) – LOW length 45 – this is the lower limit of the range (in the case of parameters, the value must be specified in LOW and all other components are ignored) – HIGH length 45 – this is the lower limit of the range
  • 67. Calling programs using Program/Report Name (continued) Example showing “WITH SELECTION-TABLE” DATA: MY_RSPAR LIKE STANDARD TABLE OF RSPARAMS WITH HEADER LINE. MOVE: 'SO_CAR' TO MY_RSPAR-SELNAME, 'S' TO MY_RSPAR-KIND, You can pass parameters 'I' TO MY_RSPAR-SIGN, and/or select-options by 'BT' TO MY_RSPAR-OPTION, 'CO' TO MY_RSPAR-LOW, 'DL' TO MY_RSPAR-HIGH. specifying correct value in the APPEND MY_RSPAR. KIND field (P for parameters, CLEAR MY_RSPAR. MOVE: 'SO_CAR' TO MY_RSPAR-SELNAME, S for select-options) 'S' TO MY_RSPAR-KIND, 'I' TO MY_RSPAR-SIGN, 'EQ' TO MY_RSPAR-OPTION, 'LH' TO MY_RSPAR-LOW, ' ' TO MY_RSPAR-HIGH. APPEND MY_RSPAR. CLEAR MY_RSPAR. MOVE: 'COUNTRY' TO MY_RSPAR-SELNAME, 'P' TO MY_RSPAR-KIND, ‘I' TO MY_RSPAR-SIGN, 'EQ' TO MY_RSPAR-OPTION, 'FR' TO MY_RSPAR-LOW. APPEND MY_RSPAR. SUBMIT ZBC405_C027393_SSCS_2 WITH SELECTION- TABLE MY_RSPAR VIA SELECTION-SCREEN.
  • 68. Calling programs using Program/Report Name (continued) SUBMIT <programname> USING SELECTION- SET 'VARIANT1‘ If you specify this option, the parameters and selection criteria for the selection screen are supplied with values from a variant. Provide the name of the variant in single quotes. If the variant does not exist, the system sends an error message. If the variant belongs to a different selection screen, it is ignored.