SAP ABAP Syntax for Receive Keyword

Receive is the keyword used in abap programming of sap erp and its syntax is explained Below.The previous post deals with read keyword of sap abap.

Basic form

REPLACE f WITH g INTO h.

Addition

... LENGTH len (length specification for field f )

Effect

Replaces the first occurrence of the contents of field f in field h with the contents of field g . All fields are handled in their defined length; this means that closing blanks are not ignored.

The return code value indicates whether the string f was

found in h and replaced by g :

SY-SUBRC = 0 String replaced.
SY_SUBRC =Justify Full 4 String not replaced.

Example

DATA FIELD(10).
MOVE 'ABCB' TO FIELD.
REPLACE 'B' WITH 'string' INTO FIELD.

returns:

FIELD = 'AstringCB', SY-SUBRC = 0

The fields f and g in the REPLACE statement should not overlap. Otherwise, the result is undefined.

Addition

... LENGTH len ... (length specification for field f )

Effect

Searches for the string f in the field h not in its (full) field length, but in the length len .

Example

DATA: PATTERN(5) VALUE 'ABC',
LEN TYPE I,
REPL_STRING(5) VALUE '12345',
FIELD(12) VALUE 'abcdeABCDE'.
REPLACE PATTERN WITH REPL_STRING
INTO FIELD.

does not change FIELD , since 'ABC ' does not occur in abcdeABCDE ' .

LEN = STRLEN( PATTERN ).
REPLACE PATTERN LENGTH LEN
WITH REPL_STRING
INTO FIELD.

Related Posts:

SAP R/3 Introduction to best ERP Mysap
Challenges in implementing ERP
ERP implementation practices
Enterprise resource planning introduction
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
CRM Management and sales and service strategy of mysap crm
MySAP CRM and customer as business partner
How Customer Relationship management makes company Leader
CRM Uses and how to get best results with CRM
CRM software solutions and mysap advantage
SAP FICO internal order summery report
Credit Score Chart

ABAP Syntax for Read in SAP Programming

ABAP programming is used for SAP is used to extract data from R/3 data base and here we are going to learn about syntax of key word READ. Our previous discussion is regarding sap syntax for provide.





READ Determine calendar information


The READ CALENDAR statement exists only in the R/2 System.
In the R/3 System, the following function modules are substituted:

· DATE_COMPUTE_DAY : Returns the day for a date
· DATE_CONVERT_TO_FACTORYDATE : Returns the factory calendar date for a date
· DATE_GET_WEEK : Returns the week in which a date occurs
· EASTER_GET_DATE : Returns the Easter dates for a year
· FACTORYDATE_CONVERT_TO_DATE : Returns the date for a factory calendar date
· HOLIDAY_CHECK_AND_GET_INFO : Checks whether a date is a public holiday and, if necessary, returns information
· WEEK_GET_FIRST_DAY : Returns the first day of a week

READ - Read a file

Basic form

READ DATASET dsn INTO f.

Addition

... LENGTH len

Effect

Reads a record from the sequential file specified in dsn (a field or a literal) and stores it in the field f (usually a field string).

