Programming

Operator for comparing strings in ABAP/4


Operator     Description
CO Contains Only
CN Contains Not Only
CA Contains Any
NA Contains Not Any
CS Contains String
NS Contains No String
CP Matches Pattern
NP Not Match Pattern

How to Find the Number of Entries of Internal Table in ABAP/4

We can find out how many entries of internal table by apply statement "DESCRIBE".

Example


DATA: it_tab TYPE TABLE OF BKPF WITH HEADER LINE,
      tot_lines TYPE i.
...
...
DESCRIBE TABLE it_tab LINES tot_lines.

Or you can apply statement ’LOOP AT’ and count it.

Example


LOOP AT it_tab.
tot_lines = tot_lines + 1.
ENDLOOP.

Move & Move-Corresponding in ABAP/4


DATA: BEGIN OF wa_tab1,
fld1(4) VALUE ’FLD1’,
fld2(4) VALUE ’FLD2’,
fld3(4) VALUE ’FLD3’,
fld4(4) VALUE ’FLD4’,
fld5(4) VALUE ’FLD5’,
END OF wa_tab1,
BEGIN OF wa_tab2,
fld1(4),
fld2(4),
fld3(4),
fld4(4),
END OF wa_tab2.
************* Move Corresponding *************
MOVE-CORRESPONDING wa_tab1 to wa_tab2.
************ End Move Corresponding **********
******************** Move ********************
MOVE: wa_tab1-fld1 to wa_tab2-fld1,
wa_tab1-fld2 to wa_tab2-fld2,
wa_tab1-fld3 to wa_tab2-fld3,
wa_tab1-fld4 to wa_tab2-fld4.
****************** End Move ******************
In above example, the result of MOVE and MOVE-CORRESPONDING is same.

System Field When Generate ABAP/4 Report (Often to use)

Field     Description
COLNO the current column
LINNO the current line

FORMAT Options of Format Statement in ABAP/4

Option          Description
COLOR n Specific background colors
INTENSIFIED Intensified the background color
INVERSE Swap background and foreground color
HOTSPOT Effect when mouse pointer and click
INPUT Generate input field
RESET Reset formats. The format will be backed to default format.

How to Insert Page Break in ABAP/4 Report

You can apply statement "NEW-PAGE" for insert page break in your report.

Syntax


NEW-PAGE [NO-TITLE or WITH-TITLE] [NO-HEADING or WITH-HEADING].

Example


REPORT ZTEST01.
TABLES: SPFLI.
PARAMETERS: p_carrid LIKE SPFLI-CARRID.
START-OF-SELECTION.
...
...
...
END-OF-SELECTION.
...
...
NEW-PAGE.
...
...