ABAP Syntax (S-W)
S
SCROLL
Scrolls through lists
SCROLL LIST FORWARD|BACKWARD [INDEX <idx>].
SCROLL LIST TO FIRST PAGE|LAST PAGE|PAGE <pag>
[INDEX <idx>] [LINE <lin>].
SCROLL LIST LEFT|RIGHT [BY <n> PLACES] [INDEX <idx>].
SCROLL LIST TO COLUMN <col> [INDEX <idx>].
Positions the current list or the list level <idx> in accordance with the additions specified. You can scroll by window, page, columns, or to the left- or right-hand edge of the list.
SEARCH
Searches for strings.
SEARCH <f>|<itab> FOR <g> [ABBREVIATED]
[STARTING AT <n1>]
[ENDING AT <n2>]
[AND MARK]
[IN BYTE MODE|IN CHARACTER MODE].
Searches the field <f> or table <itab> for the string in the field <g>. The result is stored in SY-FDPOS. The additions let you hide intermediate characters, search from and to a particular position, and convert the found string into uppercase. In Unicode programs, you must specify whether the statement is a character or byte operation, using the IN BYTE MODE or IN CHARACTER MODE (default) additions.
SELECT
Reads data from the database.
SELECT <result>
INTO <target>
FROM <source>
[WHERE <condition>]
[GROUP BY <fields>]
[HAVING <cond>]
[ORDER BY <fields>].
The SELECT statement consists of a series of clauses, each of which fulfils a certain task:
SELECT clause
Defines the structure of the selection.
SELECT [SINGLE]|[DISTINCT]
* | <si> [AS <a i>]… <agg>( [DISTINCT] <s j>) [AS <a j>]…
The selection can be one line, SINGLE, or several lines. You can eliminate duplicate lines using the DISTINCT addition. To select the entire line, use *, otherwise, you can specify individual columns <si>. For individual columns, you can use aggregate functions <agg>, and assign alternative column names <a i>.
INTO clause
Defines the target area into which the selection from the SELECT clause is written.
Syntax
… INTO [CORRESPONDING FIELDS OF] <wa>
| INTO|APPENDING [CORRESPONDING FIELDS OF] TABLE <itab>
[PACKAGE SIZE <n>]
| INTO (<f1>, <f 2>,…)
The target area can be a flat work area <wa>, an internal table <itab>, or a list of fields <fi>. If you use the CORRESPONDING FIELDS addition, data is only selected if there is an identically-named field in the target area. If you use APPENDING instead of INTO, the data is appended to an internal table instead of overwriting the existing contents. PACKAGE SIZE allows you to overwrite or extend the internal table in a series of packages.The data type of the target area must be appropriate for the selection in the SELECT clause.
FROM clause
The FROM clause determines the database tables from which the data specified in the SELECT clause is read.
Syntax
… FROM [<tab> [INNER]|LEFT [OUTER] JOIN] <dbtab> [AS <alias>]
[ON <cond>]
[CLIENT SPECIFIED]
[BYPASSING BUFFER]
[UP TO <n> ROWS]
You can read both single fields and groups of fields. You link several tables using inner and outer joins to link tables with conditions <cond>, where <tab> is a single table or itself a join condition. The names of database tables may be specified statically or dynamically, and you can use alias names. You can bypass automatic client handling with the CLIENT SPECIFIED addition, and SAP buffering with BYPASSING BUFFER. You can also restrict the number of lines read from the table using the UP TO <n> ROWS addition.
WHERE clause
Restricts the number of lines selected.
Syntax
… [FOR ALL ENTRIES IN <itab>] WHERE <cond>
The condition <cond> may contain one or more comparisons, tests for belonging to intervals, value list checks, subqueries, selection table queries or null value checks, all linked with AND, OR, and NOT. If you use the FOR ALL ENTRIES addition, the condition <cond> is checked for each line of the internal table <itab> as long as <cond> contains a field of the internal table as an operand. For each line of the internal table, the system selects the lines from the database table that satisfy the condition. The result set is the union of the individual selections resulting from each line.
GROUP BY clause
Groups lines in the selection.
Syntax
… GROUP BY <s1> <s 2>
Groups lines with the same contents in the specified columns. Uses aggregate functions for all other columns in each group. All columns of the SELECT clause that are not listed in the GROUP BY clause must be included in aggregate functions.
HAVING clause
Restricts the number of line groups selected.
Syntax
… HAVING <cond>
Like the WHERE clause, but can only be used in conjunction with a GROUP BY clause. The HAVING clause uses conditions to restrict the number of groups selected.
ORDER BY clause
Sorts the lines of the selection.
Syntax
… ORDER BY PRIMARY KEY |… <si> [ASCENDING|DESCENDING]…
Sorts the selection in ascending or descending order according to the primary key or the contents of the fields listed.
SELECT-OPTIONS
Declares selection criteria for a selection screen.
Syntax
SELECT-OPTIONS <sel> FOR <f>
[DEFAULT <g> [to <h>] [OPTION <op>] SIGN <s>]
[MEMORY ID <pid>]
[LOWER CASE]
[OBLIGATORY]
[NO-DISPLAY]
[MODIF ID <key>]
[NO-EXTENSION]
[NO INTERVALS]
[NO DATABASE SELECTION].
Declares a selection table <sel> for the field <f>. For <sel>, places input fields on the corresponding selection screen. The additions allow you to set a default value, accept input in lowercase, define a required field, suppress or modify the display on the selection screen, restrict the selection table to a line or a selection to a single field, or prevent input from being passed to a logical database.
SELECTION-SCREEN for Selection Screen Formatting
Formats selection screens
Syntax
SELECTION-SCREEN SKIP [<n>].
SELECTION-SCREEN ULINE [[/]<pos(len)>] [MODIF ID <key>].
SELECTION-SCREEN COMMENT [/]<pos(len)> <comm> [FOR FIELD <f>]
[MODIF ID <key>].
SELECTION-SCREEN BEGIN OF LINE.
…
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF BLOCK <block>
[WITH FRAME [TITLE <titel>]]
[NO INTERVALS].
…
SELECTION-SCREEN END OF BLOCK <block>.
SELECTION-SCREEN FUNCTION KEY <i>.
SELECTION SCREEN PUSHBUTTON [/]<pos(len)> <push>
USER-COMMAND <ucom> [MODIF ID <key>].
Allows you to insert blank lines, lines and comments, group input fields together in lines and blocks, and create pushbuttons.
SELECTION-SCREEN for Selection Screen Definition
Defines selection screens.
Syntax
SELECTION-SCREEN BEGIN OF <numb> [TITLE <tit>] [AS WINDOW].
…
SELECTION-SCREEN END OF <numb>.
Defines a selection screen with screen number <numb>. All PARAMETERS, SELECT-OPTIONS, and SELECTION-SCREEN statements that occur between these two statements define the input fields and the formatting of this selection screen. The TITLE <title> addition allows you to define a title for a selection screen. You can use the AS WINDOW addition to call a selection screen as a modal dialog box.
SELECTION-SCREEN for Selection Screen Versions
Defines selection screen versions.
Syntax
SELECTION-SCREEN BEGIN OF VERSION <dynnr>
…
SELECTION-SCREEN EXCLUDE <f>.
…
SELECTION-SCREEN BEGIN OF VERSION <dynnr>.
Only occurs in logical databases. Hides fields that otherwise appear on the standard selection screen.
SELECTION-SCREEN for Logical Databases
Provides special functions.
Syntax
SELECTION-SCREEN DYNAMIC SELECTIONS | FIELD SELECTION
FOR NODE|TABLE <node>.
Only occurs in logical databases. Declares a node as accepting dynamic selections or field selections.
SET BIT
Sets individual bits.
Syntax
SET BIT <n> OF <f> [TO <b>].
This statement sets the bit at position <n> of the hexadecimal field <f> to 1 (or to the value of field <b>). The field <b> must contain the value 0 or 1.
SET BLANK LINES
Allows blank lines in lists.
Syntax
SET BLANK LINES ON|OFF.
Prevents blank lines created in WRITE statements from being suppressed in list output.
SET COUNTRY
Sets output Formats
Syntax
SET COUNTRY <c>.
Sets the output formats for numeric and date fields for the country with the ID <c>.
SET CURSOR
Sets the cursor on the screen.
Syntax
SET CURSOR FIELD <f> [OFFSET <off>]
[LINE <lin>].
SET CURSOR LINE <lin> [OFFSET <off>].
SET CURSOR <col> <line>.
Sets the cursor either to a particular position in a field, line, or column of a line.
SET DATASET
Syntax
SET DATASET <dsn> [POSITIONS <pos> | END-OF_FILE]
[ATTRIBUTE <attr>].
Changes the attributes of a file opened using OPEN DATASET. The POSITIONS addition sets the current read/write position to the value in the field <pos> or to the end of the file. The ATTRIBUTE addition passes the attributes to the file in a structure, <attr>, of the type DSET_ATTRIBUTES.
SET EXTENDED CHECK
Affects the extended program check.
Syntax
SET EXTENDED CHECK ON|OFF.
Switches the extended program check (SLIN) on or off, suppressing the corresponding messages.
SET HANDLER
Registers event handlers in ABAP Objects.
Syntax
SET HANDLER… <hi>… [FOR <ref>|FOR ALL INSTANCES].
If you do not use the FOR addition, the handler is set for all static events. Use the FOR addition to register handlers for instance events.
SET HOLD DATA
Sets a screen attribute.
Syntax
SET HOLD DATA ON|OFF.
Sets the screen attribute “Hold data” from the program.
SET LANGUAGE
Sets the display language.
Syntax
SET LANGUAGE <lg>.
All text symbols are refreshed with the contents of the text pool in language <lg>.
SET LEFT SCROLL BOUNDARY
Sets the left boundary for horizontal scrolling.
Syntax
SET LEFT SCROLL-BOUNDARY [COLUMN <col>].
Sets the current output position or the position <col> as the left-hand edge of the scrollable area on the current list page.
SET LOCALE LANGUAGE
Sets the current text environment.
Syntax
SET LOCALE LANGUAGE <lg> [COUNTRY <c>] [MODIFIER <m>].
Sets the text environment for alphabetical sorting according to the language <lg>, country <c>, and any further modifier <m>.
SET MARGIN
Sets the margin of a print page.
SET MARGIN <x> [<y>].
Sends the current list page to the spool system with a margin of <x> columns from the left-hand edge and <y> rows from the top edge of the page.
SET PARAMETER
Sets an SPA/GPA parameters
Syntax
SET PARAMETER ID <pid> FIELD <f>.
Writes the value of the field to the SPA/GPA parameter <pid> in the user-specific SAP memory.
SET PF-STATUS
Sets the GUI status
Syntax
SET PF-STATUS <stat> [EXCLUDING <f>|<itab>]
[IMMEDIATELY] [OF PROGRAM <prog>].
Sets the GUI status <stat> for the subsequent screens. The EXCLUDING addition allows you to deactivate functions dynamically. The IMMEDIATELY addition sets the GUI status of the list currently displayed. The OF PROGRAM addition allows you to use a GUI status from another program.
SET PROPERTY
Sets a property of an OLE2 Automation object.
Syntax
GET PROPERTY OF <obj> <p> = <f>.
Sets the property <p> of an external OLE2 Automation object to <f>.
SET RUN TIME ANALYZER
Controls runtime analysis.
Syntax
SET RUN TIME ANALYZER ON|OFF.
The runtime analysis only measures the runtime of the statements in the block between SET RUN TIME ANALYZER ON and OFF.
SET RUN TIME CLOCK
Controls runtime analysis.
Syntax
SET RUN TIME CLOCK RESOLUTION HIGH|LOW.
Sets the accuracy of the runtime to low accuracy with long measurement interval or high accuracy with shorter measurement interval.
SET SCREEN
Sets the next screen.
Syntax
SET SCREEN <scr>.
Temporarily overwrites the statically-defined next screen with <scr>. <scr> is processed after the current screen.
SET TITLEBAR
Sets the screen title.
Syntax
SET TITLEBAR <tit> [OF PROGRAM <prog>] [WITH <g1 >... <g9>].
Sets the title <tit> for the subsequent screens. The OF PROGRAM addition allows you to use a title from another program. The WITH addition fills any placeholders in the title.
SET UPDATE TASK LOCAL
Switches on local update.
Syntax
SET UPDATE TASK LOCAL.
Updates are processed in the current work process.
SET USER-COMMAND
Triggers a list event.
Syntax
SET USER-COMMAND <fc>.
Triggers a list event with the function code <fc> and calls the corresponding event block.
SHIFT
Shifts strings.
Syntax
SHIFT <c> [BY <n> PLACES] [LEFT|RIGHT|CIRCULAR]
[IN BYTE MODE|IN CHARACTER MODE].
Shifts the field <c> by one or <n> places. The additions allow you to specify the direction, and how the empty spaces are dealt with. In Unicode programs, you must specify whether the statement is a character or byte operation, using the IN BYTE MODE or IN CHARACTER MODE (default) additions.
SKIP for Blank Lines
Generates blank lines in the display list.
Syntax
SKIP [<n>].
The system writes <n> blank lines into the current list, starting at the current line. If no value is specified for <n>, one blank line is output.
SKIP for Positioning
Absolute position of the display in a list.
Syntax
SKIP TO LINE <lin>.
Positions the list display in the line <col>.
SORT for Extracts
Sorts an extract dataset.
Syntax
SORT [ASCENDING|DESCENDING] [AS TEXT] [STABLE]
… BY <fi> [ASCENDING|DESCENDING] [AS TEXT]…
Ends the creation of the extract dataset of a program and, at the same time, sorts its records. Without the BY option, the system sorts the dataset by the key specified in the HEADER field group. You can define a different sort key by using the BY addition. The other additions specify whether you want to sort in ascending or descending order, and whether strings should be sorted alphabetically.
SORT for Internal Tables
Sorts internal tables.
Syntax
SORT <itab> [ASCENDING|DESCENDING] [AS TEXT] [STABLE]
… BY <fi> [ASCENDING|DESCENDING] [AS TEXT]…
Sorts the internal table <itab>. If you omit the BY addition, the table is sorted by its key. You can define a different sort key by using the BY addition. The other additions specify whether you want to sort in ascending or descending order, and whether strings should be sorted alphabetically.
SPLIT
Splits a string.
Syntax
SPLIT <c> AT <del> INTO <c1>… <cn> INTO TABLE <itab>
[IN BYTE MODE|IN CHARACTER MODE].
This statement searches the character field <c> for delimiter strings <del> and the parts before and after the delimiters are placed in the target fields <c1> …> … <cn>, or into a new line of the internal table <itab>. In Unicode programs, you must specify whether the statement is a character or byte operation, using the IN BYTE MODE or IN CHARACTER MODE (default) additions.
START-OF-SELECTION
Event keywords for defining event blocks for reporting events.
Syntax
START-OF-SELECTION.
After the selection screen has been processed, the runtime environment triggers the LOAD-OF-PROGRAM event, and the corresponding event block is executed.
STATICS
Defines static variables.
Syntax
STATICS <f>…
Like DATA. Retains the value of a local variable beyond the runtime of the procedure in which it occurs.
STOP
Leaves a reporting event.
Syntax
STOP.
Only occurs in event blocks for reporting events. Leaves the event block and goes to the END-OF-SELECTION block.
SUBMIT
Calls an executable program of type 1.
Syntax
SUBMIT <rep> [AND RETURN] [VIA SELECTION-SCREEN]
[USING SELECTION-SET <var>]
[WITH <sel> <criterion>]
[WITH FREE SELECTIONS <freesel>]
[WITH SELECTION-TABLE <rspar>]
[LINE-SIZE <width>]
[LINE-COUNT <length>].
Calls the program <rep>. If you omit the AND RETURN addition, the current program is terminated. Otherwise, the data from the current program is retained, and processing returns to the calling program when <rep> has finished running. The other additions control the selection screen and set attributes of the default list in the called program.
SUBTRACT for single fields
Subtracts two single fields.
Syntax
SUBTRACT <n> FROM <m>.
The contents of <n> are subtracted from the contents of <m> and the results are stored in <m>. This is equivalent to: <m> = <m> – <n>.
SUBTRACT-CORRESPONDING
Subtracts components of structures.
Syntax
SUBTRACT-CORRESPONDING <struc1> FROM <struc2>.
All the subfields of the structures <struc1> and <struc2> having the same name are subtracted and the results are stored in <struc2>.
SUM
Calculates sums of groups.
Syntax
SUM.
Only occurs in loops through internal tables. Calculates the sums of the numeric fields in all lines of the current control level and writes the results to the corresponding fields in the work area.
SUPPLY
Fills context instances with values.
Syntax
SUPPLY <key1> = <f 1>… <key n> = <f n> TO CONTEXT <inst>.
Fills the key fields <keyn> of the context instance <inst> with the values <f n>.
SUPPRESS DIALOG
Prevents the current screen from being displayed.
Syntax
SUPPRESS DIALOG.
Can only occur in a PBO dialog module. The screen is not displayed, but its flow logic is still processed.
T
TABLES
Declares an interface work area.
Syntax
TABLES <dbtab>.
Declares a structure with the same data type and the same name as a database table, a view, or a structure from the ABAP Dictionary. Structures in main programs and subroutines declared using TABLES use a common data area.
TOP-OF-PAGE
Event keywords for defining event blocks for list events.
Syntax
TOP-OF-PAGE [DURING LINE-SELECTION].
Whenever a new page begins while a standard list is being created, the runtime environment triggers the TOP-OF-PAGE event and the corresponding event block is executed. The addition DURING LINE-SELECTION has the same function, but for detail lists.
TRANSFER
Writes to a file.
Syntax
TRANSFER <f> TO [LENGTH <len>].
Writes the field <f> to the file <dsn> on the application server. You can specify the length of the data you want to transfer using the LENGTH addition.
TRANSLATE
Converts characters to strings.
Syntax
TRANSLATE <c> TO UPPER|LOWER CASE
|USING <r>.
The characters of the string <c> are converted into upper- or lowercase, or according to a substitution rule specified in <r>.
TRY
Introduces a TRY block.
Syntax
TRY.
Class-based exceptions can be handled using the CATCH statement, within the block ended with ENDTRY.
TYPE-POOL
Introduces a type group.
Syntax
TYPE-POOL <tpool>.
The first statement in a type group. This statement is not entered in the ABAP Editor, but is automatically generated by the Dictionary in the ABAP Workbench. A type group is an ABAP program that contains type definitions and constant declarations that can be used in several programs.
TYPE-POOLS
Declares the types and constants of a type group to a program.
Syntax
TYPE-POOLS <tpool>.
This statement allows you to use all the data types and constants defined in the type group <tpool> in your program.
TYPES for Single Field Types
Defines a single field type.
Syntax
TYPES <t>[(<length>)] [TYPE <type>|LIKE <obj>] [DECIMALS <dec>].
Defines the internal data type <t> in the program with length <len>, reference to the ABAP Dictionary type <type> or a data object <obj>, and, where appropriate, with <dec> decimal places.
Syntax
TYPES <t> TYPE REF TO <class>|<interface>.
Defines the internal data type <t> in the program with reference to the class <class> or the interface <interface>.
Syntax
TYPES <t> TYPE REF TO DATA|<type>.
Defines the internal data type <t> as a data reference to a data object.
TYPES for Complex Types
Defines complex types.
Syntax
TYPES: BEGIN OF <structure>,
…
<ti>…,
…
END OF <structure>.
Combines the data types <ti> to form the structure <structure>. You can address the individual components of a structure in a program using a hyphen between the structure name and the component name as follows: <structure>-<t i>.
Syntax
TYPES <t> TYPE|LIKE <tabkind> OF <linetype> [WITH <key>].
Defines the local data type <t> in the program as an internal table with the access type <tabkind>, the line type <linetype>, and the key <key>.
Syntax
TYPES <t> TYPE|LIKE RANGE OF <type>|<obj>.
Defines the internal data type <t> as a RANGES table. A RANGES table has the same data type as a selection table, but is not linked to input fields on a selection screen.
U
ULINE
Places horizontal lines in the display list.
Syntax
ULINE [AT [/][<pos>][(<len>)]].
Without additions, creates a new line on the current list and fills it with a horizontal line. The additions allow you to insert a line break and specify the starting position and length of the line.
UNPACK
Converts type P variables to type C.
Syntax
UNPACK <f> TO <g>.
Unpacks the packed field <f> and places it in the string <g> with leading zeros. This can be reversed with the PACK statement.
UPDATE
Changes entries in database tables.
Syntax
UPDATE <dbtab> SET <si> = <f>
|<si> = <s i> + <f>
|<si> = <s i> – <f> [WHERE <cond>].
The value in the column <si> is set to the value <f>, increases it by <f>, or decreases it by <f> for all lines selected. The WHERE clause specifies the lines that are changed. If you omit the WHERE clause, all lines are changed.
Syntax
UPDATE <dbtab> FROM <wa>.
UPDATE <dbtab> FROM TABLE <itab>.
This deletes the line that has the same primary key as the work area <wa>, or deletes all the lines in the database that have the same primary key as a line in the internal table <itab>. The work area <wa> or the lines of the internal table <itab> must have at least the same length and alignment as the lines of the database table.
W
WHEN
Introduces a statement block in a CASE control structure.
Syntax
WHEN <f1> [OR <f 2> OR...] | OTHERS.
The statement block following a WHEN statement is executed if the contents of the field <f> in the CASE statement are the same as those of one of the fields <f i >. Afterwards, the program carries on processing after the ENDCASE statement. The statement block after WHEN OTHERS statement is executed if the contents of <f> does not equal any of the <f i > contents.
WHILE
Introduces a loop.
Syntax
WHILE <logexp> [VARY <f> FROM <f1> NEXT <f2>].
Introduces a statement block that ends with ENDWHILE. The statement block between WHILE and ENDWHILE is repeated as long as the logical expression <logexp> is true, or until a termination statement such as EXIT or CHECK occurs. The VARY addition allows you to process fields the same distance apart in memory.
WINDOW
Displays a list as a modal dialog box.
Syntax
WINDOW STARTING AT <x1> <y1> [ENDING AT <x2> <y2>].
Only occurs in list processing. The current detail list is displayed as a modal dialog box. The top left-hand corner of the window is positioned at column <x1> and line <y1>. The bottom right-hand corner is positioned at column <x2> and line <y2> (if specified).
WRITE
Displays lists.
Syntax
WRITE [AT [/][<pos>][(<len>)]] <f> [AS CHECKBOX|SYMBOL|ICON|LINE]
[QUICKINFO <g>].
[<format>]
The contents of the field <f> are formatted according to their data type and displayed in the current list. . The additions before the field allow you to specify a line break, the starting position, and the length of the field. The additions after the field allow you to display checkboxes, symbols, icons, and lines. The <format> addition can contain various other formatting options. The QUICKINFO addition allows you to assign a tool tip <g> to the field.
WRITE TO
Assigns string values.
Syntax
WRITE <f1> TO <f2> [<format>].
Converts the contents of a data object <f1> to type C, and assigns the resulting string to the variable <f2>. You can use the same formatting options available in the WRITE statement
Incoming search terms:
- elemen dari sap easy access
- wirosastro net
- cara membuat raport dengan excel
- pengertian sales order data pada sap
- cara buat blueprint sap sd
- perbedaan basis abaper dan functional modul pada sap
- sap abaper adalah
- cara membuat raport
- pelatihan bisnis proses SAP
- navigasi dari SAP easy acces
Tagged with: ABAP
Like this post? Subscribe to my RSS feed and get loads more!
Leave a Reply