· Binary mode (addition IN BINARY MODE in the OPEN DATASET statement:
Read from file in length of field f .

· Text mode (addition IN TEXT MODE in the OPEN statement):

Read a line.

If the specified file is not open, READ DATASET attempts to open the file dsn ( IN BINARY MODE FOR INPUT or with the specifications of the last OPEN command for this file). Any errors result in the termination of the program.

To read all the records in a file, you are recommended to place READ DATASET in a DO loop that you leave with EXIT .

The return code value is set as follows:

SY-SUBRC = 0 Record read from file.
SY_SUBRC = 4 End of file reached.

Example

Define the field string REC :
DATA: BEGIN OF REC,
TEXT(30),
NUMBER TYPE I,
END OF REC.

Read the file "/usr/test":

DO.
READ DATASET '/usr/test' INTO REC.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
WRITE: / REC-TEXT, REC-NUMBER.
ENDDO.

You can use TRANSFER to output records to a sequential dataset.

· The format of file names depends largely on the operating system. You can access portable programs by using the function module FILE_GET_NAME which returns the physical name for a given logical file name.

Related Posts:

COST CENTER of SAP Actual line items
SAP Finance General Ledger report account balance
Finance general ledger line items SAP ABAP report
General ledger report SAP FINACNE
SAP FICO customer open items report
Customer balance in local currency for SAP FICO
Vendor open items report
SAP Finance abap report for Vendor balance in local currency

SAP Programming Syntax for Provide in ABAP

The sap programming language ABAP syntax for provide is discussed here in detail and we have done about print control in the previous post.

Basic form

PROVIDE f1 f2 ... FROM itab1
g1 g2 ... FROM itab2
...
* FROM itabi
...
BETWEEN f AND g.

Effect

Retrieves the contents of the specified fields from the internal tables ( itab1 , itab2 , ...) and places them in the table header lines within the required range. Also executes the processing block enclosed by the PROVIDE and ENDPROVIDE statements for each range.

For itab1 , itab2 ... only tables with header lines are allowed.

Basic principle:

The diagram below illustrates the functionality of the PROVIDE statement for the most simple case where just two tables A and B are to be processed:

IA1 IA2
|-----------| |--------------| table A
: : : :
: IB1 : IB2 : :
: |-----------| |-------------| : table B
: : : : : : : :
: : PROVIDE area : : :
...|----------------------------------------|...
: : : : : : : :
:TI1: TI2 :TI3: : TI4 : TI5 : TI6 :
...|---|-------|---| |-------|-----|-----|...

result ranges

The data structures which form the basis for the table lines must each contain two components which can be interpreted as a range (e.g. start date and end date). In the diagram, the ranges belonging to the entries in table A are marked with IA1 or IA2 , and those in table B with IB1 or IB2 .

If you split the ranges of both tables into overlapping and non-overlapping ranges and then form the union set with the PROVIDE area, this results in 6 sub-ranges TI1 to TI6 . In these sub-ranges, the values of the tables A and B are constant. The PROVIDE1 statement makes the contents of the tables A and B available for the 6 sub-ranges, one after the other. It thus acts as a kind of loop where the data of the tables involved can be processed1 with reference to each range.

Effect

General principle

Each of the specified internal tables has two fields which contain the line-related validity range. You can determine these in the DATA statement with the addition " VALID BETWEEN ... AND ...

". If this addition is not used, sub-fields of the table determine these range fields (e.g. VALID BETWEEN first field AND second field). These fields can be date fields, time fields or even number fields. Both these two fields and also f and g should be the same type.

PROVIDE splits the range f to g into sub-ranges so that each of the fields ( f1 , f2 , ...) specified for each table is constant in this range and so that each sub-range is as large as possible (range limits are considered part of the range).

Each time the processing passes through the loop, the current range limits and the specified sub-fields are placed in the header lines of the internal tables. If you want to make all subfields available, enter '*' instead of the field list. The unspecified sub-fields are set to their initial value (CLEAR ).

It is a requirement that the ranges within a table are in ascending order and not overlapping. However, there can be gaps between one upper range limit and the next lower range limit. For each table itab1 , itab2 ... , the automatically generated fields itab1_VALID , itab2_VALID , ... indicate (with 'X' oder Leerzeichen ' ' ) whether a suitable entry was found for the current sub-range.

sap edi with out message control
sap edi outbound process with message control for purchase introduction
And part two of edi outbound with message control for Purchase order
Cost center report for open line items of SAP
ERP Introduction

SAP programming Syntax Print Control ABAP

Syntax check for perform in sap programming is the previous topic of ABAP and now we are going to discuss deal with print control syntax of sap.

Effect

Determines the desired print format for the subsequent characters, starting from the current output position.

You define the output position either implicitly:

· Line 1/column 1 before the first WRITE output on the current page.

· Line and column of the next field output with WRITE .

or explicitly:

· Line 1/column 1 using NEW-PAGE ,
· Line n/column 1 using SKIP TO LINE n

· Line */column m using POSITION n (* = current output line).

With output to the screen or when printing screen output, the statement has no effect.

Variant 2

PRINT-CONTROL INDEX-LINE f.

Effect

Ouputs the contents of the field f as an index line in the current print output. An index line usually contains only administration information for archiving and is not output when printing. If no print mode is active, the statement has no effect. If the WRITE statement has already begun a print line, the index line is output after this line.

Example

DATA: INDEX_LINE(200).
PRINT-CONTROL INDEX-LINE INDEX_LINE.

Related Posts

Challenges in implementing ERP

ERP implementation practices
Enterprise resource planning introduction
Enterprise resource planing implementation process and its advantages
These are the following recent posts about fico reports of sap abap from this blog.

SAP Finance General Ledger report account balance
Finance general ledger line items SAP ABAP report
General ledger report SAP FINACNE
SAP FICO customer open items report
Customer balance in local currency for SAP FICO
Vendor open items report
SAP Finance abap report for Vendor balance in local currency
Customer relationship management introduction

SAP Programming syntax Perform code

We are discussing regarding SAP programming language ABAP and its syntax for perform and it is the continuation of it.

Variant 5

PERFORM n ON COMMIT

Addition

1. ... LEVEL level

Effect

Executes the specified subroutine when a COMMIT WORK occurs. This allows you to execute a subroutine only if the logical transaction has ended successfully. The subroutine is not executed until the key word COMMIT WORK is called. FORMs specified several times are executed only once on COMMIT WORK (see COMMIT WORK ). If you call ROLLBACK WORK , you delete all the specified routines.

With PERFORM ... ON COMMIT , you cannot transfer any data with USING/CHANGING . To do this, you must either store the data in global variables or store it temporarily with EXPORT ... TO MEMORY .

Addition 1

... LEVEL level

Effect

The addition LEVEL , followed by a field, defines the order in which the subroutines are executed after COMMIT WORK .

They are called in ascending order of level. If there is no addition LEVEL , the subroutine always has the level zero. If the level is the same, the order of calls determines the order of execution. Level assignment occurs during development, e.g. by defining constants in an include program. The level must be of type I.


ABAP TOPIC WISE COMPLETE COURSE

BDC
OOPS ABAP
ALE
IDOC'S
BADI
BAPI
Syntax Check
Interview Questions
ALV Reports with sample code
ABAP complete course
ABAP Dictionary
SAP Scripts
Script Controls
Smart Forms
Work Flow
Work Flow MM
Work Flow SD
Communication Interface

You may be also interested in the following SAP Finance reports.

SAP Finance General Ledger report account balance
Finance general ledger line items SAP ABAP report
General ledger report SAP FINACNE
SAP FICO customer open items report
Customer balance in local currency for SAP FICO
Vendor open items report
SAP Finance abap report for Vendor balance in local currency
Customer relationship management introduction
Enterprise resource planning introduction

ABAP Syntax Code for Perform in SAP Programming

ABAP Code for programming SAP data retrieval has a key word perform and the previous post deals with syntax of perform and this is in continuation of that.

Variant 3

PERFORM form IN PROGRAM prog.

Additions

1. ... USING p1 p2 p3 ...
2. ... CHANGING p1 p2 p3 ...
3. ... TABLES itab1 itab2 ...
4. ... IF FOUND

Effect

Similar to variation 2 (external PERFORM ), except that here you can specify both the subroutine and the program dynamically (at runtime); in this case, you must enclose the variables form or prog in parentheses. If you omit specification of the program after IN PROGRAM , ABAP/4 searches for the routine in the current program.

Example

DATA: RNAME(30) VALUE 'WRITE_STATISTIC',

PNAME(8) VALUE 'ZYX_STAT'.

PERFORM WRITE_STATISTIC(ZYX_STAT).

PERFORM (RNAME) IN PROGRAM ZYX_STAT.

PERFORM WRITE_STATISTIC IN PROGRAM (PNAME).

PERFORM (RNAME) IN PROGRAM (PNAME).

All four of the above PERFORM statements have the same effect, i.e. they call the subroutine 'WRITE_STATISTIC' defined in the program 'ZYX_STAT' .

Addition 4

... IF FOUND

Effect

Calls the specified subroutine only if it already exists. Otherwise, the statement is ignored.

Variant 4

PERFORM n OF form1 form2 form3 ... .

Effect

Drives a subroutine specified by the index n from a list of subroutine names listed in the statement. At runtime, the variable n must contain a value between 1 (first name) and the total number of subroutines specified (last name). Up to 256 subroutine names are possible.

Runtime errors

· PERFORM_INDEX_0 : The index specified was too small.

· PERFORM_INDEX_NEGATIVE : The index specified was negative.

· PERFORM_INDEX_TOO_LARGE : The index specified was too large.

SAP Finance sample report for abap code and programming can be learned here.

ABAP TOPIC WISE COMPLETE COURSE

BDC
OOPS ABAP
ALE
IDOC'S
BADI
BAPI
Syntax Check
Interview Questions
ALV Reports with sample code
ABAP complete course
ABAP Dictionary
SAP Scripts
Script Controls
Smart Forms
Work Flow
Work Flow MM
Work Flow SD
Communication Interface

SAP ABAP Syntax for Perform part two

SAP ABAP Syntax for Perform is discussed in the previous post and it is in continuation with it.

Addition 3

... TABLES itab1 itab2 ...

Effect

You use TABLES to pass internal tables to subroutines.

Example

DATA: BEGIN OF ITAB OCCURS 100,
TEXT(50),
NUMBER TYPE I,
END OF ITAB.
STRUC LIKE T005T.
...
PERFORM DISPLAY TABLES ITAB
USING STRUC.
FORM DISPLAY TABLES PAR_ITAB STRUCTURE ITAB
USING PAR STRUCTURE T005T.
DATA LOC_COMPARE LIKE PAR_ITAB-TEXT.
WRITE: / PAR-LAND1, PAR-LANDX.
...
LOOP AT PAR_ITAB WHERE TEXT = LOC_COMPARE.
...
ENDLOOP.
...
ENDFORM.

Within the subroutine DISPLAY , you can apply all the available table operations to the internal tables passed.

TABLES must always appear first in the PERFORM call. It must not be preceded by an addition.

Variant 2

PERFORM form(prog).

Effect

Calls the subroutine form defined in the program prog (i.e. external PERFORM ).

Parameter passing to the external subroutine is the same as in variation 1.

Parameter passing can be implemented by using a common data area (see DATA BEGIN OF COMMON PART ).

Nested calls are possible, even with several external subroutines from different programs.

If you call a subroutine of a program prog , the system loads the program prog .

ABAP TOPIC WISE COMPLETE COURSE

BDC
OOPS ABAP
ALE
IDOC'S
BADI
BAPI
Syntax Check
Interview Questions
ALV Reports with sample code
ABAP complete course
ABAP Dictionary
SAP Scripts
Script Controls
Smart Forms
Work Flow
Work Flow MM
Work Flow SD
Communication Interface

Learn about abap programming Finance sap abap sample codes and reports here.

SAP ABAP Syntax for Perform

The sap abap syntax for perform has different variants an shown below.

Variant 1

PERFORM form.

Additions

1. ... USING p1 p2 p3 ...
2. ... CHANGING p1 p2 p3 ...
3. ... TABLES itab1 itab2 ...

Effect

Calls the subroutine form specified in the FORM statement. On completion, processing in the main program resumes.

Example

PERFORM HELP_ME.
...
FORM HELP_ME.
...
ENDFORM.

The PERFORM statement calls the subroutine HELP_ME .

Nested calls are allowed (i.e. PERFORM within a FORM ... ENDFORM ).Recursive calls are also possible.

To define local data, use the DATA statement after FORM . Each time you enter the subroutine, the data is recreated (with an initial value) and released at the end (from the stack).

To define global data used within a subroutine, use the LOCAL statement after FORM . The values are saved when you enter the subroutine and then released at the end (from the stack).

Runtime errors

· PERFORMANCE_PARAMETER_MISSING : The called form expects more parameters than were specified.

· PERFORM_PARAMETER_COUNT ,

· PERFORM_TOO_MANY_PARAMETERS : More parameters were given than the FORM expected.

· PERFORM_CONFLICT_TYPE ,

· PERFORM_CONFLICT_GENERIC_TYPE ,

· PERFORM_BASE_WRONG_ALIGNMENT ,

· PERFORM_PARAMETER_TOO_SHORT ,

· PERFORM_TABLE_REQUIRED : The parameter type does not match the type specified in the FORM definition.

· PERFORM_BASE_LITL : A literal was passed to a structured parameter.

Addition 1

... USING p1 p2 p3 ...

Addition 2

... CHANGING p1 p2 p3 ...

Effect

These additions are equivalent to each other.

Parameter offset and length can be passed as variables. The addition ' ...USING p1+off(*) ' causes parameter p1 to be passed with offset off so that the field limits of p1 are not exceeded.

Example

DATA: NUMBER_I TYPE I VALUE 5,
NUMBER_P TYPE P VALUE 4,
BEGIN OF PERSON,
NAME(10) VALUE 'Paul',
AGE TYPE I VALUE 28,
END OF PERSON,

ALPHA(10) VALUE 'abcdefghij'.
FIELD-SYMBOLS .
ASSIGN NUMBER_P TO .

PERFORM CHANGE USING 1
NUMBER_I
NUMBER_P
PERSON
ALPHA+NUMBER_I().

FORM CHANGE USING VALUE(PAR_1)
PAR_NUMBER_I
PAR_NUMBER_P
PAR_POINTER

PAR_PERSON STRUCTURE PERSON
PAR_PART_OF_ALPHA.
ADD PAR_1 TO PAR_NUMBER_I.
PAR_NUMBER_P = 0.
PAR_PERSON-NAME+4(1) = ALPHA.
PAR_PERSON-AGE = NUMBER_P + 25.
ADD NUMBER_I TO PAR_POINTER.

PAR_PART_OF_ALPHA = SPACE.
ENDFORM.

Field contents after the PERFORM call are as follows:

NUMBER_I = 6
NUMBER_P = 6
= 6
PERSON-NAME = 'Paula'
PERSON-AGE = 25
ALPHA = 'abcde j'

The field type and length of the parameters remain. If parameter values change within the subroutine, these new values remain after you leave the subroutine. However, this does not apply to parameters passed with VALUE (see FORM )

If you pass literals, you must either leave them unchanged or pass them in the FORM definition with the USING VALUE statement.

ABAP TOPIC WISE COMPLETE COURSE

BDC
OOPS ABAP
ALE
IDOC'S
BADI
BAPI
Syntax Check
Interview Questions
ALV Reports with sample code
ABAP complete course
ABAP Dictionary
SAP Scripts
Script Controls
Smart Forms
Work Flow
Work Flow MM
Work Flow SD
Communication Interface

SAP ABAP Syntax for Parameters part five

This post is in continuation with previous post about SAP ABAP syntax for parameters part four.

Addition 15

... VALUE-REQUEST

Effect

This addition is only allowed for database-specific parameters in the INCLUDE DBldbSEL . It permits self-programmed value help (for report-specific parameters, this is achieved by specifying the event key word AT SELECTION-SCREEN ON VALUE-REQUEST FOR ... ). The addition has the following effect:

On the selection screen, the parameter has a button for requesting possible entries. When the user presses this button or F4 , this starts the FORM routine p_VAL in the database access program SAPDBldb (if it exists). Then - even if the parameter with LIKE points to a Dictionary field - this FORM routine is processed rather than displaying the check table or the fixed values of the Dictionary field.

Example

* INCLUDE DBXYZSEL
...
PARAMETERS PL_TYPE LIKE SAPLANE-PLANETYPE VALUEREQUEST.
...
REPORT SAPDBXYZ DEFINING DATABASE XYZ.
...
TABLES SAPLANE.
...
FORM PL_TYPE_VAL.
...
CALL FUNCTION ...
...
ENDFORM.

Addition 16

... HELP-REQUEST

Effect

Like VALUE-REQUEST , this addition is only allowed for database-specific parameters in the INCLUDE DBldbSEL . It permits self-programmed value help (for report-specific parameters, this is achieved by specifying the event key word AT SELECTION-SCREEN ON VALUE-REQUEST FOR ... ). When the user presses F1 , this starts the FORM routine p_HLP in the database access program SAPDBldb (if it exists). Then -even if the parameter with LIKE points to a Dictionary field - this FORM routine is processed rather than displaying the data element documentation of the Dictionary field. You can also branch from the routine p_HLP to a function module which displays its own documentation.

Example

* INCLUDE DBXYZSEL
...
PARAMETERS PL_TYPE LIKE SAPLANE-PLANETYPE HELPREQUEST.
...
REPORT SAPDBXYZ DEFINING DATABASE XYZ.
...
TABLES SAPLANE.
...
FORM PL_TYPE_HLP.
...
CALL FUNCTION ...
...
ENDFORM.

ABAP TOPIC WISE COMPLETE COURSE

BDC
OOPS ABAP
ALE
IDOC'S
BADI
BAPI
Syntax Check
Interview Questions
ALV Reports with sample code
ABAP complete course
ABAP Dictionary
SAP Scripts
Script Controls
Smart Forms
Work Flow
Work Flow MM
Work Flow SD
Communication Interface

SAP ABAP Syntax for Parameters part Four

SAP ABAP Syntax for parameters were previously discussed in part one, two and three and the present post is in continuation with it.

Addition 13

... FOR TABLE dbtab

Effect

Assigns the database-specific parameter p to the table dbtab . This addition only makes sense in a logical database access program.

With database-specific parameters, you need this addition to ensure that the selection screen for a report contains only database-specific parameters which belong to a table from the currently active report.

Addition 14

... AS MATCHCODE STRUCTURE

Effect

Creates the database-specific parameter p as a field string according to the Dictionary structure MCPARAMS with the fields MCID (matchcode ID ) and STRING (search string ). Used for data selection through matchcode entry. On the selection screen, both sub-fields are displayed in a box with the text "Matchcode selection".

You can get a list of possible entries for the matchcode ID and the search string by pressing F4 . If you choose a matchcode ID and press F4 in the field "Search string", you see a dialog box where you can enter a search criterion for each field of the matchcode ID. The system interprets what you enter generically for each sub-field.

The addition AS MATCHCODE STRUCTURE only makes sense in a logical database access program and must therefore be used together with the addition FOR TABLE . It can also be combined with the addition MODIF ID , but not with any other additions. The matchcode object to which the matchcode ID and the search string refer is determined when you define the logical database.

Example

Input on the selection screen:

Matchcode ID: Customers Search string: Daniel

The effect of this is to select all customers whose names begin with "Daniel".

Performance

Matchcode selection can improve program performance considerably. This is because specifying a search string often describes the required set of data records more accurately than the key fields of the table. For example, it is easier to select by name ("Daniel") than by customer number ("000043010") and far fewer records are read from the database.

If a logical database (e.g. ldb ) contains a parameter p defined with AS MATCHCODE STRUCTURE , the system always creates an internal table ldb_MC which includes all the key fields of the selected records. The structure of ldb_MC is determined by the matchcode object and generated automatically. In the maintenance transaction for logical databases, the structure is displayed as a comment in the database program.

Example

Matchcode object for table T1 with key field T1-K1 . The table ldb_MC then has the following structure:

DATA: BEGIN OF ldb_MC OCCURS 100,
T1_K1 LIKE T1-K1,
END OF ldb_MC.

If the user has entered values in the matchcode parameter fields, the program reads the selected data from the matchcode table after START-OF-SELECTION and makes it available to the logical database program in the internal table ldb_MC . Then, the database program processes the records in the subroutine PUT_ldb_MATCHCODE and, with the help of PUT , triggers the appropriate GET events in the report. Subsequent processing is exactly the same as that for data selection direct from the database.


Example

FORM PUT_ldb_MATCHCODE.
SELECT * FROM T1
WHERE K1 = ldb_MC-T1_K1
FOR ALL ENTRIES IN ldb_MC.
PUT T1.
ENDSELECT.
ENDFORM.

In matchcode selection, the system flags all fields in the internal table MC_FIELDS which are filled with values by the matchcode (the field name is in MC_FIELDS-FIELDNAME and the flag is in MC_FIELDS-SUPPLIED ).

Example

A field F0 is supplied with a value by the matchcode if the following condition is satisfied:

IF MC_FIELDS-FIELDNAME EQ 'F0'
AND MC_FIELDS-SUPPLIED NE SPACE.

ABAP TOPIC WISE COMPLETE COURSE

BDC
OOPS ABAP
ALE
IDOC'S
BADI
BAPI
Syntax Check
Interview Questions
ALV Reports with sample code
ABAP complete course
ABAP Dictionary
SAP Scripts
Script Controls
Smart Forms
Work Flow
Work Flow MM
Work Flow SD
Communication Interface

OTHER PROGRAMMING COURSES:

Dot Net Complete Course Part one and two
ASP.NET part one and

SAP ABAP Syntax for Parameters part three

This SAP ABAP syntax for parameters part is in continuation with part two .

Addition 8

... NO-DISPLAY

Effect

Does not display the parameter on the selection screen. With "normal" parameters, the associated data object is created and the parameter can be passed when SUBMIT is executed.

These parameters are the part of the report interface not presented to the user on the selection screen. You can set the parameter values either internally (with the routine INIT in the SAPDBldb or at INITIALIZATION ) or pass them when SUBMIT is executed. These parameters are also stored along with the variants.

If, under certain circumstances (e.g. because of the values of other parameters or due to the selection options ), you want to present the parameter to the user for input, you can do this in the PAI modlue of the database program SAPDBldb (for database-specific parameters) or under AT SELECTIONSCREEN (for report-specific parameters) by calling a function module (CALL FUNCTION ) or your own screen (CALL SCREEN < /> ).

Since the parameter is not generated on the selection screen, the NO-DISPLAY parameters do not allow you to use any of the additions concerning the display and handling of parameters on the selection screen.

Addition 9

... LOWER CASE

Effect

The parameter is not case-sensitive (i.e. allows both upper and lower case).

Addition 10

... OBLIGATORY

Effect

Makes an entry on the selection screen compulsory.

Addition 11

... AS CHECKBOX

Effect

Displays the parameter as a checkbox on the selection screen. Since you are not allowed to specify type or length when defining this parameter, it always has the type C and the length 1 as default values.

The checkbox is displayed on the left and the associated text on its right. To define any order other than this, use the SELECTION-SCREEN statement.

If LIKE refers to an ABAP/4 Dictionary field, you cannot use the addition AS CHECKBOX . If the ABAP/4 Dictionary field has the type CHAR , a length of 1 and the fixed values 'X' and ' ' (according to the relevant domain), the parameter is always displayed as a checkbox on the selection screen.

Addition 12

... RADIOBUTTON GROUP radi

Effect

Displays the parameter on the selection screen as a radio button (selection field). All parameters assigned in this way to the same group radi (which can be up to 4 characters long) form a group of radio buttons on the selection screen, i.e. if the user presses one of these buttons, the others are set to "not pressed".

When you define one of these parameters, you are not allowed to make type or length specifications. However, you can use LIKE to point to a field of length 1 and type C . The addition has no effect on the ordering of the parameter (as is the case with the addition AS CHECKBOX ).

You can make changes to the order with the SELECTION-SCREEN .

ABAP TOPIC WISE COMPLETE COURSE

BDC
OOPS ABAP
ALE
IDOC'S
BADI
BAPI
Syntax Check
Interview Questions
ALV Reports with sample code
ABAP complete course
ABAP Dictionary
SAP Scripts
Script Controls
Smart Forms
Work Flow
Work Flow MM
Work Flow SD
Communication Interface

SAP ABAP Syntax for Parameters part two

SAP ABAP Syntax for parameters is the previous post and this is in continuation with that.

Addition 4

... LIKE g

Effect

Creates the field p with the same attributes as the field g which is already defined. g can be either a database field or an existing internal field.

You cannot use the addition ... LIKE g with the addition ... TYPE typ . No explicit length may be specified for the parameter (for example, a statement such as PARAMETERS p(len) LIKE g is not allowed).

Example

PARAMETERS PROGRAM LIKE SY-REPID.

If g is an ABAP/4 Dictionary field of the type CHAR , length 1 and default values 'X' and ' ' (according to the relevant domain), the parameter is always displayed as a checkbox on the selection screen (see also AS CHECKBOX ).

Field attributes on the selection screen:

The input/output field which appears on the selection screen for the parameter has the attributes of the field g specified after LIKE . These include type, length or - with ABAP/4 Dictionary fields - conversion exit .

If g is an ABAP/4 Dictionary field, the selection screen is automatically regenerated after most field attribute changes. An excception to this rule are the attributes "Check table" and "Fixed values". If these change, you must generate the program in the ABAP/4 Development Workbench. This also generates the selection screen.

The maximum permitted length of a parameter on the selection screen is 45 (scrollable up to length 132). If you have defined it longer than this (either explicitly with p(200) or implicitly with LIKE ), the parameter is truncated on the selection screen after the 132nd character. However, you can use SUBMIT to pass longer parameters to a report (particularly if these are not displayed on the selection screen at all because of the addition NO-DISPLAY ).

Addition 5

... MEMORY ID pid

Effect

On the selection screen, assigns the memory ID pid to the parameter, i.e. when you execute the report, the selection screen displays the last value which the user entered in a field with the memory ID pid .

The memory ID must be a constant, i.e. a value specified without quotation marks, and can be up to 3 characters long.

Addition 6

... MATCHCODE OBJECT mobj

Effect

On the selection screen, assigns the matchcode object mobj to the parameter.

The name of the matchcode object must be a constant, i.e. a value specified without quotation marks, and can be up to 4 characters long.

Addition 7

... MODIF ID key

Effect

The screen fields contain the specified modification group ( SCREEN-GROUP1 ) which you can use for screen modifications (e.g. set to "not ready for input") under AT SELECTION-SCREEN .

The name of the modification group must be a constant, i.e. a value specified without quotation marks, and can be up to 3 characters long.

Example

PARAMETERS CHARLY MODIF ID ABC.
...
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'ABC'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
...

Effect

The parameter is not ready for input on the selection screen.

ABAP TOPIC WISE COMPLETE COURSE

BDC
OOPS ABAP
ALE
IDOC'S
BADI
BAPI
Syntax Check
Interview Questions
ALV Reports with sample code
ABAP complete course
ABAP Dictionary
SAP Scripts
Script Controls
Smart Forms
Work Flow
Work Flow MM
Work Flow SD
Communication Interface

SAP ABAP Syntax for Paramters

Basic form

PARAMETERS p

Effect

This statement only makes sense in report programs, i.e. in programs defined as type '1' in the attributes. You execute report programs with the SUBMIT statement. When this takes place, the parameters and selection options (SELECT-OPTIONS ) specified in the report program shape the interface which determines what the user sees on the selection screen.

These
parameters and selection options are then presented to the user who can enter values (see the addition NO-DISPLAY or SUBMIT without the addition VIA SELECTION-SCREEN ).

Creates internal fields like the DATA statement. By making the appropriate entry in the attributes, you can assign a report to a logical database ldb . In this case, both the logical database ldb and the report can define parameters (and selection options). You define the database-specific parameters (i.e. those belonging to the logical database) in an ABAP/4 INCLUDE program DBldbSEL (in the logical database maintenance transaction).

Since the system then integrates this
INCLUDE program in the logical database access program SAPDBldb and (partially) in the report, the database-specific parameters (and selection options) are available to both. The ("report-specific") parameters defined in the report are known only in the report (not in the SAPDBldb ). Some additions of PARAMETERS are allowed only in the DBldbSEL .

Example

PARAMETERS: SUM(1).

The name of a parameter can be up to 8 characters long. By selecting Goto -> Text elements and then choosing Selection texts followed by Display , you can enter a description for each parameter; this is then displayed on the selection screen. You define the report-specific parameter texts with the text elements of the report and the database-specific parameter texts with the text elements of the database program SAPDBldb .

Addition 1

... DEFAULT f

Effect

Assigns the default value f to the parameter.

You must specify the default value f in internal format, e.g.

PARAMETERS DATE LIKE SY-DATUM DEFAULT '19931224' ,

not ... DEFAULT '24.12.1993' .

Addition 2

... TYPE typ

Effect

Assigns the type typ to the internal field.

Example

PARAMETERS: NUMBER(4) TYPE P DEFAULT '999'.

Addition 3

... DECIMALS dec

Effect

Assigns dec decimal places to the internal field. dec must be numeric.

You can only use the addition DECIMALS dec with the addition TYPE P , i.e. it is only allowed with parameters of type P .

Example

PARAMETERS: NUMBER (4) TYPE P DECIMALS 2
DEFAULT '123.45'.

ABAP TOPIC WISE COMPLETE COURSE

BDC
OOPS ABAP
ALE
IDOC'S
BADI
BAPI
Syntax Check
Interview Questions
ALV Reports with sample code
ABAP complete course
ABAP Dictionary
SAP Scripts
Script Controls
Smart Forms
Work Flow
Work Flow MM
Work Flow SD
Communication Interface

SAP ABAP Syntax for Overlay

SAP abap programming learning process shall start with syntax check of each key word and here is the effort for that.

Basic form


OVERLAY c1 WITH c2.

Addition

... ONLY c3

Effect

The contents of the field c2 overlay the field c1 in all positions where c1 has the value SPACE ; c2 itself remains unchanged. The return code value is set as follows:

SY-SUBRC = 0 At least one character in c1 is overlaid by a character from c2 .
SY_SUBRC = 4 No character in c1 was overlaid by a character from c2 .

Example

DATA: WORK(20) VALUE 'Th t h s ch ng d.',
HELP(20) VALUE 'Grab a pattern'.
OVERLAY WORK WITH HELP.

WORK now contains ' That has changed. ' and the system field SY-SUBRC is set to 0.

Addition

... ONLY c3

Effect

The contents of the field c2 overlay the field c1 only in those positions where c1 has one of the characters existing as a value in c3 ; the fields c2 and c3 remain unchanged.

Example

Linking field selection templates:

DATA: ONE(16), TWO(16).
ONE = '----****++++....'.
TWO = '-*+.-*+.-*+.-*+.'.
OVERLAY ONE WITH TWO ONLY '.'.
OVERLAY TWO WITH ONE ONLY '.+'.
OVERLAY ONE WITH TWO ONLY '+*'.

Field ONE now contains '-----***-*++-*+.' and field TWO contains '-*---***-*++-*+.' .

Performance

The runtime required for the OVERLAY command in the example of the basic form is about 45 msn (standardized microseconds). To execute the addition ... ONLY c3 , about 40 msn are needed.

ABAP TOPIC WISE COMPLETE COURSE

BDC OOPS ABAP ALE IDOC'S BADI BAPI Syntax Check
Interview Questions ALV Reports with sample code ABAP complete course
ABAP Dictionary SAP Scripts Script Controls Smart Forms
Work Flow Work Flow MM Work Flow SD Communication Interface

OTHER PROGRAMMING COURSES:

Dot Net Complete Course Part one and two ASP.NET part one and two
Programming with C and C Sharp
Interview Questions in dot net and asp.net part one part two
Software Testing Complete course part one and two and Interview Questions

What is Data Structures ?

Team blog recent posts

SAP ABAP EDI Interface testing

ABAP Syntax for Open
Software testing development process over view
Errors and approximations(physics)

Thank you for visiting SAP ABAP REPORTS.If you liked the post, please subscribe to RSS FEED or get the updates directly into your mail box through EMAIL SUBSCRIPTION.You can contact me at d_vsuresh[at the rate of]yahoo[dot]co[dot]in for any specific feed back.