sap programming syntax for select options in abap

abap programming use the word select options in its keyword usage to get the required output as shown below.

Effect

Declares a variable selection option.

This statement only makes sense in reports, i.e. in programs defined as type 1 in the attributes. You can execute reports with the SUBMIT statement. The statements SELECTOPTIONS and PARAMETERS determine the technical interface and the user interface. The parameters and selection options you specify are displayed on the selection screen for the user to enter values (see also the addition NO-DISPLAY or SUBMIT without the addition VIA SELECTION-SCREEN .

sel must be 1 - 8 characters long.

· This statement defines an internal table sel with a fixed structure which consists of the fields sel-SIGN , sel-OPTION , sel-LOW and sel-HIGH .
· A report can (by means of an entry in the attributes) be assigned to a logical database ldb . This means that both the logical database ldb and the report can define selection options (and parameters). You define the (database-specific) selection options in an ABAP/4 include program DBldbSEL (in logical database maintenance). The system then imports this include program into the actual logical database access program SAPDBldb and (partially) into the report. As a result, the database-specific selection options (and parameters) relevant to the report are available both to the database program SAPDBldb and to the report.

The 'report-specific' selection options are known only in the report (not in SAPDBldb ). Some SELECT-OPTIONS additions are allowed only in DBldbSEL . The addition 'NO DATABASE SELECTION' can only be used in the report.

· Each line of the internal table sel formulates a condition. If you require precise details about how to formulate these conditions, see the section on the IN operator under Logical expressions .
· If the user enters a value set on the selection screen, the internal table sel is automatically filled.

You can use normal ABAP/4 statements to read and manipulate the internal table sel .

· The values you enter for the database-specific selection options are passed directly to the database for data selection (i.e. no unwanted records are read). This also applies to report-specific SELECT-OPTIONS that refer to a field in a logical database table defined for dynamic selections (see also the addition " NO DATABASE SELECTION ").

You must check report-specific selections that refer to other fields with the CHECK statement (i.e. unwanted records must first be read from the database and discarded afterwards). This process is therefore not as efficient as the process described above.

· Under "Text elements/selection texts", you should enter a description for each selection criterion sel . This description is displayed on the selection screen. If no such text exists, the name sel of the selection option is displayed instead.

· The LOW and HIGH fields of a selection option are displayed in a length up to 18 bytes long (scrollable up to 45 bytes). If you define a length longer than 45, fields are truncated on the selection screen after the 45th character. This affects the first line of the SELECT-OPTIONS table. You can, however, pass longer selection options to a report if they are specified with the addition NO-DISPLAY and thus do not appear on the selection screen. Without NO-DISPLAY , the fields are then truncated whenever the selection screen is processed in the background (SUBMIT without VIA SELECTION-SCREEN ).

Example

SELECT-OPTIONS PROGRAM FOR SY-REPID.

&ABAP-EFFECT& Suppose you create an internal table

PROGRAM with the header line fields PROGRAM-SIGN ,

PROGRAM-OPTION , PROGRAM-LOW and PROGRAM-HIGH .

PROGRAM-LOW and PROGRAM-HIGH have the same field attributes as SY-REPID . When the report is executed, a line on the selection screen contains the text 'PROGRAM' or the associated selection text as well as input fields for PROGRAMLOW and PROGRAM-HIGH . At the end of the line, there is a pushbutton with an arrow. When you press this button, you branch to the 'Complex Selections' screen where you can enter more selection lines for sel . Here, you can formulate very complicated selection conditions. For further information about how these entries determine the result set, see Logical expressions or select Utilities -> Help sel. screen on the 'Complex Selections' screen.

· Field attributes on the selection screen. The input/output fields displayed on the selection screen for entry of upper and lower limits have the same attributes for type, length or conversion exits as the field f specified after FOR .

Related Posts:

SAP ABAP HR report for EEOC
ABAP Programming hr new hire report
SAP ABAP HR PAYROLL REPORT
ABAP HR head count report for sap
SAP ABAP FICO REPORT FOR GROUP CURRENCY RECONCILIATION
fico reconcilation report for company code currency report
SAP ABAP FICO report about profitability analysis
SAP ABAP fico report profitability analysis report
My sapcrm customers and consumer segmentation
Organizational challenges in crm and mysap solutions
Business View and Mysap.com
What is SAP R/3 introduction to mysap.com
SAP FICO cross company code reconciliation report
sap sales and distribution back orders report in abap

sales in erp programming invoice reportabap syntax for search and select

abap programming syntax for Select

Abap programming has some keywords and select is one of the important one among them.Here is the syntax check for that.

Basic form

ELECT result [target] FROM source [where] [GROUP BY fields] [ORDER BY order].

Effect

Retrieves an extract and/or a set of data from a database table or view (see Relational database ). SELECT belongs to the OPEN SQL command set.

Each SELECT command consists of a series of clauses specifying different tasks:

The SELECT result clause specifies

· whether the result of the selection is a table or a single record,
· which columns the result is meant to have and
· whether the result is allowed to include identical lines.

The INTO target clause specifies the target area into which the selected data is to be read. If the target area is an internal table, the INTO clause specifies
· whether the selected data is to overwrite the contents of the internal table or
· whether the selected data is to be appended to the contents and
· whether the selected data is to be placed in the internal table all at once or in several packets.
The INTO clause can also follow the FROM clause.

You can omit the INTO clause. The system then makes the data available in the table work area (see TABLES ) dbtab . If the SELECT clause includes a "*", the command is processed like the identical SELECT * INTO dbtab FROM dbtab statement. If the SELECT clause contains a list a1 ... an , the command is executed like SELECT a1 ... an INTO CORRESPONDING FIELDS OF dbtab FROM dbtab .

If the result of the selection is meant to be a table, the data is usually (for further information, see INTO -Klausel ) read line by line within a processing loop introduced by SELECT and concluded by ENDSELECT . For each line read, the processing passes through the loop once. If the result of the selection is meant to be a single record, the closing ENDSELECT is omitted.

The FROM source clause the source (database table or view ) from which the data is to be selected. It also determines

· the type of client handling,
· the behavior for buffered tables and
· the maximum number of lines to be read.

The WHERE where clause specifies the conditions which the result of the selection must satisfy. It thus determines the lines of the result table. Normally - i.e. unless a client field is specified in the WHERE clause - only data of the current client is selected. If you want to select across other clients, the FROM clause must include the addition ... CLIENT SPECIFIED
. The GROUP-BY fields clause combines groups of lines together into single lines. A group is a set of lines which contain the same value for every database field in the GROUP BY clause.
The ORDER-BY order clause stipulates how the lines of the result table are to be ordered. Each time the SELECT statement is executed, the system field SY-DBCNT contains the number of lines read so far. After ENDSELECT , SY-DBCNT contains the total number of lines read.

Related Posts:

SAP ABAP HR report for EEOC
ABAP Programming hr new hire report
SAP ABAP HR PAYROLL REPORT
ABAP HR head count report for sap
SAP ABAP FICO REPORT FOR GROUP CURRENCY RECONCILIATION
fico reconcilation report for company code currency report
SAP ABAP FICO report about profitability analysis
SAP ABAP fico report profitability analysis report
My sapcrm customers and consumer segmentation
Organizational challenges in crm and mysap solutions
Business View and Mysap.com
What is SAP R/3 introduction to mysap.com
SAP FICO cross company code reconciliation report
sap sales and distribution back orders report in abap

sales in erp programming invoice report

sap programming syntax for keyword search

sap programming is done with a language called ABAP and it has some important keywords and search is one among them.Its usage is given as shown below.

SEARCH f FOR g.

Additions

1. ... ABBREVIATED
2. ... STARTING AT n1
3. ... ENDING AT n2
4. ... AND MARK

Effect

Searches the field f for the string in the field g . This string can have any of the following formats:

'str' a character string (trailing blanks are ignored) '.str.' any character string between the periods '*str' a word ending with "str", including the word "str" 'str*' a word beginning with "str", including the word "str"

You can use the following characters as delimiters:

' ', ',', ';', ':', '.', '!', '?', '(', ')', '+', '/' and '='.

The return code value is set as follows:

SY-SUBRC = 0 The search string g was found in the field f .
SY-FDPOS contains the offset of the found string or the found word within the field.
SY_SUBRC = 4 The search string g was not found in the field f .

Addition 1

... ABBREVIATED

Effect

Searches the field f for a word containing the character string specified in the field. Here, the characters specified in g may be separated by other characters in a word. If the string g occurs in a word, the return code in system field SY-SUBRC is set to 0. The first letter of the search string g and the word must match.

Example

DATA F(50).
MOVE 'Alaska Texas California' TO F.
SEARCH F FOR 'Clfrn' ABBREVIATED.

Here, SY-SUBRC is set to 0, since not only does the string 'Clfrn' occur (separated by other characters) in 'California' , but 'Clfrn' and 'California' begin with the same letter.

Addition 2

... STARTING AT n1

Effect

Searches the field f starting from the position n1 . Here, a field can be anything containing the corresponding value. The first character in the field f is in position 1.

When you use the addition STARTING AT , the position specified for the found pattern in SY-FDPOS does not refer to the start of the field, but to the position n1 .

Addition 3

... ENDING AT n2

Effect

Searches the field f up to the position n2 .

Addition 4

... AND MARK

Effect

If the search string g is found, all the characters of the search string and all the characters occurring in between (in the case of SEARCH ABBREVIATED ) are converted to upper case in the field f .

Example

DATA F(20) VALUE 'Peter Paul Mary'.
SEARCH F FOR '*UL' AND MARK.

SY-SUBRC is now set to 0, since the search string was found in 'Paul' . SY-FDPOS has the value 6, since the character string found starts at the offset 6. Also, the search string is marked, so that the new contents of f are as follows:

'Peter PAUL Mary'

Related Posts:

SAP ABAP HR report for EEOC
ABAP Programming hr new hire report
SAP ABAP HR PAYROLL REPORT
ABAP HR head count report for sap
SAP ABAP FICO REPORT FOR GROUP CURRENCY RECONCILIATION
fico reconcilation report for company code currency report
SAP ABAP FICO report about profitability analysis
SAP ABAP fico report profitability analysis report
My sapcrm customers and consumer segmentation
Organizational challenges in crm and mysap solutions
Business View and Mysap.com
What is SAP R/3 introduction to mysap.com
SAP FICO cross company code reconciliation report
sap sales and distribution back orders report in abap

SAP ABAP Programming Syntax for Scroll Keyword

SAP ABAP programming language has some keywords and they have some rules to follow while using them during programming the ERP language.It is as given below.

The return code value is set as follows:

SY-SUBRC = 0 O.K.
SY_SUBRC = 4 List limits have been reached - scrolling not possible
SY-SUBRC = 8 List does not exist - scrolling not possible

Variant 1

SCROLL LIST TO FIRST PAGE.

Additions

1. ... INDEX idx
2. ... LINE lin

Effect

Scrolls up to the first page of the report displayed on the screen (corresponds to a command field entry, P-- and PP-- ). When a basic list is created, the current list is itself the basic list; When a details list is created, it is the list directly below it.

Addition 1

... INDEX idx.

Effect

Scrolls to the list level idx . idx corresponds to the value of system field SY-LSIND when creating the report.

Example

Scroll to the beginning of the report at list level 1.
SCROLL LIST INDEX 1 TO FIRST PAGE.

If a new list (which is to replace the last list displayed) is created at an event ( AT USER-COMMAND , AT LINESELECTION... ), and if you want to scroll to a particular place in this new list, note the following: A change made to the system field SY-LSIND is only ever taken into account after the event. Therefore, SY-LSIND should be manipulated using the last command belonging to the event (e.g. SY-LSIND = SY-LSIND - 1 ). A SCROLL command with the addition ...INDEX idx must therefore be used for scrolling in this new list. In this way, scrolling in the old list (instead of the new list) is avoided.

Addition 2

... LINE lin

Effect

Displays the report from the line lin (corresponds to the command field entry PLnn). The standard page header and TOP-OF-PAGE area are not moved vertically and are therefore ignored when line lin is determined.

Variant 2

SCROLL LIST TO LAST PAGE.

Additions

1. ... INDEX idx (see addition 1 of variant 1)
2. ... LINE lin (see addition 2 of variant 1)

Effect

Scrolls to the last page of the report displayed on the screen (corresponds to the command field entries P++ and PP++ ).

Variant 3

SCROLL LIST TO PAGE pag.

Additions

1. ... INDEX idx (see addition 1 of variant 1)
2. ... LINE lin (see addition 2 of variant 1)

Effect

Scrolls to the specified page of the report displayed on the screen (corresponds to the command field entry PPnn ).

Examples

Scroll report on list level 1 to page 7.

SCROLL LIST INDEX 1 TO PAGE 7.
Scroll report on list level 1 to page 7 and display from line 5.
SCROLL LIST INDEX 1 TO PAGE 7 LINE 5.

Although the list is now displayed from page 7 and line 5, it is precisely this line which is overlayed by the page header, if a header exists for page 7 (standard header and/or TOP-OF-PAGE lines).

If you want to display a particular line immediately after the page header, you can use the function module 'LIST_SCROLL_LINE_TOPMOST' which makes the necessary calculations (according to DESCRIBE LIST ... ).

Related Posts:

SAP ABAP HR report for EEOC
ABAP Programming hr new hire report
SAP ABAP HR PAYROLL REPORT
ABAP HR head count report for sap
SAP ABAP FICO REPORT FOR GROUP CURRENCY RECONCILIATION
fico reconcilation report for company code currency report
SAP ABAP FICO report about profitability analysis
SAP ABAP fico report profitability analysis report
My sapcrm customers and consumer segmentation
Organizational challenges in crm and mysap solutions
Business View and Mysap.com
What is SAP R/3 introduction to mysap.com
SAP FICO cross company code reconciliation report

ABAP Programming Syntax for Scan keyword

ABAP programming language has some keywords and scan is one among them.The syntax for this programming word is as shown below.

Basic form

SCAN ABAP-SOURCE itab1 TOKENS INTO itab2
STATEMENTS INTO itab3.

Effect

Breaks down the ABAP/4 source code in the source code table itab1 into tokens according to the rules of the ABAP/4 scanner. The tokens are written - one per line - to the token table itab2 . The token table itab2 must have the structure STOKEN . (If you specify the addition WITH ANALYSIS , the token table must have the extended structure STOKEX .)

Normally, comments are filtered out and subordinate source code units (included programs, called macros) are ignored. If you want to include these items, use the additions WITH COMMENTS and WITH ANALYSIS .

In addition to classifying the source code by token, the scanner organizes the tokens themselves into statements - using the colon-comma logic to form chain records - and the statement table itab3 contains a statement description on each line. Here, a three-part chain record "a: b, c1 c2, d." results in three entries "a b,", "a c1 c2," and "a d." in the statement table itab3 .

The statement table itab3 must have the structure SSTMNT . The statement classification characters colon, comma and period are not written to the token table itab2 . Instead, the table itab3 contains details about the position of a colon or the type (comma or period and position of the end marker in the statement description.

The return code value is set as follows:
SY-SUBRC = 0 Source code table is not empty, contains no errors and is broken down into tokens.

SY-SUBRC = 1 Source code table is not empty and is broken down into tokens, but at least one include program does not exist (can occur only in connection with the addition WITH INCLUDES ).
SY-SUBRC = 2 Source code table itab1 is empty or a blank line range was selected (applies to the additions FROM and TO ).

SY_SUBRC = 4 Scanner detects error in source code. \
SY-SUBRC = 8 Other error or RABAX in scanner.

The fields of the structure STOKEN , and thus the columns of the token table itab2 , have the following meaning:

TYPE Type of token with possible values:
I (Identifier)
S (String, i.e. character literal)
L (List, enclosed in parentheses)
C (Comment)
ROW Number of line where token occurs or where it begins (>= 1)
COL Offset of first character of token relative to start of line (>= 0)
LEN Length of token STR Character string forming the token (or just first part) OVFL Overflow flag for field STR with the following possible values:

SPACE (no overflow, token fits completely in field STR )
X (overflow, either not resolved (no overflow are specified) or token fits in overflow area c1 ))
O (overflow of token and overflow of overflow area c1 )
OFF1 Offset in overflow area, if token does not fit completely in field STR and an overlfow area c1 is specified and token fits completely in overflow area c1 .

The fields of the structure SSTMNT , and thus the columns of the statement table itab3 , have the following meaning:
TYPE Type of statement with the following possible values:
E (Native SQL statement between EXEC SQL and
ENDEXEC )
I ( INCLUDE prog )
J ( INCLUDE prog , prog does not exist, can occur only in connection with the addition WITH INCLUDES )
R (Call a macro from table TRMAC )
D (Call an internally defined macro with DEFINE )
M (Macro definition between DEFINE and END-OF-DEFINITION )
C ( COMPUTE statement, sometimes without COMPUTE as first token)
K (Other ABAP/4 key word)
N (Blank statement)
U (Unknown, non-blank statement)
LEVEL Index of source code unit in the level table itab5 (>= 1, if level table specified, otherwise 0)

FROM Index of first token of statement in the token table itab2
TO Index of last token of statement in the token table itab2 (the end marker of the statement - comma or period - counts as no more then a token)

NUMBER Statement counter in a source code unit. Covers all statements, regardless of how many are actually selected - in cases where a key word table itab4 is specified PREFIXLEN Number of tokens before the colon (with chain statements >= 1, otherwise 0)

When expanding macro calls, no position specifications are available. The relevant fields in the token table itab2 and in the statement table itab3 are then set to 0. Unlike the usual syntax check, the following are not treated as errors:

· Comma without preceding colon (the comma then acts as an end marker),
· Open chain statement sequence at end of source code,
i.e. the last statement is closed by a comma, not by a period,
· Open statement at end of source code, i.e. the last statement is closed neither by a period nor by a comma.
To be able to analyze errors without modifying programs, use the additions INCLUDE , MESSAGE , WORD , LINE and OFFSET .

These provide information about the errors which have occurred.

Related Posts:

ABAP HR head count report for sap
SAP ABAP FICO REPORT FOR GROUP CURRENCY RECONCILIATION
fico reconcilation report for company code currency report
SAP ABAP FICO report about profitability analysis
SAP ABAP fico report profitability analysis report
My sapcrm customers and consumer segmentation
Organizational challenges in crm and mysap solutions
Business View and Mysap.com
What is SAP R/3 introduction to mysap.comSyntax for report key word for sap abap

SAP ABAP Syntax for Report in Programming

Report is the key word used in sap abap programming and here we are going to learn about the way it is used in writing the code for programming this abap language.

Effect

Introduces the report. You can choose any name you like up to 8 characters long.

Example

REPORT ZREPNAME.

Only standard SAP reports should begin with 'R'.

Addition 1

... NO STANDARD PAGE HEADING

Effect

Suppresses output of the standard page header (see NEWPAGE ).

Addition 2

... LINE-SIZE col

Effect

Creates a report with col columns per line. The maximum line length permitted is 255 characters.

If the LINE-SIZE specification is missing, the line length corresponds to the current screen width. The system field SYLINSZ contains the current line size for generating reports (see NEW-PAGE ... LINE-SIZE ).

The specified LINE-SIZE must not appear in quotation marks.

· If the you want the report list (i.e. the output) to be printable, do not define a LINE-SIZE with a value greater than 132 because most printers cannot handle wider lists.

Example

REPORT ZREPNAME LINE-SIZE 132.

Addition 3

... LINE-COUNT lin(n)

Effect

Creates a report with lin lines per page, of which n lines are reserved for the END-OF-PAGE processing. If you omit the " (n) ", the default value 0 applies. The system field SY-LINCT contains the current number of lines per page for generating reports.

If the LINE-COUNT specification is missing, the number of lines per page is calculated dynamically from the number of lines actually output on this page. Here, a page break no longer occurs automatically, but must be specified explicitly with NEW-PAGE , and the system field SY-LINCT is set to 0. (NEW-PAGE ... LINE-COUNT )

The LINE-COUNT must not be enclosed in quotation marks.

Further information about using LINE-COUNT .

Examples

REPORT ZREPNAME LINE-COUNT 65.

The page has 65 lines.

REPORT ZREPNAME LINE-COUNT 65(8).

The page has 65 lines, of which the last 8 are only defined by
END-OF-PAGE .

Addition 4

... MESSAGE-ID xx

Effect

Takes the messages output by MESSAGE under the specified 2- character ID xx from table T100 .

Example

REPORT RSTEST00 MESSAGE-ID SY.

Addition 5

... DEFINING DATABASE ...

Effect

All the database programs must specify in the REPORT statement the three-character name of the logical database to which they belong.

This addition is generated automatically (in the REPORT statement) when you create a logical database by selecting Utilities -> Development/test -> Logical databases .

This ID must not be enclosed in quotation marks.

Example

REPORT SAPDBKDF DEFINING DATABASE KDF.

The previous post deals with sap abap syntax of refresh .

Related Posts:

My sapcrm customers and consumer segmentation
Organizational challenges in crm and mysap solutions
Business View and Mysap.com
What is SAP R/3 introduction to mysap.comFICO sap abap reporting

SAP ABAP Syntax for Refresh mysap programming

Refresh is the key word used in sap abap programming to get the fresh and modified data from mysap server. The previous programming sap abap key word is regarding recieve.

Basic form

REFRESH CONTROL ctrl FROM SCREEN scr.

Effect

Initializes the control ctrl defined by a CONTROLS statement according to its description in the screen scr . The screen scr does not have to match the initial screen for the control .

REFRESH - Delete an internal table

Variants

1. REFRESH itab.
2. REFRESH itab FROM TABLE dbtab.
3. REFRESH itab FROM SELECT-OPTIONS.

Variant 1

REFRESH itab.

Effect

The internal table itab is reset to its initial state, i.e. all table entries are deleted.
The return code value SY-SUBRC is undefined.

· The header entry of a table with a header line remains unchanged. It can be reset to its initial value using CLEAR .

· FREE itab can be used to free up the memory allocated to the table.

Variant 2

REFRESH itab FROM TABLE dbtab.

This variant is no longer maintained and should no longer be used (. Please use the SELECT ... INTO TABLE statement instead.

Effect

The internal table itab is deleted and it is then filled with the contents of the database table dbtab .

A generic argument can be used to specify a restriction to a particular part of the database table when filling (LOOP AT dbtab , READ TABLE dbtab ).

The table dbtab must be declared in the program using TABLES.

The return code value SY-SUBRC is undefined.

Example

Deleting an internal table MESSAGES , followed by filling the table with all messages from the table T100 with language key 'D' and ID 'RF' .

TABLES T100.
DATA BEGIN OF MESSAGES OCCURS 200.
INCLUDE STRUCTURE T100.
DATA END OF MESSAGES.
MESSAGES-TEXT = 'Delete me'.
APPEND MESSAGES.
T100-SPRSL = 'D'.
T100-ARBGB = 'RF'.
REFRESH MESSAGES FROM TABLE T100.
Variant 3
REFRESH itab FROM SELECT-OPTIONS.

This variant is no longer supported . The equivalent functionality is now available in the function module
RS_REFRESH_FROM_SELECTOPTIONS .

Effect

Deletes the internal table itab and then transfers the database selections and the selection parameters together with the values entered by the user.

Performance

The runtime for the execution of the REFRESH statement is around 5 ms (standard microseconds).

REFRESH - Refresh the SAPGUI interface

Basic form

REFRESH SCREEN.

This statement is no longer maintained and should therefore not be used.Instead, please use a SET USER-COMMAND f statement.

Effect

Refreshes the SAPGUI interface after receiving the results of the asynchronous Remote Function Call via RECEIVE RESULTS FROM FUNCTION func .

This form of the REFRESH statement simulates pressing the return key.

Using this variant only makes sense in connection with the asynchronous Remote Function Call (CALL FUNCTION func ...STARTING NEW TASK taskname ) after receiving the results of such a call within the FORM routine (RECEIVE RESULTS FROM FUNCTION func ). It has no effect in other environments.

It ensures that the last screen is processed again with the commad '%_RS'. You can see this value in the command<0> field in the top left corner of the current screen.

REFRESH

Delete an internal table

- REFRESH itab.

- REFRESH itab FROM TABLE dbtab.

- REFRESH itab FROM SELECT-OPTIONS.

Refresh the SAPGUI interface

- REFRESH SCREEN.

Initialize a control

- REFRESH CONTROL ctrl FROM SCREEN scr.

129

Related Posts:

Business View and Mysap.com
ERP software selection
ERP implementation process and advantages SAP FINANCE cost center summery
MYsap crm business scenarios and sap solutions
MySAP CRM and customer relationship management
Customer Relationship Management and mysap an introduction
What is SAP R/3 introduction to mysap.comFICO sap abap reporting