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