SAP ABAP Syntax SYST

ABAP Syntax No Comments »

SY-SUBRC :  系統執行某指令后,表示執行成功与否的變數,’0′ 表示成功Return Value of ABAP Statements
SY-UNAME:  當前使用者登入SAP的USERNAME;
SY-DATUM:  當前系統日期; Current Date of Application Server
SY-UZEIT:    當前系統時間; Current Time of Application Server
SY-TCODE:   當前執行程式的Transaction code Current Transaction Code
SY-INDEX :   當前LOOP循環過的次數Loop Index
SY-TABIX:  當前處理的是internal table 的第几筆Index of Internal Tables
SY-TMAXL: Internal table的總筆數 Obsolete ABAP System Field
SY-SROWS: 屏幕總行數; Screens, numbers of lines
SY-SCOLS:  屏幕總列數; Screens, number of columns
SY-MANDT: CLIENT NUMBER Client ID of Current User
SY-VLINE:  畫豎線 Vertical Line
SY-ULINE:  畫橫線Horizontal Line

BDC OKcode

ABAP Syntax No Comments »

OKCODE                                 Description

/nn                                       Function Key nn

/00                                        Enter

/8                                          F8,Continue or Execute

/11                                         F11,Post

%EX                                         Exit

BACK                                        F3,Back Previous Screen

DLT                                          Delete

PICK                                         Double Click

SAVE                                         F11,Save

ABAP Syntax Initial Table Refresh,Clear,Free

ABAP Syntax No Comments »

1. REFRESH <itab>

It is used in internal Table without HEADER LINE,clear all elements.

Example:

    REFRESH ITAB.

2. CLEAR <itab> []

It is used in Internal Table with HEADER LINE,clear all elements.

Example:

    CLEAR ITAB[].

3. Free <itab>

Release Internal Table’s memory space, it is used after REFRESH and CLEAR.

ABAP Syntax Internal Table Sorting

ABAP Syntax No Comments »

ABAP Syntax:

SORT <itab> [<order>] [BY <f1>] ….

[<order>] : (DESCENDING) (ASCENDING), (ASCENDING)

<f1>: Field

Example:

SORT ITAB DESCENDING BY COL2.

Technorati Tags: ,,,

ABAP Syntax Collect Line

ABAP Syntax No Comments »

ABAP Syntax of Collect Line.

DATA: BEGIN OF ITAB OCCURS 3,

COL1(3) TYPE C,

COL2 TYPE I,

END OF ITAB.

ITAB-COL1 = ‘ABC’. ITAB –COL2 = 10.

COLLECT ITAB.

ITAB-COL1 = ‘XYZ’. ITAB-COL2 = 20.

COLLECT ITAB.

ITAB-COL1 = ‘ABC’. ITAB-COL2 = 30.

COLLECT ITAB. “Collect COL2 to COL1=ABC’s element

LOOP AT ITAB.

WRITE: / ITAB-COL1,ITAB-COL2.

ENDLOOP.

Result :

ABC 40

XYZ 20

Technorati Tags: ,,
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in