Syntax Check for GET part three

Previously we have discussed about GET SYNTAX in part ONE and TWO.Here is the continuation for that.

Basic form 3

GET PARAMETER ID key FIELD f.

Effect

Transfers the value stored under the key pid from the global user-related SAP memory memory to the field f .

The key pid must consist of three characters. For an overview of the keys (parameters) used, refer to the SAP system description or the appropriate function in the ABAP/4 Development Workbench.

The return code value is set as follows:

SY-SUBRC = 0 A value was read from SAP memory.

SY_SUBRC = 4 No value was found in SAP memory under the specified key

1. The global user-related SAP memory is available to each user for the entire duration of a terminal session.

For this reason, set values are retained when you leave a program.

2· The SAP memory should not be used for intermediate storage, since a user's parallel sessions use the same global memory.

Example

Read the program name from SAP memory:

DATA : REPID(8).
GET PARAMETER ID 'RID' FIELD REPID.

Basic form 4

GET PROPERTY OF obj p = f.

Addition

... NO FLUSH

Effect

Transfers attribute p of object obj to field f .

Object obj must be of type OLE2_OBJECT .

GET PROPERTY

Addition

... NO FLUSH

Example

Read the attribute 'Visible' of an EXCEL worksheet.

INCLUDE OLE2INCL.
DATA: EXCEL TYPE OLE2_OBJECT,
VISIBLE TYPE I.
CREATE OBJECT EXCEL 'Excel.Application'.
GET PROPERTY OF EXCEL 'Visible' = VISIBLE.

Basic form 5

GET RUN TIME FIELD f.

Effect

Relative runtime in microseconds. The first call sets (initializes) the field f to zero. For each subsequent call, f contains the runtime in microseconds since the first call. The field F should be of type I .

1. If the applications server is a multiple processor, switching the CPU to another processor may lead to fluctuations in the returned runtime. When measuring the runtime of smaller program components, you can achieve the correct result by taking several small measurements.

Example

DATA: T1 TYPE I,
T2 TYPE I,
TMIN TYPE I.
DATA: F1(4000), F2 LIKE F1.
TMIN = 1000000.

DO 10 TIMES.

GET RUN TIME FIELD T1.

MOVE F1 TO F2. "Time measurement of the MOVE statement

GET RUN TIME FIELD T2.
T2 = T2 - T1. IF T2 < tmin =" T2." href="http://abapprogramming.blogspot.com/2008/08/sap-abap-syntax-check-complete.html">

No comments :

Post a Comment