Showing posts with label abap syntax. Show all posts
Showing posts with label abap syntax. Show all posts

SAP Full Form and Meaning of SPLIT Keyword in ABAP

SAP has its own importance and here in this post we are going to talk about the full form of sap and its meaning and how the keyword SPLIT is used in ABAP programming.

Variants

1. SPLIT f AT g INTO h1 ... hn.
2. SPLIT f AT g INTO TABLE itab.

Variant 1

SPLIT f AT g INTO h1 ... hn.

Effect

Splits the contents of the f according to the delimiter g and places them in the fields h1 to hn ( n >= 2).g is used in its defined length. The return code value is set as follows:

SY-SUBRC = 0 All hi fields (1 <= i <= n ) were big enough.
SY_SUBRC = 4 One of the hi fields was not big enough and had to be truncated.

DATA: NAMES(30) VALUE 'Charly, John, Peter',
ONE(10),
TWO(10),
DELIMITER(2) VALUE ','.
SPLIT NAMES AT DELIMITER INTO ONE TWO.

Now, ONE has the value "Charly" and TWO has the value "John, Pete" .
SY-SUBRC is set to 4, since TWO was not big enough to include "John, Peter" .
DATA: NAMES2(30) VALUE 'Charly, John, Peter', THREE(10) VALUE 'New York',
FOUR(10),
FIVE(10),
SIX(10) VALUE 'SAP'.
SPLIT NAMES2 AT ',' INTO THREE FOUR FIVE SIX.
IF THREE = 'Charly' AND
FOUR = ' John' AND
FIVE = ' Peter' AND
SIX = SPACE.
WRITE 'SPLIT is OK'.
ENDIF.

Outputs "SPLIT is OK" .

Unless the number of target fields is greater than the number of delimiters in the source field, very little information ought to be lost. Therefore, the last target field in this case contains the "rest", including the delimiters .

If the source field does not contain the separator sequence at all, it is copied incomplete to the first
target field.

Variant 2

SPLIT f AT g INTO TABLE itab.

Effect

Like variant 1.

Stores the components of f in the internal table itab . For each part of f , a "special" table line is created. f is considered without trailing blanks.

Example

DATA: BEGIN OF ITAB OCCURS 10,
WORD(20),
END OF ITAB.
SPLIT 'STOP Two STOP Three STOP ' AT 'STOP' INTO
TABLE ITAB.

Now, ITAB has three lines. The first line is blank, the second contains 'Two' and the third contains 'Three' .

Performance

The runtime required for the SPLIT command in the first example for variant 1 is about 15 msn (standardized microseconds). If the sub-fields of f are written to an internal table, about 30 msn are needed.

Related Posts:




SAP definition,full form,over veiw and introduction

SAP Full form of planning and distribution of goods
SAP full form for mrp,sales and materiel planning
What is SAP and Why do we are in need of It
sap full form,meaning and history of SAP

SAP full form syntax for SET

ABAP Reports Syntax for Select Options

Here in this post we are going to have a look at the abap programming language syntax for a key word select optoins.Basic form for this key word is SELECT-OPTIONS sel FOR f.

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

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 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 . The system then imports this include program into the actual logical database access program SAPDBldb and into the report. As a result, the database-specific selection options 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 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 . This also applies to report-specific SELECT-OPTIONS that refer to a field in a logical database table defined for dynamic selections .You must check report-specific selections that refer to other fields with the CHECK statement . 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 .

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 . If f is a Dictionary field, the selection screen is regenerated automatically after most changes to its attributes. The attributes 'Check table' and 'Fixed values' are exceptions to this rule. If these are changed, you have to generate the program in the ABAP/4 Editor. This also generates the selection screen.

Addition 1

... DEFAULT g

Effect

Proposes the single value g as the default selection when the report is called.


· For each SELECT-OPTION , you can only specify one DEFAULT .
· You must specify the default value g in its internal format, e.g. " SELECT-OPTIONS DATE FOR SYDATUM DEFAULT '19931224' ", not " ... DEFAULT '24.12.1993' ".
· The default value g should normally be a literal because, at runtime, it is transferred to the selection options table sel so early that no value can be assigned to the field g . System fields are an exception here because the system usually assigns values to them as soon as the report processing starts.

· On the "Multiple Selection" screen, you can also enter ranges for selection options with " NO INTERVALS ".

· By combining this addition with " NO-EXTENSION ", you can restrict the user to entry of a single value for the selection option, but with the possibility of also choosing single value options like 'Greater than' or 'Less than or equal'.

Addition

... NO DATABASE SELECTION

Effect

This addition is allowed only for report-specific SELECTOPTIONS which refer to a field f belonging to a table dbtab of the logical database. Here, the selections entered by the user are not passed directly to the logical database unless the logical database supports dynamic selections for dbtab if dynamic selections for dbtab are not supported, the addition has no effect.
This addition can be useful if you only want the selections entered by the user for this SELECT-OPTION to be effective under certain conditions. However, you should be careful when using it: Since the selections have to be checked with CHECK after the records have been read, this has a
considerable effect on performance.

ABAP Programming Report for Stock Requirement List
programming report on produciton order for abap

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 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