当前位置:网站首页>SAP ABAP report programming-08

SAP ABAP report programming-08

2022-06-22 16:21:00 Boating in rainy days

SAP ABAP Report programming -08

SAP-ABAP Two types of programs are supported - Reporting procedures and dialogue procedures . report form The program uses... When it needs to display a large amount of data

In this tutorial , You will learn :

  • Select screen
  • ABAP Report planned events
  • Format report
  • Interactive report programming
  • Logical database

The purpose of the reporting procedure / purpose

  • When data from multiple tables must be selected and processed before rendering , They will be used
  • Use... When a report requires a special format
  • When the report must be transferred from SAP Download to the to be distributed Excel Use... When working with worksheets .
  • Use when the report must be mailed to a specific person .

Notes on reporting procedures

  • The reporter is always an executable program . The program type is always 1.
  • Each reporter corresponds to a specific application type , Sales and distribution ,FI - CO etc. . It can also be cross application , That is, type “*”.
  • Report programming is an event driven programming .
  • The first line of the reporter is always the report *< Report name >.*
  • To suppress the display of list titles or program names , Please use add *“ No standard page title *”.
  • You can use the addition line size < size > To set up a specific report Line size of .
  • You can use the addition line count n(n1) To set the row count for a particular page .N Is the number of lines on the page ,N1 Is the number of rows reserved for the page footer .
  • To display any information or error messages , We use the added add Add a message class to the program in :Message-id<message Class name >. The mail class is in SE91 In the maintenance .

therefore , The ideal reporting process should begin with :

Report <report name> no standard page heading

line-size <size>

line-count <n(n1)>

message-id <message class>.

Select screen

Select screen ” Is a screen that specifies the input values that the program should run .

The selection screen usually starts from

  1. Parameters
  2. choice - Options

grammar

Selection-screen begin of screen <screen #>
selection-screen begin of block <#>  with frame title <text>
.........
.........
selection-screen end of block <#>
selection-screen end of screen <screen #>

Parameters

Parameters help with dynamic selection . They can only hold one value for one execution cycle of the program .

grammar

Define parameters as data types

Parameters p_id(30) type c.

Defining parameters , As shown in the table .

Parameter p_id like <table name>-<field name>.

The parameter can be a check box , It can also be a radio button .

Parameters p_id as checkbox.Parameters p_id1 radiobutton group <group name>.
Parameters p_id2  radiobutton group <group name>.

The parameter can be a list box .

Parameter p_id like <table name>-<field name> as listbox

Select options

The selection option is used to enter a series of values or a set of values into the program

grammar

select-options s_vbeln for vbak-vbeln.

 Insert picture description here

You can also define a selection option , Such as variable

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

ABAP Report planned events

ABAP The reporting procedure is Event driven programs . Different events in the report Program Include :

Program loading

  • The load type is 1、M、F or S After , Trigger the associated event in the internal session .
  • Run the associated processing block once for each program and internal session at the same time , And only run once .
  • For types of 1、M、F or S Of ABAP Program , Processing block LOAD-OF-PROGRAM Functions and constructors of for ABAP Classes in the object have roughly the same functions

initialization .

  • This event is executed before the selection screen is displayed .
  • Initialize all values .
  • You can specify values other than the default values on the selection screen .
  • You can fill the selection screen with some values at run time .

On the selection screen .

  • When processing the selection screen ( stay PAI At the end of ) Deal with the incident .
  • The validation and check of input values are performed here

Start choosing .

  • ad locum , The program starts selecting values from the table .

Choose the end .

  • After selecting all data , This event writes data to the screen .

Interactive activities

  • For interactive reporting . It is used to create detailed lists from basic lists .

Format report

ABAP It is allowed to set the format of the report to the format desired by the user . for example ,“ Alternate row ” Must be displayed in different colors ,“ A total of ” Lines should be displayed in yellow .

grammar

Format Color n

Format Color n Intensified On

n It can correspond to various numbers

Please note that , Besides the format , There are other additions

FORMAT COLOR OFF INTENSIFIED OFF INVERSE OFF HOTSPOT OFF INPUT OFF

Interactive report programming

  • Use interactive programming , Users can actively control the retrieval and display of data
  • Used to create detailed lists from very basic lists
  • The detailed data is written in the auxiliary list .
  • The auxiliary list can completely cover the first screen , It can also be displayed in a new screen
  • The auxiliary list itself can be interactive .
  • The first list can also invoke transactions .
  • There are different events associated with interactive programming .

Some commands for interactive programming

hotspot

If you drag the mouse over the data displayed in the report , The cursor changes to “ Hold out your index finger ” hand . have access to FORMAT Statement implementation hotspot .

Syntax:      Format Hotspot On (Off).

hide

This command helps you store field names based on field names that will be processed further , For a detailed list . It is written directly in the field WRITE After statement . When selecting rows , Values are automatically populated into variables for further use .

Syntax:     Hide <field-name>.

Logical database

  • You can use a logical database to retrieve program data , Instead of using “ choice ” Inquire about .
  • The logical database consists of transactions SE36 establish
  • The name of a logical database can contain at most 20 Characters . It may start with a namespace prefix .
  • The data is selected by another program , have access to GET Command access data , This command places the data in the workspace .

Logical database is relative to common database Select Advantages of query .

  1. It provides inspection conditions , To see if the input is correct , Complete and reasonable
  2. It contains a central authorization check for database access
  3. Performance improvements and other enhancements are immediately applied to all reports that use a logical database .

notes : Due to the complexity involved , In most cases, logical databases are not used

Reference resources :https://www.guru99.com/all-about-abap-report-programming.html

原网站

版权声明
本文为[Boating in rainy days]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221500489241.html