Escolar Documentos
Profissional Documentos
Cultura Documentos
Logistic area
Table of Contents
Overview
ABAP dictionary
Debugger
Enhancements
Examples (Q&A)
Central Database
(Storage of all data)
Access to Dataase:
(Read / Write data)
Database
Input / Output
of data to users
Processing of data
Application using application logic
Presentation of the
processed data to
Presentation the user
ABAP Workbench
Each of the repository objects can be edited using a respective tool. For our convenience we can access
all these tools in The Object navigator, Transaction SE80.
Roland Obcescu | IBM RO GDC | 04.06.2015 Internal use only Page 6
IBM Romania
Table of Contents
Overview
ABAP dictionary
Debugger
Enhancements
Examples (Q&A)
Type to which
Name of the component is
component assigned
Tables
Table of Contents
Overview
ABAP dictionary
Debugger
Enhancements
Examples (Q&A)
Internal Tables
Internal table is a data object to keep identically structured data records at runtime.
ABAP internal tables are STORED IN MEMORY not on the DATABASE.
Individual records are known as table rows or table entries.
Used in retaining data from database tables or sequential files for future processing.
DATA gt_makt1 TYPE makt OCCURS 10.
DATA gt_makt2 TYPE TABLE OF makt.
DATA gt_mara_b1 TYPE mara_b OCCURS 10.
DATA gt_mara_b2 TYPE TABLE OF mara_b.
Conditional instructions
IF log_exp1. CASE operand.
[statement_block1] [WHEN operand1 [OR operand2 [...]]].
[ELSEIF log_exp2. [statement_block1]]
[statement_block2]] [WHEN OTHERS.
[ELSE. [statement_blockn]]
[statement_blockn]] ENDCASE.
ENDIF.
CASE sy-ucomm.
lv_time = sy-uzeit.
WHEN 'BACK'.
LEAVE TO SCREEN 100.
IF lv_time < '120000'.
WHEN 'CANCEL'.
WRITE: / lv_time, 'AM' .
LEAVE SCREEN.
ELSEIF lv_time > '120000' AND
WHEN 'EXIT'.
lv_time < '240000'.
LEAVE PROGRAM.
lv_time = lv_time - 12 * 3600.
WHEN OTHERS.
WRITE: / lv_time, 'PM' .
MESSAGE '...' TYPE 'E'.
ELSE.
ENDCASE.
WRITE / 'High Noon'.
ENDIF.
Loops instructions
DO [n TIMES]. WHILE log_exp
[statement_block] [statement_block]
ENDDO. ENDWHILE.
DATA square TYPE i. DATA text TYPE string
VALUE `One Two Three`.
DO 10 TIMES.
square = sy-index ** 2. WHILE sy-subrc = 0.
WRITE: / sy-index, square. REPLACE ` ` IN text WITH `-`.
ENDDO. ENDWHILE.
SELECT instruction
SELECT result
FROM source
INTO|APPENDING target
[[FOR ALL ENTRIES IN itab] WHERE sql_cond]
[ORDER BY sort_key].
[ENDSELECT].
SELECT s~carrid s~carrname p~connid
INTO CORRESPONDING FIELDS OF TABLE itab
FROM scarr AS s
LEFT OUTER JOIN spfli AS p ON s~carrid = p~carrid
AND p~cityfrom = p_cityfr.
SELECT carrid connid fldate
FROM sflight
INTO CORRESPONDING FIELDS OF TABLE result_tab
FOR ALL ENTRIES IN entry_tab
WHERE carrid = entry_tab-carrid
AND connid = entry_tab-connid
ORDER BY carrid DESCENDING.
SY-SUBRC Meaning
0 The SELECT statement sets sy-subrc to 0 for every value passed to an ABAP data object.
The SELECT statement also sets sy-subrc to 0 before it exits a SELECT loop with ENDSELECT if at least one row was passed.
4 The SELECT statement sets sy-subrc to 4 if the result set is empty, that is, if no data was found in the database.
Forms
Forms are used to group a set of instructions in order to execute it multiple times
* form definition
FORM fill_table USING wa TYPE any
CHANGING ptab TYPE INDEX TABLE.
APPEND wa TO ptab.
ENDFORM. "fill_table
* in main program
PERFORM fill_table USING lw_mseg
CHANGING lt_mseg.
Function modules
Function modules are procedures that are defined in special ABAP programs only, so-called function
groups, but can be called from all ABAP programs. Function groups act as containers for function
modules that logically belong together.
Examples (use transaction code SE37)
MB_READ_T156
/SPE/GET_T156
RV_LIPS_PSTYV_DETERMINE
Questions
Coffee break
Table of Contents
Overview
ABAP dictionary
Debugger
Enhancements
Examples (Q&A)
A Session breakpoint
Session External is valid as long the
breakpoint breakpoint user stays connected
An External breakpoint
has time validity (even
if the user reconnects)
Breakpoint can be se
dynamically
Function Description
Table of Contents
Overview
ABAP dictionary
Debugger
Enhancements
Examples (Q&A)
Enhancements
The R/3 enhancement concept allows you to add your own functionality to SAPs standard business
applications without having to modify the original applications
Advantages
They do not affect standard SAP source code
They do not affect software updates and upgrades
There are multiple types of enhancements, mainly in logistics are used the following:
User exit (transaction SMOD/CMOD) example MBCF0002
Function module attached can be found in the program as CALL CUSTOMER-FUNCTION
Called in
program
SAPMM07M
Table of Contents
Overview
ABAP dictionary
Debugger
Enhancements
Examples (Q&A)