7 all about abap report programming

Upload: raza887

Post on 03-Apr-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 7 All About ABAP Report Programming

    1/5

    3/18/13 All About ABAP Report Programming

    www.saptraininghub.com/all-about-abap-report-programming/

    Sap Training Hub

    Free SAP Training & Tutorials

    What is SAP?

    ABAP

    HR

    FICO

    SD

    Video

    Payroll

    Quiz

    Java

    Testing

    Answers

    All About ABAP Report Programming

    SAP-ABAP supports two types of Programs - Report Programs & Dialog Programs. Report Programs are used when

    large amounts of data needs to be displayed

    Purpose/Use of Report Programs

    They are used when data from a number of tables have to be selected and processed before presenting

    Used when reports demand a special format

    Used when the report has to be downloaded from SAP to an Excel sheet to be distributed across.

    Used when the report has to be mailed to a particular person.

    Important Points to Note About Report Program

    DB2/UDB DBA training

    www.db2team.com

    Learn to be a DBA online Learn from theexperts

    http://www.saptraininghub.com/http://www.google.com/url?ct=abg&q=https://www.google.com/adsense/support/bin/request.py%3Fcontact%3Dabg_afc%26url%3Dhttp://www.saptraininghub.com/all-about-abap-report-programming/%26gl%3DPK%26hl%3Den%26client%3Dca-pub-6330153051175486%26ai0%3DCGSXdvppGUZOBEcWaigbYqIG4BL-tz4gDr-aJu0fAjbcBEAEgm8zvI1CPhpHs-_____8BYMsEyAEBqAMByAPTBKoElgFP0DiM0d84BZ-L5JguPrACYghi3w7YJCigrEWE5CUPXvAEeZvPBFWYTbMdqfTjrWS92JDhhmND2t7ufbLvRJpME9VuCo8_ABO1hbb0epDistzR5yRW7al2p6-2GBWTzXK95QckmcodOXmPFPdqy9DfOs2Kb0Vsyl79s8b9xK_1KM0YaSlDHoxZmdgj_yDO2_GxrAJcCvSAB_fZmSk&usg=AFQjCNFaNWmRhJqCiNBMsW7u4EbmVguefAhttp://googleads.g.doubleclick.net/aclk?sa=L&ai=CGSXdvppGUZOBEcWaigbYqIG4BL-tz4gDr-aJu0fAjbcBEAEgm8zvI1CPhpHs-_____8BYMsEyAEBqAMByAPTBKoElgFP0DiM0d84BZ-L5JguPrACYghi3w7YJCigrEWE5CUPXvAEeZvPBFWYTbMdqfTjrWS92JDhhmND2t7ufbLvRJpME9VuCo8_ABO1hbb0epDistzR5yRW7al2p6-2GBWTzXK95QckmcodOXmPFPdqy9DfOs2Kb0Vsyl79s8b9xK_1KM0YaSlDHoxZmdgj_yDO2_GxrAJcCvSAB_fZmSk&num=1&sig=AOD64_1p9vsGIok3v5G5m4KpONs4bxBQnA&client=ca-pub-6330153051175486&adurl=http://www.db2team.com&nm=5http://www.83answers.com/http://www.guru99.com/http://www.javatutorialhub.com/http://www.saptraininghub.com/quiz/http://www.saptraininghub.com/sap-payroll/http://www.saptraininghub.com/sapvideos/http://www.saptraininghub.com/free-sap-sd-training-course/http://www.saptraininghub.com/sap-fico-training-tutorials/http://www.saptraininghub.com/sap-hcm/http://www.saptraininghub.com/abap-tutorial/http://www.saptraininghub.com/what-is-sap/http://feeds.feedburner.com/SapTrainingHubhttp://www.facebook.com/pages/Sap-Training-Hub/139632216092864http://twitter.com/SAPTHubhttp://www.saptraininghub.com/
  • 7/29/2019 7 All About ABAP Report Programming

    2/5

    3/18/13 All About ABAP Report Programming

    www.saptraininghub.com/all-about-abap-report-programming/

    Report Programs are always Executable Programs. Program Type is always 1.

    Every Report program corresponds to a particular Application Type i.e. either with Sales & Distribution, FI

    CO etc. It can also be Cross Application i.e. type *.

    Report Programming is an Event-driven programming.

    The first line of a report program is always Report .

    In order to suppress the list heading or the name of the program the additionNo Standard Page Headingis

    used.

    The line size for a particular report can be set by using the addition line-size .The line count for a particular page can be set by using the addition line-count n(n1). N is the number of lines

    for the page and N1 is the number of lines reserved for the page footer.

    To display any information or error message we add a message class to the program using the addition:

    Message-id . Message classes are maintained in SE91.

    Therefore an ideal report program should start with:

    Report no standard page heading

    line-size

    line-count

    message-id .

    Selection Screen

    Selection screen is the screen where one specifies the input values for which the program should run.

    The selection screen is normally generated from the

    1. Parameters

    2. Select-Options

    Syntax

    Selection-screen begin of screen

    selection-screen begin of block with frame title

    selection-screen end of block

    selection-screen end of screen

    Parameters

    Parameters helps one to do dynamic selection. They can accommodate only one value for one cycle of execution of the

    program.

    Syntax

    Defining parameters as a data type

  • 7/29/2019 7 All About ABAP Report Programming

    3/5

    3/18/13 All About ABAP Report Programming

    www.saptraininghub.com/all-about-abap-report-programming/

    Parameters p_id(30) type c.

    Defining parameters like a table field.

    Parameter p_id like -.

    Parameters can be Checkboxes as well as Radiobuttons.

    Parameters p_id as checkbox.

    Parameters p_id1 radiobutton group .

    Parameters p_id2 radiobutton group .

    Parameters can be listbox.

    Parameter p_id like - as listbox

    Select Options

    A Select-Option is used to input a range of values or a set of values to a program

    Syntax

    select-options s_vbeln for vbak-vbeln.

    You can also define a select option like a variable

    select-options s_vbeln for vbak-vbeln no intervals no-extension

    Events in an ABAP Report Program

    ABAP report programs are event driven programs. The different events in a report Program are:

    Load-of-program

    Triggers the associated event in an internal session after loading a program of type 1, M, F, or S.

    Also runs the associated processing block once and once only for each program and internal session.

    The processing block LOAD-OF-PROGRAM has roughly the same function for an ABAP program of type 1,

    M, F or S as a constructor has for classes in ABAP Objects

    Initialization.

    This event is executed before the selection screen is displayed .

    Initialization of all the values.

    You can assign different values other than the values defaulted on the selection screen .

    You can fill your selection screen with some values at runtime.

    At Selection-Screen.

  • 7/29/2019 7 All About ABAP Report Programming

    4/5

    3/18/13 All About ABAP Report Programming

    www.saptraininghub.com/all-about-abap-report-programming/

    The event is processed when the selection screen has been processed (at the end of PAI ).

    Validation & Checks of inputted values happen here

    Start-of-Selection.

    Here the program starts selecting values from tables.

    End-of-selection.

    After all the data has been selected this event writes the data to the screen.

    Interactive Events

    Used for interactive reporting. It is used to create a detailed list from a basic list.

    Formatting the report

    ABAP allows the reports to be formatted as the user wants it to be. For example, Alternate Lines must appear in

    different colors and the Totals line should appear in Yellow.

    Syntax

    Format Color n

    Format Color n Intensified On

    n may correspond to various numbers

    Please note that there are other additions along with format as well

    FORMAT COLOR OFF INTENSIFIED OFF INVERSE OFF HOTSPOT OFF INPUT OFF

    Interactive Programming

    Using Interactive Programming users can actively control the data retrieval and display of data

    Used to create a detailed list from a very basic list

    The detailed data is written on a secondary list.

    The secondary list may either completely overlay the first screen or one can display it in a new screen

    The secondary lists can be themselves interactive.

    The first list may also call a transaction.

    There are different events associated with interactive programming.

    Some commands used for interactive programming

    Hotspot

    If one drags the mouse over the data displayed in the repor the cursor changes to a Hand with an Outstretched Index

    finger. An hotspot can be achieved using the FORMAT statement.

    Syntax: Format Hotspot On (Off).

  • 7/29/2019 7 All About ABAP Report Programming

    5/5

    3/18/13 All About ABAP Report Programming

    www.saptraininghub.com/all-about-abap-report-programming/

    Hide

    This command helps you to store the field names based on which one will be doing further processing to get a detailed

    list. It is written directly after the WRITE statement for a field. When a row is selected the values get automatically filled

    in the variables for further use.

    Syntax: Hide .

    Logical Databases

    Instead of using Select queries you can use logical database to retrieve data for a program.

    Logical databases are created by transaction SE36

    The name of a logical database can be up to 20 characters long. It may begin with a namespace prefix.

    The data is selected by another program and one can access the data using GET command which

    places the data in the work area .

    Advantages of a logical database over normal Select queries.

    1. It offers check conditions to see whether the input is correct, complete and plausible2. It contains central authorization checks for database access

    3. Enhancements such as improvement in performance immediately apply to all reports which use logical database.

    Note: Due to the complexities involved, logical databases are not used in most of the cases

    You might like:

    Recommended by

    Share7 Tweet1 Share0 +14 Share950

    On January 18, 2011 / ABAP / Comments Off

    Comments are closed.

    Search

    FAQ

    How to trace if an

    OSS Note is

    deployed in your

    landscape

    Accounting Key How To Create

    Credit Memo

    How to become SAP

    consultant

    LSMW Data

    Migration - Step by

    Step

    http://www.saptraininghub.com/lsmw-data-migration-step-by-step/http://www.saptraininghub.com/how-to-become-sap-consultant/http://www.saptraininghub.com/credit-memo-request/http://www.saptraininghub.com/accounting-key/http://www.saptraininghub.com/how-to-trace-if-an-oss-note-is-deployed-in-your-landscape/http://www.saptraininghub.com/lsmw-data-migration-step-by-step/http://www.saptraininghub.com/how-to-become-sap-consultant/http://www.saptraininghub.com/credit-memo-request/http://www.saptraininghub.com/accounting-key/http://www.saptraininghub.com/how-to-trace-if-an-oss-note-is-deployed-in-your-landscape/http://www.saptraininghub.com/abap/