This document was ed by and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this report form. Report 3b7i
=
= <m> -
= <m> *
= <m> /
= <m> DIV
= <m> MOD
= <m> ** ...... MEMORY ID ... VISIBLE LENGTH , the input field is displayed in the length ...... OBLIGATORY ...... To check a entry against a check table or against fixed values in the ABAP Dictionary, you use the following syntax: PARAMETERS TYPE ...... NO-DISPLAY ...... To modify the appearance of an input field on the selection screen, you must assign the parameter to a modification group as follows: PARAMETERS ...... MODIF ID ]. The statement without any options stores the contents of line of the addressed list. This statement reads a line twice in succession. To do this, you use the READ CURRENT LINE statement in your program: READ CURRENT LINE [FIELD VALUE ] [<modifications>]. Without the first line of options, this statement modifies line
Keyword ADD
• ABAP s automatic type conversion and length adjustment for all of them except type D (date) and type T (time) fields which cannot be converted into each other. FIELD SYMBOLS:Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.You can create field symbols either without or with type specifications. If you do not specify a type, the field symbol inherits all of the technical attributes of the field assigned to it. If you do specify a type, the system checks the compatibility of the field symbol and the field you are asg to it during the ASSIGN statement. To declare a field symbol, use the statement FIELD-SYMBOLS
- 34 -
SAP –ABAP BOOK When you assign the data object, the system checks whether the technical attributes of the data object
SAP –ABAP BOOK EXTRACT
Comparing Strings Similarly to the special statements for processing strings, there are special comparisons that you can apply to strings with types C, D, N, and T. You can use the following operators:
Meaning Contains Only Contains Not only Contains Any contains Not Any Contains String contains No String Contains Pattern contains No Pattern - 36 -
SAP –ABAP BOOK There are no conversions with these comparisons. Instead, the system compares the characters of the string. INTERNAL TABLES Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. You should use internal tables whenever you want to process a dataset with a fixed structure within a program. A particularly important use for internal tables is for storing and formatting data from a database table within a program. They are also a good way of including very complicated data structures in an ABAP program. Table type:The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types: Standard tables have an internal linear index. From a particular size upwards, the indexes of internal tables are istered as trees. In this case, the index istration overhead increases in logarithmic and not linear relation to the number of lines. The system can access records either by using the table index or the key. The response time for key access is proportional to the number of entries in the table. The key of a standard table is always non-unique. You cannot specify a unique key. This means that standard tables can always be filled very quickly, since the system does not have to check whether there are already existing entries. You should fill a standard table by appending lines (ABAP APPEND statement), and read, modify and delete entries by specifying the index Sorted tables are always saved sorted by the key. They also have an internal index. The system can access records either by using the table index or the key. The response time for key access is logarithmically proportional to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique or non-unique. When you define the table, you must specify whether the key is to be unique or not. Standard tables and sorted tables are known generically as index tables. You fill sorted tables using the INSERT statement. Entries are inserted according to the sort sequence defined through the table key Hashed tables have no linear index. You can only access a hashed table using its key. The response time is independent of the number of table entries, and is constant, since the system access the table entries using a hash algorithm. The key of a hashed table must be unique. When you define the table, you must specify the key as UNIQUE. Initial Memory Requirement:You can specify the initial amount of main memory assigned to an internal table object when you define the data type using the following addition: INITIAL SIZE
- 37 -
SAP –ABAP BOOK This size does not belong to the data type of the internal table, and does not affect the type check. You can use the above addition to reserve memory space for
- 38 -
SAP –ABAP BOOK If you are using internal tables with header lines, that the header line and the body of the table have the same name. If you want to address the body of the table in a comparison, you must place two brackets ([ ]) after the table name. CLEAR
- 39 -
SAP –ABAP BOOK you sort a table several times by the same key, the sequence of the table entries will change in each sort. However, a stable sort takes longer than an unstable sort. To ensure compatibility with previous releases, you can also specify formal parameters in subroutines and function modules as TABLES parameters. This defines a formal parameter as a standard table with default key and header line. Whenever you a table without a header line as an actual parameter to a formal parameter with a header line (TABLES), the system automatically creates the corresponding header line in the routine. To find out the attributes of an internal table at runtime that were not available statically, use the statement: DESCRIBE TABLE
Standard tables
The line is appended to the end of the internal table. This has the same effect as the explicit APPEND statement. •
Sorted tables
The line is inserted into the table according to the table key. If the key is non-unique, duplicates are inserted above the existing entry with the same key. The runtime for the operation increases logarithmically with the number of existing table entries. •
Hashed tables
The table is inserted into the internal hash istration according to the table key.
To add several lines to an internal table, use the statement: INSERT LINES OF
SAP –ABAP BOOK effect as inserting the new line. If an entry with the same key already exists, the COLLECT statement does not append a new line, but adds the contents of the numeric fields in the work area to the contents of the numeric fields in the existing entry 3) To read a single line of any table, use the statement: READ TABLE
Standard tables
Linear search, where the runtime is in linear relation to the number of table entries. •
Sorted tables
Binary search, where the runtime is in logarithmic relation to the number of table entries. •
Hashed tables
The entry is found using the hash algorithm of the internal table. The runtime is independent of the number of table entries. 4) To change a single line, use the following statement: MODIFY TABLE
Meaning First line of the internal table Last line of the internal table Beginning of a group of lines with the same contents in the field
You can use control level statements to react to control breaks in internal tables instead of programming them yourself with logical expressions. Within the loop, you must order the AT-
- 41 -
SAP –ABAP BOOK ENDAT statement blocks according to the hierarchy of the control levels. If the internal table has the columns
Operations with header line Operations for all Table Types
INSERT <wa> INTO TABLE
INSERT TABLE ITAB.
COLLECT <wa> INTO
COLLECT
READ TABLE
READ TABLE
MODIFY TABLE
MODIFY TABLE
MODIFY
MODIFY
DELETE TABLE
DELETE TABLE
LOOP AT ITAB INTO <wa> ...
LOOP AT ITAB ... Operations for Index Tables
APPEND <wa> TO
APPEND
INSERT <wa> INTO
INSERT
MODIFY
MODIFY
File Handling in ABAP ABAP contains three statements for working with files: • • •
OPEN DATASET for opening files CLOSE DATASET for closing files DELETE DATASET for deleting files
To open a file on the application server, use the OPEN statement as follows: OPEN DATASET
SAP –ABAP BOOK To open a file for reading, use the FOR INPUT addition to the OPEN DATASET statement. OPEN DATASET
OPEN DATASET READ DATASET TRANSFER DELETE DATASET
the system automatically checks the ’s authorization against the authorization object S_DATASET.
- 43 -
SAP –ABAP BOOK To make programs portable, the R/3 System has a concept of logical filenames and paths. These are linked to physical files and paths. The links are created in special tables, which you can maintain according to your own requirements. In an ABAP program, you can then use the function module FILE_GET_NAME to generate a physical filename from a logical one
TO LOAD THE DATA INTO APPLICATION SERVER *&-------------------------------------------------------------------* *& Report Z_APPL_TEST * *& * *&-------------------------------------------------------------------* REPORT z_appl_test . DATA: BEGIN OF itab OCCURS 0, name(10), num TYPE n, END OF itab. itab-name = 'VIKRAM'. itab-num = '24'. APPEND itab. DATA: BEGIN OF it_read OCCURS 0, txt(100), END OF it_read. OPEN DATASET '\usr\JHSOFT.txt' FOR OUTPUT IN TEXT MODE ENCODING DEFAULT. IF sy-subrc = 0. LOOP AT itab. TRANSFER itab TO '\usr\JHSOFT.txt'. ENDLOOP. ENDIF. CLOSE DATASET '\usr\JHSOFT.txt'. TO READ DATA FROM APPLICATION SERVER *&---------------------------------------------------------------------* *& Report Z_APPL_TEST_READ *&---------------------------------------------------------------------* REPORT Z_APPL_TEST_READ . parameter p_file like rlgrap-filename. data: begin of it_read occurs 0, txt(300), end of it_read.
- 44 -
SAP –ABAP BOOK
OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT. IF sy-subrc = 0. DO. READ DATASET p_file INTO it_read. IF sy-subrc <> 0. EXIT. ENDIF. APPEND it_read. ENDDO. ENDIF. loop at it_read. write:/ it_read-txt. endloop.
* SELECTION-SCREENS * -defined selection screens The two statements: SELECTION-SCREEN BEGIN OF SCREEN
RS_SET_SELSCREEN_STATUS
Sets another GUI status defined in the same ABAP program, or deactivates functions of the standard GUI status. •
RS_EXTERNAL_SELSCREEN_STATUS
Sets a GUI status defined in an external function group. You must use the SET PF-STATUS statement to set the status in a special function module in this function group. You must the name of the function module that sets the Status as a parameter to the function module RS_EXTERNAL_SELSCREEN_STATUS.
- 45 -
SAP –ABAP BOOK The SPA/GPA Parameter Technique is a general procedure for filling the initial screen when a program is called. To use this technique for parameters on selection screens, you must link the parameter to an SPA/GPA parameter from the SAP memory as follows: PARAMETERS
SIGN
The data type of SIGN is C with length 1. The contents of SIGN determine for each row whether the result of the row condition is to be included in or excluded from the resulting set of all rows. Possible values are I and E. – I stands for "inclusive" (inclusion criterion - operators are not inverted) – E stands for "exclusive" (exclusion criterion - operators are inverted) •
OPTION
- 46 -
SAP –ABAP BOOK The data type of OPTION is C with length 2. OPTION contains the selection operator. The following operators are available: – If HIGH is empty, you can use EQ, NE, GT, LE, LT,, and NP. These operators are the same as those that are used for logical expressions. Yet operators and NP do not have the full functional scope they have in normal logical expressions. They are only allowed if wildcards ( '*' or '+' ) are used in the input fields, and no escape character is defined. – If HIGH is filled, you can use BT (BeTween) and NB (Not Between). These operators correspond to BETWEEN and NOT BETWEEN that you use when you check if a field belongs to a range. •
LOW
The data type of LOW is the same as the column type of the database table, to which the selection criterion is linked. – If HIGH is empty, the contents of LOW define a single field comparison. In combination with the operator in OPTION, it specifies a condition for the database selection. – If HIGH is filled, the contents of LOW and HIGH specify the upper and lower limits for a range. In combination with the operator in OPTION, the range specifies a condition for the database selection. •
HIGH
The data type of HIGH is the same as the column type of the database table, to which the selection criterion is linked. The contents of HIGH specify the upper limit for a range selection. If the selection table contains more than one row, the system applies the following rules when creating the complete selection criterion: 1. Form the union of sets defined on the rows that have SIGN field equal to I (inclusion). 2. Subtract the union of sets defined on the rows that have SIGN field equal to E (exclusion). 3. If the selection table consists only of rows in which the SIGN field equals E, the system selects all data outside the set specified in the rows. RANGES Tables You can use the RANGES statement to create internal tables of the same type as selection tables. RANGES
Upper and lower case for selection criteria:
(2) SELECT-OPTIONS <seltab> FOR
To make the From field a required field on the selection screen, use:
(3) SELECT-OPTIONS <selcrit> FOR
To hide input fields on the selection screen, use:
(4) SELECT-OPTIONS <selcrit> FOR
To modify input fields on the selection screen, use:
(5) SELECT-OPTIONS <selcrit> FOR
To place comments on the selection screen, and if you want write anything in selection-screen, you use: SELECTION-SCREEN COMMENT [/]<pos(len)>
- 48 -
<x1>
SAP –ABAP BOOK (4) SELECTION SCREEN PUSHBUTTON [/]<pos(len)>
-COMMAND
Similarly to on screens, where you can define checkboxes and radio buttons with function codes, you can do the same with checkboxes and radio buttons on selection screens. You do this using the -COMMAND addition when you declare the relevant parameters: PARAMETERS ... AS CHECKBOX | RADIOBUTTON GROUP ... -COMMAND
- 49 -
SAP –ABAP BOOK The ABAP statements that create lists actually create the list on the application server, where it is buffered. The list is then displayed either when the LEAVE TO LIST-PROCESSING statement occurs in the program, or, for executable programs, automatically. In executable programs, the list that you create is displayed (at the latest) after the last event block in the program. You can output symbols or R/3 icons on a list by using the following syntax: Syntax WRITE <symbol-name> AS SYMBOL. WRITE
This statement
ends the current page. All other output appears on a new page.
only starts a new page if output is written to the current page as well as to the new page after NEW-PAGE. The system then increases the SY-PAGNO system field by one. You cannot produce empty pages.
•
does not trigger the END-OF-PAGE event. This means that the system does not output a page footer even if one is defined.
•
Conditional Page Break- Defining a Block of Lines:-
- 50 -
SAP –ABAP BOOK To execute a page break on the condition that less than a certain number of lines is left on a page, use the RESERVE statement: Syntax RESERVE
- 51 -
SAP –ABAP BOOK RESERVE. ..... BACK. If BACK follows RESERVE, the subsequent output appears in the first line written after RESERVE. You can use this statement, for example, to jump back to a specific line after writing an output from within a loop. PROCESSING BLOCKS: Dialog modules Dialog modules are defined using the following pair of statements: MODULE <mod> OUTPUT|[INPUT]. ... ENDMODULE The OUTPUT addition defines the dialog module <mod> as one that may be called from the PBO event of the flow logic of any screen. The INPUT addition defines the dialog module <mod> as one that may be called from the PAI event of the flow logic of any screen. INPUT is the standard addition. It may be omitted. You can define two dialog modules, both called <mod>, in the same program as long as one of them has the addition OUTPUT and the other has the addition INPUT. Description of Events This section describes in more detail the events that occur when you run an executable program. The following events occur when you run a typical executable program with a logical database:
Event INITIALIZATION AT SELECTION-SCREEN START-OF-SELECTION GET
. - 47 - SAP –ABAP BOOK Besides the special additions, there are a number of other additions that you can use with the SELECT-OPTIONS statement and that have the same syntax and the same function as for the PARAMETERS statement. SPA/GPA parameters as default values SELECT-OPTIONS (1) SELECT-OPTIONS <seltab> FOR
GET
LATE END-OF-SELECTION Occurs Before the standard selection screen is displayed After input on a selection screen has been processed, but while the selection screen is still active After the standard selection screen has been processed, before data is read from the logical database After the logical database has read an entry from the node
After all of the nodes of the logical database have been processed that are below
Occurs In list processing when a new page starts In list processing when a page ends When the triggers the predefined function code PICK When the triggers the predefined function code PF
INITIALIZATION: This event occurs before the standard selection screen is called. You can use it, for example, to initialize the input fields of the standard selection screen. This is the only possible way to change the default values of parameters or selection criteria defined in logical databases. To change a selection criterion, you must fill at least the components <seltab>-SIGN, <seltab>-OPTION, and <seltab>-LOW of the selection table <seltab>, otherwise it remains undefined. AT SELECTION-SCREEN The event AT SELECTION-SCREEN is the basic form of a whole series of events that occur while the selection screen is being processed. The standard selection screen in an executable program or in the logical database linked to it is automatically called between the INITIALIZATION and START-OF-SELECTION events. When you call the selection screen, and when s interact with it, the ABAP runtime environment generates selection screen events, which occur between INITIALIZATION and START-OFSELECTION. You can define event blocks for these events in your program to change the selection screen or process input START-OF-SELECTION This event occurs after the selection screen has been processed and before data is read using the logical database. You can use it to prepare for reading data and creating the list by, for example, setting values for internal fields and writing introductory notes on the output list. In an executable program, any non-declarative statements that occur between the REPORT or PROGRAM statement and the first processing block are also processed in the START-OFSELECTION block. TOP-OF-PAGE: To layout a page header individually, you must define it in the processing block following the event keyword TOP-OF-PAGE: Syntax - 53 -
SAP –ABAP BOOK TOP-OF-PAGE. The TOP-OF-PAGE event occurs as soon as the system starts processing a new page of a list. The system processes the statements following TOP-OF-PAGE before outputting the first line on a new page. During the event TOP-OF-PAGE, you can also fill the system fields SY-TVAR0 to SY-TVAR9 with values that should replace possible placeholders &0 to &9 in the standard page header END-OF-PAGE
:-
To define a page footer, use the END-OF-PAGE event. This event occurs if, while processing a list page, the system reaches the lines reserved for the page footer, or if the RESERVE statement triggers a page break. Fill the lines of the page footer in the processing block following the event keyword END-OF-PAGE: Syntax END-OF-PAGE. WRITE: .... The system only processes the processing block following END-OF-PAGE if you reserve lines for the footer in the LINE-COUNT option of the REPORT statement END-OF-SELECTION
:-
This is the last of the events called by the runtime environment to occur. It is triggered after all of the data has been read from the logical database, and before the list processor is started. You can use the corresponding event block to process and format the data that the program has stored in internal tables or extracts during the various GET events. *-------------------------------------------------------------* * Program : Z_TRNG_BASICLIST_T009 * * Title : Basic Report * * Author : VIKRAM M * * Description : Creating a Report for Material Details * *-------------------------------------------------------------* * M O D I F I C A T I O N L O G : *-------------------------------------------------------------* * Date Correction Programmer Descr of Change **===============================* * 06/01/2007 VIKRAM M Initial Implementation **------------------------------------------------------------* REPORT z_trng_basiclist_t009 NO STANDARD PAGE HEADING LINE-COUNT 30(3) LINE-SIZE 150 MESSAGE-ID zid. *-------------TABLE DECLERATION.------------------------* TABLES: mara."marc. TYPES : BEGIN OF str_1, matnr TYPE mara-matnr, "MATERIAL NUMBER. ernam TYPE mara-ernam, "NAME OF PERSON mtart TYPE mara-mtart, "MATERIAL TYPE.
- 54 -
SAP –ABAP BOOK END OF str_1. *-----INTERNALTABLE DECLERATION. DATA: it_1 TYPE TABLE OF str_1 WITH HEADER LINE. *-----SELCTION-SCREEN . SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001. SELECT-OPTIONS so_matnr FOR mara-matnr. SELECTION-SCREEN END OF BLOCK b1. *-----INITIALIZATION. INITIALIZATION. so_matnr-low = '40'. so_matnr-high = '1000'. APPEND so_matnr. *------AT SELECTION-SCREEN. AT SELECTION-SCREEN. SELECT SINGLE * FROM mara INTO CORRESPONDING FIELDS OF it_1 WHERE matnr IN so_matnr. IF sy-subrc NE 0. MESSAGE i001. ENDIF. *-----START OF SELECTION EVENT. START-OF-SELECTION. SELECT matnr ernam mtart FROM mara INTO CORRESPONDING FIELDS OF TABLE it_1 WHERE matnr IN so_matnr. *-----END OF SELECTION EVENT. END-OF-SELECTION. LOOP AT it_1. WRITE :/ sy-vline, 2(6) sy-tabix, sy-vline, 25 it_1-matnr, 46(10) sy-vline, 65 it_1-ernam, 93(10) sy-vline,115 it_1-mtart, 140(10) sy-vline. ULINE. ENDLOOP. HIDE it_1-matnr. *-----DISPLAYING PAGE-HEADING. TOP-OF-PAGE. ULINE. WRITE: 50 'MATERIAL DETAILS'. ULINE. WRITE:/ sy-vline, 'SL.NO' CENTERED COLOR 1, sy-vline, 20 'MATERIAL NUMBER' CENTERED COLOR 1, 46 sy-vline, 58 'NAME OF PERSON CREATED' CENTERED COLOR 1, 93 sy-vline, 110 'MATERIAL TYPE'CENTERED COLOR 1, 140 sy-vline. ULINE. *-----DISPLAYING END OF PAGE. END-OF-PAGE. ULINE.
- 55 -
SAP –ABAP BOOK * INTERACTIVE REPORTS * Lists are displayed in a special container screen. As with all other screens, you can link a dialog status to it using the SET PF-STATUS statement. In the dialog status, you link function codes to function keys, menu entries, icons in the standard toolbar, and pushbuttons in the application toolbar. . In list processing, the event is intercepted by the list processor and processed. Instead of calling dialog modules, one of the three following list events may be called, depending on the function code triggered by the . •
AT PF
•
AT LINE-SELECTION
•
AT -COMMAND
If you have written the corresponding event blocks in your program, they are executed. You can access the function code in the system field SY-UCOMM. All lists created during an interactive list event are detail lists. Each interactive list event creates a new detail list. With one ABAP program, you can maintain one basic list and up to 20 detail lists. If the creates a list on the next level (that is, SY-LSIND increases), the system stores the previous list and displays the new one. The can interact with whichever list is currently displayed. The system accepts only index values which correspond to existing list levels. It then deletes all existing list levels whose index is greater or equal to the index you specify. For example, if you set SY-LSIND to 0, the system deletes all secondary lists and overwrites the basic list with the current secondary list. System Fields for Details Lists After each action on a list, the following ABAP system fields will be set in the corresponding event block: System field SY-LSIND SY-LISTI SY-LILLI SY-LISEL SY-CUROW
Information Index of the list created during the current event (basic list = 0) Index of the list level from which the event was triggered Absolute number of the line from which the event was triggered Contents of the line from which the event was triggered Position of the line in the window from which the event was triggered (counting starts with 1) SY-CUCOL Position of the column in the window from which the event was triggered (counting starts with 2)
- 56 -
SAP –ABAP BOOK SY-AGE Page number of the first displayed page of the list from which the event was triggered SY-STARO Number of the first line of the first page displayed of the list from which the event was triggered (counting starts with 1). This line may contain the page header. SY-STACO Number of the first column displayed in the list from which the event was triggered (counting starts with 1) SYFunction code that triggered the event UCOMM SY-PFKEY Status of the list currently being displayed.
The most important function is for selecting list lines by double-clicking. As described in Using a GUI Status, the double-click function is always linked to the F2 key. If a function code is assigned to the F2 key in the GUI status, it will be triggered when you double-click. The Standard List Status As with normal screens, you can define your own GUI status for lists and attach it to a list level using the SET PF-STATUS statement. If you do not set a particular GUI status, the system sets a default list status for the list screen in an executable program. In other programs, for example, when you call a list from screen processing, you must set this status explicitly using the statement SET PF-STATUS space. This default interface always contains at least the functions described in the Standard List section. Unlike normal dialog statuses, the default list status is affected by the ABAP program. If you define event blocks in your program using the event keywords AT LINE-SELECTION or AT PF
•
AT LINE-SELECTION For this event, the F2 key (double-click) is assigned the function code PICK and function code Choose. The function also always appears in the application toolbar. During list processing, the PICK function code is assigned to the event AT LINE-SELECTION. PICK always triggers AT LINE-SELECTION.
•
All other function codes are either intercepted by the runtime environment or trigger the event AT -COMMAND. Function codes that trigger AT -COMMAND must be defined in your - 57 -
SAP –ABAP BOOK own GUI status. The easiest way to do this is to use the standard list status and add extra functions of your own to it. Setting a Dialog Status You set the dialog status for lists in the same way as for normal screens, that is, using the statement SET PF-STATUS <stat> [EXCLUDING
- 58 -
SAP –ABAP BOOK replaces '&' placeholders in succession by the contents of the corresponding
- 59 -
SAP –ABAP BOOK This statement takes effect after the current list is completed. Before the list is displayed, the event assigned to function code
HIDE
The HIDE statement is one of the fundamental statements for interactive reporting. You use the HIDE technique when creating a basic list. It defines the information that can be ed to subsequent detail lists. •
READ LINE
Use the statements READ LINE and READ CURRENT LINE to read data from the lines of existing list levels. These statements are closely connected to the HIDE technique. •
GET CURSOR
Use the statements GET CURSOR FIELD and GET CURSOR LINE to the output field or output line on which the cursor was positioned during the interactive event to the ABAP program. •
DESCRIBE LIST
- 60 -
SAP –ABAP BOOK The DESCRIBE LIST statement allows you to read certain list attributes, such as the number of lines or pages, into program variables. The following sections describe these statements in more detail: The HIDE Technique You use the HIDE technique while creating a list level to store line-specific information for later use. To do so, use the HIDE statement as follows: HIDE
by an interactive event.
For each interactive event, the HIDE fields of the line on which the cursor is positioned during the event are filled with the stored values. •
by the READ LINE statement.
You can think of the HIDE area as a table, in which the system stores the names and values of all HIDE fields for each list and line number. As soon as they are needed, the system reads the values from the table. Reading Lines from Lists All of the lists generated by a single program are stored internally in the system. You can therefore access any list in a program that was created for the same screen and that has not yet been deleted by returning to a lower list level. To read lines, use the statements READ LINE and READ CURRENT LINE. To read a line from a list after an interactive list event, use the READ LINE statement: READ LINE
INDEX
SAP –ABAP BOOK The system reads the information for line
FIELD VALUE
The system interprets the output values of the variables
OF CURRENT PAGE
With this option,
OF PAGE
With this option,
- 62 -
SAP –ABAP BOOK The options have the following effects: •
OFFSET
The field
LINE
The field
VALUE
The field
LENGTH
The field
OFFSET
The field
VALUE
The field
LENGTH
The field
- 63 -
SAP –ABAP BOOK DESCRIBE LIST NUMBER OF LINES|PAGES
LINE-SIZE
writes the page length into the variable
LINES
writes the number of displayed lines into the variable
FIRST-LINE
writes the absolute number of the first line into the variable
TOP-LINES
writes the number of page header lines into the variable
TITLE-LINES
writes the number of list header lines of the standard page header into the variable
- 64 -
SAP –ABAP BOOK •
HEAD-LINES
writes the number of column header lines of the standard page header into the variable . •
END-LINES <end>
writes the number of page footer lines into the variable <end>. Use DESCRIBE LIST for completed lists only, since for lists in creation (index is SY-LSIND) some attributes are not up to date.
Scrolling in Detail Lists When you use the SCROLL statement with detail lists, you must the following: You can only use the SCROLL statement for completed lists. If you use SCROLL before the first output statement of a list, it does not affect the list. If you use SCROLL after the first output statement of a list, it affects the entire list, that is, all subsequent output statements as well.
•
When you create a secondary list, a SCROLL statement without INDEX option always refers to the previously displayed list on which the interactive event occurred (index SY-LISTI).
•
Only when creating the basic list does the SCROLL statement refer to the list currently being created.
•
You can use the INDEX option to scroll explicitly on existing list levels. To do this, the lists need not be displayed. When the displays the list again, it is scrolled to the specified position. If the specified list level does not exist, the system sets SY-SUBRC to 8.
•
If, during an interactive event, you want to scroll through the list you are currently creating, use SY-LSIND as the index in the SCROLL statement. Note that changing SY-LSIND only takes effect at the end of the event, regardless of where you change it in the processing block. If you want to set the list level explicitly, you can change SY-LSIND in the last statement of the processing block. This ensures that a SCROLL statement within the processing block accesses the correct list.
•
SCROLL LIST LEFT BY 12 PLACES SCROLL LIST RIGHT BY 12 PLACES Setting the Cursor from within the Program You can set the cursor on the current list dynamically from within your program. You can do this to the with entering values into input fields or selecting fields or lines. If input fields occur on a list, the system by default places the cursor into the first input field.
- 65 -
SAP –ABAP BOOK To set the cursor, use the SET CURSOR statement. This statement sets the cursor in the most recently-created list. While the basic list is being created, this is always the basic list itself. For a detail list, it is the previous list. With SET CURSOR, you can set the cursor to an absolute position, to a field, or to a line. Setting the Cursor Explicitly To set the cursor to a certain position in the output window, use: SET CURSOR
Explicitly:
MODIFY LINE
- 66 -
SAP –ABAP BOOK If detail lists are defined in the corresponding event blocks of the ABAP program (AT LINESELECTION, AT -COMMAND), actions on the basic list will lead to the detail list, and further interaction will lead to further list levels. You can leave list processing in two ways: • •
By leaving the basic list using the Back, Exit, or Cancel function. By using the following statement during list processing:
LEAVE LIST-PROCESSING. In both cases, control returns from the list processor to the dialog processor. Each time this occurs, the entire list system is initialized. Any subsequent list output statements in PBO and PAI modules apply to an empty basic list. By default, the dialog processor returns to the PBO processing of the screen from which the list processor was called. The optional addition AND RETURN TO SCREEN allows you to specify a different screen in the current screen sequence at whose PBO event you want to resume processing. In particular, the statement LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0. can be used to end the current screen sequence and return to the point from which it had originally been called. Recommended Procedure If you want to display lists during screen processing, you should create a separate screen for each list system that you want to call. This screen encapsulates the creation and display of the basic list. It can then be called from anywhere in the program using CALL SCREEN. The actual screen mask of this screen can remain empty. You do not need any PAI modules, and only a single PBO module. In the PBO module, you define the basic list of the list system and call the list processor. 1.
First, use the
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0. statement to call the list display at the end of the screen, and to ensure that, after leaving the list, you return to the point from which the screen was called. 2. Next, set a GUI status for the list; for example, the default list status SPACE or a list status of your own. 3. Use one of the following statements to ensure that the empty screen is not displayed: SUPPRESS DIALOG. or LEAVE SCREEN. Instead, the list is displayed immediately at the end of the screen. 4. Now define the entire basic list, and place any necessary data in the HIDE area. Calling Screens from List Processing - 67 -
SAP –ABAP BOOK To call a screen from list processing, use the statement CALL SCREEN
Message Management Messages are single texts, stored in table T100, that you can maintain in Transaction SE91 or by forward navigation in the ABAP Workbench. T100 has the following structure: • • • •
Language key Twenty-character message class Message number Message text (up to 72 characters)
Specifying the Message Dynamically To specify the message class, message number, and message type dynamically, use the following form of the MESSAGE statement: MESSAGE ID
- 68 -
SAP –ABAP BOOK MESSAGE..... RAISING <exc>. If the calling program does not handle the exception <exc> itself, the message is displayed, and the program continues processing in the manner appropriate to the message type and context. If the calling program handles the exception, the message is not displayed, but the exception is triggered. In this case, the message class, message number, message type, and any values of placeholders are placed in the system fields SY-MSGID, SY-MSGNO, SY-MSGTY, and SY-MSGV1 to SYMSGV4 in the calling program. Message processing depends on the message type specified in the MESSAGE statement, and the program context in which the statement occurs. Message Types A
Termination
The message appears in a dialog box, and the program terminates. When the has confirmed the message, control returns to the next-highest area menu.
E
Error
Depending on the program context, an error dialog appears or the program terminates.
I
Information
The message appears in a dialog box. Once the has confirmed the message, the program continues immediately after the MESSAGE statement.
S
Status
The program continues normally after the MESSAGE statement, and the message is displayed in the status bar of the next screen.
W
Warning
Depending on the program context, an error dialog appears or the program terminates.
X
Exit
No message is displayed, and the program terminates with a short dump. Program terminations with a short dump normally only occur when a runtime error occurs. Message type X allows you to force a program termination. The short dump contains the message ID.
With only two exceptions (AT SELECTION-SCREEN and GET), event blocks have no local data area. All declarative statements in event blocks are handled with the global data declarations in the program. You should therefore include all of your declarations at the start of the program
- 69 -
SAP –ABAP BOOK
Leaving Event Blocks Using STOP If you use the STOP statement within an event block, the system stops processing the block immediately. The ABAP runtime environment triggers the next event. Before and during selection screen processing, the next event in the prescribed sequence is always called. From the AT SELECTION-SCREEN event onwards, the system always jumps from a STOP statement directly to the END-OF-SELECTION statement. Once the corresponding event block has been processed, the system displays the list. Leaving Event Blocks Using EXIT If you use the STOP statement within an event block but not in a loop, the system stops processing the block immediately Before and during selection screen processing, the next event in the prescribed sequence is always called. From the START-OF-SELECTION event onwards, the system starts the list processor directly when the EXIT statement occurs, and displays the list. If the EXIT statement occurs in a loop using DO, WHILE, or LOOP, it is the loop that terminates, not the processing block. Leaving Event Blocks Using CHECK If you use the CHECK <expr> statement within an event block but not within a loop, and the condition <expr> is not fulfilled, the system exits the processing block immediately. <expr> can be any logical expression or the name of a selection table. If you specify a selection table and the contents of the corresponding table work are do not fulfill the condition in the selection table, it is the same as a false logical expression. If the CHECK statement occurs in a loop using DO, WHILE, or LOOP, it is the loop that terminates, not the processing block. Within a GET event block, this means the next GET event at the same hierarchical level. When it leaves the event block, the logical database reads the next line of the current node, or the nexthighest node if it has already reached the end of the hierarchy level. Nodes that are lower down in the hierarchical structure of the logical database are not processed. Inside GET events, you can use an extra variant of the CHECK statement: CHECK SELECT-OPTIONS. This statement checks the contents of the table work area of the current node against all selection tables linked to that node. - 70 -
SAP –ABAP BOOK Note that CHECK statements for checking database contents in GET events are only processed after the data has been read from the logical database. For performance reasons, you should therefore avoid using checks Leaving a GET Event Block Using REJECT The REJECT statement was specially developed for leaving GET event blocks. Unlike CHECK and EXIT, REJECT always refers to the current GET event block. If CHECK and EXIT occur in a loop, they refer to the loop, and in a subroutine, they always refer to the subroutine. The REJECT statement, on the other hand, allows you to exit a GET event block directly from a loop or a subroutine The statement REJECT [
- 71 -
SAP –ABAP BOOK DATA : IT_VBAK TYPE TABLE OF TY_VBAK, WA_VBAK TYPE TY_VBAK, IT_VBAP TYPE TABLE OF TY_VBAP, WA_VBAP TYPE TY_VBAP, V_NETWR TYPE vbak-NETWR. ********* SELECTION-SCREEN DESIGN SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001. SELECT-OPTIONS so_vbeln FOR vbAk-vbeln. SELECTION-SCREEN END OF BLOCK b1. **** Initialization INITIALIZATION. so_vbeln-low = '4969'. so_vbeln-high = '5190'. so_vbeln-sign = 'I'. so_vbeln-option = 'BT'. APPEND so_vbeln. *********START-OF-SELECTION. START-OF-SELECTION. SELECT VBELN ERDAT NETWR FROM VBAK INTO CORRESPONDING FIELDS OF TABLE it_VBAK WHERE VBELN IN so_VBELN. IF NOT it_VBAK[] IS INITIAL. LOOP AT it_VBAK INTO wa_VBAK. *** v_netwr = v_netwr + wa_vbak-netwr. WRITE : /5 WA_VBAK-CB1 AS CHECKBOX, 15 wa_VBAK-VBELN, 35 wa_VBAK-ERDAT, 55 wa_VBAK-NETWR. HIDE WA_VBAK-VBELN. * ULINE. AT LAST. SUM. WRITE : / 'TOTAL OF NETWR ', 55 WA_VBAK-NETWR. ENDAT. ENDLOOP. - 72 -
SAP –ABAP BOOK ENDIF. *****AT LINE SELECTION AT LINE-SELECTION. CASE SY-LSIND. WHEN '1'. SELECT VBELN POSNR MATNR FROM VBAP INTO TABLE it_VBAP WHERE VBELN = WA_VBAKVBELN. IF NOT it_VBAP[] IS INITIAL. LOOP AT it_VBAP INTO wa_VBAP. WRITE :/ wa_VBAP-VBELN, wa_VBAP-POSNR, wa_VBAP-MATNR. * ULINE. ENDLOOP. ENDIF. ENDCASE. **********TOP-OF-PAGE. TOP-OF-PAGE. * Top of Page Display WRITE (142) 'INTERACTIVE LIST' CENTERED COLOR 2. WRITE:/125 'PAGE:',sy-pagno LEFT-JUSTIFIED. END-OF-PAGE. WRITE:/ V_NETWR. clear v_netwr.
- 73 -
SAP –ABAP BOOK
*&---------------------------------------------------------------------------------------------------* *& Report: Z_TRNG_SHIPTOPARTY_T009 * *& Title : Report to display ship-to-party details * - 74 -
SAP –ABAP BOOK *& Author: VIKRAM M * *& Desc : This report retrieve the sales document * * related info & associated item information and * * displays & results in the basic list and secondary list. * *&---------------------------------------------------------------------------------------------------* *&---M O D I FI C A T I O N---L O G *&------------------------------------------------------------*& DATE TRANSPORT# CHANGED_BY DESCRIPTION *&--------- ------------ ---------- -----------------------*& 01/11/07 N/A VIKRAM M Initial creation. *&------------------------------------------------------------REPORT z_trng_shiptoparty_t009 NO STANDARD PAGE HEADING LINE-COUNT 37(3) MESSAGE-ID zsap. *-----TABLES------------------------------------------------* TABLES: vbak,kna1. *-----DATA DECLERATION---------------------------------* DATA: BEGIN OF it_sales OCCURS 0, kunnr TYPE vbpa-kunnr, "Customer Number vbeln TYPE vbak-vbeln, "Sales Document erdat TYPE vbak-erdat, "Creation Date ernam TYPE vbak-ernam, "Person Created netwr TYPE vbak-netwr, "Net Val Sales Order name1 TYPE kna1-name1, "Name of Customer END OF it_sales, BEGIN OF it_vbap OCCURS 0, vbeln TYPE vbap-vbeln, "Sales Document posnr TYPE vbap-posnr, "Sales Document Item matnr TYPE vbap-matnr, "Material number matkl TYPE vbap-matkl, "Material Group END OF it_vbap, BEGIN OF it_vbeln OCCURS 0, vbeln TYPE vbak-vbeln, END OF it_vbeln, checkfield, v_field LIKE dd03l-fieldname, v_value LIKE vbak-vbeln, v_words LIKE spell. "Amount in words *-----SELECTION-SCREEN---------------------------------* SELECT-OPTIONS so_vbeln FOR vbak-vbeln. START-OF-SELECTION. *-----POPULATING OWN GUI STATUS------------------* - 75 -
SAP –ABAP BOOK SET PF-STATUS 'MENU'. *-----FETCHING DATAS FROM TABLE------------------* SELECT vbpa~kunnr vbak~vbeln vbak~erdat vbak~ernam vbak~netwr INTO TABLE it_sales FROM vbak vbpa ON vbak~vbeln = vbpa~vbeln AND vbpa~parvw = 'WE' WHERE vbak~vbeln IN so_vbeln. SELECT vbeln posnr matnr FROM vbap INTO TABLE it_vbap FOR ALL ENTRIES IN it_sales WHERE vbeln = it_sales-vbeln. END-OF-SELECTION. SORT it_sales BY kunnr. *-----DISPLAYING DATA FROM BASIC LIST---------------* LOOP AT it_sales. AT NEW kunnr. *-----DISPLAYING DATA IN NEW PAGE-------------------* NEW-PAGE. SELECT SINGLE name1 FROM kna1 INTO kna1-name1 WHERE kunnr EQ it_sales-kunnr. ENDAT. *-----RETRIEVE MATERIAL DETAILS FROM TABLE--------* WRITE:/1 sy-vline, checkfield AS CHECKBOX, 5 it_sales-vbeln, 13 sy-vline, 14 it_sales-erdat, 26 sy-vline, 27 it_sales-ernam, 38 sy-vline, 39(17) it_sales-netwr CURRENCY '2' RIGHT-JUSTIFIED, 55 sy-vline. ULINE:/(55). AT END OF kunnr. SUM. "FORMAT COLOR 3. WRITE:/27 text-249 COLOR 3,it_sales-netwr CURRENCY '2' COLOR 3. FORMAT COLOR OFF. *-----FUNCTION MODULE TO DISPLAY IN WORDS-------* - 76 -
SAP –ABAP BOOK CALL FUNCTION 'SPELL_AMOUNT' EXPORTING amount = it_sales-netwr currency = 'INR' language = sy-langu IMPORTING in_words = v_words. WRITE: / text-333 COLOR 3,18 v_words-word COLOR 5. "DISPLAY TOTAL IN WORDS WRITE / v_words-decword UNDER v_words-word COLOR 5. ENDAT. AT LAST. SUM. FORMAT COLOR 3. WRITE:/7 text-241,it_sales-netwr CURRENCY '2'. FORMAT COLOR OFF. ENDAT. ENDLOOP. *-----HEADER FOR PAGES---------------------------------* TOP-OF-PAGE. WRITE:35 text-007 COLOR 1, / text-221 COLOR 2, text-223 COLOR 1,17 kna1-name1, / text-222 COLOR 2,17 it_sales-kunnr. ULINE:/(55). *-----RETRIEVE MATERIAL DETAILS FROM TABLE--------* WRITE:/1 sy-vline, 2 text-230 COLOR 4, 13 sy-vline, 14 text-231 COLOR 4, 26 sy-vline, 27 text-232 COLOR 4, 38 sy-vline, 39 text-101 COLOR 4, 55 sy-vline. ULINE:/(55). AT -COMMAND. *----- BASED OPERATION----------------------------IF sy-ucomm = 'ITEM' AND sy-lsind = '1'. DO. READ LINE sy-index FIELD VALUE : checkfield,it_sales-vbeln. IF checkfield EQ 'X'. UNPACK it_sales-vbeln TO it_sales-vbeln. - 77 -
SAP –ABAP BOOK APPEND it_sales-vbeln TO it_vbeln. CLEAR it_vbeln. ELSEIF sy-subrc NE 0. EXIT. ENDIF. CLEAR: checkfield,it_sales-vbeln. ENDDO. *-----RETRIVEING ITEM DETAILS IN LIST---------------* LOOP AT it_vbeln. LOOP AT it_vbap WHERE vbeln = it_vbeln-vbeln. *-----RETRIEVE MATERIAL DETAILS FROM TABLE-------* WRITE:/ sy-vline,2 it_vbap-vbeln HOTSPOT, 23 sy-vline,24 it_vbap-posnr, 43 sy-vline,44 it_vbap-matnr HOTSPOT, 59 sy-vline,60 it_vbap-matkl, 74 sy-vline. ULINE:/(74). ENDLOOP. ENDLOOP. REFRESH it_vbeln. ENDIF. SET PF-STATUS space. "Remove the own GUI Status *-----CALLING LIST-----------------------------------------* AT LINE-SELECTION. GET CURSOR FIELD v_field VALUE v_value. IF sy-lsind EQ 2. CASE v_field. WHEN 'IT_VBAP-MATNR'. SET PARAMETER ID 'MAT' FIELD v_value. CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN. WHEN 'IT_VBAP-VBELN'. SET PARAMETER ID 'AUN' FIELD v_value. CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN. WHEN OTHERS. MESSAGE i000. ENDCASE. ENDIF. *-----PAGE HEADING DURING LINE SELECTION----------* TOP-OF-PAGE DURING LINE-SELECTION. WRITE:25 text-225 COLOR 1 CENTERED. ULINE:/(74).
- 78 -
SAP –ABAP BOOK *-----RETRIEVE MATERIAL DETAILS FROM TABLE--------* WRITE:/ sy-vline,2 text-226 COLOR 2, "SALES DOCUMNET NUMBER 23 sy-vline,24 text-227 COLOR 2, "SALES DOCUMENT ITEM 43 sy-vline,44 text-228 COLOR 2, "MATERIAL NUMBER 59 sy-vline,60 text-229 COLOR 2, "MATERIAL GROUP 74 sy-vline. ULINE:/(74).
JH SOFTECH
SAP ABAP - BOOK 3
JH SOFTECH 303,Kaveri Queen’s Building, Opp Aradhana Theater, Tarnaka, Hyderabad. Ph: 040 – 40202178 , 040 – 65870996 9293002250 www.jhsoftech.com
ALV
- 79 -
SAP –ABAP BOOK
ABAP LIST VIEWER
The ABAP List Viewer unifies and identifies and simplifies the uses of lists in the R/3 System. The ABAP List Viewer can be used to view both single-level lists and multilevel sequential lists. • Single level lists consist any number of lines that have no hierarchical relationship to each other. • Multilevel Sequential level lists consist any number of lines that have two hierarchical levels. Multilevel lists have header rows and item rows: the item rows are subordinate to the header rows. For each header rows there can be any number of subordinate items rows. There are number of the function modules used to view the list. The selection of function module depends on the way that how you want to display your list .Some useful function modules are listed below: 1. REUSE_ALV_LIST_DISPLAY 2. REUSE_ALV_HIERSEQ_LIST_DISPLAY 3.REUSE_ALV_FIELDCATALOG_MERGE 4.REUSE_ALV_COMMENTARY_WRITE 5.REUSE_ALV_EVENTS_GET 6.REUSE_ALV_BLOCK_LIST_INIT 7.REUSE_ALV_BLOCK_LIST_APPEND 8.REUSE_ALV_BLOCK_LIST_HS_APPEND 9.REUSE_ALV_BLOCK_LIST_DISPLAY 10.REUSE_ALV_LIST_LAYOUT_INFO_GET 11.REUSE_ALV_LIST_LAYOUT_INFO_SET 12.REUSE_ALV_POPUP_TO_SELECT 13.REUSE_ALV_VARIANT_DEFAULT_GET 14.REUSE_ALV_VARIANT_F4 15.REUSE_ALV_VARIANT_EXISTENCE
1. REUSE_ALV_LIST_DISPLAY: - (This function module is used to display simple list.) IMPORTING VALUE(I_INTERFACE_CHECK) DEFAULT SPACE VALUE(I_CALLBACK_PROGRAM) LIKE SY-REPID DEFAULT SPACE VALUE(I_CALLBACK_PF_STATUS_SET) TYPE SLIS_FORMNAME DEFAULT SPACE VALUE(I_CALLBACK__COMMAND) TYPE SLIS_FORMNAME DEFAULT SPACE VALUE(I_STRUCTURE_NAME) LIKE DD02L-TABNAME OPTIONAL VALUE(IS_LAYOUT) TYPE SLIS_LAYOUT_ALV OPTIONAL VALUE(IT_FIELDCAT) TYPE SLIS_T_FIELDCAT_ALV OPTIONAL VALUE(IT_EXCLUDING) TYPE SLIS_T_EXTAB OPTIONAL VALUE(IT_SPECIAL_GROUPS) TYPE SLIS_T_SP_GROUP_ALV OPTIONAL VALUE(IT_SORT) TYPE SLIS_T_SORTINFO_ALV OPTIONAL VALUE(IT_FILTER) TYPE SLIS_T_FILTER_ALV OPTIONAL VALUE(IS_SEL_HIDE) TYPE SLIS_SEL_HIDE_ALV OPTIONAL VALUE(I_DEFAULT) DEFAULT 'X' VALUE(I_SAVE) DEFAULT SPACE VALUE(IS_VARIANT) LIKE DISVARIANT STRUCTURE DISVARIANT DEFAULT SPACE VALUE(IT_EVENTS) TYPE SLIS_T_EVENT OPTIONAL VALUE(IT_EVENT_EXIT) TYPE SLIS_T_EVENT_EXIT OPTIONAL VALUE(IS_PRINT) TYPE SLIS_PRINT_ALV OPTIONAL VALUE(IS_REPREP_ID) TYPE SLIS_REPREP_ID OPTIONAL VALUE(I_SCREEN_START_COLUMN) DEFAULT 0
- 80 -
SAP –ABAP BOOK VALUE(I_SCREEN_START_LINE) DEFAULT 0 VALUE(I_SCREEN_END_COLUMN) DEFAULT 0 VALUE(I_SCREEN_END_LINE) DEFAULT 0 EXPORTING VALUE(E_EXIT_CAUSED_BY_CALLER) VALUE(ES_EXIT_CAUSED_BY_) TYPE SLIS_EXIT_BY_ TABLES T_OUTTAB EXCEPTIONS PROGRAM_ERROR . I_INTERFACE_CHECK: To avoid overloading list output with interface consistency checks, they are only made in an extra call mode. If this parameter is 'X', the consistency of the interface is checked When the function module is called, and an error log is output. This parameter should only be set for development test purposes (e.g. in debugging). The interface check can also be made on the results list by entering the function code &SOS. I_CALLBACK_PROGRAM: Program which calls the function module and contains the exit routines. It must be a Report, Function group, Module pool or Form routine pool (not an Include). Note: Never SY-REPID directly in the interface. If the desired program name is in SY-REPID, it must be assigned to an intermediate variable, which is then ed to the interface. I_CALLBACK_PF_STATUS_SET: ing an EXIT routine tells ALV that the caller wants to set his or her own status. The default ALV status is then not set. The form routine interface must be defined as follows: FORM set_pf_status USING rt_extab TYPE slis_t_extab The table RT_EXTAB contains the function codes which are hidden in the
standard interface.
I_CALLBACK__COMMAND: ing an EXIT routine tells ALV that the application wants to react to certain function codes itself. These are general function codes which ALV does not recognize (not ALV standard functions) and which were defined and set by an application status. See also the documentation of the parameter I_CALLBACK_PF_STATUS_SET. The interface of the specified form routine must be defined as follows: FORM _command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE slis_selfield. The parameter R_UCOMM contains the function code called. The structure RS_SELFIELD contains the following information: o tabname : internal output table name o tabindex : internal output table index o fieldname: field name o endsum : cursor is on the final total row
- 81 -
SAP –ABAP BOOK o o o o o o o o
sumindex : if >0, the cursor is on a subtotal row value : field contents refresh : (exporting) list is to be refreshed col_stable:(exporting) keep column positions in refresh row_stable:(exporting) keep row positions in refresh exit :(exporting) leave list (and ALV) before_action: jump before performing standard action after_action : jump after performing standard action, before creating list o ignore_multi : internal use o sel_tab_field: internal use The exit routine always runs when a function code occurs which ALV does not recognize, or a jump before or after a standard function code is defined by the interface parameter IT_EVENT_EXIT. I_STRUCTURE_NAME: If the internal output table is defined via an ABAP/4 Dictionary structure (INCLUDE STRUCTURE struct or LIKE struct), the field catalog can be built-up automatically by ing the structure name. The field catalog is internally built up for this structure as follows: o All fields are in the list (NO_OUT = SPACE) except fields of data type CLNT. o The key fields of the Dictionary structure are also key fields in the field catalog. o Dictionary references to unit fields are copied if the reference fields are in the structure. o If a field catalog is also ed as parameter, the structure information is combined with this field catalog. IS_LAYOUT:- (list layout specifications) Output list description structure. The parameters are described under the following headers: o Display options o Exceptions o Totals o Interaction o Detail screen o Display variants (only for hierarchical-sequential lists) o Color o Other Note the section 'Default'. Display options • colwidth_optimize value set: SPACE, 'X' 'X' = optimzes the column width so that all contents are displayed completely. o no_colhead value set: SPACE, 'X' 'X' = column headers are not output o zebra value set: SPACE, 'X' 'X' = striped pattern (e.g. for wide lists) o no_vline
- 82 -
SAP –ABAP BOOK Value set: SPACE, 'X' Not relevant for: hierarchical-sequential lists and multiple-line lists. 'X' = columns separated by SPACE o no_min_linesize Value set: SPACE, 'X' Not relevant for block lists 'X' = line size depends on list width ' ' = Line size is set to 80 or MIN_LINESIZE (if > 0) . o min_linesize value set: 0, 10 - 250 minimum width of the list (to change default of 80) If the list is wider, the format uses the list width (maximum 250 or MAX_LINESIZE (if > 0)). prerequisite: no_min_linesize = ' '. o max_linesize value set: 0, 80 - 1020 maximum list width (to change the default of 250) interactively-definable maximum list width setting. Caution: wide lists are difficult to read and to print. Exceptions o lights_fieldname value set: SPACE, internal output table field name internal output table field containing the codes of exceptions to be output. Output table field code: '1' = red traffic light '2' = yellow traffic light '3' = green traffic light o lights_tabname value set: SPACE, internal output table name Only relevant for hierarchichal-sequential lists. Name of the internal output table, which contains the field in the parameter LIGHTS_FIELDNAME. If LIGHTS_FIELDNAME is not empty, this field must also be filled for hierarchical-sequential lists. o lights_rollname Value set: SPACE, data element name The documentation of this data element is displayed when you call F1 help for an exception column. o lights_condense Value set: SPACE, 'X' 'X' = the 'maximum' exception of the items in the subtotal is output at subtotal level. Ex.: if a list record is output with 'red traffic light', each subtotal which includes this record is also output with 'red traffic light'. Totals o no_sumchoice Value set: SPACE, 'X' 'X' = fields which are to be summed, ed by the calling program (FIELDCAT-DO_SUM = 'X'). The should not be able to change this value interactively. o no_totalline Value set: SPACE, 'X'
- 83 -
SAP –ABAP BOOK 'X' = no total record is to be output. Subtotals can still be calculated and output. The fields in the subtotals are flagged DO_SUM = 'X' in the field list. •
no_subchoice Value set: SPACE, 'X' 'X' = value whose change triggers subtotals, provided by the calling program. The should not be able to change this value interactively. See also the documentation of the IMPORTING parameter IT_SORT. o no_subtotals Value set: SPACE, 'X' 'X' = no subtotals. o totals_only Value set: SPACE, 'X' 'X' = only total records are output. An interactive breakdown of simple and hierarchical-sequential lists is possible. Prerequisite: the IMPORTING parameter IT_SORT contains the sort criteria and subtotal flags. See also the documentation of the IMPORTING parameter IT_SORT. o totals_text Value set: SPACE, string(max.60) ' ' = the first column in the total record contains an appropriate number of '*'s to indicate the total by default. If the first column is wide enough, the string 'Total' is output after the asterisks. 'string' = the string ed is output after the total indicated by '*', if the column is wide enough.
o subtotals_text Value set: SPACE, string(max.60) ' ' = in the first column of subtotal records, the subtotal is indicated by an appropriate number of '*' by default. If the first column is not a subtotal criterion, the string 'Total' is output after the asterisks, if the column is wide enough. 'string' = the string ed is output after the subtotal indicated by '*', if the column is wide enough and the first column is not a subtotal criterion. If it is a subtotal criterion, its value is repeated after the total, if the column is wide enough. o numc_sum Value set: SPACE, 'X' ' ' = By default NUMC fields cannot be totalled 'X' = NUMC fields can be totalled. If this flag is set, the total can be controlled via the FIELDCAT-NO_SUM parameter per NUMC column. Interaction o box_fieldname Value set: SPACE, internal output table field name if the list has checkboxes at the start of records (for selecting several records), this parameter contains the internal output table field name indicated by the checkbox selection column. The field is a checkbox at the start of list records without a list header. o box_tabname Value set: SPACE, internal output table name Only relevant for hierarchical-sequential lists. Name of the internal output table which contains the field in the parameter BOX_FIELDNAME. If BOX_FIELDNAME is not empty, this field must also be filled for
- 84 -
SAP –ABAP BOOK hierarchical-sequential lists. o no_input Value set: SPACE, 'X' 'X' = all ready-for-input fields in a list are displayed as not ready-for-input. (Record selection checkboxes and fields which can be made ready-for-input via the field list parameter FIELDCAT-INPUT = 'X') o expand_fieldname Value set: SPACE, internal header table field name Only relevant for hierarchical-sequential lists If hierarchical-sequential list items are to be expandable and collapsable, the internal header table must contain an additional CHAR(1) field which contains the expansion status of the header entry. The name of this field must be assigned to the parameter IS_LAYOUT-EXPAND_FIELDNAME. The initial value of the field in the header table is that the items are not displayed
and the folder symbol
SYM_PLUS_FOLDER appears in the list before the header entry. If the field contains 'X' for a header entry, the items for this header appear, and the folder symbol SYM_MINUS_FOLDER appears on the list before the header entry. The can show or hide the items by clicking on the folder symbol (hotspot). If the items for a header entry are only to be read by the calling program and ed to ALV when a header has been expanded interactively, this can be controlled via the CALLBACK event 'ITEM_DATA_EXPAND'. o f2code Value set: SPACE, function code meaning in the ALV standard interface: To assign an ALV standard function code to double-click (F2), assign the function code to this parameter. Ex.: to assign the ALV standard function 'Detail' ('&ETA') to F2. => LAYOUT-F2CODE = '&ETA' Effect in ' interface': Case 1: The ALV standard function code for F2 '&IC1' is left in the copied application interface, but F2 is to have a function which is not under F2 in the interface (ALV standard function or application function). this function codeto ALV in the parameter F2CODE. Case 2: The ALV standard function code for F2 '&IC1' was deleted from the application interface and replaced by another function code (ALV standard function or application function). this function code to ALV in the parameter F2CODE. This is the prerequisite for column selection in this case. o confirmation_prompt Value set: SPACE, 'X' 'X' = if one of the functions 'Back(F03)', 'Exit(F15)' or 'Cancel(F12)' occurs, a confirmation prompt appears. o key_hotspot Value set: SPACE, 'X' The columns defined in the field catalog as key fields (FIELDCAT-KEY = 'X') are output as hotspots, i.e. clicking on a key column (highlighted in color in the list) calls the function under F2. o reprep
- 85 -
SAP –ABAP BOOK Value set: SPACE, 'X' 'X' = activate Report/Report interface: Prerequisite: application system (=> Report RKKBRSTI exists). List module is a possible sender in the Report/Report interface logic (poss. initialization of the interface...). The calling report/module pool... of type RT=Report in I_CALLBACK_PROGRAM is ed to the Report/Report interface as sender report. If the sender report is assigned to receiver reports in the table TRSTI, the function code BEBx is active (x = function code class).
Example: If Report Writer report group 7KOI with function code class '3' (SAP setting) is assigned as a receiver for the sender RKTFGS15, this receiver report group is called by function code 'BEB3' via the Re/Re interface. The report restrictions and the key information of the selected records are ed to the Re/Re interface as selection criteria. For further information about the Report/Report interface see the documentation of the function group 'RSTI'. o group_buttons Value set: SPACE, 'X' Not relevant for block lists (output of several lists consecutively) Prerequisite: Group output fields via FIELDCAT-SP_GROUP in the field list, and the group name to the list module in the interface parameter IT_SPECIAL_GROUPS. Further information: See the documentation of the IMPORTING parameter IT_SPECIAL_GROUPS. and the field catalog parameter FIELDCAT-SP_GROUP of the IMPORTING parameter
- 86 -
SAP –ABAP BOOK o no_keyfix Value set: SPACE, 'X' Not relevant for block lists (output of several lists consecutively) ' ' = The key columns defined in the field catalog by FIELDCAT-KEY = 'X' are fixed in the list output. These columns do not scroll horizontally. The item table key columns are fixed in hierarchical-sequential lists. The header table key fields are not considered here. 'X' = key columns not fixed The can change these general settings interactively. To fix a column by default which is not a key column, set the parameter to 'X' and control it via the field list. See the documentation of the field list parameter FIELDCAT-FIX_COLUMN of the IMPORTING parameter
- 87 -
SAP –ABAP BOOK You can toggle between display field and field list views via pushbuttons in the display variant definition popup for hierarchical-sequential lists. The views refer to the hierarchy level of the fields. This is technically a toggle between the header table and item table fields. ' ' = The header table field pushbutton text is 'Header' by default. CHAR (20) = header table field pushbutton text. o item_text Value set: SPACE, CHAR(20) Only relevant for hierarchical-sequential lists You can toggle the view between the display fields and the field list via pushbuttons in the display variant definition popup for hierarchical-sequential lists. The views refer to the hierarchy level of the fields. This is technically a toggle between the header table and item table fields. ' ' = the pushbutton text for the item table fields is 'Item' by default. CHAR(20) = item table field pushbutton text. o item_default Value set: SPACE, 'X' Only relevant for hierarchical-sequential lists ' ' = The header table fields are displayed by default in the display variant definition popup. The can switch to the item table fields interactively. 'X' = the item table fields are displayed by default in the display variant Definition Popup. The can switch to the header table fields interactively. Color o info_fieldname Value set: SPACE, internal output table field name A whole list record can be colored individually using acolor code in a column of the internal output table for the record. Assign the name of the field containing the color code to this parameter. The internal output table field must be of type CHAR(3). The code must have the following syntax: 'Cxy': C = color (all codes must start with 'C') x = color number ('1'-'9') y = bold ('0' = off, '1' = on) Note: the color of the key columns is not affected. Key columns can be colored at record or cell level using the complex coloring which is described in the next parameter COLTAB_FIELDNAME. To color columns, see the documentation of the field catalog parameter FIELDCAT-EMPHASIZE of the IMPORTING parameter IT_FIELDCAT. o coltab_fieldname Value set: SPACE, internal output table field name Cells can be colored individually using a color code which is contained in a column of the internal output table for the record containing the cell. Assign the name of the field to this parameter. The internal output table field must be of type SLIS_T_SPECIALCOL_ALV. Principle: the color code field is entered for the record containing the cells to be colored. The field contains an internal table with the above structure, containing the field names of the cells to be colored and the color code. The cell coordinates are determined by the record position containing the color code and the column information in the color table. The record structure of the internal color table of type SLIS_T_SPECIALCOL_ALV is as follows: Color table-FIELDNAME = field name of the cell to be colored Color table-COLOR-COL = color number (1 - 9) Color table-COLOR-INT = bold (0 = off, 1 = on) Color table-COLOR-INT = inverse (0 = off, 1 = on) Color table-NOKEYCOL = ignore key coloring ('X' = yes, ' ' = no)
- 88 -
SAP –ABAP BOOK If the parameter color table-FIELDNAME is not filled, the coloring applies to all fields, so the entire record is colored. Others o list_append Value set: SPACE, 'X' Only relevant for block lists which are not output with the REUSE_ALV_BLOCK_... modules. It is only useful to output block-lists without specifying the above modules if the number of list blocks exceeds, or may exceed, the maximum number specified in the block module documentation. These operations are not possible for -defined block lists. Principle: to output a list of n blocks Call the function module for the list type for the first block. The caller must enter the maximum list width of the n blocks in the parameter LAYOUT-MIN_LINESIZE in the first call. The event table IT_EVENTS of the event END_OF_LIST must contain the associated form routine name (see also the documentation of the interface parameter IT_EVENTS). The parameter LAYOUT-LIST_APPEND must be initial . After the first list has been output, the form routine specified in the event END_OF_LIST is called by Callback. The remaining n-1 blocks are then output by calling the function module for the list type. The parameter LAYOUTLIST_APPEND must be set = 'X' for these n-1 calls. The event table IT_EVENTS should not contain the event END_OF_LIST or at least be assigned to a different form routine name from the first call. IT_FIELDCAT: Field catalog containing descriptions of the list output fields (usually a subset of the internal output table fields). A field catalog is required for every ALV list output. The field catalog for the output table is built-up in the caller's coding. The build-up can be completely or partially automated by calling the REUSE_ALV_FIELDCATALOG_MERGE module. See also the documentation of the function module REUSE_ALV_FIELDCATALOG_MERGE. The minimal field catalog is documented under 'default'. The caller can use the other optional parameters to assign output attributes to a field which differ from the default. A field catalog need not be built-up and ed explicitly only under the following conditions: o The internal table to be output has the same structure as a Data Dictionary structure which is referred to in the internal table declaration using LIKE or INCLUDE STRUCTURE. o all fields in this structure are to be output o the structure name is ed to ALV in the parameter I_STRUCTURE_NAME. See also the documentation of the IMPORTING paramter I_STRUCTURE_NAME. Positioning o row_pos (row position) Value set: 0, 1 - 3 Only relevant if the list output is to be multi-line (two or three lines) by default. A multi-line list can also be defined by the interactively if the default list is one-line. The parameter specifies the relative output line of the column in a multi-line list. o col_pos (column position) Value set: 0, 1 - 60 Only relevant when the default relative column positions differ from the field catalog field sequence.
- 89 -
SAP –ABAP BOOK The parameter specifies the relative column position of the field in the list output. The column order can be changed interactively by the . If this parameter is initial for all field catalog entries, columns appear in the field catalog field sequence. Identification o fieldname (field name) Value set: internal output table field name (required parameter) Name of the internal output table field which is described by this field catalog entry o tabname (internal output table) Value set: SPACE, internal output table name This parameter is used in 'manual' field catalog build-up only for hierarchical-sequential lists. Name of the internal output table which contains the field FIELDCAT-FIELDNAME.
Data Dictionary reference o ref_fieldname (reference field name) Value set: SPACE, Data Dictionary field name Name of the Data Dictionary field referred to. This parameter is only used when the internal output table field described by the current field catalog entry has a reference to the Data Dictionary (not a program field), and the field name in the internal output table is different from the name of the field in the nambiguous and is therefore explicitly output by the caller in the list header, the field catalog units field entry can take the parameter FIELDCAT-TECH = 'X'. The association of a value field to a unit affects the output as follows: - appropriate decimal places display for the unit - an initialized field with a link to a non-initial unit is output as '0' for the unit (if FIELDCAT-NO_ZERO is initial). When this field is summed, this unit affects whether the units are homogeneous. - an initialized field with a link to an initial unit is output as SPACE. When this field is summed, the unit SPACE does not affect the homogeneity of the units. - When non-initial fields with an initial unit are summed, the unit SPACE is considered to be a unit. Link to currency unit o cfieldname (currency unit field name) Value set: SPACE, output table field name Only relevant for amount columns with associated unit. Name of the internal output table field containing the currency unit associated with the amount field FIELDCATFIELDNAME. The field in FIELDCAT-CFIELDNAME must have its own field catalog entry. o ctabname (internal currency unit field output table) Value set: SPACE, output table field name only relevant for hierarchical-sequential lists Name of the internal output table containing the FIELDCAT-CFIELDNAME field. Link to measurement unit o qfieldname (measurement unit field name) Value set: SPACE, output table field name Only relevant for quantity columns with unit link. Name of the internal output table field containing the measurement unit associated with the quantity field FIELDCAT-FIELDNAME. The field in FIELDCAT-QFIELDNAME must have its own field catalog entry. o qtabname (internal measurement unit field output table) Value set: SPACE, output table field name Only relevant for hierarchical-sequential lists Name of the internal output table containing the FIELDCAT-QFIELDNAME field.
- 90 -
SAP –ABAP BOOK Column output options o outputlen (column width) Value set: 0 (initial), n For fields with a Data Dictionary link this parameter can be left initial. For fields without a Data Dictionary link (program field) the parameter must be given the value of the desired field list output length (column width). Initial = column width is the output length of the referred Data Dictionary field (domain). n = column width is n characters o key (key column) Value set: SPACE, 'X' 'X' = key field (key field output in color) Key fields can not be interactively hidden. Parameter FIELDCAT-NO_OUT must be left initial. For exceptions see the documentation of the FIELDCAT-KEY_SEL parameter. o key_sel (hideable key column) Value set: SPACE, 'X' Only relevant when FIELDCAT-KEY = 'X' Key field which can be hidden interactively. The key column sequence cannot be changed interactively by the . The output is controlled by the FIELDCAT-NO_OUT parameter analogously to non-key fields. o no_out (field in field list) Value set: SPACE, 'X' 'X' = field is not displayed in the current list. The can interactively choose the field for output from the field list. The can display the contents of these fields at line level using the 'Detail' function. See also the 'Detail screen' documentation of the parameter IS_LAYOUT. o tech (technical field) Value set: SPACE, 'X' 'X' = technical field Field cannot be output in the list and cannot be displayed interactively. Field can only be used in the field catalog (not in IT_SORT, ...). o emphasize (highlight columns in color) Value set: SPACE, 'X' or 'Cxyz' (x:'1'-'9'; y,z: '0'=off '1'=on) 'X' = column is colored with the default column highlight color. 'Cxyz' = column is colored with a coded color: - C: Color (coding must begin with C) - x: color number - y: bold - z: inverse o hotspot (column as hotspot) Value set: SPACE, 'X' 'X' = column cells are output as hotspots o fix_column (fix column) Value set: SPACE, 'X' Not relevant for block lists (output of several lists consecutively) 'X' = column fixed (does not scroll horizontally) All columns to be fixed must have this flag, starting from the left.
- 91 -
SAP –ABAP BOOK IF A COLUMN WITHOUT THIS FLAG IS OUTPUT, ONLY THE COLUMNS TO THE LEFT of this column are fixed. The can change the column fixing interactively. See also the documentation of the Layout parameter IS_LAYOUT-NO_KEYFIX of the IMPORTING paramter IS_LAYOUT. o do_sum (sum over column) Value set: SPACE, 'X' 'X' = a sum is to be calculated over this internal output table field. This function can also be called by the interactively. o no_sum (sums forbidden) Value set: SPACE, 'X' 'X' = no sum can be calculated over this field, although the data type of the field would allow summing. o input (column ready for input) Function not available Format column contents o icon Value set: SPACE, 'X' 'X' = column contents to be output as an icon. The internal output table column contents must be valid icon strings (@xx@). The caller must consider the printability of icons. •
symbol Value set: SPACE, 'X' 'X' = column contents are to be output as a symbol. The internal output table column must be a valid symbol character. The caller must consider the printability of symbols. Symbols can usually be printed, but may not always be output correctly, depending on the printer configuration.
o just (justification) Value set: SPACE, 'R', 'L', 'C' Only relevant for fields of data type CHAR or NUMC ' ' = default justification for this data type 'R' = right-justified output 'L' = left-justified output 'C' = centered output The justification of the column header always follows the justification of the columns. Independent justification of the column header is not possible. o lzero (leading zeros) Value set: SPACE, 'X' Only relevant for fields of data type NUMC ALV outputs NUMC fields right-justified without leading zeros by default. 'X' = output with leading zeros Note: If a NUMC field is output left-justified or centered by FIELDCAT-JUST, leading zeros are output. If the output of leading zeros is suppressed by a Data Dictionary reference ALPHA conversion exit, the output is always left justified.
- 92 -
SAP –ABAP BOOK o no_sign (no +/- sign) Value set: SPACE, 'X' Only relevant for value fields 'X' = value output without +/ sign o no_zero (suppress zeros) Value set: SPACE, 'X' Only relevant for value fields 'X' = suppress zeros o edit_mask (field formatting) Value set: SPACE, template template = see documentation of WRITE formatting option USING EDIT MASK template The output conversion conv can be made by template = '== conv'.
Texts The following text parameters should be specified for program fields without a Data Dictionary reference. The texts are taken from the Data Dictionary for fields with a Data Dictionary reference. If this is not desired, the text parameters can also be specified. The Data Dictionary texts are then ignored. If the changes the column width interactively, the column header text with the appropriate length is always used. The interactive function 'Optimize column width' takes of both the field contents and the column headers: if all field contents are shorter than the shortest column header, the column width depends on the column header. The 'long field label' is also used in display variant definition, sort, etc. popups. o seltext_l (long field label) o seltext_m (medium field label) o seltext_s (short field label) o reptext_ddic (header) Analogous to the Data element maintenance 'Header' The specified text is not necessarily output in the list, an optimum among all texts is sought. o ddictxt (specify text) Value set: SPACE, 'L', 'M', 'S' You can specify with values 'L', 'M', and 'S', the keyword that should always be used as column header. If the column width changes, no attempt is made in this case to find an appropriate header for the new output width. Parameters for program fields without Data Dictionary reference see also 'Text' parameters o datatype (data type) Value set: SPACE, Data Dictionary data type (CHAR, NUMC,...) Only relevant for fields without Data Dictionary reference Program field data type o ddic_outputlen (external output length) value set: 0 (initial), n Only relevant for fields without Data Dictionary reference whose output is nevertheless to be modified by a conversion exit. Prerequisites: - FIELDCAT-EDIT_MASK = '==conv' See also the documentation of the parameter FIELDCAT-EDIT_MASK
- 93 -
SAP –ABAP BOOK - FIELDCAT-INTLEN = n See also the documentation of the parameter FIELDCAT-INTLEN n = external format field output length The column width FIELDCAT-OUTPUTLEN need not be the same as the external format output length (FIELDCAT-DDIC_OUTPUTLEN). o intlen (internal output length) Value set: 0 (initial), n Only relevant for fields without Data Dictionary reference whose output is nevertheless to be modified by a conversion exit. Prerequisites: - FIELDCAT-EDIT_MASK = '==conv' See also the documentation of the parameter FIELDCAT-EDIT_MASK - FIELDCAT-DDIC_OUTPUTLEN = n See also the documentation of the parameter FIELDCAT-DDIC_OUTPUTLEN n = internal format field output length o rollname (data element) Value set: SPACE, Data Dictionary data element name F1 help can be provided for a program field without a Data Dictionary reference, or F1 help which differs from the Data Dictionary help can be provided for a field with a Data Dictionary reference, using this parameter. When F1 help is called for this field, the documentation of the specified data element is displayed.
IF THE FIELDCAT-ROLLNAME IS INITIAL FOR FIELDS WITH A DATA DICTIONARY reference, the documentation of the data element of the referred Data Dictionary field is output. Others o sp_group (field group key) Value set: SPACE, CHAR(1) Field group key. Keys are assigned to group names in the IT_SPECIAL_GROUPS parameter (see also the documentation of the parameter IT_SPECIAL_GROUPS). When such an assignment is made in the field catalog and in IT_SPECIAL_GROUPS, the fields are grouped correspondingly in the display variant popup. o reprep (Report/Report interface selection criterion) Value set: SPACE, 'X' Prerequisites: - The system contains the Report/Report interface (function group RSTI, table TRSTI) - Parameter LAYOUT-REPREP = 'X' (see also the documentation of the parameter LAYOUT-REPREP of the IMPORTING parameter IS_LAYOUT) 'X' = When the Report/Report interface is called, the value of this field is ed in the selected interface start record as a selection criterion. Value range Default
- 94 -
SAP –ABAP BOOK o The following entries are usually sufficient for internal table fields with a reference to a field defined in the Data Dictionary : - fieldname - ref_tabname Notes: ALV gets the remaining information from the Data Dictionary. If no relative column position (COL_POS) is specified, the fields are output in the list in the order in which they were added to the field catalog. REF_FIELDNAME need only be specifid when the name of the internal table field differs from the name of the referred Data Dictionary field. Information which is explicitly entered in the field catalog is not overwritten by information from the Data Dictionary. Priority rule: Entries in the field catalog have priority over differing entries in the Data Dictionary. o The following entries are usually sufficient for internal table fields without a reference to the Data Dictionary (program fields): - fieldname - outputlen - datatype - seltext_s - seltext_m - seltext_l Notes: F1 help can be provided for program fields by asg a data element to the parameter ROLLNAME. If the parameters SELTEXT_S, SELTEXT_M, SELTEXT_L, and REPTEXT_DDIC contain appropriate field labels, the program field column headers are also adjusted appropriately when the column width changes. IT_EXCLUDING :The optional IMPORTING parameter IT_EXCLUDING is an internal table. It is only needed if the caller uses the list tool standard interface but wants to deactivate interface functions which he or she does not need. In this case the function codes of these standard functions are entered in the table. IT_SPECIAL_GROUP :If fields have been grouped in the field catalog by a shared value of the parameter SP_GROUP, the technical key of the group (FIELDCAT-SP_GROUP) is assigned to the field group text in this internal table. IT_SORT: - Sort criteria for first list display The caller specifies the sorting and/or subtotalling of the basic list in the internal table IT_SORT. This internal table has the following fields: o spos Sort sequence
- 95 -
SAP –ABAP BOOK o fieldname Internal output table field name o tabname Only relevant for hierarchical-sequential lists Name of the internal output table o up
'X' = SORT IN ASCENDING ORDER
O DOWN 'X' = sort in descending order Subtot 'X' = subtotal at group value change o group '* ' = New page at group value change 'UL' = underline at group value change The formatting options are constants of the domain SLIS_CTRLS. See also the documentation of GROUP_CHANGE_EDIT of the interface structure IS_LAYOUT for more information about group value change formatting. o comp (INTERNAL USE ONLY) o expa Prerequisite: IT_SORT-SUBTOT = 'X', i.e. sort criterion is also subtotal criterion If the first list output is only to be expanded to total level n, and can then be further expanded interactively by the , the flag should be set at the total level criterion for level n. IT_FILTER: Filter criteria table Filter criteria which result, e.g. from explicitly loading an initial display variant, can be ed to list output in this parameter. This table should never be built-up 'manually'. IS_SEL_HIDE: Only relevant when the layout parameter LAYOUT-GET_SELINFOS of the IMPORTING structure IS_LAYOUT is set. Complex type for modifying the information displayed in the selection info popup: o mode: 'R' = only the entries ed in the internal table IS_SEL_HIDE-T_ENTRIES are output in the popup. Selection info which the list tool read in the selection screen (when called by a report with a selection screen) are replaced by the values ed. 'S' = the selection info which the list tool read in the selection screen of the calling report are modified by the entries in the table IS_SEL_HIDE-T_ENTRIES.
- 96 -
SAP –ABAP BOOK o t_entries:
Selection info table
o t_entries-mode: 'A' = output the selection info for the current table record additionally in the info popup. 'D' = do not output select option or SELNAME parameter selection info in the popup. o t_entries-selname: (only used in t_entries-mode = 'D') Name of the select option or parameter. The following table fields are only used in t_entries-mode = 'A'. They contain the selection information to be added. o t_entries-field: DDIC field name of the field for which selection information is to be output. o t_entries-table: DDIC table names of t_entries-field. o t_entries-stext: Field name in info popup. If t_entries-field and t_entries-table have been entered, this text is taken from DDIC. o t_entries-valuf: Selection condition 'from' value (external format) o t_entries-valut: Selection condition 'to' value (external format) o t_entries-sign0: (I)nclusive (E)xclusive o t_entries-optio: All values of the select options Option field allowed. The remaining fields are used internally and are not relevant for the caller. I_DEFAULT: Initial variant logic active/inactive. Prerequisite: The parameter IS_VARIANT has the appropriate value. See also the documentation of the IMPORTING parameter IS_VARIANT. Value Range:‘ ‘ = no variant can be defined
‘X’= VARIANT CAN BE DEFINED I_SAVE: Controls the storage mode Prerequisite: The IS_VARIANT parameter has the appropriate value. See also the documentation of the IMPORTING parameter IS_VARIANT. Value range o ' ' = display variants cannot be saved Defined display variants (e.g. delivered display variants) can be selected for presentation independently of this flag. Changes can not be saved.
- 97 -
SAP –ABAP BOOK o 'X' = standard save Display variants can be saved as standard display variants. -specific saving is not possible. o 'U' = only -specific saving The can only save display variants -specifically o 'A' = standard and -specific saving The can save a display variant -specifically and as standard display variant. The chooses in the display variant save popup. Default SPACE IS_VARIANT- Variant Information This structure is only relevant if display variants are to be saved and/or read. Variant information including the name of the list output variant. The access path must be specified in the fields REPORT (required field), HANDLE (optional) and/or LOG_GROUP (optional) to allow ALV to read display variants. If display variants are also to be saved, the parameter I_SAVE must also be entered. See also the documentation of the IMPORTING parameter I_SAVE.
•
A variant is identified uniquely by: the program to which it is assigned (REPORT)
o the handle if, e.g. several lists with various structures and data are called (HANDLE) in a program (I_CALLBACK_PROGRAM) The handle is a unique -assigned CHAR(4) field, which assigns the call to the current internal output table structure. Example: Various lists can be output in program x, depending on a action. Display variants are to be able to be defined for each of these lists. This functionality is guaranteed by asg a HANDLE for each list. If variants are saved for this program and handle, the handle must not change. o the logical group if, e.g. the same list is made with different settings (LOG_GROUP) via different transactions. The logical group is a unique -assigned CHAR(4) field which determines the assignment. Example: The program x is called via the transactions T1 and T2. The field catalog fields offered to the vary depending on the transaction code by assignment to logical groups. If variants are saved for the program and logical group, the logical group must not change. o the name, if variants are saved -specifically (NAME) This parameter is never entered manually as the variant name is unique. •
the variant name (VARIANT). This parameter is only to be entered if a particular variant is to be read and the list is to be output with this variant via this structure.
Value range
- 98 -
SAP –ABAP BOOK The above fields must be specified to be able to call a list with a variant. Default : If the structure is initial but saving is active (I_SAVE is not initial), IS_VARIANT-REPORT is set to I_CALLBACK_PROGRAM.
IT_EVENTS: This table tells ALV which events are processed by the caller by CALLBACK. The table of possible events per list type can be initialized using the module REUSE_ALV_EVENTS_GET. You can display the names of the constants in the type pools SLIS which represent the individual events using the individual test function in the function module REUSE_ALV_EVENT_NAMES_GET. Only events with a form routine name are processed. The table structure contains the fields: o IT_EVENTS-NAME Name of the Callback event. Possible Callback events: - Action _COMMAND USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE SLIS_SELFIELD Process actions on the list As this is a frequently-used Callback event, the form routine can also be ed directly in the interface in the IMPORTING parameter I_CALLBACK__COMMAND. PF_STATUS_SET USING RT_EXTAB TYPE SLIS_T_EXTAB If a list status is to be set, it must be done in the form routine assigned to this event. The ALV function codes, which must not be active, are in the Parameter RT_EXTAB. This table must be ed with the SET PF-STATUS command (with inactive function codes as well, if necessary). The STANDARD status of the function group SALV should be used as a template for a -specific status. As this is a frequently-used Callback event, its form routine can also be ed directly in the interface in the IMPORTING parameter I_CALLBACK_PF_STATUS_SET. ITEM_DATA_EXPAND USING RS_SELFIELD TYPE SLIS_SELFIELD RFLG_ALL TYPE C Only relevant for hierarchical-sequential lists using the layout parameter IS_LAYOUT-EXPAND_FIELDNAME of the structure IS_LAYOUT. Exit for ing item entries (ITEM table) for a header record, which was expanded interactively by the . RS_SELFIELD-TABINDEX contains the header table index for which the item entries are to be put in the global item output table (T_OUTTAB_SLAVE). The Callback is only called if ALV has no items for a header which is to be expanded. RFLG_ALL is ed with 'X' if the shows all items. The application must ensure that entries are not repeated in the item table. RS_SELFIELD is initial in this case. CALLER_EXIT USING RS_DATA Is called at the beginning of the function module to make special settings. It is not usually used. - List processing events IMPORTANT: The application Callback routine must not manipulate the internal output table and/or its header record. This restriction applies to all Callbacks which are called in the list output and run under the 'List processing events'.
- 99 -
SAP –ABAP BOOK TOP_OF_LIST no USING parameter Information output at the start of the list END_OF_LIST no USING parameter Information output at the end of the list TOP_OF_PAGE no USING parameter Equivalent to the list processing TOP-OF-PAGE event END_OF_PAGE no USING parameter Not available for hierarchical-sequential lists. Information output at the end of a page. This is only called for printing. TOP_OF_COVERPAGE no USING parameter The selection information and list status are output together (if they exist) on a separate page by default. See also the documentation of the parameters: IS_PRINT-NO_COVERPAGE IS_PRINT-NO_PRINT_SELINFOS IS_PRINT-NO_PRINT_LISTINFOS IS_LAYOUT-GET_SELINFOS The can format the header area of the 'cover page' himself or herself by specifying a Callback routine for this event. END_OF_COVERPAGE no USING parameter Analogously to TOP_OF_COVERPAGE the can add other information to the information output by ALV (selection information, list status) at this event. FOREIGN_TOP_OF_PAGE no USING parameter The Top-of-page event is always processed in ALV and is only ed to the caller via the Callback mechanism. This is still the case if the caller, e.g. by a action, processes a branch list which was not formatted by ALV (e.g. a popup with additional information about the list record selected and displayed by ALV). In this case, top-of-page cannot be formatted by ALV analogously to the basic list, it must be handled completely by the caller. The event top-of-page still occurs in ALV. When ALV notices a top-of-page which was not caused by an ALV output, the form routine in FOREIGN_TOP_OF_PAGE is called. FOREIGN_END_OF_PAGE no USING parameter The event end-of-page is always processed in ALV and only ed to the caller via callback. This is still the case, e.g. when the caller processes a details list which was not formatted by ALV (e.g. a popup with further information about selected list records which were displayed by ALV). In this case, end-of-page cannot be formatted by ALV analogously to the basic list, it must be handled completely by the caller. The event end-of-page still occurs in ALV. When ALV notices an end-of-page that was not caused by an ALV output, the form routine in FOREIGN_END_OF_PAGE is called. BEFORE_LINE_OUTPUT USING RS_LINEINFO TYPE SLIS_LINEINFO Output information before each output line. Should only be used in justified cases because it costs a lot of performance. AFTER_LINE_OUTPUT USING RS_LINEINFO TYPE SLIS_LINEINFO Output information after each output line. Should only be used in justified cases because it costs a lot of performance. Internal use only LIST_MODIFY USING R_TABNAME TYPE SLIS_TABNAME R_INDEX LIKE SY-TABIX R_INDEX_ITEM LIKE SY-TABIX R_INDEX_SUM LIKE SY-TABIX
- 100 -
SAP –ABAP BOOK o IT_EVENTS-FORM Name of the form routine, which should be called in the calling program at the event.
IT_EVENT_EXIT: Table for ing ALV standard function codes, to return control to the before and/or after execution with the callback event _COMMAND. See also the documentation of the IMPORTING parameter I_CALLBACK__COMMAND. This table should only be ed when the application wants to react to the execution of standard functions. This could, e.g. be to check the authorization for a standard function or to select data depending on the current display variant. Note: the functions 'Back (F3)', 'Cancel (F15)' and 'Exit (F12)' are NOT standard ALV functions, they are system functions. If the application wants to react to these (e.g. to send a confirmation prompt before leaving the list), these functions must be occupied by application function codes. The table fields are as follows: o ucomm Standard function code which is also ed in the callback event _COMMAND. Example: ucomm = '&OL0' means that the application also gets control at the display variant definition function code. o before 'X' = the application gets control before ALV executes the function. o after 'X' = the application gets control after ALV has executed the function, but before the list is output. Example: ucomm = '&OL0' and after = 'X'. The application gets control after the has left the display variant definition popup. In the function code processing form routine which is ed to ALV in the I_CALLBACK__COMMAND parameter, the application can now get the field catalog which may have been modified by the , using the module REUSE_ALV_LIST_LAYOUT_INFO_GET, and then reselect the data for the new output fieldes in the internal output table, if necessary. If the application sets the SELFIELD-REFRESH flag (_COMMAND form routine interface reference parameter) after the selection, the list is output again. Output fields added by the and reselected data now appear. IS_PRINT: -
PRINT CONTROL PARAMETER o PRINT Value set: SPACE, 'X' 'X' = the list is to be printed and not displayed on the screen. Other settings can be made in the print parameter screen. o NO_PRINT_SELINFOS
- 101 -
SAP –ABAP BOOK Value set: SPACE, 'X' 'X' = do not print selection info (see LAYOUT-GET_SELINFOS) o NO_COVERPAGE Value set: SPACE, 'X' 'X' = do not print selection information and list status on a separate page. •
NO_NEW_PAGE Value set: SPACE, 'X' For internal use only o RESERVE_LINES Value set: 0, n Not relevant for hierarchical-sequential lists and block lists. n = number of lines to be printed by the in the footer area in the Callback at the event END_OF_PAGE. o NO_PRINT_LISTINFOS Value set: SPACE, 'X' 'X' = Do not print list status (sort, subtotal and filter information). o NO_CHANGE_PRINT_PARAMS Value set: SPACE, 'X' SPACE = (default) The output format (number of columns) is dynamically adjusted to the list width (max. 255). 'X' = The current print parameters are used. If the list is wider, the output width is not dynamically adjusted.
IS_REPREP_ID: Initialization key for Re/Re interface. I_SCREEN_START_COLUMN: Only to be used if the list is output in a popup. x coordinate of the top left-hand corner of the popup I_SCREEN_START_LINE: Only to be used if the list is output in a popup y coordinate of the top left-hand corner of the popup.
I_SCREEN_END_COLUMN: Only to be used if the list is output in a popup x coordinate of the bottom right-hand corner of the popup. I_SCREEN_END_LINE: Only to be used if the list is output in a popup y coordinate of the bottom right-hand corner of the popup. E_EXIT_CAUSED_BY_CALLER: - delete list in the CALLBACK__COMMAND Parameter which states whether the caller left the list (SELFIELD-EXIT = 'X') in CALLBACK _COMMAND ES_EXIT_CAUSED_BY_CALLER: - (HOW THE LEFT THE LIST) If one of the ALV standard function codes for 'Back', 'Cancel' or 'Exit' occurs, the current list is discarded and the ALV function module ends. In this case the exporting structure ES_EXIT_CAUSED_BY_ contains one of the following flags: o ES_EXIT_CAUSED_BY_-BACK = 'X' 'Back' occurred
- 102 -
SAP –ABAP BOOK o ES_EXIT_CAUSED_BY_-CANCEL = 'X' 'Cancel' occurred o ES_EXIT_CAUSED_BY_-EXIT = 'X' 'Exit' occurred T_OUTTAB: - (TABLE WITH DATA TO BE DISPLAYED)
Internal table with any structure containing the data to be output in list form. This table can contain more fields than are relevant for the list output (display fields and field list). Only the fields named in field catalog and the layout structure are used for the list output. Other internal table fields are ignored. The value of the field FIELDCAT-NO_OUT in the field catalog determines whether a field is output directly in the list, or whether this field is initially put in the field list. The can interactively move fields between this field list and the output field list to display or hide them. If the internal table is defined in the calling program without a header, no F1 help is possible in the list.
2. REUSE_ALV_HIERSEQ_LIST_DISPLAY: - (Used to display multilevel sequential list.) IMPORTING VALUE(I_INTERFACE_CHECK) DEFAULT SPACE VALUE(I_CALLBACK_PROGRAM) LIKE SY-REPID OPTIONAL VALUE(I_CALLBACK_PF_STATUS_SET) TYPE SLIS_FORMNAME DEFAULT SPACE VALUE(I_CALLBACK__COMMAND) TYPE SLIS_FORMNAME DEFAULT SPACE VALUE(IS_LAYOUT) TYPE SLIS_LAYOUT_ALV OPTIONAL VALUE(IT_FIELDCAT) TYPE SLIS_T_FIELDCAT_ALV OPTIONAL VALUE(IT_EXCLUDING) TYPE SLIS_T_EXTAB OPTIONAL VALUE(IT_SPECIAL_GROUPS) TYPE SLIS_T_SP_GROUP_ALV OPTIONAL VALUE(IT_SORT) TYPE SLIS_T_SORTINFO_ALV OPTIONAL VALUE(IT_FILTER) TYPE SLIS_T_FILTER_ALV OPTIONAL VALUE(IS_SEL_HIDE) TYPE SLIS_SEL_HIDE_ALV OPTIONAL VALUE(I_SCREEN_START_COLUMN) DEFAULT 0 VALUE(I_SCREEN_START_LINE) DEFAULT 0 VALUE(I_SCREEN_END_COLUMN) DEFAULT 0 VALUE(I_SCREEN_END_LINE) DEFAULT 0 VALUE(I_DEFAULT) DEFAULT 'X' VALUE(I_SAVE) DEFAULT SPACE VALUE(IS_VARIANT) LIKE DISVARIANT STRUCTURE DISVARIANT DEFAULT SPACE VALUE(IT_EVENTS) TYPE SLIS_T_EVENT OPTIONAL VALUE(IT_EVENT_EXIT) TYPE SLIS_T_EVENT_EXIT OPTIONAL VALUE(I_TABNAME_HEADER) TYPE SLIS_TABNAME VALUE(I_TABNAME_ITEM) TYPE SLIS_TABNAME VALUE(I_STRUCTURE_NAME_HEADER) LIKE DD02L-TABNAME OPTIONAL VALUE(I_STRUCTURE_NAME_ITEM) LIKE DD02L-TABNAME OPTIONAL VALUE(IS_KEYINFO) TYPE SLIS_KEYINFO_ALV VALUE(IS_PRINT) TYPE SLIS_PRINT_ALV OPTIONAL VALUE(IS_REPREP_ID) TYPE SLIS_REPREP_ID OPTIONAL EXPORTING VALUE(E_EXIT_CAUSED_BY_CALLER) VALUE(ES_EXIT_CAUSED_BY_) TYPE SLIS_EXIT_BY_
- 103 -
SAP –ABAP BOOK TABLES T_OUTTAB_HEADER T_OUTTAB_ITEM EXCEPTIONS PROGRAM_ERROR I_INTERFACE_CHECK: - (Interface consistency check log output.) Same as in REUSE_ALV_LIST_DISPLAY I_CALLBACK_PROGRAM: - (Name of the calling program.) Same as in REUSE_ALV_LIST_DISPLAY I_CALLBACK_PF_STATUS_SET: Same as in REUSE_ALV_LIST_DISPLAY I_CALLBACK__COMMAND: - (Exit routine for command handling.) Same as in REUSE_ALV_LIST_DISPLAY IS_LAYOUT: - (List layout specifications) Same as in REUSE_ALV_LIST_DISPLAY IT_FIELDCAT: - (Field catalog with field descriptions) Same as in REUSE_ALV_LIST_DISPLAY IT_EXCLUDING: - (Table of inactive function codes) Same as in REUSE_ALV_LIST_DISPLAY IT_SPECIAL_GROUPS: - (Grouping fields for column selection) Same as in REUSE_ALV_LIST_DISPLAY IT_SORT: -(Sort criteria for first list display) Same as in REUSE_ALV_LIST_DISPLAY IT_FILTER: -(Filter criteria for first list output) Same as in REUSE_ALV_LIST_DISPLAY IS_SEL_HIDE: - (Selection information modification) Same as in REUSE_ALV_LIST_DISPLAY I_SCREEN_START_COLUMN: -(Coordinates for list in dialog box) Same as in REUSE_ALV_LIST_DISPLAY I_SCREEN_START_LINE: - -(Coordinates for list in dialog box) Same as in REUSE_ALV_LIST_DISPLAY I_SCREEN_END_COLUMN: -(Coordinates for list in dialog box) Same as in REUSE_ALV_LIST_DISPLAY I_SCREEN_END_LINE: - -(Coordinates for list in dialog box) Same as in REUSE_ALV_LIST_DISPLAY I_DEFAULT: - (Initial variant active/inactive logic) Same as in REUSE_ALV_LIST_DISPLAY I_SAVE: -(Variants can be saved) Same as in REUSE_ALV_LIST_DISPLAY IS_VARIANT: -(Variant information) Same as in REUSE_ALV_LIST_DISPLAY IT_EVENTS: - (Table of events to perform) Same as in REUSE_ALV_LIST_DISPLAY IT_EVENT_EXIT: - (Standard fcode exit requests table) Same as in REUSE_ALV_LIST_DISPLAY I_TABNAME_HEADER: -(Header Table Name) Name of the internal table in the program containing the output data of the highest hierarchy level. I_TABNAME_ITEM: - (Item Table Name) Name of the internal table in the program containing the output data of the lowest hierarchy level. I_STRUCTURE_NAME_HEADER:- (Internal output table (header) structure name) Same as I_STRUCTURE_NAME in REUSE_ALV_LIST_DISPLAY I_STRUCTURE_NAME_ITEM: -(Internal output table (posit.) structure name) Same as I_STRUCTURE_NAME in REUSE_ALV_LIST_DISPLAY IS_KEYINFO: - (Header/posit. table field links) This structure contains the header and item table field names which link the two tables (shared key).
- 104 -
SAP –ABAP BOOK Enter the foreign key field names in the fields KEYINFO-HEADERxx and KEYINFO-ITEMxx. The foreign key field names of the header and item tables are usually identical. The item table has other key fields as well as the header table foreign key. These other key fields should also be named in this structure. The corresponding header table field (HEADERxx) must be SPACE. Naming the other key fields guarantees a stable item table sort sequence. IS_PRINT: - (Print information) Same as in REUSE_ALV_LIST_DISPLAY IS_REPREP_ID: - (Initialization key for Re/Re interface) E_EXIT_CAUSED_BY_CALLER: -(Delete list in CALLBACK__COMMAND) Same as in REUSE_ALV_LIST_DISPLAY ES_EXIT_CAUSED_BY_: -(How the left the list) Same as in REUSE_ALV_LIST_DISPLAY T_OUTTAB_HEADER: -(Header table with data to be output) Same as T_OUTTAB in REUSE_ALV_LIST_DISPLAY T_OUTTAB_ITEM: - (Position table with data to be output) Same as T_OUTTAB in REUSE_ALV_LIST_DISPLAY
3. REUSE_ALV_FIELDCATALOG_MERGE: -(this module is used to create field catalog from dictionary structure or internal table) IMPORTING VALUE(I_PROGRAM_NAME) LIKE SY-REPID OPTIONAL VALUE(I_INTERNAL_TABNAME) TYPE SLIS_TABNAME OPTIONAL VALUE(I_STRUCTURE_NAME) LIKE DD02L-TABNAME OPTIONAL VALUE(I_CLIENT_NEVER_DISPLAY) TYPE SLIS_CHAR_1 DEFAULT 'X' VALUE(I_INCLNAME) LIKE TRDIR-NAME OPTIONAL CHANGING VALUE(CT_FIELDCAT) TYPE SLIS_T_FIELDCAT_ALV EXCEPTIONS INCONSISTENT_INTERFACE PROGRAM_ERROR I_PROGRAM_NAME: - (Internal table declaration program) Program from which the function module is called and which contains the exit routines. The program should always be a Report, Function group, Module pool or Form routine pool (not an Include). I_INTERNAL_TABNAME: -(Output table name) Name of the internal output table in the CALLBACK_PROGRAM. I_STRUCTURE_NAME: - (Structure name (structure, table, view)) Same as in REUSE_ALV_LIST_DISPLAY I_CLIENT_NEVER_DISPLAY: - (Hide client fields) Client field handling in the structure ed. Value range 'X', SPACE SPACE: client fields (type CLNT) in the structure ed are flagged as technical (=> no screen output) in the field catalog. I_INCLNAME: -(Data declaration include name) If the list output structure data declaration is not in the assigned TOP Include, the Include name can be specified here if no structure is specified. CT_FIELDCAT: - (Field catalog with field descriptions) Same as IT_FIELDCAT in REUSE_ALV_LIST_DISPLAY.
- 105 -
SAP –ABAP BOOK
4. REUSE_ALV_COMMENTARY_WRITE: - (this module is used for list body comment block output) IMPORTING VALUE(IT_LIST_COMMENTARY) TYPE SLIS_T_LISTHEADER IT_LIST_COMMENTARY: - (Comment block) Internal table with the following fields: o TYP: Possible values: - (H)eader: - List header - only the contents of INFO are output (KEY is ignored) - usually one line = one entry Attributes: - left-justified - bold - followed by empty line - (S)election: - Important header information, e.g. currency of amounts in the list - display format: KEY(bold) INFO(normal) Ex.: --- KEY----- ----INFO------Currency DEM Ctrl area curr. Material FGS_TEST Test material - Usually several entries (one entry per line) Attributes: - left-justified - Bold (KEY=on/INFO=off) - Followed by empty line
o KEY: o INFO:
- (A)ction: - Action info (see LIBS) - Direct output via table - Only the contents of INFO are Output (KEY is ignored) - Usually one entry Attributes: - left-justified - Normal intensity String with keyword character output in combination with TYP = 'S'. Information output in header, formatted by type.
5. REUSE_ALV_EVENTS_GET: - (this module returns table of possible events for a list type) IMPORTING VALUE(I_LIST_TYPE) TYPE SLIS_LIST_TYPE DEFAULT 0 EXPORTING VALUE(ET_EVENTS) TYPE SLIS_T_EVENT EXCEPTIONS LIST_TYPE_WRONG I_LIST_TYPE: -(List type (0,1,2,3)) 0 = simple list (REUSE_ALV_LIST_DISPLAY) 1 = hierarchcal-sequential list (REUSE_ALV_HIERSEQ_LIST_DISPLAY) 2 = simple block list (REUSE_ALV_BLOCK_LIST_APPEND) 3 = hierarchical-sequential block list (REUSE_ALV_BLOCK_LIST_HS_APPEND) ET_EVENTS: - (Table of events to perform) The event table is returned with all possible CALLBACK events for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM' field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field 'FORM' filled and the entry modified using constants from the type pool SALV.
- 106 -
SAP –ABAP BOOK The function module REUSE_ALV_EVENT_NAMES_GET gets the names of these constants (call in test mode).
6. REUSE_ALV_BLOCK_LIST_INIT: - (This module is used for the initialization of blocks & called first before calling REUSE_ALV_BLOCK_LIST_APPEND or REUSE_ALV_BLOCK_LIST_HS_APPEND) IMPORTING VALUE(I_CALLBACK_PROGRAM) LIKE SY-REPID VALUE(I_CALLBACK_PF_STATUS_SET) TYPE SLIS_FORMNAME DEFAULT SPACE VALUE(I_CALLBACK__COMMAND) TYPE SLIS_FORMNAME DEFAULT SPACE VALUE(IT_EXCLUDING) TYPE SLIS_T_EXTAB OPTIONAL I_CALLBACK_PROGRAM: SAME AS IN REUSE_ALV_LIST_DISPLAY :
I_CALLBACK_PF_STATUS_SET: -
SAME AS IN REUSE_ALV_LIST_DISPLAY :
I_CALLBACK__COMMAND: -
SAME AS IN REUSE_ALV_LIST_DISPLAY :
IT_EXCLUDING: -
SAME AS IN REUSE_ALV_LIST_DISPLAY
7.REUSE_ALV_BLOCK_LIST_APPEND: -(this behaves same as REUSE_ALV_LIST_DISPLAY) IMPORTING VALUE(IS_LAYOUT) TYPE SLIS_LAYOUT_ALV VALUE(IT_FIELDCAT) TYPE SLIS_T_FIELDCAT_ALV VALUE(I_TABNAME) TYPE SLIS_TABNAME VALUE(IT_EVENTS) TYPE SLIS_T_EVENT VALUE(IT_SORT) TYPE SLIS_T_SORTINFO_ALV OPTIONAL VALUE(I_TEXT) TYPE SLIS_TEXT40 DEFAULT SPACE TABLES T_OUTTAB EXCEPTIONS PROGRAM_ERROR MAXIMUM_OF_APPENDS_REACHED IS_LAYOUT: -
SAME AS IN REUSE_ALV_LIST_DISPLAY IT_FIELDCAT: Same as in REUSE_ALV_LIST_DISPLAY I_TABNAME: IT_EVENTS: Same as in REUSE_ALV_LIST_DISPLAY IT_SORT: Same as in REUSE_ALV_LIST_DISPLAY I_TEXT: T_OUTTAB: Same as in REUSE_ALV_LIST_DISPLAY
8. REUSE_ALV_BLOCK_LIST_HS_APPEND: -(this behaves same as REUSE_ALV_HIERSEQ_LIST_DISPLAY) IMPORTING
- 107 -
SAP –ABAP BOOK VALUE(IS_LAYOUT) TYPE SLIS_LAYOUT_ALV VALUE(IT_FIELDCAT) TYPE SLIS_T_FIELDCAT_ALV VALUE(IS_KEYINFO) TYPE SLIS_KEYINFO_ALV VALUE(I_HEADER_TABNAME) TYPE SLIS_TABNAME VALUE(I_ITEM_TABNAME) TYPE SLIS_TABNAME VALUE(IT_EVENTS) TYPE SLIS_T_EVENT VALUE(IT_SORT) TYPE SLIS_T_SORTINFO_ALV OPTIONAL VALUE(I_TEXT) TYPE SLIS_TEXT40 DEFAULT SPACE TABLES T_OUTTAB_HEADER T_OUTTAB_ITEM EXCEPTIONS PROGRAM_ERROR IS_LAYOUT: -
SAME AS IN REUSE_ALV_HIERSEQ_LIST_DISPLAY IT_FIELDCAT: Same as in REUSE_ALV_HIERSEQ_LIST_DISPLAY IS_KEYINFO: Same as in REUSE_ALV_HIERSEQ_LIST_DISPLAY I_HEADER_TABNAME: Same as I_TABNAME_HEADER in REUSE_ALV_HIERSEQ_LIST_DISPLAY I_ITEM_TABNAME: Same as I_TABNAME_ITEM in REUSE_ALV_HIERSEQ_LIST_DISPLAY IT_EVENTS: Same as in REUSE_ALV_HIERSEQ_LIST_DISPLAY IT_SORT: Same as in REUSE_ALV_HIERSEQ_LIST_DISPLAY I_TEXT: T_OUTTAB_HEADER: Same as in REUSE_ALV_HIERSEQ_LIST_DISPLAY T_OUTTAB_ITEM: Same as in REUSE_ALV_HIERSEQ_LIST_DISPLAY
9. REUSE_ALV_BLOCK_LIST_DISPLAY: - (This module is called display blocks after appending then.) IMPORTING VALUE(I_INTERFACE_CHECK) DEFAULT SPACE VALUE(IS_PRINT) TYPE SLIS_PRINT_ALV OPTIONAL VALUE(I_SCREEN_START_COLUMN) DEFAULT 0 VALUE(I_SCREEN_START_LINE) DEFAULT 0 VALUE(I_SCREEN_END_COLUMN) DEFAULT 0 VALUE(I_SCREEN_END_LINE) DEFAULT 0 EXPORTING VALUE(E_EXIT_CAUSED_BY_CALLER) VALUE(ES_EXIT_CAUSED_BY_) TYPE SLIS_EXIT_BY_ EXCEPTIONS PROGRAM_ERROR I_INTERFACE_CHECK: -
SAME AS IN REUSE_ALV_LIST_DISPLAY IS_PRINT: -
- 108 -
SAP –ABAP BOOK Same as in REUSE_ALV_LIST_DISPLAY I_SCREEN_START_COLUMN: Same as in REUSE_ALV_LIST_DISPLAY I_SCREEN_START_LINE: Same as in REUSE_ALV_LIST_DISPLAY I_SCREEN_END_COLUMN: Same as in REUSE_ALV_LIST_DISPLAY I_SCREEN_END_LINE: Same as in REUSE_ALV_LIST_DISPLAY E_EXIT_CAUSED_BY_CALLER: Same as in REUSE_ALV_LIST_DISPLAY ES_EXIT_CAUSED_BY_: Same as in REUSE_ALV_LIST_DISPLAY
10. REUSE_ALV_LIST_LAYOUT_INFO_GET: - (this module is used to read current ALV list information) XPORTING VALUE(ES_LAYOUT) TYPE SLIS_LAYOUT_ALV VALUE(ET_FIELDCAT) TYPE SLIS_T_FIELDCAT_ALV VALUE(ET_SORT) TYPE SLIS_T_SORTINFO_ALV VALUE(ET_FILTER) TYPE SLIS_T_FILTER_ALV VALUE(ES_LIST_SCROLL) TYPE SLIS_LIST_SCROLL VALUE(ES_VARIANT) LIKE DISVARIANT STRUCTURE DISVARIANT XCEPTIONS NO_INFOS PROGRAM_ERROR ES_LAYOUT: -
SAME AS IT_LAYOUT IN REUSE_ALV_LIST_DISPLAY ET_FIELDCAT: Same as IT_FIELDCAT in REUSE_ALV_LIST_DISPLAY ET_SORT: Same as IT_SORT in REUSE_ALV_LIST_DISPLAY ET_FILTER: SAME AS IT_FILTER IN REUSE_ALV_LIST_DISPLAY ES_LIST_SCROLL: Structure with fields which describe the current list scroll status: o lsind See the documentation of the system field SY-LSIND o age See the documentation of the system field SY-AGE o staro See the documentation of the system field SY-STARO o cursor_line
- 109 -
SAP –ABAP BOOK Current cursor row position in the list (not in the internal output Table) o cursor_offset current cursor column position in the list (not in the internal output table) ES_VARIANT: Same as IS_VARIANT in REUSE_ALV_LIST_DISPLAY
11.REUSE_ALV_LIST_LAYOUT_INFO_SET: -(this module is used to set the current ALV list information) IMPORTING VALUE(IS_LAYOUT) TYPE SLIS_LAYOUT_ALV OPTIONAL VALUE(IT_FIELDCAT) TYPE SLIS_T_FIELDCAT_ALV OPTIONAL VALUE(IT_SORT) TYPE SLIS_T_SORTINFO_ALV OPTIONAL VALUE(IT_FILTER) TYPE SLIS_T_FILTER_ALV OPTIONAL VALUE(IS_LIST_SCROLL) TYPE SLIS_LIST_SCROLL OPTIONAL IS_LAYOUT: -
SAME AS IN REUSE_ALV_LIST_DISPLAY
IT_FIELDCAT: SAME AS IN REUSE_ALV_LIST_DISPLAY
IT_SORT: -
SAME AS IN REUSE_ALV_LIST_DISPLAY
IT_FILTER: -
SAME AS IN REUSE_ALV_LIST_DISPLAY
IS_LIST_SCROLL: -
SAME AS ES_LIST_SCROLL IN REUSE_ALV_LIST_LAYOUT_INFO_GET
12.REUSE_ALV_POPUP_TO_SELECT: -(This module is used to List in popup to choose one or more entries (or display only)) IMPORTING VALUE(I_TITLE) OPTIONAL
VALUE(I_SELECTION) DEFAULT 'X' VALUE(I_ZEBRA) DEFAULT SPACE VALUE(I_SCREEN_START_COLUMN) DEFAULT 0 VALUE(I_SCREEN_START_LINE) DEFAULT 0 VALUE(I_SCREEN_END_COLUMN) DEFAULT 0 VALUE(I_SCREEN_END_LINE) DEFAULT 0 VALUE(I_CHECKBOX_FIELDNAME) OPTIONAL VALUE(I_LINEMARK_FIELDNAME) OPTIONAL
- 110 -
SAP –ABAP BOOK VALUE(I_SCROLL_TO_SEL_LINE) DEFAULT 'X' VALUE(I_TABNAME) VALUE(I_STRUCTURE_NAME) LIKE DD02L-TABNAME OPTIONAL VALUE(IT_FIELDCAT) TYPE SLIS_T_FIELDCAT_ALV OPTIONAL VALUE(IT_EXCLUDING) TYPE SLIS_T_EXTAB OPTIONAL VALUE(I_CALLBACK_PROGRAM) LIKE SY-REPID OPTIONAL VALUE(I_CALLBACK__COMMAND) TYPE SLIS_FORMNAME OPTIONAL EXPORTING VALUE(ES_SELFIELD) TYPE SLIS_SELFIELD VALUE(E_EXIT) TABLES T_OUTTAB EXCEPTIONS PROGRAM_ERROR I_TITLE: - (Dialog box title) Title to be displayed as the popup title. I_SELECTION: - ((X) = Selection possible, ( ) = Display) I_SELECTION = 'X' => the can select entries in the displayed internal table. I_ZEBRA: - (Line output with alternating color) I_ZEBRA = 'X' => List rows are output in alternating colors for better readability. This option should be used when the list is relatively wide. I_SCREEN_START_COLUMN: Column coordinate of the top left-hand corner of the popup. If no coordinates or only the coordinates of the top left-hand corner are specified in the interface, the module calculates the optimal coordinates using the table information. The coordinates need not normally be specified in the interface parameters. You can position the popups by specifying the top left-hand corner, without specifying its size. I_SCREEN_START_LINE: Row coordinate of the top left-hand corner of the popup. I_SCREEN_END_COLUMN: Column coordinate of the bottom right-hand corner of the popup. I_SCREEN_END_LINE: Row coordinate of the bottom right-hand corner of the popup. I_CHECKBOX_FIELDNAME: - (Output table checkbox field name) If the table output in the popup has checkboxes at the beginning of the rows (e.g. for multiple selection), the internal table must contain a field containing the value of the checkbox. Assign the name of this field to the parameter I_CHECKBOX_FIELDNAME. I_LINEMARK_FIELDNAME: - (LINE SELECTION COLOR INFORMATION FIELD NAME) Name of the internal output table field containing the color code. A complete list row is colored individually by color coding in a column of the internal output table. The name of this field is assigned to this parameter. The internal output table field must be of type CHAR(3). The coding must have the following syntax:
- 111 -
SAP –ABAP BOOK 'Cxy': C = color (each code must begin with 'C') x = color number ('1'-'9') y = highlight ('0' = off, '1' = on) Note: the color of the key columns is not affected. I_SCROLL_TO_SEL_LINE: - (SCROLL TO DEFAULT SELECTION IF NECESSARY) Prerequisite: A row has been color highlighted and its index in the internal output table is greater than the number of entries which can be displayed in the popup without scrolling. When the popup is called, the cursor should be immediately positioned on, or scrolled to, this row. Prerequisite: color code the highlighted row with 'C50' See also the documentation of the importing parameter I_LINEMARK_FIELDNAME I_TABNAME: - (Table name with chosen values) Name of the internal output table in the calling program I_STRUCTURE_NAME: - (INTERNAL OUTPUT TABLE STRUCTURE NAME)
SAME AS I_STRUCTURE_NAME IN REUSE_ALV_LIST_DISPLAY IT_FIELDCAT: -
SAME AS IN REUSE_ALV_LIST_DISPLAY IT_EXCLUDING: The optional IMPORTING parameter IT_EXCLUDING is an internal table. This is only used when the caller wants to deactivate standard functions. The function codes of these standard functions are entered in this table. At most the following functions are active in the standard and can be deactivated using IT_EXCLUDING: o o o o o o o o o o o o
Function code: &ETA (Detail) Function code: &SC (Find) Function code: &SC+ (Find next) Function code: &OUP (Sort ascending) Function code: &ODN (Sort descending) Function code: &ILT (Filter) Function code: &OL0 (Display variant) Function code: &CRB (Horizontal scroll: First column) Function code: &CRL (Horizontal scroll: Previous column) Function code: &CRR (Horizontal scroll: Next column) Function code: &CRE (Horizontal scroll: Last column) Function code: &AC1 (Cancel)
Only for active checkboxes: o Function code: &ALL (Select all) o Function code: &SAL (Deselect all)
- 112 -
SAP –ABAP BOOK I_CALLBACK_PROGRAM: Same as in REUSE_ALV_LIST_DISPLAY I_CALLBACK__COMMAND: Same as in REUSE_ALV_LIST_DISPLAY ES_SELFIELD: The structure SELFIELD contains the following information about the current cursor position o tabname : internal output table name o tabindex : internal output table index o fieldname: field name o value : field contents Multiple selection using checkboxes puts an 'X' in the I_CHECKBOX_FIELDNAME field in the corresponding row in the internal table. E_EXIT: - ('X' = Cancel by ) Flag is set when the leaves the popup with the 'Cancel' function. T_OUTTAB: Internal table of any structure which contains the data to be output in list form. Only the fields named in the field catalog and in the I_CHECKBOX_FIELDNAME parameter are used for the list output. Other internal table fields are ignored.
13. REUSE_ALV_VARIANT_DEFAULT_GET: -(This module is used to read default display variant) IMPORTING VALUE(I_SAVE) DEFAULT SPACE CHANGING VALUE(CS_VARIANT) LIKE DISVARIANT STRUCTURE DISVARIANT EXCEPTIONS WRONG_INPUT NOT_FOUND PROGRAM_ERROR I_SAVE: - (VARIANT CAN BE SAVED)
SAME AS IN REUSE_ALV_LIST_DISPLAY CS_VARIANT: - (Variant information)
SAME AS IN REUSE_ALV_LIST_DISPLAY WRONG_INPUT: - Inconsistent input parameters NOT_FOUND: - VARIANT NOT FOUND PROGRAM_ERROR: - Program errors
14. REUSE_ALV_VARIANT_F4 : -(This module is used to display variant selection popup) IMPORTING
- 113 -
SAP –ABAP BOOK VALUE(IS_VARIANT) LIKE DISVARIANT STRUCTURE DISVARIANT VALUE(I_TABNAME_HEADER) TYPE SLIS_TABNAME OPTIONAL VALUE(I_TABNAME_ITEM) TYPE SLIS_TABNAME OPTIONAL VALUE(IT_DEFAULT_FIELDCAT) TYPE SLIS_T_FIELDCAT_ALV OPTIONAL VALUE(I_SAVE) DEFAULT SPACE EXPORTING VALUE(E_EXIT) VALUE(ES_VARIANT) LIKE DISVARIANT STRUCTURE DISVARIANT EXCEPTIONS NOT_FOUND PROGRAM_ERROR IS_VARIANT: SAME AS IN REUSE_ALV_LIST_DISPLAY I_TABNAME_HEADER: SAME AS IN REUSE_ALV_HIERSEQ_LIST_DISPLAY I_TABNAME_ITEM: SAME AS IN REUSE_ALV_HIERSEQ_LIST_DISPLAY IT_DEFAULT_FIELDCAT: SAME AS IN REUSE_ALV_LIST_DISPLAY I_SAVE: SAME AS IN REUSE_ALV_LIST_DISPLAY E_EXIT: - DIALOG CANCELLED BY ES_VARIANT: SAME AS IN REUSE_ALV_LIST_DISPLAY
15.REUSE_ALV_VARIANT_EXISTENCE: - (this module is used to check existence of a display variant) IMPORTING VALUE(I_SAVE) DEFAULT SPACE CHANGING VALUE(CS_VARIANT) LIKE DISVARIANT STRUCTURE DISVARIANT EXCEPTIONS WRONG_INPUT NOT_FOUND
- 114 -
SAP –ABAP BOOK PROGRAM_ERROR I_SAVE: SAME AS IN REUSE_ALV_LIST_DISPLAY CS_VARIANT: SAME AS IN REUSE_ALV_LIST_DISPLAY
PROGRAM FOR ALV BASIC LIST TYPE-POOLS: SLIS. TABLES: VBAK. *-----POPUATING STRUCTURE. TYPES: BEGIN OF STR_1, vbeln TYPE vbeln, erdat TYPE erdat, audat TYPE audat, auart TYPE auart, END OF STR_1. *-----POPULATING INTERNALTABLE FOR STRUCTURE. DATA: IT_1 TYPE TABLE OF STR_1 WITH HEADER LINE. *----POPULATING INTERNALTABLE FOR FIELD CATALOG. DATA: IT_SATH TYPE SLIS_T_FIELDCAT_ALV, WA_SATH TYPE slis_fieldcat_alv. *-----POPULATING SELECT-OPTIONS. SELECT-OPTIONS: SO_SATH FOR VBAK-VBELN. *-----RETRIEVE THE DATA INTO INTERNAL TABLE START-OF-SELECTION. SELECT VBELN ERDAT AUDAT AUART FROM VBAK INTO TABLE IT_1 WHERE VBELN IN SO_SATH. *-----CREATING FIELD CATALOG WA_SATH-COL_POS = '1'. WA_SATH-FIELDNAME = 'VBELN'. WA_SATH-SELTEXT_M = 'SD_NUM'. APPEND WA_SATH TO IT_SATH. WA_SATH-COL_POS WA_SATH-FIELDNAME WA_SATH-SELTEXT_M
"POS OF THE FIELD " FIELD NAME "DESC OF THE COLUMN
= '2'. = 'ERDAT'. = 'ORDER_DATE'.
- 115 -
SAP –ABAP BOOK APPEND WA_SATH TO IT_SATH. WA_SATH-COL_POS = '3'. WA_SATH-FIELDNAME = 'AUDAT'. WA_SATH-SELTEXT_M = 'DOC_DATE'. APPEND WA_SATH TO IT_SATH. WA_SATH-COL_POS = '4'. WA_SATH-FIELDNAME = 'AUART'. WA_SATH-SELTEXT_M = 'DOC_TYPE'. APPEND WA_SATH TO IT_SATH. DATA: V_PROG_NAME TYPE SY-REPID. V_PROG_NAME = 'Z_TRNG_ALVSAMPLE1_T009'. *-----FUNCTION MODULE TO CALL ALV CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING IT_FIELDCAT = IT_SATH I_CALLBACK_PROGRAM = V_PROG_NAME TABLES t_outtab = IT_1.
- 116 -
SAP –ABAP BOOK
Out Put
- 117 -
SAP –ABAP BOOK PROGRAM FOR ALV BASIC INTRA LIST WITH LOGO *-----TABLES------------------------------------------------* TABLES: vbak, vbpa, kna1. *-----TYPE-POOLS DECLAIRATION------------------------* TYPE-POOLS: slis. *-----TYPE DECLERATION----------------------------------* TYPES: BEGIN OF str_1, vbeln LIKE vbak-vbeln, "Sales Document erdat LIKE vbak-erdat, "Date of record created ernam LIKE vbak-ernam, "Name of Person Created netwr LIKE vbak-netwr, "Net Value of Sales Order END OF str_1, BEGIN OF str_2, vbeln LIKE vbap-vbeln, posnr LIKE vbap-posnr, matnr LIKE vbap-matnr, END OF str_2.
"Sales Document "Sales Document Item "Material Number
*-----DATA DECLERATION---------------------------------* DATA: it_vbak TYPE str_1 OCCURS 0, wa_vbak TYPE str_1, it_vbap TYPE str_2 OCCURS 0, wa_vbap TYPE str_2, it_fieldcat TYPE slis_t_fieldcat_alv, wa_fieldcat TYPE slis_fieldcat_alv, it_fieldcat1 TYPE slis_t_fieldcat_alv, wa_fieldcat1 TYPE slis_fieldcat_alv, it_events TYPE slis_t_event, wa_events TYPE slis_alv_event, it_page TYPE slis_t_listheader WITH HEADER LINE. *-----SELECTION-SCREEN---------------------------------* SELECT-OPTIONS: so_vbeln FOR vbak-vbeln OBLIGATORY. *-----START-OF-SELECTION-----------------------------* START-OF-SELECTION. *-----RETRIEVE MATERIAL INFO FROM VBAK TABLE-----* SELECT vbeln erdat ernam netwr FROM vbak INTO TABLE it_vbak WHERE vbeln IN so_vbeln. *-----CREATING FIELD CATALOG FOR BASIC LIST------* wa_fieldcat-col_pos = '1'. wa_fieldcat-fieldname = 'VBELN'. wa_fieldcat-seltext_m = text-001.
- 118 -
SAP –ABAP BOOK APPEND wa_fieldcat TO it_fieldcat. CLEAR wa_fieldcat. wa_fieldcat-col_pos = '2'. wa_fieldcat-fieldname = 'ERDAT'. wa_fieldcat-seltext_m = text-002. APPEND wa_fieldcat TO it_fieldcat. CLEAR wa_fieldcat. wa_fieldcat-col_pos = '3'. wa_fieldcat-fieldname = 'ERNAM'. wa_fieldcat-seltext_m = text-003. APPEND wa_fieldcat TO it_fieldcat. CLEAR wa_fieldcat. wa_fieldcat-col_pos = '4'. wa_fieldcat-fieldname = 'NETWR'. wa_fieldcat-seltext_m = text-004. APPEND wa_fieldcat TO it_fieldcat. CLEAR wa_fieldcat. *-----CREATING FIELD CATALOG FOR SECONDARY LISTwa_fieldcat1-col_pos = '1'. wa_fieldcat1-fieldname = 'VBELN'. wa_fieldcat1-seltext_m = text-001. APPEND wa_fieldcat1 TO it_fieldcat1. CLEAR wa_fieldcat1. wa_fieldcat1-col_pos = '2'. wa_fieldcat1-fieldname = 'POSNR'. wa_fieldcat1-seltext_m = text-005. APPEND wa_fieldcat1 TO it_fieldcat1. CLEAR wa_fieldcat1. wa_fieldcat1-col_pos = '3'. wa_fieldcat1-fieldname = 'MATNR'. wa_fieldcat1-seltext_m = text-006. APPEND wa_fieldcat1 TO it_fieldcat1. CLEAR wa_fieldcat1. DATA: a TYPE sy-repid. a = 'Z_TRNG_ALVLOGO_T009'. * *APPEND wa_events TO it_events. *-----CALLING FUNCTION MODULE FOR BASIC LIST-----CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING i_callback_program =a i_callback__command = 'B' i_callback_top_of_page = 'H1' it_fieldcat = it_fieldcat it_events = it_events TABLES t_outtab = it_vbak. *-----FORM HEADER--------------------------------------*
- 119 -
SAP –ABAP BOOK *-----HEADER FOR SALES DOC DETAILS----------* FORM h1. it_page-typ = 'H'. it_page-info = 'SALES ORDER DETAILS'. APPEND it_page. CLEAR it_page. *-----FUNCTION MODULE TO DISPLAY LOGO--------* CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE' EXPORTING it_list_commentary = it_page[] i_logo = 'ENJOYSAP_LOGO'. FREE it_page. ENDFORM. *-----FORM IMPLEMENTATION FOR COMMAND----* FORM b USING c LIKE sy-ucomm d TYPE slis_selfield. READ TABLE it_vbak INTO wa_vbak INDEX d-tabindex. *-----RETRIEVE MATERIAL INFO FROM VBAP TABLE------SELECT vbeln posnr matnr FROM vbap INTO TABLE it_vbap WHERE vbeln = wa_vbak-vbeln. IF sy-subrc EQ 0. *----CALLING FUNCTION MODU FOR SECONDARY LIST* CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING i_callback_program = a i_callback_top_of_page = 'H2' it_fieldcat = it_fieldcat1 TABLES t_outtab = it_vbap. ENDIF. ENDFORM. *-----FORM HEADER--------------------------------------* *-----HEADER FOR ITEM DETAILS------------------------* FORM h2. it_page-typ = 'H'. it_page-info = 'SALES DOCUMENT DETAILS'. APPEND it_page. CLEAR it_page. *-----FUNCTION MODULE TO DISPLAY LOGO-------------* CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE' EXPORTING it_list_commentary = it_page[] i_logo = 'ENJOYSAP_LOGO'. FREE it_page. ENDFORM. ALV FOR HIERARCHICAL METHOD type-pools: slis.
- 120 -
SAP –ABAP BOOK tables: vbak. TYPES: BEGIN OF ty_header_data, vbeln TYPE vbeln, erdat TYPE erdat, netwr TYPE netwr, END OF ty_header_data, BEGIN OF ty_item_data, vbeln TYPE vbeln, posnr TYPE posnr, arktx TYPE arktx, werKS TYPE werks, END OF ty_item_data. data: it_header_data type ty_header_data occurs 0, wa_header_data type ty_header_data, it_item_data type ty_item_data occurs 0, wa_item_data type ty_item_data, It_fcat type slis_t_fieldcat_alv, wa_fcat type slis_fieldcat_alv, v_tabname_header type slis_tabname, v_tabname_item type slis_tabname, is_keyinfo type SLIS_KEYINFO_ALV, v_prog_name like sy-repid. v_prog_name = 'Z_TRNG_HIERARCHICALALVREPORT01'. v_tabname_header = 'VBAK'. v_tabname_ITEM = 'VBAP'. IS_KEYINFO-HEADER01 = 'VBELN'. IS_KEYINFO-ITEM01 = 'VBELN'.
** DEVELOPING FIELDCATALOG wa_fcat-col_pos = 1. wa_fcat-fieldname = 'VBELN'. wa_fcat-seltext_m = 'ORDER NO'. wa_fcat-tabname = 'VBAK'. wa_fcat-outputlen = '100'. APPEND wa_fcat TO it_fcat. CLEAR WA_FCAT. wa_fcat-col_pos = 2. wa_fcat-fieldname = 'ERDAT'. wa_fcat-seltext_m = 'ORDER DATE'. wa_fcat-tabname = 'VBAK'. APPEND wa_fcat TO it_fcat. CLEAR WA_FCAT. wa_fcat-col_pos = 3. wa_fcat-fieldname = 'NETWR'. wa_fcat-seltext_m = 'ORDERVALUE'. wa_fcat-tabname = 'VBAK'.
- 121 -
SAP –ABAP BOOK APPEND wa_fcat TO it_fcat. CLEAR WA_FCAT. wa_fcat-col_pos = 4. wa_fcat-fieldname = 'POSNR'. wa_fcat-seltext_m = 'ITEM NO'. wa_fcat-tabname = 'VBAP'. APPEND wa_fcat TO it_fcat. CLEAR WA_FCAT. wa_fcat-col_pos = 5. wa_fcat-fieldname = 'ARKTX'. wa_fcat-seltext_m = 'ITEM DESCRIPTION'. wa_fcat-tabname = 'VBAP'. APPEND wa_fcat TO it_fcat. CLEAR WA_FCAT. wa_fcat-col_pos = 6. wa_fcat-fieldname = 'WERKS'. wa_fcat-seltext_m = 'PLANT'. wa_fcat-tabname = 'VBAP'. APPEND wa_fcat TO it_fcat. CLEAR WA_FCAT. select-options: so_vbeln for vbak-vbeln. START-OF-SELECTION.. select vbeln erdat netwr from vbak into table it_header_data where vbeln in so_vbeln. if it_header_data[] is not initial. select vbeln posnr arktx werks from vbap into table it_item_data for all entries in it_header_data where vbeln = it_header_data-vbeln. endif. **--fn module to create hierarchical alv list CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY' EXPORTING * I_INTERFACE_CHECK ='' I_CALLBACK_PROGRAM = v_prog_name * I_CALLBACK_PF_STATUS_SET ='' * I_CALLBACK__COMMAND ='' * IS_LAYOUT = IT_FIELDCAT = it_fcat * IT_EXCLUDING = * IT_SPECIAL_GROUPS = * IT_SORT = * IT_FILTER = * IS_SEL_HIDE = * I_SCREEN_START_COLUMN =0 * I_SCREEN_START_LINE =0 * I_SCREEN_END_COLUMN =0 * I_SCREEN_END_LINE =0
- 122 -
SAP –ABAP BOOK * * * * *
I_DEFAULT = 'X' I_SAVE ='' IS_VARIANT = IT_EVENTS = IT_EVENT_EXIT = i_tabname_header = v_tabname_header i_tabname_item = v_tabname_item * I_STRUCTURE_NAME_HEADER = * I_STRUCTURE_NAME_ITEM = is_keyinfo = is_keyinfo * IS_PRINT = * IS_REPREP_ID = * I_BYING_BUFFER = * I_BUFFER_ACTIVE = * IMPORTING * E_EXIT_CAUSED_BY_CALLER = * ES_EXIT_CAUSED_BY_ = tables t_outtab_header = it_header_data t_outtab_item = it_item_data EXCEPTIONS PROGRAM_ERROR =1 OTHERS = 2. IF sy-subrc <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SYMSGV3 SY-MSGV4. ENDIF.
SAP ABAP SCRIPTS Often there are instances where an output from a SAP program is required on a physical paper in a pre-designed format. Using normal ABAP code this is not possible. Instead SAP provides an object called SAPSCRIPT to generate such kind of documents which can contain logos, tables and other objects and which can look like pre-printed documents. This article focuses on the design and use of Layout sets in ABAP programs to generate beautified output in SAP. A layout set is a template designed in SAP to place the stream of data coming from a SAP program on different parts of a physical page. The designer needs to lay out the various elements that need to be printed on the page and store it as an object in the SAP system. An ABAP program will subsequently call this object to generate an instance of the template – thus generating an output document from the program. In this 7 article tutorial we will cover subjects such as: • • •
Main elements of SAPscript Commands that can be used in a layout set How to include a graphical image - 123 -
SAP –ABAP BOOK • • • •
Commands that can be used in SAPscript Step-by-step walkthrough of example Example layout set Example SAPscript code
Language Language in which the data coming on to the layout set will be printed. Generally, this will be the language that has been set up as default in the SAP system Header Section to define the various attributes of the layout set on a global level. Changing these attributes will affect all the components of the layout set. The various components of the header are explained below •
istration Information This shows the information about the layout set – details of the designer, details of changes occurring to the design, development class of the layout set and the language details for the layout set
•
Standard Attributes 1. Description - Brief description or title of the layout set 2. Default paragraph - The base paragraph that is globally applicable to the document. This can be overridden at lower level of the layout set by using other paragraphs 3. Tab Stop - The base tab-stop that is globally applicable to the document. These can be overridden at lower level of the layout set by using other tab stops 4. First Page - The start page of the layout set 5. Page Format 6. Orientation - The direction of printing the data on a page – P for portrait (vertical) and L for landscape (horizontal) 7. Lines per inch 8. Characters/inch
•
Font Attributes
Here the various attributes and the base font applicable to the document can be defined. This font setting can be overridden at a lower level using the character strings Paragraphs Used to define the start and end positions for the different texts and objects that need to be printed on the output document. - 124 -
SAP –ABAP BOOK Character Strings Used to define the fonts and the formatting and printing styles for each and every character that needs to be printed on the output document. The start of the character string is indicated by <string name>, while the end of the character string is indicated by Pages The designer needs to organise the template as a series of pages. When an actual output document is printed, it will refer to each page for putting the data coming from the ABAP program. The order of pages is also taken from the template i.e the layout set defined. Windows Various parts of the output document can be conveniently organised on the pages using windows. Thus the data stream coming from the ABAP program can be logically grouped into various parts and can be placed on different locations on a page There are 2 main types of windows that can be used in a layout set: MAIN - A layout set can have only one MAIN window which is created by default. This window can flow over multiple pages. CONSTANT - A layout set can have any number of constant windows. A constant window can be used once per page Text Elements Any text that needs to be written on the output document should be placed within a text element. This includes constant text as well as variable data like internal table data coming from the ABAP program. It is advisable to group logically related data within one text element. The fields of various tables defined in the ABAP program will be included under these text elements. These fields are carriers of data. Every field should be included in a pair of & characters. (e.g. &aufk-aufnr&) Page Windows All the windows that form a page of the layout set. Choose the window and click the Text Elements button to go to the Layout Set Editor. This consists of 2 parts
- 125 -
SAP –ABAP BOOK The small space on the left is for specifying the type of command, while the window adjacent to it is for writing the command or the text that needs to go under a text element. The various types of commands that can be used within a layout set are tabulated below Command
Purpose
*
Default paragraph
Blank
Continuous text
=
Extended Line
(
Raw Line
/
Line Feed
/=
Line feed and extended line
/(
Line Feed and Raw Line
/:
Command Line
/*
Comment Line
/E
Text Element
This is either the name of the paragraph that should be applicable from that line of the layout set
The steps for including graphical elements in the layout set are as follows •
The graphical element (like company logo) should be in valid graphic file format like .bmp or .jpg
•
Use appropriate software to convert the above file into a .TIFF file
•
Use report RSTXLDMC to this file as a text module in SAP
•
Execute the above program from the ABAP /4 editor
•
Enter the location of the .TIFF file on the PC
•
Specify BMON or BCOL as the raster image type
- 126 -
SAP –ABAP BOOK •
The SAP system suggests a name for the file ( like ZHEX-MARCO-* ). The * indicates the type of file. For e.g. if the file contains a logo then the name can be ZHEX-MACRO-LOGO
•
The ID should be ‘ST’ and give the logon language
•
Running the program will convert this .TIFF file into a text element
•
Incorporate this converted logo in the appropriate window under the appropriate text element by giving INCLUDE ZHEX-MACRO-LOGO OBJECT TEXT ID ST in the first line
The commands that are commonly used in a sap script are as follows -: Command
Use
New-page <page name>
Prints the text following this command on a new page (when a page name is specified then that page is taken as the next page)
Protect ….. Endprotect
This acts like a conditional page break. Putting the text within this command prevents the breaking of the text across multiple pages. If there is not enough space for the entire paragraph to be printed in the space remaining on the page, then the entire paragraph is printed on the next page
Box <xpos>
The BOX command draws a box as per the specifications. The x y co-ordinates are for the upper left corner relative to the values in the position command.
Position <xorigin>
POSITION command is used to set the x y co-ordinates with respect to the start position of the window. SIZE command is used to specify the size of the box that we need to draw. Varying these parameters also helps to draw a line instead of a box.
IF ….. END IF
This allows the conditional printing of the text on the output document. The various conditional operators that can be used are as follows = EQ Equal to
- 127 -
SAP –ABAP BOOK < LT Less than > GT Greater than <= LE Less than or equal to >= GE greater than or equal to <> NE not equal to The logical operators that can be used are as follows NOT, AND, OR
The best way to explain the various steps in deg a SAP script is to visualize the creation of a document. The entire process is explained as a series of steps. Let us assume that we need to design the document Invoice.doc for the ABC Company Limited. 1. Understand the structure of the document that needs to be generated page by page. 2. Find out the different pages that form the document. 3. Decide the FIRST page of the document and the pages that are going to follow. 4. Find out the various fonts and styles (bold, italics, etc) that are used in the document. 5. Also try to group the data printed on the document into logical parts. 6. Create all the character strings that have been used in the document 7. Create all the paragraphs that have been used in the document 8. Create all CONSTANT the windows that have been uniquely identified in the document 9. Identify the MAIN window of the every page of the document 10. Define the pages that form the parts of the document 11. Assign the windows to each page
- 128 -
SAP –ABAP BOOK 12. Define the text elements within each window 13. Use function module OPEN_FORM to open the layout set. 14. Use function module WRITE_FORM to write the text elements in various windows 15. Use function module CLOSE_FORM to close the layout set Always to check and activate the layout set when any change is done to it, otherwise the change will not appear on the output document that is printed!!! Steps:
- 129 -
SAP –ABAP BOOK
Enter Description
Save ( Ctrl + S ) Click on Pages
- 130 -
SAP –ABAP BOOK Page1
Save , then give Description – FIRST PAGE
Save Click on Paragraph format
Enter P1
Enter Description
- 131 -
SAP –ABAP BOOK
Goto - Header
Click on Basic Settings
- 132 -
SAP –ABAP BOOK
Save – click on Windows
There will be a default Window called Main Window - 133 -
SAP –ABAP BOOK
To create New window follow the Navigation As shown Above
Save and Activate Select a window and then
- 134 -
SAP –ABAP BOOK
Write some text as shown below MAIN window text Element MAIN P1
Customer/Supplier:,,&KNA1-NAME1& / P1 PO No:,,&EKPO-EBELN& / P1 Part No:,,&MAKT-MATNR& / P1 Description:,,&MAKT-MAKTX& / P1 Quantity:,,&EKPO-MENGE& / P1 Sign:&uline(81)& / P1 Date:&EKKO-AEDAT& Come Back,No need to Save. Click on Page Windows.
- 135 -
SAP –ABAP BOOK
You get a pop-up as shown below
- 136 -
SAP –ABAP BOOK
Select one window. Now give Width and Height
FOOTER Element FOOTER /: POSITION XORIGIN 2 CM YORIGIN '-0.5 CM' /: BOX XPOS 1 CM YPOS 1 CM WIDTH 18 CM HEIGHT 1 CM FRAME 10 TW INTENSITY 10 / / / P2 ,,PLEASE SIGN THE PO BEFORE DISPATCH /
- 137 -
SAP –ABAP BOOK
Activate. Below is the Program that you need to write in SE38 (ABAP EDITOR) REPORT ZPSAPSCRIPT. TABLES : EKKO, EKPO, KNA1, USR01, MARA, MAKT. DATA : BEGIN OF ZOPTION. INCLUDE STRUCTURE ITO. DATA : END OF ZOPTION. PARAMETERS: P_EBELN LIKE EKKO-EBELN, P_EBELP LIKE EKPO-EBELP. CLEAR EKPO. SELECT SINGLE * FROM EKPO WHERE EBELN = P_EBELN AND EBELP = P_EBELP. CLEAR KNA1. SELECT SINGLE NAME1 FROM KNA1 INTO KNA1-NAME1 WHERE KUNNR = EKPO-KUNNR. CLEAR MAKT. SELECT SINGLE MAKTX FROM MAKT INTO MAKT-MAKTX WHERE MATNR = EKPO-MATNR AND SPRAS = SY-LANGU. - 138 -
SAP –ABAP BOOK
CLEAR USR01. SELECT SINGLE * FROM USR01 WHERE BNAME = SY-UNAME. ZOPTION-TDDEST ZOPTION-TDIMMED ZOPTION-TDDELETE ZOPTION-TDPROGRAM
= = = =
USR01-SPLD. 'X'. 'X'. 'ZPQRPRNT'.
CALL FUNCTION 'OPEN_FORM' EXPORTING APPLICATION * ARCHIVE_INDEX * ARCHIVE_PARAMS DEVICE DIALOG FORM LANGUAGE OPTIONS IMPORTING LANGUAGE EXCEPTIONS OTHERS = 1.
"Output device (printer) "Print immediately "Delete after printing "Program Name
= 'TX' = ' ' = ' ' = 'PRINTER' = ' ' = 'Z_TESTSCRIPT' = SY-LANGU = ZOPTION = SY-LANGU
CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = 'HEADER' * FUNCTION = 'SET' * TYPE = 'BODY' WINDOW = 'HEADER' EXCEPTIONS ELEMENT = 1. CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = 'MAIN' * FUNCTION = 'SET' * TYPE = 'BODY' WINDOW = 'MAIN' EXCEPTIONS ELEMENT = 1. CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = 'FOOTER' * FUNCTION = 'SET' * TYPE = 'BODY' WINDOW = 'FOOTER'
- 139 -
SAP –ABAP BOOK EXCEPTIONS ELEMENT
= 1.
CALL FUNCTION 'CLOSE_FORM' EXCEPTIONS UNOPENED = 1 OTHERS = 2. SMARTFORMS Smart Forms: Transaction Code for Create Smarf Forms: SMARTFORMS Transaction Code for Create Styles (Paragraph Formats, Character Formats, etc.,) Used in Smart Forms: SMARTSTYLES Steps to be followed while creating Smart Forms: 1.
Enter the Form Name (e.x. ZEKKO_EKPO) and Press Create Button.
2.
Enter Form Description and Select the “Output options” Tab Enter the Page Format (e.x. DINA4) and Style (e.x.SF_STYLE_01).
- 140 -
SAP –ABAP BOOK
3. 4.
Double click the Form interface Left Sub-tree. Enter the Import Parameters (The values that ed from the Print Program into the Form) (e.x. Company Code) Parameter name Type assignment Reference type Default value value COMPANY_CODE TYPE EKKO-BUKRS
5.
Double click the Global definitions from the Left Sub-tree. Assume that we are using two tables EKKO and EKPO in this example: Click the “Types” Tab. Enter the Code as following:
6. 7.
- 141 -
SAP –ABAP BOOK TYPES: BEGIN OF WA_EKKO, EBELN LIKE EKKO-EBELN, BUKRS LIKE EKKO-BUKRS, END OF WA_EKKO. TYPES: BEGIN OF WA_EKPO, EBELN LIKE EKPO-EBELN, EBELP LIKE EKPO-EBELP, MENGE LIKE EKPO-MENGE, NETPR LIKE EKPO-NETPR, END OF WA_EKPO. TYPES: T_EKKO TYPE STANDARD TABLE OF WA_EKKO, T_EKPO TYPE STANDARD TABLE OF WA_EKPO.
8.
Click the “Global data” Tab. Declare the Internal Tables and Work Areas as follows: Variable name Type assignment Reference type Constant I_EKKO TYPE T_EKKO I_EKPO TYPE T_EKPO WA_EKKO TYPE WA_EKKO WA_EKPO TYPE WA_EKPO
- 142 -
Default value
SAP –ABAP BOOK
9.
Double click the “%PAGE1 New Page” in the Left Sub-tree.
10.
Change the %PAGE1 to “FIRST” or any name and Enter the Description (e.x. First Page). Select the Next Page as “FIRST”
11.
- 143 -
SAP –ABAP BOOK
12.
Select the “Output options” Tab and select the format of the page (Portrait or Landscape) and all other print attributes.
13.
Select the “Background Picture” Tab, and Enter the Name, Object and Id of the image file. (Before this step, go to SE78 and import the image first) for the Image which has to be appeared in the Background of the Script. If you want to add any LOGO in the First Page of the Script then right click the “FIRST New Page” in the Left Sub-tree from the Menu option “Create” select the “Graphic”.
14.
- 144 -
SAP –ABAP BOOK
15. 16. 17.
Double click the “%Graphic1 New Graphic 1” in the Left Sub-tree. Give the Name and Description (e.x. Graphic = “COMP_LOGO” and Description = “LOGO WINDOW”)for the New Graphic Inserted. Enter Name, Object and ID for the Graphic image and Select the Color grid screen (BCOL) option button in the “General attributes” Tab.
Click - Output options Tab. Set Left and Upper Margins as given:
- 145 -
SAP –ABAP BOOK
18.
Right click the “FIRST New Page” in the Left Sub-tree and from the Menu option “Create” select the “Window”.
19.
Double click the “%WINDOW1 New Window1” in the Left Sub-tree and enter the Window name and Description (e.x. Window = “ADD_WIN” and Description = “Address Window”)
- 146 -
SAP –ABAP BOOK
Set the Left and Upper margins for the ADD_WIN as follows:
20.
Right click “ADD_WIN Address Window” in Left Sub-tree and from the Menu option “Create” select the “Program Lines”.
21.
Enter the Program Lines name and description (e.x. Program Lines = “ADD_FETCH” and Description = “FETCHING COMPANY ADDRESS”)
- 147 -
SAP –ABAP BOOK
22.
Enter the Input Parameter as COMPANY_CODE and Export Parameter as V_ADRNR in the “General attributes” Tab and write the select query as following: SELECT SINGLE ADRNR INTO V_ADRNR FROM T001 WHERE BUKRS EQ COMPANY_CODE. (Note: Before writing the select query first declare the Variable V_ADRNR in the Global definitions area as follows: V_ADRNR TYPE T001-ADRNR.
23.
Right click the “ADD_WIN Address Window” in the Left Sub-tree and from the Menu option “Create” select the “Address”.
- 148 -
SAP –ABAP BOOK
24.
Double click the “%ADDRESS1 New address1” and change the Address name and description (e.x. Address = COMP_ADD and Description = “COMPANY ADDRESS”).
- 149 -
SAP –ABAP BOOK
25.
Select the Type of the address in the “General attributes” Tab. (Since we are retrieving the Organization address, we selected the first radio button) and in the Address number text box the V_ADRNR Variable as &V_ADRNR&.
26.
Set the Main window attributes like this: (Setting of window co-ordinates)
27.
Right click the “MAIN Main Window” in the Left Sub-tree and from the Menu option “Create” select the “Program Lines”.
- 150 -
SAP –ABAP BOOK
28.
Enter the name and description (e.x. Program Lines = “SELECT_RECORD” and Description = “SELECTING RECORDS”).
- 151 -
SAP –ABAP BOOK
29.
30.
Enter the Input Parameter as COMPANY_CODE and Output Parameter as I_EKKO and I_EKPO in the “General attributes” Tab and write the select query as following: SELECT EBELN BUKRS INTO TABLE I_EKKO FROM EKKO UP TO 10 ROWS WHERE BUKRS EQ COMPANY_CODE. IF SY-SUBRC EQ 0. SORT I_EKKO BY EBELN. SELECT EBELN EBELP MENGE NETPR INTO TABLE I_EKPO FROM EKPO FOR ALL ENTRIES IN I_EKKO WHERE EBELN EQ I_EKKO-EBELN. IF SY-SUBRC EQ 0. SORT I_EKPO BY EBELN EBELP. ENDIF. ENDIF. Right click “MAIN Main Window” in the Left Sub-tree and from the Menu option “Create” select the “Complex Section”.
- 152 -
SAP –ABAP BOOK
31.
Enter the Section name and description (e.x. Section = “PO_LOOP” and Description = “PURCHASE ORDER NUMBER LOOP”) and check the “Repeat processing” check box and select the “Output type” as Unstructured (i.e. select the Unstructured radio button) in the “General attributes” Tab.
32. 33.
Select the “Data” Tab. Enter the Internal Table Name as I_EKKO and Work area name as WA_EKKO and sort by the BUKRS and EBELN fields.
- 153 -
SAP –ABAP BOOK
34.
Right click “PO_LOOP PURCHASE ORDER NUMBER LOOP” in Left Sub-tree and from the Menu option “Create” select the “Text”.
35.
Enter the Text name and description (e.x. Text = “PO_NO_DISPLAY” and Description = “PURCHASE ORDER NUMBER DISPLAY”) and enter the values as in the screen shot
- 154 -
SAP –ABAP BOOK
Click the Text Editor
- 155 -
SAP –ABAP BOOK
Display the values of Company Code and Purchase Order Number as shown below:
Press Back Button, then Press Save and Check Buttons
- 156 -
SAP –ABAP BOOK
36.
Right click the “PO_LOOP PURCHASE ORDER NUMBER LOOP” in the Left Subtree and from the Menu option “Create” select the “Template”.
37.
Double click on “%TEMPLATE1 New template” and enter the Template name and description (e.x. Template Name = “OI_HEAD” and Description = “ORDER ITEM HEADER”).
- 157 -
SAP –ABAP BOOK
Before press save or enter click the “Table Painter Button” which will take you to following screen. To avoid the “cross line” in the Editor click the “Settings Button”
which will result in the following popup, in which you un-check the “Cross” Check Box and press enter.
- 158 -
SAP –ABAP BOOK
38.
Split the Cell into Four or into any number of columns you want to display in the script by right clicking the “%C1”. and press “Back” Button.
39.
Select the pattern of the table to be displayed in the script by the clicking “Select pattern” Button
- 159 -
SAP –ABAP BOOK
40. 41.
Selected table pattern Inorder to Display the “Column Text“ for the table columns, insert the Text as shown below: Right click the “OI_HEAD ORDER ITEM HEADER” and from the Menu path “Create” Select the “Text” .
- 160 -
SAP –ABAP BOOK
42.
Enter the Text name and description (e.x. Text = “HEAD1” and Description = “COLUMN1”) and enter the values as in the screen shot (i.e. as explained in the point no 34).
43.
Inorder to match the Template Column with the insertedText “HEAD1 COLUMN1”, select the “Output options” Tab and Enter the Line Number and Column Number in which the above Text has to be printed in the form
- 161 -
SAP –ABAP BOOK
44.
Repeat Step No.40 & 41 for all the remaining column headings.
- 162 -
SAP –ABAP BOOK
- 163 -
SAP –ABAP BOOK
- 164 -
SAP –ABAP BOOK
45. 46.
47.
The Form is ready with all data upto Table Header. Inorder to populate data under each column header, insert a table. Insert the Table under “PO_LOOP PURCHASE ORDER NUMBER LOOP” by right clicking the same.
Enter Table Name and Description (e.x. Table Name = “OI_DISPLAY” and Description = “ORDER ITEM DISPLAY”)
- 165 -
SAP –ABAP BOOK
48.
Match the column width with the “OI_HEAD ORDER ITEM HEADER” Template (refer step no 38 screet shot no 2) and Select the “Default” radio button and “No page break” check box. Click the “Select pattern” push button to select the table pattern to be displayed.
Column width m with OI_HEAD O ITEM HEADER
49.
Click the “Data” and populate the Item details by looping the Internal Table I_EKPO into the Work Area WA_EKPO sorted by EBELN and EBELP as shown in the following screen shot
- 166 -
SAP –ABAP BOOK
50.
Inorder to Display the values for each column, we have to Insert Separate Text for each column under the Table “OI_DISPLAY ORDER ITEM DISPLAY” by Right clicking the same. Enter the Name and Description for the Each Text Inserted under the Table.
Column 1 for Line Item of each Purchase Order – Populate the values for each column as explained in the step no 34.
- 167 -
SAP –ABAP BOOK
Inorder to Match the Item values with the Template Header, In the Inserted Text “ORD_ITM_COL COLUMN1” Click the “Output options” and Select the “New line” Check box and Select the “Line type” as “Detail” and also check the “New cell” Check box.
51.
Similary add one Text for the remaining columns.
- 168 -
SAP –ABAP BOOK
For the Second Column Text You need only to select the “New cell” Check box.
- 169 -
SAP –ABAP BOOK
For the Third Column Text also You need only to select the “New cell” Check box.
52.
Before Inserting the 4th Text for the 4th Column, we have to calculate the Amount by Multiplying the Quantity and Unit Price and for the same we have to insert “Program Lines” by Right clicking “OI_DISPLAY ORDER ITEM DISPLAY”
- 170 -
SAP –ABAP BOOK
53.
Similarly calculate the subtotal by adding the totals and calculate the grand total by adding the subtotals. Before doing the calculations, declare variables for total, subtotal and grand total in Global definitions.
InputParameters: WA_EKPO-MENGE,WA_EKPO-NETPR & OutputParameters: V_TOTAL,V_SUBTOTAL, V_GRDTOTAL.
- 171 -
SAP –ABAP BOOK
54.
Now add the 4th Text to display the 4th column in the Form.
For the Fourth Column Text also You need only to select the “New cell” Check box.
- 172 -
SAP –ABAP BOOK
55.
Inorder to display the Subtotals (which has been created earlier i.e. refer to step no 52) of all the Line Items for each Purchase Order, we have to Insert a separate Text Under the Table OI_DISPLAY ORDER ITEM DISPLAY” by right clicking the same.
- 173 -
SAP –ABAP BOOK
56.
Enter the Name and Description for the Inserted Text (e.x. Text = “SUB_TOTAL_DISPLAY” and Description = “SUB_TOTAL_DISPLAY” and populated the value for subtotal.
57.
After each purchase order, the Variable V_SUBTOTAL has to be refreshed, Inorder the clear the subtotal variable we have to insert “Program Lines” by right clicking the “OI_DISPLAY ORDER ITEM DISPLAY”.
- 174 -
SAP –ABAP BOOK
58.
Enter Name and Description for the Program Lines (%CODE1 New program lines 1) Inserted (e.x. Program lines = “CLR_VAR” and Description = “CLEAR SUBTOTAL VARIABLE”. Input parameters = “V_SUBTOTAL”. Clear the variable as shown below:
- 175 -
SAP –ABAP BOOK
59.
Now, we have to display the Grand Total (i.e. summation of all the subtotals). Insert “Text” under the “PO_LOOP PURCHASE ORDER NUMBER LOOP” by right clicking the same.
- 176 -
SAP –ABAP BOOK
Text “%TEXT1 New text1” gets inserted. Now enter the name and description for the same and also populated the value for grand total
- 177 -
SAP –ABAP BOOK
Text = “GRD_TOT_DISP”, Description = “GRAND TOTAL DISPLAY” and Variable V_GRDTOTAL has been populated to display the grand total in the form.
60.
Inorder to display the Current Page Number and Total Number of pages in the form we need a separate window and to obtain the same right click the “FIRST First Page” and the insert window.
- 178 -
SAP –ABAP BOOK
Window “%WINDOW1 New window 1” get inserted under the first page.
- 179 -
SAP –ABAP BOOK
61.
Enter the Window name and description (e.x. Window = “PG_WIN” and Description “PAGE NUMBER WINDOW”)
Set the window co-ordinates for page number window “PG_WIN” as given below: - 180 -
SAP –ABAP BOOK
62.
Inorder to display the page numbers we have to insert a “Text” by right clicking the “PG_WIN PAGE NUMBER WINDOW”.
- 181 -
SAP –ABAP BOOK Text “%TEXT1 New text 1” gets inserted and now enter the text name and
description. Text = “PG_DISP”, Description = “PAGE NUMBER DISPLAY” and Page Number gets displayed from the Transparent Table “SFSY”.
63.
General Screen Shot of Entire Left Sub-tree:
- 182 -
SAP –ABAP BOOK
ENTIRE LEFT SUBTREE
64.
Form output:
- 183 -
SAP –ABAP BOOK
65.
SOME MORE FURTHER MODIFICATIONS / ADDITIONAL OPTIONS IN THE ABOVE CREATED FORM: Condition-1: Create second page and company logo should get printed only in the first page and not in the second page. Similarly, company address window should get printed only in the last page and not in other pages. To create the second page right click the “FIRST First Page” in the left sub-tree.
66.
Another page gets inserted with name “%PAGE1 New page 1”.
- 184 -
SAP –ABAP BOOK
67.
Enter Page name and description for the inserted new page (e.x. Page = “SECOND” and Description = “Second Page”) and set the next page as inserted second page and select the mode as increase counter as shown below:
68.
Now change the “FIRST First Page”s Next page as “SECOND” and change the mode as Initialize counter.
- 185 -
SAP –ABAP BOOK
69.
Now copy the Main, Company Address, Page No windows from “FIRST First Page “ to “SECOND Second Page”.
70.
Arrange all the windows under the Main window in both first and second page. Inorder to restrict the company logo to be printed only in the first page, go to the first page and double click the “LOGO_WIN LOGO WINDOW” and select the “Conditions” tab and Check the “only on first page” Check Box.
- 186 -
SAP –ABAP BOOK
71.
Output showing the main window got printed only in the first page and not in the second page and so on …. First Page: With LOGO
- 187 -
SAP –ABAP BOOK
Second Page: Without
LOGO
- 188 -
SAP –ABAP BOOK
72.
Inorder to restrict the Company address to be printed only in the last page and not in the remaining pages, double click the “ADD_WIN ADDRESS WINDOW” in the first page and Check the “only after end of main window” Check Box. Repeat the same process for the second page also.
- 189 -
SAP –ABAP BOOK
73.
Output showing the address window got printed only in the last page and not in the first page and so on …. First Page: without company address
- 190 -
SAP –ABAP BOOK
Last page (second page): with company address window
- 191 -
SAP –ABAP BOOK
Condition-2: Purchase order’s whose value is more than 5000 only should get displayed / printed. Inorder to achieve the same, right click the “PO_LOOP PURCHASE ORDER NUMBER LOOP” and select the “Loop”.
74.
75.
“%LOOP1 New loop 1” gets inserted
- 192 -
SAP –ABAP BOOK
76.
Enter Loop name and description.
77.
Select the “Data” Tab Loop the Internal I_EKPO as shown below:
- 193 -
SAP –ABAP BOOK
78.
Inorder to check the subtotal value for each purchase order (i.e. purchase order value should be more than 5000), Insert a program lines under the new loop inserted.
79.
“%CODE1 New program lines 1” gets inserted
- 194 -
SAP –ABAP BOOK
80.
Enter the name and description for Program lines. Before calculating the subtotal declare two variables one for total and another for subtotal in Global definitions. Calculate the Subtotal as shown below:
Input parameters: “WA_EKPO-MENGE, WA_EKPO-NETPR, V_TOT”; Output Parameters: “V_VALUE”.
- 195 -
SAP –ABAP BOOK
81.
Now we calculated the subtotal for each purchase order. Inorder to restrict the display of purchase orders whose values are more than 5000, we need to insert “Alternate” and for the same right click the “PO_LOOP PURCHASE ORDER NUMBER LOOP” and from the menu path create select the “Alternate”.
82.
“%CONDITION1 New alternate 1” gets inserted.
- 196 -
SAP –ABAP BOOK
83.
Enter Alternate name and description. Select the “General attributes” Tab and Enter the condition of subtotal > 5000 as shown:
84.
Now, move “PO_NO_DISPLAY PURCHASE ORDER NUMBER DISPLAY, OI_HEAD ORDER ITEM HEADER, OI_DISPLAY ORDER ITEM DISPLAY, SUB_TOTAL_DISPLAY DISPLAY SUBTOTAL and CLR_VAR New program lines” under the “TRUE” part.
- 197 -
SAP –ABAP BOOK
85.
In the “FALSE” part (i.e. If subtotal value is less than 5000, then clear the variable), insert program lines and code as shown:
86.
Only those purchase order whose value is more than 5000 gets displayed – First Page.
- 198 -
SAP –ABAP BOOK
Only those purchase order whose value is more than 5000 gets displayed – Second Page.
- 199 -
SAP –ABAP BOOK
- 200 -
SAP –ABAP BOOK 87.
Condition-3 Each Purchase Order should get printed in a new page. Logo should get printed in the first page along with the first purchase order and similarly, Grand total should get printed in the last page with the last purchase order. 88. Inorder to achieve this, when the first successful purchase order whose value is more than 5000 is found then increase one counter variable by 1 (this is required because the “New page command” should not get triggered in the first page itself”) and for the same we have to insert a “Program lines” under the “TRUE” part of “CHK_COND SUBTOTAL CONDITION”. Before increasing the counter variable first declare the counter variable in the “Global definitions” part.
- 201 -
SAP –ABAP BOOK
Output parameters: V_COUNTER.
89.
Inorder to avoid triggering “New page command” in the first page, we have to insert “Command” in the “TRUE” part of “CHK_COND SUBTOTAL CONDITION” by right clicking the same as shown below:
- 202 -
SAP –ABAP BOOK
90.
“%COMMAND1
New command 1” gets inserted.
91.
Enter name and description for the inserted Alternative. Select “General attributes” Tab and check whether for the counter variable is more than 1.
- 203 -
SAP –ABAP BOOK
92.
If the counter variable is more than 1 means, we got the second successful purchase order whose value is more than 5000. Hence, we can trigger new page command here and for the same right click the “TRUE” part in “NEW_PG NEW PAGE COMMAND” as shown:
“%COMMAND1 New command 1” gets inserted
- 204 -
SAP –ABAP BOOK
93.
Enter the name and description for Command and select the “General attributes” Tab and Check the “Go to new page” and select the page as “SECOND” as shown below:
- 205 -
SAP –ABAP BOOK
94.
The following is the output: First Page with company logo and without company address window, first purchase order whose value is more than 5000.
- 206 -
SAP –ABAP BOOK
Second page: without company logo and with company address window for the last purchase order whose value is more than 5000.
- 207 -
SAP –ABAP BOOK
95.
The new PROBLEM we faced when we create the smart form is page number. Total Page Number got displayed as “*” as shown:
- 208 -
SAP –ABAP BOOK
96.
Inorder to solve the above problem Double Click the “PG_DISP PAGE NUMBER DISPLAY” and Click the Text Editor.
- 209 -
SAP –ABAP BOOK
Upon clicking the text editor it will take you to the following screen:
Cut (Ctrl+X) the “SFSY-FORMPAGES” and delete the remaining things as shown.
Go to the menu path Insert Symbols New as shown
Which will result you in the following popup and fill the popup as shown.
- 210 -
SAP –ABAP BOOK
97.
It will takes you to the following screen.
98.
Now replace &SFSY-FORMPAGES+4(4CZ)& as &SFSY-FORMPAGES+0(4CZ)&
99.
Press back and then check, activate and execute – You can observe that the problem has resolved.
- 211 -
SAP –ABAP BOOK
100.
Enjoy and try to create more smart forms……..
BUSINESS ADD-INS CONTENTS
I. Basic concept II. Basic skills required III. BADI in detail a. Different views
- 212 -
SAP –ABAP BOOK b. Architecture c. Technical details i. Defining a Business Add-in ii. Implementation of BAdi iii. Calling BAdi in the Application iv. Filter dependent Badi v. Multiple use Badi IV. Difference between different enhancement technique with BADI V. Advantages of BADI’s VI. Technical stuff
BASIC CONCEPT
SAP has introduced new enhancement technique Business Add-ins from release 4.6A. Business Add-in is the new enhancement technique based on ABAP Objects. BADI is an exit point in a source that allows specific industry sectors, partners, and customers to attach additional software to standard SAP source code with out modifying the original object. The s of Business Add-ins can customize the logic according to requirement or they can use the standard logic one available. SAP guarantees the upward compatibility of all Business Add-in interfaces. Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces.
BASIC SKILLS REQUIRED
• •
Work Experience/Knowledge on ABAP Objects (Object orientation of ABAP) is mandatory. Experience on SAP enhancement technique.
BADI IN DETAIL
Business Add-ins infrastructure is multi-level system landscape (SAP, partner, customer solutions, as well as country versions, and industry solutions). Definitions and implementations of Business Add-ins at each level within system infrastructure.
Different Views a) The different views of the BADI’s are: i.
Definition view, Application Programmer can predefine the exit points in the source in which specific industry sector customers can attach additional - 213 -
SAP –ABAP BOOK
ii.
software to standard SAP source code with out having to modify the original object. Implementation view, the s of Business Add-ins can customize the logic they need or use a standard logic if available.
Architecture a) Architecture:
b) defined BADI’s: i.
c)
First define a Business Add-In, application developer creates an interface for the add-in. ii. Enhancement management creates an adapter class that implements the interface and thus provides the interface for implementation by the customer, partner and so on. iii. The programmer/developer creates an instance of the adapter class in the application program and calls the corresponding method at the appropriate time. Standard BADI’s: i. For Standard Business Add-ins, the interface and adapter class will be predefined by SAP. The adapter class that implements the interface and provides the interface for implementation by the customer, partner specific to business.
d) Each Business Add-in will have one interface and an adapter class that implements interface. Depending on the business requirement will implement the interface. The generated class (Adapter class) has the following tasks. i. Control, the adapter class calls the active implementations.
- 214 -
SAP –ABAP BOOK ii.
Filtering, If the Add-in has to be executed under certain conditions, then the adapter class ensures that only certain implementations will be executed.
Technical Details e) BAdIs are contained in the system and are fully operational as of Release 4.6B. SAP creates Add-ins for specific programs, menus, and screen enhancements for standard R/3 applications. This Add-ins doesn’t contain any functionality. Instead you can add-on functionality onto these hooks.
f) Customers can find the enhancements in their system in the implementation guide and in the component hierarchy. If customer wishes to use a Business Add-in, he has to first create an implementation. The customer must implement the methods and the enhancements, and afterwards activate the implementation of the enhancement. The enhancement’s active components are then called at runtime.
g) Business Add-in contains an interface and other additional components such as function codes for menu enhancements. Business Add-ins also includes enhancements for screens. The enhancement, interface and generated classes are all located in the appropriate application development namespace. Business Add-in implementations are created in the respective implementation namespace.
Defining a Business Add-in SAP provides the Badi’s where are applicable in the standard applications. Application programmer who ever wishes to have a Business Add-ins in a particular program can define the interface for an enhancement in the Business Add-in builder. Programmer has to program the interface call in the program at the appropriate place. Customers can select the add-in and implement it accordingly to their business needs.
a) From SAP menu, choose Tools -> ABAP Workbench -> Utilities -> Business Addins or transaction code SE18. The example, which is illustrated, is the string conversion in the program. And giving the provision to the s to determine themselves how their strings are to be converted. Application developer define an enhancement, consists of interface with a method with changing parameter used to the string.
- 215 -
SAP –ABAP BOOK b) Enter the Badi name and choose create.
c) Enter the short text, choose the interface tab.
d) Double click on the interface name field. The system branches to the class builder.
- 216 -
SAP –ABAP BOOK
e) In the class builder assign a method to the interface and define a parameter with the attributes.
f) Save and activate the interface and navigate back to the Business Add-in definition. Now in the Badi screen, displays the method you have created for the interface. When you maintain the interface methods, corresponding executing class (Adapter class) is generated. g) Save your entries and document the description of the Business Add-in. Documentation is important for the s to understand the purpose of the Add-in.
- 217 -
SAP –ABAP BOOK
Implementation of Badi a) The list of Business Add-ins available in the system can be found through SAP Reference Implementation guide (IMG) or in component hierarchy. Badi’s definition is included in IMG so that the customer/partner can create suitable, company-specific implementations. b) In the SAP menu, choose ABAP Workbench -> Utilities -> Business Add-ins or transaction code SE19. c) Enter the implementation name and click on the create button.
d) Enter the BAdi name
- 218 -
SAP –ABAP BOOK
e) Enter the short description for the BAdi implementation and implement the interface in the class appearing in the BAdi implementation screen.
f) Double click on the implementation class and insert the desired source code for the implementation between the method ZIF_EX_BUSINESSADDIN~CONVERSION. And Method. In - 219 -
SAP –ABAP BOOK this particular example enter the statement translate parameter to upper case. Save and activate your entries and return to the change implemention screen. g) Choose Activate, now you can use this implementation when the application program is executed. Several implementations may exist for a Business Add-in but that is not used in multiple use basis. However only one implementation can be activate at any one time. But in case of multiple use of the BAdi, we can have multiple implementations activate. The instance generation of the implementing class must set the attribute as public and not as private, protected or abstract. System will give dump if you do so. h) Following is the code for the class ZCL_CONVERSION_BADI_IMPL method CONVERSION Method ZIF_EX_BUSINESSADDIN~CONVERSION. translate parameter to upper case. endmethod.
Calling Badi in the Application a) When we define BAdi, enhancement management generates a class that implements the interface. The application developer uses a factory method to create an instance of adapter class in the application program and calls corresponding method. The adapter class method generated by the enhancement management decide by checking the entries in the table whether one or several active implementations need to be called. If required, the implementations are subsequently executed. The application program ensures only the adapter class method is called. The application program doesn’t know which implementations are called. b) Call the string conversion Business Add-in, the program calling the Business Addin. Following is the ABAP source code
REPORT ZMPTEST_BADI. * Declaring the handler class: cl_exithandler definition load. * Interface Reference data: badi_interface type ref to ZIF_EX_BUSINESSADDIN. * String data: w_str(15) type c value 'baddi test'. ************************************************* ****Start of Selection Event..................... ************************************************ start-of-selection. call method cl_exithandler=>get_instance changing instance = badi_interface. write: / 'Please click here'.
*************************************************
- 220 -
SAP –ABAP BOOK ****At line-selection Event..................... ************************************************ at line-selection. write: / 'original word', w_str. if not badi_interface is initial. call method badi_interface->conversion changing parameter = w_str. endif. write: / 'Converted word', w_str.
Filter dependent Badi a) Business Add-in definition level (for example a country, industry sector) we can have filter dependent option. If an enhancement for country specific versions then it is likely that different partners can implement this enhancement. The individual countries can create and activate their own implementation. b) In the enhancement definition, all the methods created in the enhancement’s interface need to have filter value as their importing parameter. The application program provides the filter values for the implementation method. c) Filter dependent BAdi is called using one filter value only, it is possible to check active implementation for the filter value using the function module SXC_EXIT_CHECK_ACTIVE.
Multiple use Badi a) There are multiple use and single use Business Add-ins. This option can be choose at Business Add-in definition. b) The distinction is base on the procedure or event character of an enhancement. In the first case the program waits for the enhancement to return a return code. Typical example is benefit calculation in HR depending on the implementation, alternative calculations can be executed. In case of multiple use add-ins, an event that may be interest to other components in program flow. Any number of components could use this event as a hook to hang their own additional actions on to. c) There is no sequence control for multiple-use implementations of BAdi’s. Sequence control is technically impossible, at the time of the definition the interface does not know which implementations parameters will be change the implementations. d) The concept of multiple use of the Business Add-in is that has been implemented once already can be implemented again by right of the software chain.
DIFFERENCE BETWEEN DIFFERENT ENHANCEMENT TECHNIQUE WITH BADI
a) Difference between Business Transaction Events and BADI’s.
- 221 -
SAP –ABAP BOOK iii.
The concept of the BADI is similar to Business Transaction Events (Open FI). BTE’s was developed specific to Financial ing module. But were as BADI’s was developed in generalised to all modules. iv. BTE’s can only be used to make the program enhancements. You cannot enhance interface with Open FI, but you can with Business Add-ins. v. Open FI assumes that enhancement can only take place on three levels i.e. SAPpartners – customers, but in case of BAdi’s you can create and implement enhancements in as many software layers as you like. vi. Function modules are used for program enhancements in Open FI. With BAdi’s, ABAP Objects is used to enhance programs. b) Difference between customer exits and BAdi’s. i. Customer exits assume a two-tiered system infrastructure (SAP - Customers). Where as in case of BAdi’s you can created and implement enhancements in as many software layers as you like. ii. BAdi’s are considered as generalized BTE’s that can be used to bundle program, menu and screen enhancements into a single add-in. BAdi’s can be created and employed in each of the various software levels.
ADVANTAGES OF BADI’S
a) This enhancement technique has the advantage of being based on a multi-level system landscape (SAP, country versions, IS solutions, partner, customer and so on).
b) We can create definitions and implementations of business add-ins at any level of the system landscape.
TECHNICAL STUFF
a) Following are the Tables which are relevant to BAdi’s i. SXS_ATTRT - BAdi Definition list ii. V_EXT_ACT - Active implementations of an exit iii. V_EXT_ IMP - Implementation class for an interface+filter iv. V_EXT_M - BAdi’s with filters b) Transaction related to BAdi’s i. SE18 - Business Add-in builder ii. SE19 – Implementation of Badi iii. SE24 – Class/Interface Builder
- 222 -
Related Documents 3m3m1z
More Documents from "Mudavath Raju" 422867
in the database hierarchy After all data has been read by the logical database - 52 - SAP –ABAP BOOK List processor events: Event TOP-OF-PAGE END-OF-PAGE AT LINE-SELECTION AT PF