ABAP/4
How to Generate Value Request by ABAP/4
We can use function module "F4IF_INT_TABLE_VALUE_REQUEST" for generate value request by ABAP report.
Example
*** Screen Flow ***
PROCESS ON VALUE-REQUEST.
FIELD scn_kokrs MODULE create_value_request.
*** ABAP Editor ***
MODULE create_value_request INPUT.
DATA: BEGIN OF itab_request OCCURS 0,
kokrs LIKE TKA01-KOKRS,
bezei LIKE TKA01-BEZEI,
END OF itab_request.
SELECT KOKRS BEZEI
FROM TK
- thitima's blog
- Add new comment
- Read more
- 2582 reads
How to Read Table Dynamically in ABAP/4
About statement "READ TABLE", we can generate code for read key dynamic as below:
DATA: BEGIN OF itab OCCURS 0,
fld1(2),
fld2(2),
fld3(10),
fld4 TYPE i,
END OF itab,
wa_tab LIKE itab,
gv_key1(4) TYPE C VALUE ’FLD1’,
gv_key2(4) TYPE C VALUE ’FLD2’.
...
...
...
READ TABLE itab INTO wa_tab
WITH KEY (gv_key1) = ’AA’
(gv_key2) = ’BB’.
- thitima's blog
- Add new comment
- 1115 reads
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
- thitima's blog
- Add new comment
- 1228 reads
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.
- thitima's blog
- Add new comment
- 1680 reads
Move & Move-Corresponding in ABAP/4
In above example, the result of MOVE and MOVE-CORRESPONDING is same.
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 ******************
- thitima's blog
- Add new comment
- Read more
- 4690 reads
System Field When Generate ABAP/4 Report (Often to use)
Field Description
COLNO the current column
LINNO the current line
- thitima's blog
- Add new comment
- Read more
- 692 reads
Recent comments
2 years 30 weeks ago
2 years 35 weeks ago
2 years 36 weeks ago
2 years 36 weeks ago
2 years 36 weeks ago
2 years 39 weeks ago
2 years 39 weeks ago
2 years 39 weeks ago
2 years 39 weeks ago
2 years 39 weeks ago