ABAP/4 Training

Session 1,2, 3 & 4 DAY - 1

What Does SAP R/3 Do?

Materials Management Production Planning

Finance and Controlling

Sales and Distribution

Human Resources

SAP R/3 Basis Software Is the “Middleware” of the R/3 System
R/3 Basis components (“middleware”)

External Computing environment

UNIX

Request for computing resources

The R/3 Basis System
Materials Management Production Planning Sales and Distribution Finance and Controlling

Human Resources

SAP R/3 Basis Software Hardware and Operating System

Logical Groupings or “Layers” of
The Presentation Layer
Those SAP R/3 software components SAP R/3 Components that specialize in interacting with end-users form the Presentation Layer.

The Application Layer
Those SAP R/3 software components that specialize in processing business applications form the Application Layer.

The Database Layer
Those SAP R/3 software components that specialize in the management , storage and retrieval of data form the Database Layer

Three-Tiered Client/Server Communication Architecture “Logical Layers” Communication
The Presentation Layer The Presentation Layer collects user input and collects user input and creates process requests. creates process requests. The Application Layer The Application Layer uses the application logic of uses the application logic of SAP programs to collect and SAP programs to collect and process the process requests. process the process requests. The Database Layer The Database Layer stores and retrieves all data. stores and retrieves all data.

Physical Distribution of R/3’s Logical Layers
Presentation Layer components Application Layer components Database Layer components

reside in:

reside in:

reside in:

Presentation servers: Presentation servers: Systems capable of Systems capable of providing a providing a graphical interface. graphical interface.

Application servers: Application servers: Specialized systems Specialized systems multiple CPUs and multiple CPUs and vast amounts of RAM. vast amounts of RAM.

Database servers: Database servers: Specialized systems Specialized systems with fast and large with fast and large hard drives. hard drives.

Client/Server Defined PC Software program SAP Client Server Software Presentation Layer Application Layer MS Excel components Database Layer A B C .

. The Database Layer components are installed on one high-end database server.Physical Distribution of R/3’s Three Layered Client/Server Presentation Layer components are installed across many PCs. Architecture The Application Layer components are installed across one or more high-end servers.

R/3’s Client/Server Configurations Centralistic Centralistic Computer “A” Presentation Layer Application Layer Database Layer .

Computer “A” Computer “A-1” Computer “A-2” Computer “A-n” R/3’s Client/Server Configurations Presentation Distributed Presentation Distributed Computer “B” Presentation Layer Application Layer Database Layer .

Computer “A” Computer “A-1” Computer “A-2” Computer “A-n” R/3’s Client/Server Configurations Client/Server Two-tier Client/Server Two-tier Computer “B” Presentation Layer Application Layer Database Layer .

Computer “A” Computer “A” Computer “A” Computer “A” R/3’s Client/Server Configurations Client/Server Three-tier Client/Server Three-tier Computer “B” Computer “B” Computer “B” Computer “C” Presentation Layer Application Layer Database Layer .

Cooperative Client/Server Configuration Computer “A” Computer “A-1” Computer “A-2” Computer “A-n” Multi-tier. cooperative Client/Server Multi-tier.R/3’s Multi-Tier. cooperative Client/Server Computer “B” Computer “B-1” Computer “B-n” Computer “C” Computer “C-n” Presentation Layer Application Layer Database Layer .

Cooperative Client/Server Configuration Computer “A” Computer “A-1” Computer “A-2” Computer “A-n” Computer “B-1” Computer “B-1” Computer “C” Computer “B-n” Computer “C-n” Presentation Layer Application Layer Database Layer .R/3’s Multi-Tier.

SAPGUI: The Presentation Layer Software Example components of SAPGUI: • SAP Business Graphics • SAP Hierarchy Graphics • SAP Pushbutton Graphics • SAP Statistical Graphics • SAP Gantt Chart Graphics • SAP HPGL Display • SAP Network Graphics Presentation Layer Software: SAPGUI • SAP Portfolio Graphics • .

Exchanging Data between the Presentation and Application Layers 1 to 2 Kilobytes Presentation Layer Software: SAPGUI Application Layer Software: R/3 Runtime System .

Business Transactions Business Transaction FD02 “Change customer information” Screen 1 Screen 2 Complete transaction ? .

… Prepare to “ROLLBACK” if necessary .Business Transactions and the R/3 Runtime System Screen 2 Screen 1 R/3 Runtime System … LOCK business object “XYZ” then.

2.3&4 .DAY .2 Session 1.

Each process a program. to system resources.Processes Process A Process is essentially A Process is essentially a program. . Each process has memory and access has memory and access to system resources.

it’s process requests.Threads A Thread is the actual component A Thread is the actual component of a process that is executing at of a process that is executing at one time. Process Thread 1 Thread 1 Thread 2 Thread 2 Thread 3 Thread 3 . Each thread is capable one time. Each thread is capable of completing a different task that of completing a different task that it’s process requests.

The Kernel Process Process Process OS Kernel OS Kernel CPU .

access to the OS kernel.SAP Dialog Work Processes and the Dispatcher Update Enqueue Spool Background SAP Dispatcher SAP Dispatcher OS Kernel OS Kernel CPU A component of the SAP A component of the SAP Kernel called the Dispatcher Kernel called the Dispatcher must manage process must manage process access to the OS kernel. .

The R/3 Runtime System Dispatcher Dialog Update Spool Background Application Server “A” Dispatcher Dialog Update Spool Background Application Server “B” Dispatcher Dialog Update Enqueue Spool Background Database Server .

Dispatcher USER 1 USER 1 USER 3 USER 3 Dispatcher USER 2 USER 2 USER 4 USER 4 .

Work Processes Dialog Update Enqueue Spool Background or Batch .

Dispatcher in Action Presentation level Various types of processing requests Application level Dispatcher Request queues Dialog Update Enqueue Spool Batch .

Inside the R/3 Runtime System Various types of processing requests Process Request User: Fred Jones Activity: Read data XYZ Screen: 1 Dispatcher Request queues .

The Code Behind R/3 SAP R/3 Transactions are written in ABAP/4. SAP’s 4th generation interpreted programming language. Dispatcher Dialog Update Enqueue Spool SAP R/3 Runtime System is written in ANSI-C Background or Batch .

Inside the R/3 Runtime System Task Handler DYNPRO Processor ABAP/4 Processor memory Work Process .

Inside the R/3 Runtime System Various types of processing requests Process Request Read data “XYZ” or Write data “XYZ” Request queues Dispatcher .

. I only want to include data in my report that pertains to orders that were filled within the last 2 months. Screen 2. Screen 3. I want to run a customer report for customer 00017. But only for product XYZ.Reading data in the R/3 System Transaction Screen 1 Screen 1. Screen 2 Screen n.

Process Request 3 Dispatcher Request queues .Reading data in the R/3 System Transaction Screen 1 Process Request 1 Screen 2 Process Request 2 Screen n.

R/3 Buffers Process Requests Dialog Task Handler Task Handler DYNP ABAP/4 Task Handler DYNP ABAP/4 Requested data retrieved from the R/3 Buffers DYNP ABAP/4 memory AVA BLE ILA USY B USY B memory memory Dialog .Reading data in the R/3 System Shared Memory Segments Dispatcher Request Queues Dialog Transaction Screen 1 Screen 2 Screen n.

The data retrieved for the last screen is stored in extended memory in an area called the user context. memory Extended Memory Dispatcher .Shared Memory Segments Reading data in the R/3 System R/3 Buffers Task Handler DYNP ABAP/4 Request Queues Extended Memory Manager Dialog A ILAB VA The process request for the next screen is L E copied down.

SAP Logical Unit of Work SAP Logical Unit of Work (SAPLUW) Update Transaction Screen 1 Screen 2 Screen n. + .

Distribution of a Business Transaction Across Multiple SAP Logical Unit of Work (SAPLUW) WPs Update Transaction Screen 1 Handled by: Screen 2 Handled by: Screen n. Handled by: + Handled by: Dialog A Dialog B Dialog C Update .

Write Write Write VBLOG . Database Commit Dialog C + The Online Phase of an update ends here.Asynchronous Updating: SAP Logical Unit of Work (SAPLUW) The Online Phase Update Transaction Screen 1 Database Commit Dialog A Screen 2 Database Commit Dialog B Screen n.

VBLOG .Asynchronous Updating: SAP Logical Unit of Work (SAPLUW) The Posting Phase Update Transaction Screen 1 Database Commit Dialog A Screen 2 Database Commit Dialog B Screen n. Database Commit Dialog C + Read Update The Posting Phase of an update starts here.

VBLOG records Dialog A VBLOG Posting Routine Data U1 Screen 1 of 3 SAPLUW Dialog B Posting Routine Data U2 Screen 2 of 3 Dialog C Posting Routine Data U2 Screen 3 of 3 .

Errors during Update Phase .

ROLLBACK Dialog C Posting Routine Data U2 Screen 2 of 3 ..Handling of Error Situations (U1 Termination) Dialog A Update VBLOG Posting Routine Data U1 Screen 1 of 3 .ROLLBACK SAPLUW Dialog B Posting Routine Data U1 Screen 2 of 3 U 1 ...Ignored .

Handling of Error Situations Update (U2 Termination) Dialog A VBLOG Posting Routine Data U1 Screen 1 of 3 SAPLUW Dialog B Posting Routine Data U2 Screen 2 of 3 U 2 Dialog C Posting Routine Data U2 Screen 2 of 3 Continue .

The Enqueue Work Process Dialog Lock Request Lock Request Message Service Enqueue Lock Table .

.The Background Work Process Background Background Job A Step # 1 Step # 2 Defining a background job. Defining a background job.

Print O/S Spooler . print queue management.The Spool Work Process The Operating System The Operating System spooler assumes the spooler assumes the print queue management.

SAP Instance SAP Instance An SAP Instance Work Processes Work Processes SAP Dispatcher SAP Dispatcher Operating Operating System System TCP/IP Software TCP/IP Software .

SAP Central Instance SAP Central Instance Work Processes Work Processes An SAP Central Instance Enqueque Work Process Peripheral Instance “A” SAP Dispatcher SAP Dispatcher Operating Operating System System TCP/IP TCP/IP Software Software Message Service Peripheral Instance “B” .

SAP Instance Work Processes An SAP System SAP Instance Work Processes SAP Dispatcher TCP/IP Software Operating System TCP/IP Software SAP Dispatcher Operating System Work Processes Enqueque Work Process DATABASE SAP Central Instance SAP Dispatcher Message Service Operating System TCP/IP Software .

SAP Servers SAP Server/ Instance 8 Dialog Work Processes 3 Background Work Processes 1 Spool Work Processes SAP Server/ Instance 3 Dialog Work Processes 8 Background Work Processes 1 Spool Work Processes .

The GTC Training System Database Louis Oracle • • • • • • • Central Instance Louis 2 Dialog 2 Background 3 Update 1 Enqueue 1 Spool Msg Service Gateway Instance LOC A Julio • 8 Dialog • 3 Background • 1 Spool Instance LOC B Clint • 8 Dialog • 3 Background • 1 Spool .

3 .ABAP/4 Dictionary Session – 1.2.3 & 4 DAY .

ABAP Dictionary .

Lock objects are used to synchronize access to the same data by more than one user. A view on the database can then be created from this structure.What Information is Stored in the ABAP Dictionary? • Tables are defined in the ABAP Dictionary independently of the database. Function modules that can be used in application programs are generated from the definition of a lock object in the ABAP Dictionary. Changes to a type automatically take effect in all the programs usin the type. The documentation about the field is created for a data element that describes the meaning of the contents of a table field. Views are logical views on more than one table. The structure of the view is defined in the ABAP Dictionary. The ABAP Dictionary also contains the information displayed with the F1 and F4 help for a field in an input template. The list of possible input values that appears for the input help is created by a foreign key or a search help • • • • • . A domain defines the value range of all table fields and structure components that refer to this domain. Types are used in ABAP program. A table having the same structure is then created from this table definition in the underlying database. Different fields having the same technical type can be combined in domains. The structure of a type can be defined globally in ABAP programs.

Tables .

Views .

Types User-defined data types can be stored for all programs in the ABAP Dictionary. that is they refer to a type Table types: A table type describes the structure and functional attributes of an internal table . Structures (structured types): A structure consists of components that also have a type. These user-defined types provide the same functionality as the local types that can be defined in ABAP programs with TYPES • • • Data elements (elementary types and reference types).

Domains .

• Collective search helps combine several elementary search helps. The elementary search help must define where the data of the hit list should be read from (selection method). how the exchange of values between the screen template and selection method is implemented (interface of the search help) and how the online input help should be defined (online behavior of the search help).Search Helps • • The input help (F4 help) is a standard function of the R/3 System. There are two types of search help: • Elementary search helps describe a search path. The user can display the list of all possible input values for a screen field with the input help. . A collective search help thus can offer several alternative search paths.

Exclusive but not cumulative Function Modules for Lock Requests: Enqueue_<lock object name> Dequeue_<lock object name> . • Exclusive lock. When tables are selected. Further tables (secondary tables) can also be added using foreign key relationships Lock Arguments: • The lock argument of a table in the lock object consists of the key fields of the table.Lock Objects The R/3 System synchronizes simultaneous access of several users to the same data records with a lock mechanism. Shared lock. one table (the primary table) is first selected. Structure of a Lock Object: • The tables in which data records should be locked with a lock request are defined in a lock object together with their key fields. Lock Mode: • The lock mode controls whether several users can access data records at the same time.

Pooled and Cluster Tables .

ABAP/4 Workbench .

ABAP Programming Techniques DAY.2.4 Session –1.3 & 4 .

ABAP Data Types .

.. WHILE.. AT USER-COMMAND • Defining keywords. Ex: AT SELECTION SCREEN. CASE ………contd . Ex: FORM . START-OF-SELECTION.. Control Statements • Controls the flow of an ABAP program Ex: IF. • The modularization keywords can be further divided into: • Event Keywords. Ex: TYPES.. ENDFORM..ABAP Statements Declarative Statements • These statements define data types or declare data objects which are used by the other statements in a program or routine. ENDFUNCTION. DATA. TABLES Modularization Statements • These statements define the processing blocks in an ABAP program.. MODULE .. FUNCTION . The collected declarative statements in a program or routine make up its declaration part. ENDMODULE.

COMPUTE etc Database Statements • These statements use the database interface to access the tables in the central database system. SUBMIT.Call Statements • Use to call processing blocks in the same ABAP program or in a different program Ex: PERFORM. MOVE. Ex: WRITE. . ADD. LEAVE TO Operational Statements • These keywords process the data that you have defined using declarative statements. There are two kinds of database statement in ABAP: Open SQL and Native SQL. CALL. SET USER-COMMAND.

. • Assigning Values between Components of Structures MOVE-CORRESPONDING <struct1> TO <struct2>.WRITE <f1> TO <f2> • Specifying the Source field Dynamically Ex: WRITE (<f>) TO <g>. • Assigning Values with WRITE TO Ex:.MOVE <f1> TO <f2> it is equivalent to <f2> = <f1>. • Resetting Values to Their Initial Value To reset a variable <f> to the appropriate initial value for its type.Processing Data • Assigning Values Ex:. use the statement Ex: CLEAR <f>.

Ex:. COMPUTE is optional.Numerical Operations • To assign the result of a mathematical calculation to a variable. use the COMPUTE statement or the assignment operator (=).COMPUTE <n> = <expression>. you can also write as follows: <n> = <expression> Arithmetic Calculations: • . Here.

from Arithmetic Operations Arithmetic Calculations Using Structures • • • • • you can also perform arithmetic operations between the components of structures using the following statements: ADD-CORRESPONDING SUBTRACT-CORRESPONDING MULTIPLY-CORRESPONDING DIVIDE-CORRESPONDING .Contd.

[COMPUTE] <n> = STRLEN( <c> ). TRANSLATE <c> TO LOWER CASE.Processing Character Strings • • Shifting Field Contents SHIFT <c> [BY <n> PLACES] [<mode>]. use the REPLACE statement. To replace a string in a field with a different string. TRANSLATE <c> USING <r>.Contd • • • • . TRANSLATE <c> TO UPPER CASE. The ABAP function STRLEN returns the length of a string up to the last character that is not a space. The OVERLAY statement overlays one string with another: OVERLAY <c1> WITH <c2> [ONLY <str>]. To search a character field for a particular pattern. use the SEARCH statement as follows: SEARCH <c> FOR <str> <options>. …………. REPLACE <str1> WITH <str2> INTO <c> [LENGTH <l>]. Converting to Upper or Lower case.

By specifying an offset +<o> and a length (<l>) directly after the field name <f>. use the SPLIT statement as follows: SPLIT <c> AT <del> INTO <c1> ... you can address the part of the field starting at position <o>+1 with length <l> .• • • • • The CONDENSE statement deletes redundant spaces from a string: CONDENSE <c> [NO-GAPS] The CONCATENATE statement combines two or more separate strings into one. <cn> Assigning Parts of Character Strings: The following variant of the MOVE statement works only with type C fields: MOVE <c1> TO <c2> PERCENTAGE <p> [RIGHT] Processing Sections of Strings: <f>[+<o>][(<l>)] here. CONCATENATE <c1> . <cn> INTO <c> [SEPARATED BY <s>] To split a character string into two or more smaller strings...

ELSE.. <statement block> ELSEIF <condition2> <statement block>..Controlling the Program Flow • Branching Conditionally • Loops Branching Conditionally: • The IF Control Structure IF <condition1>.. ELSEIF <condition3>. <statement block> ENDIF ………………….Contd .. <statement block> .

<statement block> ENDCASE.]... .[OR <f 22> OR ... WHEN <f11> [OR <f 12> OR ... <statement block> WHEN . WHEN OTHERS. .] <Statement block> WHEN <f31> [OR <f 32> OR ..• The CASE Control Structure CASE <f>....... <Statement block> WHEN <f21>.].

<statement block> ENDWHILE. <Statement block> ENDDO. .LOOPS • Unconditional Loops • Conditional loops Unconditional Loops: DO [<n> TIMES] [VARYING <f> FROM <f1> NEXT <f 2>]. Conditional loops: WHILE <condition> [VARY <f> FROM <f1> NEXT <f 2>].

use the CHECK <condition> statement • Exiting a Loop To terminate an entire loop immediately and unconditionally. use the CONTINUE statement • Terminating a Loop Pass Conditionally To terminate a single loop pass conditionally. use the EXIT statement .Terminating Loops • Terminating a Loop Pass Unconditionally To terminate a single loop pass immediately and unconditionally.

Internal Tables • Dynamic sequential dataset in which all records have the same structure and a key • Part of the ABAP type concept • In ABAP. key. internal tables fulfill the function of arrays • Internal tables can exist both as data types and as data objects Internal Tables as Data Types • The data type of an internal table is fully specified by its line type. and table type .

Table Types .

HASHED TABLE • <linetype> • <key> UNIQUE or NON-UNIQUE • INITIAL SIZE <n> Initial amount of main memory assigned to an internal table • WITH HEADER LINE It declares an extra data object with the same name and line type as the internal table . • <itab> Name of the Internal Table • <tabkind> may be STANDARD TABLE. SORTED TABLE.Declaring Internal Tables: DATA <itab> TYPE|LIKE <tabkind> OF <linetype> WITH <key> [INITIAL SIZE <n>][WITH HEADER LINE].

Program Modularization .

Program Modularization • Subroutines • Function Modules .

USING and CHANGING are equivalent. ] [CHANGING.Contd ..... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>].  To avoid the value of an actual parameter being changed automatically. ].... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>].. ENDFORM.. you must pass it by value. ………………... . • USING and CHANGING define the parameter interface • Protecting Global Data Objects Against Change use LOCAL <F> • Parameters passed by Reference  For calling by reference.Subroutines • A subroutine is a block of code introduced by FORM and concluded by ENDFORM FORM <subr> [USING .

.... VALUE(<pi>) [TYPE <t>|LIKE <f>] ...• Input Parameters That Pass Values FORM <subr> USING ... <pi>.. ] [IF FOUND]...... <pi>. <pi>... • Terminating Subroutines Use EXIT to terminate a subroutine unconditionally Use CHECK to terminate a subroutine conditionally • Calling Subroutines PERFORM. ] [IF FOUND].. VALUE(<pi>) [TYPE <t>|LIKE <f>] .... • Specifying Subroutines Dynamically PERFORM (<fsubr>)[IN PROGRAM (<fprog>)][USING ..... <pi>. ] [CHANGING........ • Output Parameters That Pass Values FORM <subr> CHANGING ... ] [CHANGING. ]. ] [CHANGING. [USING . • Calling External Subroutines PERFORM <subr>(<prog>) [USING . <pi>. <pi>...

• Export parameters • Changing parameters • Tables parameters . Play an important role in database updates and in remote communications Function modules supports exception handling Attributes of Function Modules: • Documentation • Import parameters.Function Module • • • • • Function modules are procedures that are defined in function groups Function groups act as containers for function modules that logically belong together You create function groups and function modules in the ABAP Workbench using the Function Builder(SE37).

f n = a n] [IMPORTING f1 = a 1.. e n = r n [ERROR_MESSAGE = r E] [OTHERS = ro]]. f n = a n] [EXCEPTIONS e1 = r 1. f n = a n] [CHANGING f1 = a 1..To Call A Function Module: CALL FUNCTION <module> [EXPORTING f1 = a 1......... f n = a n] [TABLES f1 = a 1. ......

.

5 .3 & 4 DAY .Lists & ABAP/4 Query Session –1.2.

• Formatting Options: WRITE .. Formatting options for all data types .Lists • Lists can be created using ABAP statements • The basic ABAP statement for displaying data on the screen is WRITE.. <f> <option>.. Syntax: WRITE <F> • Positioning WRITE output on the list: WRITE AT [/][<pos>][(<len>)] <f>.

• Blank Lines and Drawing Lines Horizontal Lines: ULINE [AT [/][<pos>][(<len>)]] Vertical Lines: WRITE [AT [/][<pos>]] SY-VLINE. SKIP TO LINE <n> • Displaying Field Contents as CheckBoxes WRITE <f> AS CHECKBOX . or WRITE [AT [/][<pos>]] '|'. Blank Lines: SKIP [<n>].• Displaying Symbols and Icons on the list WRITE <symbol-name> AS SYMBOL. WRITE <icon-name> AS ICON.

event keyword TOP-OFPAGE • To Suppress the Standard page header.Complex Lists • To layout a page header individually. SET BLANK LINES ON|OFF • Determining the Page Length: Ex: REPORT <rep> LINE-COUNT <length>[(<n>)] • The system field SY-LINCT contains the current number of lines per page . • Creating Blank Lines: SKIP [<n>]. use the NO STANDARD PAGE HEADING Ex: REPORT <rep> NO STANDARD PAGE HEADING • Determining the List Width: REPORT <rep> LINE-SIZE <width>. • The system field SY-LINSZ contains the current line width.

Page Length of Individual pages: • NEW-PAGE LINE-COUNT <length> Formatting Output: • FORMAT <option1> [ON|OFF] <option 2> [ON|OFF] . Ex: RESERVE <n> LINES Standard Page Headers of Individual Pages: • NEW-PAGE [NO-TITLE|WITH-TITLE] [NO-HEADING|WITHHEADING]... use the RESERVE statement.Defining a Page Footer: • To define a page footer.. • FORMAT COLOR <n> [ON] INTENSIFIED [ON|OFF] INVERSE [ON|OFF] • FORMAT INPUT [ON|OFF] . • To program page breaks depending on the number of empty lines left on a page. use the END-OF-PAGE event Programming Page Breaks: • To program unconditional page breaks. use the NEW-PAGE statement.

. <g9>] [OF PROGRAM <prog>]. • AT PF<nn> (obsolete) • AT LINE-SELECTION • AT USER-COMMAND With one ABAP program.. depending upon the Function Code triggered by the user. • SET TITLEBAR <ttl> [WITH <g1> . you can maintain one basic list and up to 20 detail lists Page Headers for Detail Lists: TOP-OF-PAGE DURING LINE-SELECTION Dialog Status for Lists: • SET PF-STATUS <stat> [EXCLUDING <f>|<itab>] [OF PROGRAM <prog>] [IMMEDIATELY].Interactive Lists Following are the list events which are called..

System Field for Details Lists: .• You can display a list in a dialog box instead of on the full screen using the WINDOW statement: WINDOW STARTING AT <left> <upper> [ENDING AT <right> <lower>].

. use these statements: • HIDE <f> • • • GET CURSOR FIELD <f> [OFFSET <off>] [LINE <lin>] [VALUE <val>] [LENGTH <len>] READ LINE <lin> [INDEX <idx>] [FIELD VALUE <f1> [INTO <g 1>] . . <f n> [INTO <g n>]] [OF CURRENT PAGE|OF PAGE <p>] READ CURRENT LINE [FIELD VALUE <f1> [INTO <g 1>] ..Passing Data from Lists to Programs • • Automatic Data Transfer Program controlled Data Transfer Automatic Data Transfer: • Automatic data transfer happens by means of the system fields that are filled by the system for each interactive event • SY-LISEL: contains the contents of the selected line.].. Program controlled Data Transfer: • To pass individual output fields or additional information from a line to the corresponding processing block during an interactive event..

<options> are LINE-SIZE. Determining the Attributes of Lists: • • • To retrieve the number of lines or pages of a list. FIRST-LINE. To retrieve the attributes of a certain page. Modifying List Lines: • MODIFY LINE <n> [INDEX <idx>|OF CURRENT PAGE|OF PAGE <p> [<modifications>]. ENDLINES. . use: DESCRIBE LIST LINE <lin> PAGE <pag> [INDEX <idx>]. TOP-LINES. use: DESCRIBE LIST NUMBER OF LINES|PAGES <n> [INDEX <idx>]. HEAD-LINES. To retrieve the page number for a certain line number. TITTLE-LINES.• GET CURSOR LINE <lin> [OFFSET <off>] [VALUE <val>] [LENGTH <len>]. use: DESCRIBE LIST PAGE <pag> [INDEX <idx>] [<options>] where. LINE-COUNT. LINES.

use the statement CALL SCREEN <nnnn>. .Lists and Screens Starting Lists from Screen Processing: LEAVE TO LIST-PROCESSING [AND RETURN TO SCREEN <nnnn>]. Calling Screens from List Processing: To call a screen from list processing.

SY-MSGNO... you need to specify the message class and message number Ex: MESSAGE-ID <id>. SY-MSGTY. RAISING <exc> SY-MSGID..Messages • Messages are stored in Tables T100 • Maintain in Transaction SE91 or thru forward navigation • T100 has the following structure Language key Twenty-character message class Message number Message text (up to 72 characters) • To call a message from ABAP. • Message And Exception: you can use the RAISING addition in the MESSAGE statement to trigger exception: MESSAGE.. and SY-MSGV1 to SY-MSGV4 are the system fields which are filled automatically .

Message Types • .

Contd .Logical Database • Special ABAP programs that retrieve data and make it available to application program. • To call a LDB from ABAP Program use Function Module LDB_PROCESS Structure of LDB: • Structure • Selections • Database program Structure: • Based on the foreign key relationships between hierarchical tables • Defines the data view of the logical database. …………….

Selections: • • The selections define a selection screen. LDB Program contains following subroutines: • FORM LDB_PROCESS_INIT. FORM INIT. FORM PBO. FORM PAI. use the NODES or TABLES statement. which forms the user interface of the executable programs that use the logical database When the system generates the selection screen for an executable program. • The structure of the database program is a collection of special subroutines. FORM PUT_<node> etc . Database program: • The database program contains the ABAP statements used to read the data and pass it to the user of the logical database.

ABAP List Viewer • .

then the SAPGUI acts as a container for them.ABAP List Viewer • • • The R/3 System allows you to create custom controls using ABAP Objects. Since containers are themselves controls. they can be nested within one another . Every control exists in a container. If custom controls are to be included on the frontend.

SAP splitter container. SAP easy splitter container. SAP docking container. SAP dialog box container. .• SAP containers are divided into five groups: SAP custom container.

• .

SAP Query • The functional area determines the tables (and the fields of those tables) to which a query can refer • .

ranked lists: Require a numeric field.  Ÿ Statistics.6A.  You can use SAP Query to generate different types of lists (partial lists):  Ÿ Basic List: Single line or multiline. Data can be compressed. • You can combine different partial lists in a single query. you can also print the individual partial lists . Starting in 4. Multiline basic lists can be compressed.

• • Queries are created either in the standard area or the global area .

• .

.

.

QuickViewer .

QuickViewer • The QuickViewer allows you to define reports without having to program yourself. LDB. Table join . • DataSource may be Table. InfoSet.

.

.

3 & 4 DAY .Dialog Programming Session 1.6 .2.

Following are the available user Dialogs • Screens • Selection Screens • Lists • Messages .

Screen: • A Screen consists of the input/output mask and the flow logic • The screen flow logic is divided into the PBO. PAI event Screen Elements: • Screen Attributes • Screen Elements • Screen Fields • Screen Flow Logic Screen Attributes: • Program • Screen Number • Screen Type • Next Screen • Cursor Position • Screen Group • Hold Data .

Screen Elements: • Text Fields • Input/Output Fields • Dropdown list Boxes • Checkboxes • Radio Butttons • Push Buttons • Box • Subscreens • Table Controls • Tabstrip controls • Status Icons • OK_CODE .

Screen Flow Logic • Screen flow logic contains the procedural part of a screen • It can be created it in the flow logic editor • The language used to program screen flow logic is called as screen language • The screen flow logic is like an ABAP program in that it serves as a container for processing blocks • There are four event blocks. • PROCESS BEFORE OUTPUT • PROCESS AFTER INPUT • PROCESS ON HELP-REQUEST • PROCESS ON VALUE-REQUEST .

you can use the following keywords: .Within the event blocks.

Processing Screens • Triggering the PAI Event • Function Code is associated with the actions triggered • In each PAI event. an application toolbar) Processing Input/Output Fields: • Local Program Fields • Screen Fields with Dictionary Reference Finding Out the Cursor position: GET CURSOR FIELD <f> [OFFSET <off>] [LINE <lin>] [VALUE <val>] [LENGTH <len>]. . the function code is placed in the system field SYST-UCOMM (SY-UCOMM) • Function Code can be defined in the menu painter for GUI Status (menu bar. standard toolbar.

Calling ABAP Dialog Modules MODULE <mod> [OUTPUT/INPUT]. . ENDMODULE. ...

MODULE <mod1> ON CHAIN-INPUT|CHAIN-REQUEST...Controlling the Data Transfer: • The FIELD statement in the screen flow logic allows you to control the moment at which data is passed from screen fields to their corresponding ABAP fields. . <f 2>.Field <f> Calling Modules Unconditionally: • Type E function Codes: You can assign function type E to the function codes of both pushbuttons on the screen and of elements in the GUI status • Calling a PAI for type E Functions: MODULE <mod> AT EXIT-COMMAND Conditional Module Calls: A PAI module is only called when a certain condition applies FIELD <f> MODULE <mod> ON INPUT|REQUEST|*-INPUT.. MODULE <mod2> ON CHAIN-INPUT|CHAIN-REQUEST. ENDCHAIN.. FIELD: <g1>.. <g 2>. FIELD: <f1>. Condition for Multiple Screen Fields: CHAIN. Ex:.. ...

<v 2>. <g 2>.... .. ENDCHAIN. fixed values) Checking fields in the Screen Flow Logic: • Checking a Value List: Ex: FIELD <f> VALUES (<v1>. MODULE <mod1>. MODULE <mod2>..)... ...Input Checks Automatic Input Checks: • Mandatory Fields. FIELD: <f1>. <f 2>... The individual entries <vi> in the list can have the following format: • • [NOT] <val> [NOT] BETWEEN <val1> AND <val2> Input Checks in Dialog Modules: FIELD <f> MODULE <mod> (Checking a Single field) Checking a Set of fields: CHAIN. ABAP Dictionary Checks (FKey . FIELD: <g1>. Input format.

Field Help • • Data Element Documentation Data Element Supplement Documentation To display data element supplement documentation.. FIELD <f> MODULE <mod>. you must code the following screen flow logic in the POH event: PROCESS ON HELP-REQUEST.  HELP_OBJECT_SHOW_FOR_FIELD  HELP_OBJECT_SHOW .. • Calling Help Texts From Dialog Modules: PROCESS ON HELP-REQUEST.. . FIELD <f> [MODULE <mod>] WITH <num>. ..

FIELD <f> MODULE <mod>.). • Attaching a Search Help Input Help in Dialog Modules PROCESS ON VALUE-REQUEST... • F4IF_FIELD_VALUE_REQUEST • F4IF_INT_TABLE_VALUE_REQUEST .Input Help Input Help From ABAP Dictionary • Search Helps... Fixed Values Input Help on the Screen • Input Help in Flow Logic FIELD <f> VALUES (<val1>.. . Check Tables. <val 2>.

Modifying Screens Dynamically • • • Each screen field can be addressed using the system table SCREEN SCREEN is like an internal table with a header line LOOP AT SCREEN. ... . .. MODIFY SCREEN.. ENDLOOP.

Table Controls. INFO and ADD_STDINF Context Menus: • Context menu can be defined for any of the following screen elements: Input/Output fields. HIDE_FUNCTIONS etc. ADD_SEPARATOR. • LOAD_GUI_STATUS. ENDFORM. Subscreens. . use the function module ICON_CREATE • Import parameters for ICON_CREATE NAME. ADD_FUNCTION. ADD_MENU. • FORM ON_CTMENU_<context> USING <l_menu> TYPE REF TO cl_ctmenu. • To fill the field in your ABAP program.. TEXT. . Group Boxes.. • Context menus are objects of the global ABAP Objects class CL_CTMENU. Text Fields.Status Icons: • Status icons are display elements that you can use to represent the state of a program graphically • ABAP Dictionary type ICONS-TEXT is used to create the field. are the methods of cl_ctmenu.

CALL SUBSCREEN <area> INCLUDING [<prog>] <dynp>. ... CALL SUBSCREEN <area>.. . ..Subscreens • • • • • Define the subscreen area(s) on a screen Define suitable subscreen screens Include the subscreen screen in the subscreen area. PROCESS AFTER INPUT. PROCESS BEFORE OUTPUT.

which is displayed as the tab title. • CONTROLS <ctrl> TYPE TABSTRIP • <ctrl>-ACTIVETAB = <fcode> • Paging in the SAPgui • Paging on the Application Server . a tab page is a subscreen with a pushbutton assigned to it. Each tab page consists of a tab title and a page area • From a technical point of view.Tabstrip Controls • A tabstrip control is a screen object consisting of two or more pages.

ENDLOOP. .Table Controls • LOOP WITH CONTROL <table control>. Using Step Loops:• LOOP AT <internal-table> FROM <line1> and TO <line2> or CURSOR <scroll-var> .....<actions>.

. To Re-Use the elements of one selection screen in another using the following statement: SELECTION SCREEN INCLUDE BLOCKS <block> | PARAMETERS <p> | SELECT-OPTIONS <selcrit> | COMMENT <comm> | PUSH-BUTTON.<push>.Selection Screens ABAP Statement • PARAMETERS for single fields • SELECT-OPTIONS for complex selections • SELECTION-SCREEN for formatting the selection screen and defining user-specific selection screens • The standard selection screen of executable programs is predefined and has screen number 1000 ABAP Statement to Define User-defined selection screen: SELECTION-SCREEN BEGIN OF SCREEN <numb> [TITLE <title>] [AS WINDOW].. SELECTION-SCREEN END OF SCREEN <numb>. . .

.. LOWER CASE ........ Default Values for Parameters: PARAMETERS <p> . .Basic Form of Parameters PARAMETERS <p>[(<length>)] [TYPE <type>|LIKE <obj>] [DECIMALS <d>] Dynamic Dictionary Reference: PARAMETERS <p> LIKE (<name>) ... Reducing the Visible Length: PARAMETERS <p> ............... DEFAULT <f> . VISIBLE LENGTH <len> .. MEMORY ID <pid>... Allowing Parameters to Accept Upper and Lower Case: PARAMETERS <p> ...... SPA/GPA Parameters as Default Values: PARAMETERS <p> ....

NO-DISPLAY ...... Defining Radio Buttons: PARAMETERS <p> ....... ... Modifying Input Fields: PARAMETERS <p> ........... VALUE CHECK . Hiding Input Fields: PARAMETERS <p> ............ MODIF ID <key> ....... AS CHECKBOX .. Defining Checkboxes: PARAMETERS <p> ...... RADIOBUTTON GROUP <radi>. OBLIGATORY .....Defining Required Fields: PARAMETERS <p> ...... MATCHCODE OBJECT <search_help> Checking Input Values: PARAMETERS <p> TYPE <type> . Search Help for Parameters: PARAMETERS <p> ..

.. NO DATABASE SELECTION ...Select-options • SELECT-OPTIONS <seltab> for <f>....... Restricting Entry to Single Field: .. OPTION.... • <seltab> is a selection Table with following structure • The row type of a selection table is a structure that consists of the following four components: SIGN... Default Values for Selection Criteria: SELECT-OPTIONS <seltab> FOR <f> DEFAULT <g> [TO <h>] . NO-EXTENSION .. Restricting Entry to One Row: SELECT-OPTIONS <seltab> FOR <f> .. LOW and HIGH.. • SELECT-OPTIONS <seltab> FOR <f> .

. ..Formatting Selection Screens Blank Lines: SELECTION-SCREEN SKIP [<n>] Under Lines: SELECTION-SCREEN ULINE [[/]<pos(len)>] [MODIF ID <key>] Comments: SELECTION-SCREEN COMMENT [/]<pos(len)> <comm> [FOR FIELD <f>] [MODIF ID <key>]. SELECTION-SCREEN POSITION <pos> Block Of Elements: SELECTION-SCREEN BEGIN OF BLOCK <block> [WITH FRAME [TITLE <title>]] [NO INTERVALS].. SELECTION-SCREEN END OF BLOCK <block>.. SELECTION-SCREEN END OF LINE. . . Several Elements in a Single Line: SELECTION-SCREEN BEGIN OF LINE.

• System field SY-DYNNR contains the number of the selection screen that is currently active.Calling Selection Screens: • Calling Standard Selection Screens: It is called fully automatically between the INITIALIZATION and START-OF-SELECTION events • Calling User-Defined Selection Screens: Call from a Program: CALL SELECTION-SCREEN <numb> [STARTING AT <x1> <y 1>] [ENDING AT <x2> <y 2>]. .

PARAMETERS .. • When the user clicks the pushbutton on the selection screen.. <ucom> is entered in the UCOMM of the SSCRFIELDS interface work area. USERCOMMAND <ucom>. AS CHECKBOX | RADIOBUTTON GROUP . • You must use the TABLES statement to declare the SSCRFIELDS structure • The contents of the SSCRFIELDS-UCOMM field can be processed during the AT SELECTION-SCREEN event..User Actions on Selection Screens Pushbuttons on the Selection Screen: SELECTION SCREEN PUSHBUTTON [/]<pos(len)> <push> USER-COMMAND <ucom> [MODIF ID <key>].. .

Pushbuttons in the Application Toolbar: SELECTION-SCREEN FUNCTION KEY <i>. RS_EXTERNAL_SELSCREEN_STATUS Sets a GUI status defined in an external function group . • <i> must be between 1 and 5 • You must use the FUNCTXT_0<i> components of structure SSCRFIELDS for the individual pushbutton texts Changing the Standard GUI Status: RS_SET_SELSCREEN_STATUS Sets another GUI status defined in the same ABAP program. or deactivates functions of the standard GUI status.

• AT SELECTION-SCREEN ON <field> • AT SELECTION-SCREEN ON BLOCK <block> • AT SELECTION-SCREEN ON RADIOBUTTON GROUP <radi> • AT SELECTION-SCREEN ON <seltab> • AT SELECTION-SCREEN ON END OF <seltab> • AT SELECTION-SCREEN ON HELP-REQUEST FOR <field> • AT SELECTION-SCREEN ON VALUE-REQUEST FOR <field> . This event block allows you to modify the selection screen directly before it is displayed.Selection Screen Processing • The AT SELECTION-SCREEN event is triggered in the PAI of the selection screen once the ABAP runtime environment has passed all of the input data from the selection screen to the ABAP program • This allows to check input values for consistency • AT SELECTION-SCREEN OUTPUT is triggered in the PBO of the selection screen.

. TAB (<len>) <tab1> USER-COMMAND <ucom1> [DEFAULT [PROGRAM <prog>] SCREEN <scrn>]. TAB (<len>) <tab2> USER-COMMAND <ucom2> [DEFAULT [PROGRAM <prog>] SCREEN <scrn>].. . END OF BLOCK <sub_area>. SELECTION-SCREEN END OF SCREEN <scrn>. Subscreens on Selection Screens: SELECTION-SCREEN: BEGIN OF TABBED BLOCK <sub_area> FOR <n> LINES. Tabstrip Controls on Selection Screens: SELECTION-SCREEN: BEGIN OF TABBED BLOCK <tab_area> FOR <n> LINES. .... END OF BLOCK <tab_area>.Selection Screens as Subscreens: SELECTION-SCREEN BEGIN OF SCREEN <scrn> AS SUBSCREEN [NO INTERVALS] [NESTING LEVEL <n>].

Menu Painter .

. <g9>]. and a function key setting. consisting of a menu bar. Setting the GUI Title: SET TITLEBAR <title> [OF PROGRAM <prog>] [WITH <g1 >.• An instance of the user interface. is called a GUI status Setting the GUI Status: SET PF-STATUS <stat> [OF PROGRAM <prog>] [EXCLUDING <f>|<itab>].. a standard toolbar. an application toolbar..

• .

• Fastpath: Letter combination that allows users to choose functions without using the mouse. • Function text: A text that describes the function (such as Save). • Infotext: Text to be displayed in the status bar. tell the system when or how to carry out a function. • Icon text: Text to be output on the pushbutton in addition to the icon. Function types can. • Icon name: Name of the icon to be displayed on a pushbutton.Functions: The definition of an interface function contains the following elements: • Function code: Unique key for the function. which can be interpreted by the ABAP program. Function Types: . for example. • Function Type: is used to determine processing control.

Once you have entered a transaction code and short description. use the Transaction Maintenance transaction (SE93). Report Transactions: • To create a report transaction. choose transaction type Transaction with parameters (Parameter transaction). use the Transaction Maintenance transaction (SE93). Once you have entered a transaction code and short description. choose transaction type Program and screen (dialog transaction).Transaction • • To run a Type M program you have to created transaction SE93 is used to maintain the transaction Dialog Transactions: • To create a dialog transaction. . use the Transaction Maintenance transaction (SE93). choose transaction type Program and selection screen (report transaction). Once you have entered a transaction code and short description. Parameter Transactions: To create a parameter transaction.

2.7 .3 & 4 DAY .Data Transfer Techniques Session –1.

Overview External System SAP System Data Batch Input .

Data Transfer Rules External Data X External Data Checks & Validation s SAP Database Table .

Vendor Company Code X Address TEST1 Name Computers.e. Inc. Street City Philadelphia .Online Program To check and validate the external data.. user dialog is simulated through an SAP transaction (i. an online program).

ABAP/4 Dictionary “BDCDATA” PROGRAM DYNPRO DYNBEGIN FNAM FVAL .BDCDATA Structure To simulate user dialog. The “BDCDATA” ABAP/4 Dictionary structure is used in a batch input program to collect this information for an entire transaction. and (4) field values. (3) field names. you must know the following information: (1) online program name. (2) screen numbers.

we will use the “Change Vendor” transaction (“FK02”) to add a street address to an already existing vendor. Inc.Example . City Philadelphia .Change Vendor Vendor Company Code TEST1 For our example. X Address Name Computers. Street 123 Main St.

and transaction code (FK02).1st Step #1 Step Screen‘F1’ key and#2 Use “System > Status” Use “Technical menu path to determine online program name (SAPMF02K). Field name = RF02K-LIFNR Field name = RF02K-D0110 . Step #3 Determine how to proceed in the transaction (go to the next screen by pressing the ‘Enter’ key).Researching Transaction . Vendor Company Code X Address TEST1 Info” pushbutton in each screen field to be filled to determine the field name. screen number (0106).

Researching Transaction . Info” pushbutton in each screen field to be filled to determine the field name. Street 123 Main St. City Philadelphia . Inc.2nd Step #1 Step Screen‘F1’ key and#2 Use “System > Status” Use “Technical menu path to determine online program name (SAPMF02K) and screen number (0110). Step #3 Determine how to proceed in the transaction (save the record by clicking on the ‘Save’ pushbutton or pressing the ‘F11’ key). Field name = LFA1-STRAS Name Computers.

PROGRAM DYNPRO DYNBEGIN SAPMF02K 0106 X SAPMF02K 0110 X FNAM RF02K-LIFNR RF02K-D0110 FVAL TEST1 X LFA1-STRAS 123 Main St. we can determine the contents of the BDC table. BDC_OKCODE /11 .BDC Table Contents After researching the transaction.

Declaring BDC Table DATA: BDC_TAB LIKE BDCDATA OCCURS 6 WITH HEADER LINE. The internal table used to collect the transaction’s information must be declared “LIKE BDCDATA”. .

BDC_TAB-FVAL = ‘/11’. CLEAR BDC_TAB. BDC_TAB-PROGRAM = ‘SAPMF02K’. . BDC_TAB-FVAL = ‘TEST1’. ENDFORM. BDC_TAB-FVAL = ‘X’. BDC_TAB-DYNPRO = ‘0106’. APPEND BDC_TAB. CLEAR BDC_TAB. BDC_TAB-FNAM = ‘BDC_OKCODE’. APPEND BDC_TAB. BDC_TAB-DYNBEGIN = ‘X’. CLEAR BDC_TAB. BDC_TAB-DYNPRO = ‘0110’. BDC_TAB-FNAM = ‘LFA1-STRAS’. APPEND BDC_TAB. APPEND BDC_TAB. REFRESH BDC_TAB.’. CLEAR BDC_TAB. APPEND BDC_TAB. APPEND BDC_TAB. BDC_TAB-PROGRAM = ‘SAPMF02K’. BDC_TAB-DYNBEGIN = ‘X’. CLEAR BDC_TAB.Filling BDC Table .Method #1 FORM FILL_BDC_TAB. BDC_TAB-FNAM = ‘RF02K-D0110’. BDC_TAB-FVAL = ‘123 Main St. CLEAR BDC_TAB. BDC_TAB-FNAM = ‘RF02K-LIFNR’.

BDC_TAB-FNAM = VAR1.Filling BDC Table . BDC_TAB-DYNPRO = VAR2.Method #2 FORM FILL_BDC_TAB.’. BDC_TAB-FVAL = VAR2. BDC_TAB-PROGRAM = VAR1. IF FLAG = ‘1’. BDC_TAB-DYNBEGIN = ‘X’. This two-subroutine method to fill the BDC table is preferable because the “POPULATE_BDC_TAB” subroutine is reusable throughout all batch input programs. PERFORM POPULATE_BDC_TAB USING: ‘1’ ‘ ’ ‘ ’ ‘1’ ‘ ’ ‘ ’ ‘SAPMF02K’ ‘RF02K-LIFNR’ ‘RF02K-D0110’ ‘0106’. ENDIF. . ‘TEST1’. ENDFORM. ‘SAPMF02K’ ‘0110’. APPEND BDC_TAB. ‘LFA1-STRAS’ ‘123 Main St. ‘X’. CLEAR BDC_TAB. REFRESH BDC_TAB. ELSE. ‘BDC_OKCODE’ ‘/11’. ENDFORM. FORM POPULATE_BDC_TAB USING FLAG VAR1 VAR2.

Batch Input Methods Method #1 Batch Input Session Method #2 “CALL TRANSACTION USING” Statement Method #3 “CALL DIALOG” Statement .

It is the processing of this batch input session that updates the database.Overview BDC Program External Data The first batch input method is to create a batch input session. Batch Input Session SAP Database Table . not the execution of the batch input program.

Insert Transaction Data into Session Insert Transaction Data into Session BDC_INSERT Close Batch Input Session Close Batch Input Session BDC_CLOSE_GROUP .Creating Batch Input Sessions Open Batch Input Session Open Batch Input Session BDC_OPEN_GROUP “BDC_INSERT” is called for each transaction entered into the batch input session.

OTHERS = 11. =1 = <client> = <session name> = <keep or delete session> = <user name> HOLDDATE = <lock session until date> ..BDC_OPEN_GROUP CALL FUNCTION ‘BDC_OPEN_GROUP’ EXPORTING CLIENT GROUP KEEP USER EXCEPTIONS CLIENT_INVALID ..

BDC_INSERT CALL FUNCTION ‘BDC_INSERT’ EXPORTING TCODE TABLES DYNPROTAB = <bdc internal table> EXCEPTIONS INTERNAL_ERROR = 1 . OTHERS = 5.. = <transaction code> ..

.BDC_CLOSE_GROUP CALL FUNCTION ‘BDC_CLOSE_GROUP’ EXCEPTIONS NOT_OPEN QUEUE_ERROR OTHERS =1 =2 = 3.

Batch Input Session Header Section Creator Client Session Name Authorization User Hold Date Keep or Delete Batch Input Session Data Section Transaction Data .

Example #1 . Inc. Street City 123 Main St. Philadelphia .Change Vendor In this example. The “Change Vendor” transaction is “FK02”. Vendor Company Code X Address TEST1 Name Computers. we will create a batch input session to add a street address to an already existing vendor (TEST1).

DATA: BDC_TAB LIKE BDCDATA OCCURS 6 WITH HEADER LINE. SESSION LIKE APQI-GROUPID VALUE ‘DEMO #8’. Step #1 ** This program is continued on the next slide ** .Declaration Section REPORT Y180DM08.Example #1 .

. . PERFORM FILL_BDC_TAB. . .Example #1 . . . .Main Program Step #2 START-OF-SELECTION. CALL FUNCTION ‘BDC_INSERT’ EXPORTING TCODE = ‘FK02’ TABLES DYNPROTAB = BDC_TAB EXCEPTIONS. CALL FUNCTION ‘BDC_CLOSE_GROUP’ EXCEPTIONS. . . ** This program is continued on the next slide ** Step #3 Step #4 Step #5 . CALL FUNCTION ‘BDC_OPEN_GROUP’ EXPORTING CLIENT = SY-MANDT GROUP = SESSION USER = SY-UNAME EXCEPTIONS.

ELSE. CLEAR BDC_TAB. BDC_TAB-PROGRAM = VAR1.’. ‘LFA1-STRAS’ ‘123 Main St. IF FLAG = ‘1’. ENDIF.Example #1 . ‘TEST1’. ‘SAPMF02K’ ‘0110’. BDC_TAB-DYNPRO = VAR2. PERFORM POPULATE_BDC_TAB USING: ‘1’ ‘ ’ ‘ ’ ‘1’ ‘ ’ ‘ ’ ‘SAPMF02K’ ‘RF02K-LIFNR’ ‘RF02K-D0110’ ‘0106’. REFRESH BDC_TAB. APPEND BDC_TAB. FORM POPULATE_BDC_TAB USING FLAG VAR1 VAR2. . ENDFORM. ENDFORM.Subroutines FORM FILL_BDC_TAB. ‘X’. BDC_TAB-FNAM = VAR1. BDC_TAB-DYNBEGIN = ‘X’. BDC_TAB-FVAL = VAR2. ‘BDC_OKCODE’ ‘/11’.

Change Vendors In this example. City Boston . Street 123 Main St.Example #2 . Inc. City Philadelphia Name Computer Land Street 10 Walnut St. we will read records from a sequential file on the application server to create a batch input session that updates multiple vendors. Vendor Company Code X Address TEST1 Vendor Company Code X Address TEST2 Name Computers.

Sequential File
TEST1 TEST2 TEST3 TEST4 TEST5 123 Main St. 10 Walnut St. 32 Chestnut St. 30 Market St. 17 S. 30th St.

File name: ‘/tmp/bc180_file3’

The sequential file we will read is set up in records. Each record has two fields with the following formats: <Field1> LIKE LFA1-LIFNR <Field2> LIKE LFA1-STRAS

Example #2 - Declaration Section
REPORT Y180DM09. Step #1 DATA: BDC_TAB LIKE BDCDATA OCCURS 6 WITH HEADER LINE, SESSION LIKE APQI-GROUPID VALUE ‘DEMO #9’, INFILE(20) VALUE ‘/tmp/bc180_file3’. DATA: BEGIN OF INREC, VENDNUM LIKE LFA1-LIFNR, STREET LIKE LFA1-STRAS, END OF INREC.
** This program is continued on the next slide **

Step #2

Example #2 - Main Program
Step #3 Step #4 Step #5 Step #6 Step #7 Step #8
START-OF-SELECTION. OPEN DATASET INFILE FOR INPUT IN TEXT MODE. CALL FUNCTION ‘BDC_OPEN_GROUP’. . . . DO. READ DATASET INFILE INTO INREC. IF SY-SUBRC <> 0. EXIT. ENDIF. PERFORM FILL_BDC_TAB. CALL FUNCTION ‘BDC_INSERT’ EXPORTING TCODE = ‘FK02’ TABLES DYNPROTAB = BDC_TAB. . . . ENDDO. CALL FUNCTION ‘BDC_CLOSE_GROUP’. . . . CLOSE DATASET INFILE. ** This program is continued on the next slide **

Step #9 Step #10

Example #2 - Subroutines
FORM FILL_BDC_TAB. REFRESH BDC_TAB. CLEAR BDC_TAB. PERFORM POPULATE_BDC_TAB USING: ‘1’ ‘ ’ ‘ ’ ‘1’ ‘ ’ ‘ ’ ‘SAPMF02K’ ‘RF02K-LIFNR’ ‘RF02K-D0110’ ‘SAPMF02K’ ‘LFA1-STRAS’ ‘BDC_OKCODE’ ‘0106’, INREC-VENDNUM, ‘X’, ‘0110’, INREC-STREET, ‘/11’. IF FLAG = ‘1’. BDC_TAB-PROGRAM = VAR1. BDC_TAB-DYNPRO = VAR2. BDC_TAB-DYNBEGIN = ‘X’. ELSE. BDC_TAB-FNAM = VAR1. BDC_TAB-FVAL = VAR2. ENDIF. APPEND BDC_TAB. ENDFORM. ENDFORM. FORM POPULATE_BDC_TAB USING FLAG VAR1 VAR2.

Notice that the vendor number and street values are coming from the file’s records read into the “INREC” field string.

Summary
Research Transaction Code BDC Program Execute BDC Program
Batch Input Session Created

Process Batch Input Session
SAP Database Updated

Overview
BDC Program
External Data

In this chapter, we will learn how to process batch input sessions.

Batch Input Session

Proce ss Batch Input Sessio n

SAP Database Table

Proce ss Batch Input Sessio n

Session Overview
Transaction Code “SM35”
OR

“System→Services→Batch input→Edit” menu path

Process batch input session in the BACKGROUND.Processing Modes Process batch input session in the FOREGROUND. . DISPLAY ERRORS ONLY when processing batch input session.

Processing Options /bdel /n /bda /bde /bend .

Session Overview Options Process Select block Batch Input Session Delete Session Statistics Log .

Session Status Sessions still to be processed Sessions processed with errors Sessions processed successfully Background sessions Sessions being processed Sessions being created .

. Changes have been made Changes have been made Changes have been made Changes have been made Vendor TESTX has not been created Vendor TESTX has not been created FK02 FK02 FK02 FK02 FK02 FK02 SAPMF02K 0110 SF2056 SAPMF02K 0110 SF2056 SAPMF02K 0110 SF2056 SAPMF02K 0110 SF2056 SAPMF02K 0106 EF2163 SAPMF02K 0106 EF2163 S00370 S00370 S00363 S00363 S00364 S00364 S00365 S00365 S00366 S00366 S00382 S00382 Processing statistics Processing statistics 3 transactions read 3 transactions read 2 transactions processed 2 transactions processed 1 transactions with errors 1 transactions with errors 0 transactions deleted 0 transactions deleted Batch input processing ended Batch input processing ended . Session SESSION3 is being....Log Created Created 01/08/1997 15:12:31 01/08/1997 15:12:31 Session Log Session name Session name SESSION3 SESSION3 User User DANTHON DANTHON Time Time 15:12:31 15:12:31 15:12:32 15:12:32 15:12:32 15:12:32 15:12:32 15:12:32 15:12:32 15:12:32 15:12:32 15:12:32 15:12:32 15:12:32 15:12:32 15:12:32 15:12:32 15:12:32 15:12:32 15:12:32 Tran Tran Screen Screen Message Message S00300 S00300 Session SESSION3 is being.

Session Analysis Session Log 1 2 3 4 5 FK02 FK02 FK02 FK02 FK02 Data Status Processed Incorrect Deleted Processed Transaction Screen SAPMF02K 0106 SAPMF02K 0110 SAPMF02K 0106 SAPMF02K 0110 SAPMF02K 0106 SAPMF02K 0110 SAPMF02K 0106 SAPMF02K 0110 SAPMF02K 0106 SAPMF02K 0110 ** This is not an analysis of the batch input session from the previous page ** .

Time2 BDC program executed Batch input session created Time1 Batch input session processed SAP database updated .Timing Issue Remember: A batch input session is created when you execute a BDC program (time1). but it is processed at a different time (time2).

.Program “RSBDCSUB” Execute program “RSBDCSUB” Specify batch input session to process. Batch input session scheduled to be processed in the background.

Overview PROGRAM SAPMF02K DYNPRO 0106 DYNBEGIN X FNAM RF02K-LIFNR RF02K-D0110 FVAL TEST1 X 123 Main St. /11 SAPMF02K 0110 X LFA1-STRAS BDC_OKCODE BDC Table BDC Table Create Batch Input Session (BDC Program) Use in “CALL TRANSACTION” statement Use in “CALL DIALOG” statement .

Differences in Batch Input Methods How are errors When is the SAP database updated? handled? Automatically by the system during the processing of the batch input session Create batch input session (BDC Program): During the processing of the batch input session CALL TRANSACTION: CALL DIALOG: During the execution of the batch input program Must be handled in the batch input program .

Change Vendors To illustrate the “CALL TRANSACTION” and “CALL DIALOG” methods.Example . Inc. Street City Name Computer Land Street City 123 Main St. Boston . Vendor Company Code X Address TEST1 Vendor Company Code X Address TEST2 Name Computers. Philadelphia 10 Walnut St. we will use the example to change vendors coming from a sequential file.

“CALL TRANSACTION USING” Statement CALL TRANSACTION <transaction code> USING <bdc internal table> MODE <display mode> UPDATE <update mode> MESSAGES INTO <mssg int. table>. <display mode> A: display all E: display errors only N: no display <update mode> S: synchronous A: asynchronous .

VENDNUM LIKE LFA1-LIFNR. INFILE(20) VALUE ‘/tmp/bc180_file4’. PARAMETERS: DISPMODE DEFAULT ‘A’.Example #1 .Declaration Section REPORT Y180DM10. Step #1 DATA: BDC_TAB LIKE BDCDATA OCCURS 6 WITH HEADER LINE. STREET LIKE LFA1-STRAS. Step #2 ** This program is continued on the next slide ** . END OF INREC. UPDAMODE DEFAULT ‘S’. DATA: BEGIN OF INREC.

PERFORM FILL_BDC_TAB. EXIT. OPEN DATASET INFILE FOR INPUT IN TEXT MODE. WRITE: / ‘Error’. ENDIF. IF SY-SUBRC <> 0. CLOSE DATASET INFILE. CALL TRANSACTION ‘FK02’ USING BDC_TAB MODE DISPMODE UPDATE UPDAMODE. ** This program is continued on the next slide ** Step #8 Step #9 .Example #1 . ENDIF.Main Program Step #3 Step #4 Step #5 Step #6 Step #7 START-OF-SELECTION. DO. IF SY-SUBRC <> 0. ENDDO. READ DATASET INFILE INTO INREC.

ENDFORM. ENDIF. INREC-STREET. BDC_TAB-DYNPRO = VAR2. INREC-VENDNUM.Subroutines FORM FILL_BDC_TAB. ELSE.Example #1 . APPEND BDC_TAB. ‘0110’. REFRESH BDC_TAB. BDC_TAB-PROGRAM = VAR1. BDC_TAB-FNAM = VAR1. FORM POPULATE_BDC_TAB USING FLAG VAR1 VAR2. . BDC_TAB-DYNBEGIN = ‘X’. IF FLAG = ‘1’. ENDFORM. PERFORM POPULATE_BDC_TAB USING: ‘1’ ‘ ’ ‘ ’ ‘1’ ‘ ’ ‘ ’ ‘SAPMF02K’ ‘RF02K-LIFNR’ ‘RF02K-D0110’ ‘SAPMF02K’ ‘LFA1-STRAS’ ‘BDC_OKCODE’ ‘0106’. ‘X’. Notice that the vendor number and street values are coming from the file’s records read into the “INREC” field string. ‘/11’. BDC_TAB-FVAL = VAR2. CLEAR BDC_TAB.

Error Handling Write an error report. Send the record(s) in error to an error file. . Create a batch input session with the record(s) in error.

. IF SY-SUBRC <> 0. ENDDO. WRITE: / ‘Transaction error’. ENDDO. PERFORM FILL_BDC_TAB. WRITE: / ‘Error’. we can check SY-SUBRC to determine the success of the transaction only. CALL TRANSACTION ‘FK02’ USING BDC_TAB MODE ‘N’ UPDATE ‘S’.. we can check SY-SUBRC to determine the success of the transaction and the actual update to the database.DO. not the actual update to the database. CALL TRANSACTION ‘FK02’ USING BDC_TAB MODE ‘N’ UPDATE ‘A’.. Synchronous versus Asynchronous DO. ENDIF.. IF SY-SUBRC <> 0. With synchronous updating. ENDIF. . PERFORM FILL_BDC_TAB.. . With asynchronous updating.

“CALL DIALOG” Statement CALL DIALOG <dialog module> USING <bdc internal table> MODE <display mode>. . <display mode> A: display all E: display errors only N: no display <update mode> Notice that an update mode is not specified.

END OF INREC. VENDNUM LIKE LFA1-LIFNR. STREET LIKE LFA1-STRAS. PARAMETERS: DISPMODE DEFAULT ‘A’. Step #1 DATA: BDC_TAB LIKE BDCDATA OCCURS 6 WITH HEADER LINE. DATA: BEGIN OF INREC.Declaration Section REPORT Y180DM11. Step #2 ** This program is continued on the next slide ** . INFILE(20) VALUE ‘/tmp/bc180_file5’.Example #2 .

STOP. DO. ENDDO. READ DATASET INFILE INTO INREC. IF SY-SUBRC <> 0. ENDIF. EXIT. CALL DIALOG ‘Z_DIALOG_FK02’ USING BDC_TAB MODE DISPMODE. CLOSE DATASET INFILE. OPEN DATASET INFILE FOR INPUT IN TEXT MODE. Step #9 Step #10 ** This program is continued on the next slide ** . COMMIT WORK.Main Program Step #3 Step #4 Step #5 Step #6 Step #7 Step #8 START-OF-SELECTION. IF SY-SUBRC <> 0. PERFORM FILL_BDC_TAB. WRITE: / ‘Transaction error’. ENDIF.Example #2 .

FORM POPULATE_BDC_TAB USING FLAG VAR1 VAR2. BDC_TAB-FNAM = VAR1. PERFORM POPULATE_BDC_TAB USING: ‘1’ ‘ ’ ‘ ’ ‘1’ ‘ ’ ‘ ’ ‘SAPMF02K’ ‘RF02K-LIFNR’ ‘RF02K-D0110’ ‘SAPMF02K’ ‘LFA1-STRAS’ ‘BDC_OKCODE’ ‘0106’. ‘0110’. BDC_TAB-PROGRAM = VAR1. INREC-STREET. ENDFORM. ‘/11’. REFRESH BDC_TAB. ‘X’. Notice that the vendor number and street values are coming from the file’s records read into the “INREC” field string. IF FLAG = ‘1’. BDC_TAB-DYNPRO = VAR2. INREC-VENDNUM. BDC_TAB-FVAL = VAR2.Example #2 . CLEAR BDC_TAB. ENDFORM.Subroutines FORM FILL_BDC_TAB. ENDIF. APPEND BDC_TAB. BDC_TAB-DYNBEGIN = ‘X’. . ELSE.

“CALL TRANSACTION” versus “CALL DIALOG” CALL TRANSACTION Timing of Update Update occurs after each transaction is completed. CALL DIALOG Update occurs on “COMMIT WORK” statement. .

LSMW • • ∀ ∀ ∀ The LSM Workbench is an R/3-based tool that supports You when transferring data from non-SAP systems ("Legacy Systems") to R/3 once or periodically . Data consistency due to standard import techniques: ∗ Batch input ∗ Direct input ∗ BAPIs (Business Application Programming Interfaces) * IDocs (Intermediate Documents) .

• .

.

.

.

.

Background Processing • Phases of Background Processing • Passing Data to Subsequent Job Steps • Scheduling Job within ABAP/4 Program .

Work Processes Dispatcher Online Update Enqueue Spool Background .

Background .The Background Work Process Background Job A Background Job A Step #1 Step #2 Defining a Defining a background job. background job.

Phases of Background Processing Job Job Scheduling Scheduling Job Job Processing Processing Job Job Overview Overview .

Scheduling a Background Job Transaction SM36 Job Job Scheduling Scheduling Start date General data Job name Job class Status Target host Steps <job name> A Scheduled <target system for processing> .

Creating Step for Background Job Job Steps Job Scheduling Scheduling ABAP/4 External program ABAP/4 program Name Variant Language <name of report program> <name of variant> E .

you If you start a job based on a date/time or an event. . at a particular time. Jobs can be Jobs can be scheduled to run scheduled to run after another job has after another job has been completed. you can schedule the job to run at regular intervals. If you start a job based on a date/time or an event. not just at a particular time. been completed.Start Criteria for Background Job Start date Job Job Scheduling Scheduling Immediate Date/Time After Job After Event Jobs can be scheduled Jobs can be scheduled to run after an event to run after an event has been has been “triggered/raised”. Jobs can be scheduled to Jobs can be scheduled to run immediately or at a run immediately or at a particular date/time. particular date/time. “triggered/raised”. not just can schedule the job to run at regular intervals.

Scheduling a Periodic Job Start date Period values Job Job Scheduling Scheduling X Periodic job By checking the By checking the ‘Periodic Job’ option. you can specify you can specify that the job run at that the job run at regular intervals. the job to run hourly. ‘Periodic Job’ option. etc. regular intervals. weekly. . monthly. daily. weekly. monthly. Hourly Daily Weekly Monthly Other period With the ‘Period With the ‘Period Values’ pushbutton. daily. etc. you can schedule you can schedule the job to run hourly. Values’ pushbutton.

‘After Job’ pushbutton. After clicking on the After clicking on the ‘After Job’ pushbutton. job will run. this job will run only if the option. If you check the ‘Start status-depend. you must specify the you must specify the name of the job that must name of the job that must be completed before this be completed before this job will run.’ If you check the ‘Start status-depend.Scheduling Job after Another Job Start date After Job Job Job Scheduling Scheduling Name <job name> X Start status-depend. specified job ends successfully.’ option. . this job will run only if the specified job ends successfully.

you must specify the name of the event that must be name of the event that must be raised before this job will run. You raised before this job will run. by specifying a parameter. the If you check the ‘Periodic Job’ option. you must specify the pushbutton. specified event is raised. the system starts a new job each time the system starts a new job each time the specified event is raised. X Periodic job If you check the ‘Periodic Job’ option. .Scheduling Job After an Event Start date After Event Job Job Scheduling Scheduling Event Parameter <event name> <parameter> After clicking on the ‘After Event’ After clicking on the ‘After Event’ pushbutton. You can distinguish between different can distinguish between different occurrences of a particular event occurrences of a particular event by specifying a parameter.

Triggering/Raising Events To trigger/raise an event from within an ABAP/4 program. call the ‘BP_EVENT_RAISE’ function module. RAISE_FAILED =4 RAISE_FAILED = 4 name of the event to raise. . OTHERS = 5. you must call the ‘BP_EVENT_RAISE’ function module. OTHERS = 5. CALL FUNCTION ‘BP_EVENT_RAISE’ CALL FUNCTION ‘BP_EVENT_RAISE’ EXPORTING EXPORTING EVENTID = <event name> EVENTID = <event name> EVENTPARM = ‘‘ ’’ EVENTPARM = TARGET_INSTANCE = ‘‘ ’’ TARGET_INSTANCE = EXCEPTIONS EXCEPTIONS BAD_EVENTID =1 BAD_EVENTID =1 The only required The only required EVENTID_DOES_NOT_EXIST = 2 EVENTID_DOES_NOT_EXIST = 2 exporting parameter is the EVENTID_MISSING =3 EVENTID_MISSING = 3 exporting parameter is the name of the event to raise. you must To trigger/raise an event from within an ABAP/4 program.

Phases of Background Processing Job Job Scheduling Scheduling Job Job Processing Processing Job Job Overview Overview .

Processing a Background Job Scheduler Job Job Dispatcher Background Job Job Processing Processing Job Job .

Processing a Background Job Application Server Application Server Work Processes Work Processes 8 Online 1 Spool 3 Background Job Job Processing Processing Transaction SM50 .

All messages issued by job steps and system. . Start Module Job Step #1 Job Step #2 Job Step #3 End Module Job Job Processing Processing PRINT SPOOL List All “WRITE” statement output from job step.Processing a Background Job Job Log Scheduler Entries from start and end modules.

Phases of Background Processing Job Job Scheduling Scheduling Job Job Processing Processing Job Job Overview Overview .

Job Overview Transaction SM37 Job Status Job Status Job Job Overview Overview .

.Job Analysis using Job Log System and System and Program Program Messages Messages Job Job Overview Overview You can use this Job Log to analyze each step of a You can use this Job Log to analyze each step of a “finished” or “cancelled” background job. “finished” or “cancelled” background job.

Other Background Processing Topics • Passing Data to Subsequent Job Steps • Passing Data to Subsequent Job Steps • Scheduling Job within ABAP/4 Program • Scheduling Job within ABAP/4 Program .

. EXPORT <data> TO MEMORY.Passing Data to Subsequent Job Steps Background Job Global ABAP/4 Background Job Global ABAP/4 Memory Memory <data> Step #1 .... . ... Step #2 . IMPORT <data> FROM MEMORY....

<id2> <data2> .Passing Data to Subsequent Job Steps Background Job Global ABAP/4 Background Job Global ABAP/4 Memory Memory <id1> <data> Step #1 .... . EXPORT <data2> TO MEMORY ID <id2>. . IMPORT <data2> FROM MEMORY ID <id2>..... Step #2 ..

Insert Job Step Insert Job Step JOB_SUBMIT Close Background Job Close Background Job JOB_CLOSE .Scheduling Job within ABAP/4 Program Open Background Job Open Background Job JOB_OPEN JOB_SUBMIT is called for each step that is to be added to the job.

JOB_OPEN JOB_OPEN Exporting: jobname = <job name> Background Job <job name> <job #> Importing: jobcount = <job #> .

JOB_SUBMIT JOB_SUBMIT Exporting: authcknam = <user> jobcount = <job #> jobname = <job name> report = <report> variant = <variant> Background Job <job name> <job #> Step #1 Step #2 .

JOB_CLOSE JOB_CLOSE Exporting: jobcount = <job #> jobname = <job name> sdlstrtdt = <start date> sdlstrttm = <start time> strtimmed = <flag1> Importing: job_was_released = <flag2> Background Job <job name> <job #> Step #1 Step #2 .

DATA: JOBNUM LIKE TBTCJOB-JOBCOUNT. VARIANT = VARIANT. CALL FUNCTION ‘JOB_OPEN’ CALL FUNCTION ‘JOB_OPEN’ EXPORTING JOBNAME = JOBNAME EXPORTING JOBNAME = JOBNAME IMPORTING IMPORTING JOBCOUNT = JOBNUM. BTCHUSER. VARIANT. BTCHUSER. CALL FUNCTION ‘JOB_CLOSE’ CALL FUNCTION ‘JOB_CLOSE’ EXPORTING JOBCOUNT = JOBCOUNT EXPORTING JOBCOUNT = JOBCOUNT JOBNAME = JOBNAME. USER LIKE SY-UNAME. PROGRAM LIKE SY-REPID. VARIANT LIKE RALDB-VARIANT. VARIANT. REPORT. JOBCOUNT = JOBNUM. CALL FUNCTION ‘JOB_SUBMIT’ CALL FUNCTION ‘JOB_SUBMIT’ EXPORTING AUTHCKNAM = USER EXPORTING AUTHCKNAM = USER JOBCOUNT = JOBNUM JOBCOUNT = JOBNUM JOBNAME = JOBNAME JOBNAME = JOBNAME REPORT = PROGRAM REPORT = PROGRAM VARIANT = VARIANT. WRITE: // JOBNAME. PARAMETERS: JOBNAME LIKE TBTCJOB-JOBNAME. REPORT.ABAP/4 Program Example REPORT Y180DM01. PARAMETERS: JOBNAME LIKE TBTCJOB-JOBNAME. PROGRAM LIKE SY-REPID. JOBCOUNT. JOBCOUNT. USER LIKE SY-UNAME. REPORT Y180DM01. DATA: JOBNUM LIKE TBTCJOB-JOBCOUNT. WRITE: JOBNAME. JOBNAME = JOBNAME. VARIANT LIKE RALDB-VARIANT. Open Job Submit Step Close Job .

Scheduling Scheduling Summary of Background Processing Job Job Job Job Job Job Processing Processing Overview Overview Job Log Spool List Step #1 Step #2 Background .

3 & 4 DAY .8 .2.Enhancements Session.1.

Types of Exits: 1. Modification: Modifying the SAP repository objects in the form of custom changes. Function Module Exits 4. Customizing: Customizing constitutes changing the system parameters with its own special interface. 4. 3. Menu Exits 2. Customer Development: Need to create customer specific objects within the customer range. Screen Exits 3. Field Exit . 2. Enhancement Concept: It constitutes changing of SAP Repository objects by the customer without modification.There are four different ways of changing the SAP system to fit our needs: 1.

function Function 3 Menu 3 Menu exit Field x Field exit Field y Screen exit © SAP AG 1999 .Enhancing User Dialogs Menu 1 Menu 2 Function 1 Function 2 Cust.

Menu exit: The system contains various points at which you can include menu items that start customer programs Screen exit: Some screens contain areas (subscreens) in which you can display your own screens Field exits: Field exits allow you to incorporate extra field checks. .

© SAP AG 1999 ...Field Exits Data element FUNCTION FIELD_EXIT_. FIELD EXIT ENDFUNCTION.

perform userexit call customer  global in program ( prog) prog) → SAP Reference IMG Sales & Distribution  System adjustment User exits → Select appropriate components → CMOD Utilities  SAP enhancements → Restrict search with *<prog>* OPEN_FI_PERFORM → SAP Reference IMG Financial Accounting  Basic settings Use BTE Envir.  Information System → Select Component application components Business transaction events (BTEs) © SAP AG 1999 .Finding Enhancements User exits Customer exits System → Status → Double -click on program name Find character string...

Field exits need not be prepared by the SAP application developer. You can create a field exit for any screen input field that has a Dictionary reference. The reference object is the data element. The unit "Enhancements to Dictionary Elements" discusses how the field exits work

Session – 1,2,3,4 day 9

DAY - 9

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

• .

.

.

SAPSCRIPT .

SAP Script Chapter 1: Introduction Chapter 2: Layout Set Chapter 3: Output Program Chapter 4: Configuration .

SD Inquiry Order can have Purchase • Formsconfirmationgraphic elements. PU Purchasing req. Invoice • Examples of forms: FI Customer statement Checks IM WM Goods receipt Goods issue Picking list Packing list Labels . • Form Vs. order Delivery note Contract • Forms can be event-triggered. Reports • Forms look “nicer”.Introduction What is SAP Script ? • SAP Script is used to print forms.

Introduction How SAP Script Works (Big Picture) SAP SAP Document Document Layout set Read Data (Template) Define Form Print (Output) • Sales order • Billing document • Purchase order • etc SAP Script • Order confirmation • Invoice • Purchase order • etc • SAP documents are printed using forms. • SAP script is a tool that SAP provides for creating layout sets. . • Forms are defined and formatted using layout sets.

Form Creating Reports Output Program (ABAP) SAP SAP Document Document Report Creating Forms SAP SAP Document Document Output Program (ABAP) Form Layout set .Introduction Creating Report Vs.

bar code.Components of SAP Script Output determination configuration Introduction SAP SAP Document Document Output Program Layout set Form Printer / Font Configuration • Output program: • Layout set: • Printer / Font configuration: Extracts data from SAP data dictionary Formats the extracted data Configures impact / laser printer. logo • Output determination configuration: Configures triggering event. timing/destination .

Laser) Font configuraiton Basis / ABAP Testing End-user / Functional / ABAP resrouce . Thermal.Introduction SAP Script Development Component Output program Layout set Resource ABAP resource ABAP resource Output determination Functional resource configuration Printer configuration Basis / ABAP (Impact.

then the SAPscript checks for the style or layout set in client 000.Layout Set Some Facts • • • Client specific (clientdependent) Language specific Note: If the layout set is not available in the client in which the document is being printed. • . Recommendation: Keep only one copy of the layout set in one client.

Layout Set Elements Menu: Tools > Word processing > Layout set Initial Screen • Header • Paragraphs • Character strings • Windows • Pages • Page windows IMG .

# Date Item Material # Price 40 50 60 70 Total Part Part Part Part D E F G $250 $400 $350 $150 $2.O.O.Layout Set Elements Components S. # Date Sold-to Ship-to S.O.800 Item Material # Price 10 20 30 Part A Part B Part C $500 $350 $800 • • • • • • Header: Paragraphs: Character strings: Windows: Pages: Page windows: the pages General info and default settings Font and tab info Font info within a paragraph Description of areas on the pages Name of the pages with page flow info Position and size of the windows on . # P.O. # P.

. • Note: A window which should appear on a page must first be defined under ”Windows” and then be added to the page windows.Layout Set Elements Page Windows • List of all the windows on the page with coordinates. • The coordinates are given by the upper left-hand corner and the width and length.

Variable – CONST .Constant • Shows list of all windows defined for the layout set. .Special – VAR .Layout Set Elements Windows • Type of windows: – Main . • A window can contain hard-coded texts and the variables to be printed in the window.

Tag column: Specifies format of the text Text line column: Contains the actual content of the window. Special characters – – – – * Default paragraph /: Command line /* Comment line /E Text element .Text element • • • • A window can contain hardcoded texts and the variables to be printed in the window.Layout Set Elements Windows .

e..’ Tabs in a paragraph • ‘&&’ Variables . • It is the output program (not the layout set) that controls whether or not to print a text element (I.Layout Set Elements Windows .Text element • Text element always starts with the line /E and continues to the next text element (/E). • ‘. block of texts surrounded by /E) and the order in which they are printed.

.Layout Set Elements Pages • Shows the page flow information. • The last page recursively defines the next page as itself. • Must define at least two pages. • The first page specifies the next page.

Layout Set Elements Paragraphs • Contains all information needed to format a paragraph of text • Font • Tabs .

Layout Set Elements Paragraphs Tabs • Specify tabs to create columns for line items • If no font is specified. default font from the layout set header will be used Font .

• Can be used within paragraph to override the default settings for a few words within the paragraph.Layout Set Elements Character Strings • A default character style is specified at the paragraph level. .

Layout Set Elements Header • Administrative info • Default settings • Page format: different for different countries / applications • Never change ‘Lines per inch’ & ‘Characters/inch’ .

• It simply shows the maximum length of each of the fields being . • Test printing does not trigger the output program to interface with the layout set.Layout Set Test Print • Menu: Utility > Test print • Shows the layout design of the layout set.

Layout Set Activating Layout Set • Menu: Layout set > Activate • Must activate the layout set any time a change has been made .

• Symbols are identified by a name which is included in ‘&’ characters. they can be categorized as follows: • • • • SYSTEM symbols PROGRAM symbols STANDARD symbols TEXT symbols . the value of a symbol comes from.Layout Set Symbol • Symbols are placeholders for values during print formatting. Example : &VBAK-VBELN&. Symbols are case sensitive. • Depending on the source.

They can be used in all texts. &DATE& &DAY& &MONTH& &YEAR& &TIME& &HOURS& &MINUTES& &SECONDS& &PAGE& &NEXTPAGE& &SPACE& &ULINE& = Current date = Day = Month = Year = Time of day = Hours = Minutes = Seconds = Page = Page number of next page = Blanks = Underline . Following are list of frequently used system symbols.Layout Set Symbol • SYSTEM symbols are supplied by SAPscripts.

• Values of TEXT symbol are created by assignment via DEFINE statement.Layout Set Symbol • PROGRAM symbols are placeholders for values which come from the program that calls the layout set. Example: &KNA1-NAME1& in the layout set will output the Customer’s name. . Example : /: DEFINE &CASENUM& = ‘1234’. • STANDARD symbol are maintained centrally in one table (TTDTG) for all SAPscript users. The symbol has to be defined in the Data Dictionary and filled with values by the output program.

sign = Decimal place formatting = Exponential notation = Concatenation of symbol and text Examples : &VBDPR-MATNR+2(4)& &VBDKL-BRGEW(I13)& &’Currency : ’VBDKA-WAERK& .2)& &SYMBOL(E3)& &’text1’SYMBOL’text2’& = Off set = Length = If the symbol is initial.Layout Set Symbol • FORMATTING of the symbol can be done in following different ways: &SYMBOL+ 4& &SYMBOL(5)& &SYMBOL(I)& &SYMBOL(Z)& &SYMBOL(C)& &SYMBOL(R)& &SYMBOL(S)& &SYMBOL(5. output nothing = Suppress leading zeros = Compress blanks = Right-justified output = Suppress +/.

DEFINE &PREFIX& = ‘Mr. Example : /: /: /: /: /: . ENDIF...’.’.ENDIF can be used within the layout set to control the flow of logic. DEFINE &PREFIX& = ‘Mrs. &PREFIX& . ELSE. / IF &VBRK-VKORG(2)& EQ ‘HG’.ELSE.Layout Set Commands • IF.

.Layout Set Commands • CASE . Example : /: /: / /: / /: CASE &VBDKL-VKORG(2)& WHEN ‘HG’ Case # &‘934’VBDPL-SORTKRI& WHEN OTHERS Case # &‘999’VBDPL-SORTKRI& ENDCASE .ENDCASE command can also be used in the layout set to control the flow of logic.

Syntax : /: PROTECT text text text /: ENDPROTECT . a page -break can be made in SAPscript at any position before the end of the page defined in the layout set. The next page can be specified explicitly.Layout Set Commands • Using the command NEW-PAGE.ENDPROTECT.. Syntax: /: NEW-PAGE [PAGE] • A page break within a paragraph can be prevented by using this command PROTECT.

Layout Set Commands • The command ADDRESS…ENDADDRES formats an address according to the postal standards of the country of destination which is defined in the parameter COUNTRY. Syntax : /: ADDRESS DELIVERY PARAGRAPH paragraph [ PRIORITY prio LINES lines ] .

name2[.name4]]] STREET strno POBOX pobox [CODE code] POSTCODE postal code CITY city1[./: /: /: /: /: /: /: /: /: /: TITLE form of address NAME name1[. name3[.city2] REGION district COUNTRY recipient country FORMCOUNTRY sender country ENDADDRESS .

Layout Set Commands • Parameter PRIORITY defines which address lines may be omitted. if necessary. the data which is entered in the parameter PRIORITY is omitted. Possible values are from 1 to n. If it is not possible to format all address data due to a lack of lines. The possible values are as follows : A B C 2 3 4 L S O Form of address Mandatory blank line 1 Mandatory blank line 2 Name2 Name3 Name4 Country name Street line City line • The parameter LINES are available for formatting the address. .

. DD MM MMMM YY YYYY Example : Day Month in figures Month in words Year (2 digits) Year (4 digits) /: SET DATE MASK = ‘MM/DD/YYYY’ • The formatting can be reset at any point of time by /: SET DATE MASK = ‘’. Formatting is then carried out as defined by the System. month and year are following. The available formats for day. After formatting all date fields are output as specified.Layout Set Commands • The date can be formatted using the command SET DATE MASK = ‘…’.

. The available formats for hours. Formatting is then carried out as defined by the System. HH MM SS Example Hours Minutes Seconds /: SET TIME MASK = ‘HH:MM:SS’ • The formatting can be reset at any point of time by /: SET TIME MASK = ‘’. minutes and seconds are following.Layout Set Commands • The time can be formatted using the command SET TIME MASK = ‘…’. After formatting all time fields are output as specified.

One is . Syntax : INCLUDE name OBJECT object ID identifier PARAGRAPH paragraph LANGUAGE language Example : INCLUDE &VBDPL-TDNAME& OBJECT VBBP ID 0001 PARAGRAPH IT INCLUDE ‘SD_TEXT’ OBJECT TEXT ID SDVD PARAGRAPH HT • There are two different types of text handled in SAPscript.Layout Set Commands • In SAPscript. any text can be included at a certain position in the document using INCLUDE command.

Layout Set Commands • The ‘name’ in the include command is always the document no for APPLICATION TEXT and the name of standard text for STANDARD TEXT. Example : vbdka-tdname. The text ‘object’ specifies the environment to which a text belongs. vbdkr-tdname. vbdkl-tdname. TEXT NAME TEXT ORIGIN VBBK Sales document Header Text KNVV Customer Master SD Text VBKA Contacts General Text VTTK Shipment Header Text The ‘object’ is always ‘TEXT’ for STANDARD TEXT. • • .

Layout Set Commands • • Several different text IDs can belong to one object . . 0003 Sales document header note2. TEXT ID 0002 Sales document header note1.

• Execution sequence of function calls – A layout set must be opened before being able to output data. . – Data can be transfer as often as required. • Structure of Programs – Stand alone – Transaction Triggered Overview • Communication in between program and layout set is done via execution of function calls and communication structures.Output Program • Program retrieves the data to be printed in a Layout set.

• CALL FUNCTION ‘ WRITE_FORM ’. • CALL FUNCTION ‘ CONTROL_FORM ’. • CALL FUNCTION ‘ READ_TEXT ’.Output Program Function Call • General Function calls: • CALL FUNCTION ‘ OPEN_FORM ’. . • CALL FUNCTION ‘ CLOSE_FORM ’.

= .. = . = . = . = ... APPLICATION LANGUAGE ….. OPTIONS DIALOG = . = .....Output Program Function Call • CALL FUNCTION ‘ OPEN_FORM ’ EXPORTING FORM LANGUAGE DEVICE = .. IMPORTING EXCEPTIONS .

( Example : PRINTER. TELEX. DIALOG can request a pop-up screen on which user can enter spool information such as • • • . DEVICE specifies the output device type . SCREEN.Output Program Function Call • OPEN_FORM opens layout set for Printing . • Parameters • LANGUAGE defines the layout set language version . TELEFAX) OPTIONS can be used to specify the print preview.

Output Program Function Call • Possible Exceptions : • DEVICE • FORM • OPTIONS • UNCLOSED = Device type invalid = Layout set does not exist = Options invalid = A layout set is still active .

EXPORTING ELEMENT TYPE FUNCTION WINDOW = .Output Program Function Call • CALL FUNCTION ‘ WRITE_FORM ’ = . = . = .. = . EXCEPTIONS …...... .

TYPE defines area of the MAIN window. • Parameters • Explicitly specify ELEMENT and WINDOW name to output data from a specific ELEMENT.Output Program Function Call • WRITE_FORM transfer the data to layout. where data need to written. • = MAIN window • • . No specification of WINDOW name is necessary for MAIN window. Possible values : • TOP header.

Output Program Function Call • FUNCTION defines how the data specified in the text element is to be written in the respective WINDOW. = Identical with SET. • OTHER window • SET • APPEND • DELETE = Delete old contents and output new text. • MAIN window • SET • APPEND • DELETE = Append to preceding output. . = Delete the specified text element. = Append to preceding output. = Ineffective.

= Function is invalid. = Window area is invalid. = Layout set printing not opened. .Output Program Function Call • Possible Exceptions : • ELEMENT • FUNCTION • TYPE • WINDOW • UNOPENED = Text does not exist. = Window does not exist.

.. • • . Possible exceptions : • UNOPENED = No open layout set.Output Program Function Call • CALL FUNCTION ‘ CLOSE_FORM ’ = . EXPORTING RESULT EXCEPTIONS….. Layout set must be closed before being able to output the data on the screen or printer. = . • Layout set opened with function ‘OPEN_FORM’ is closed.

Parameter COMMAND accept the SAPscript command. Example : PROTECT … ENDPROTECT.. EXPORTING COMMAND EXCEPTIONS…. • • • ‘CONTROL_FORM’ can execute SAPscript control commands.. • • • UNSTARTED = No layout set opened .. Possible exceptions : UNOPENED = Layout set printing has not been opened.Output Program Function Call • CALL FUNCTION ‘ CONTROL_FORM ’ = . = .

. = .. EXPORTING OBJECT NAME ID LANGUAGE HEADER LINES = .. = . EXCEPTIONS ….. = ... = IMPORTING TABLES = .Output Program Function Call • CALL FUNCTION ‘ READ_TEXT ’ .. = .. .

. DATA BEGIN OF LINES OCCURS .. • Work area for header must be defined as a field string..Output Program Function Call • An application text can be read from text file. DATA BEGIN OF HEADER INCLUDE STRUCTURE THEAD DATA END OF HEADER • Work area for text lines must be defined as an internal table. HEADER and LINES contain header and text information after successful execution.

= Text not found. . = Text name invalid. = Reference sequence interrupted. = Language invalid. = Text object invalid.Output Program Function Call • Possible Exceptions : • ID • LANGUAGE • NAME • NOT_FOUND • OBJECT • REFERENCE_CHECK = Text ID invalid.

• Sources of data : Document SO Delivery Note Picking VDLKK Invoice VDBKR Header Item VDBKAVBDPA VDBKL VBDPL VBLKP VBDPR . Sales Order ) generation programs can also be triggered via business transaction.Output Program Function Call • Document ( e.g.

Output Determination  Linking a layout set to the printing program  Proposing the output type for the documents  Output time  Output device  Print parameters Configuration .

Configuration Linking Layout set to Program: SD • SD Module Menu: SD > Basic functions > Output > Output determination > Process output and forms > Assign forms and programs > Allocate to sales documents • Output type / Medium determines – Printing program – Layout set – Form routine • Good screen to check initially to see which .

Helps to consolidate logic variation in one program • .Configuration Program FORM EntryA Internt’l = X Linking Layout set to Program Layout set FORM EntryB Interco = X FORM EntryC internal = X • • FORM Entry Open_Form If Internt’l = X …. All output type can be associated with the same program / layout set combination but to different “FORM Routines”. Endif By using the “FORM Routine” field you can indicate different “entry point” to the printing program. elseif Interco = X … elseif Internal = X ….

Configuration Linking Layout set to Program: MM • Purchasing Menu: MM > Module Purchasing > Messages > • Output control > Output control > Define output control for the purchase order Inventory Management Menu: MM > IM > Output determination > Assign layout sets and programs Warehouse Management Menu: MM > WM > Activities > Define print control • .

Configuration Linking Layout set to Program: FI Module • Finance Menu: FI > AR & AP > Customer (Vendor) accounts > Line items > Correspondence > Carry out check or correspondence settings >Define form names for printing correspondence • Check Printing Menu: FI > AR & AP > Business transaction > Outgoing payments > Automatic outgoing payments > Payment method / Bank .

• Create a character string and include the barcode with it. • e. follow the steps below : • Select / Create a barcode font in SAP. / <BC> * &VBAKA-WERKS& * </> .g. • The data need to printed as barcode should be attributed via the character string.Barcode Printing • To print barcode .

This file can be a bit map or windows meta file. • Print this standard text via SAPscript INCLUDE command. /: INCLUDE ZHEX-IBMLOGO-PCL OBJECT TEXT ID ST . • e. follow the steps below : • Built a Logo. • Convert the Logo to a TIFF ( extension TIF ) file.g.Logo Printing • To print a Logo. • Use program RSTXLDMC to convert the TIF file to a standard text.

SMARTFORMS Session – 1.3 & 4 DAY .2.10 .

• .

• .

• .

Navigating in the SAP Form Builder • .

• .

.

• .

.

• .

• .

EDI.ALE.IDOC AND BAPI .

IDoc Applications Business Connector Internet Intranet ALE IDoc R/3 System Other Systems. EDI Subsystem R/2 System Workflow Electronic Form © SAP AG 1999 ...

12) by EDI subsystems. or both . • The application which uses IDocs (for EDI or ALE) must be able to write data to IDocs. or read data from IDocs.EDI: Electronic data interchange between different companies • ALE: Electronic data interchange between different systems within one company • Systems can exchange IDocs either directly (for example R/3 with R/3) or have them translated into other standards (for example UN/EDIFACT or ANSI X.

• The difference between EDI and ALE is • ALE: • it is synchronous data transfer • uses file port • Destination is not required • Data transfer between SAP-SAP .

• EDI : • Asynchronous data transfer • trfc port • Requires Destination • Data transfer is from non SAP to SAP .

EDI and ALE Document SAP R/3 System IDoc IDoc SAP R/3 System IDoc EDI Subsystem Message EDI Subsystem © SAP AG 1999 .

Assign the clients 3. .Distribute the distribution model • 6.generate the partner profile in receiving system.ALE Configuraton steps • • • • 1.Set up clients 2 .Set up rfc destination 4.generate the partner profile in sending system • 5.

• 7.Transfer the Data from sending system to destination system • T-Code for partner profile – we 20 • T-Code for port – we21 • T-Code for RFC destinations – sm59 • Assigning clients – scc4 .

IDOC • IDOC – Intermediate Document • which is used to transfer the data from one system to another system • It contains 3 types of records : • Control Record( only one ) • Data Record( One or more ) • Status Record( One or more ) .

• Status records which determine the defined processing steps for the IDoc. the number of status records for an IDoc increases as processing continues.• One control record which store the seneding and receiving system address. As a result. • Data records which store the application data in segments and describe the hierarchy of these segments. • • • • • T-code for segment – we31 T-code for message – we30 T-code for idoc – we81 T-code for attachinf idoc to message – we 82 T-code for status codes – we 41 and we 42 .

Process Flow: Sending Data R/3 System Post document Generate IDoc Check partner. find port Transfer data. process further External system © SAP AG 1999 .

process further Documentation Documentation Tools Tools © SAP AG 1999 . find port Port Definition Port Definition External System EDI Subsystem ? EDI Subsystem ? Transfer data.IDoc Settings: Sending Data R/3 System Post document Archive IDoc ? Archive IDoc ? Generate IDoc Partner Profiles Partner Profiles Check partner.

Generate IDoc Post document ok? No ok? No Error handling © SAP AG 1999 .Process Flow: Receiving Data External System Send data to R/3 System transfer R/3 System Check port & partner.

Port Definition. generate IDoc Post document Error handling R/3 System © SAP AG 1999 .IDoc Settings: Receiving Data External System EDI Subsystem ? EDI Subsystem ? Send data to R/3 System Documentation Documentation Tools Tools Port Definition. Partner Profiles Partner Profiles Archive IDoc ? Archive IDoc ? Check port & partner.

• To access the BOR T-code is sw03 • To access the BAPIs directly tcode is BAPI .BAPI • BAPI – Business Application programming interface • The BAPI ActiveX Control enables external applications to access business functions in the r/3 system by calling BAPIs through OLE Automation. • The place in SAP R/3 system where we can find all the business object types is called as Business Object Repository.

of wheels Cname Model ---------------Create(BAPIs) “ function mod. • Class Vehicle BusinessObjectTypes Customer { { color Cust id No. Move(--) {} {} change (---) Stop(------) {} {} Getlist(----){} } } .• In SAP system we have Business Object types like Classes in oops.

Establish a connection to the R/3 System. . Access Business object properties and/or call BAPIs to manipulate business objects.Classes in OOPs Client: Vehicle scooter : new vehicle() Scooter. Create one or more business object instances.color=‘black’ Scooter. Release business Objects logoff from R/3 system Release the BAPI ActiveX Control object. An instance of the BAPI ActiveX Contril.model = ‘1998’ ----------------If the Client application is VB: Create the BAPI Activex Control Object.

Day 11 Exercises .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

W .

.

.

.

.

$!$#!% .

2 .5907 431:7.$!$.5907 :95:9!747.5907 3974/:.4:9$09 .943 .943 .759 .5907 .

07 !& !:7.943 ..0 W .902039 0.389 ...8  44/870.3974/:...5.98$!$.943 !:7.4.43172.073490 4397.25084114728  :89420789..0020398 0.8047/07 W 4728..039 97070/ 3.389 .759 W $!$.-08  !.7598:80/94573914728 W 472'8 #054798 W 472844 3.9 W 4728.3.07.83706 $ 36:7 7/07.059 44/888:0 !.3-00.

70.990/:83./.943 W 3.70/0130/.7598.8047/07 W 09.9$!574.7057390/:8314728 W 4728. W $!/4.943 4$!$.90 472 !739 :95:9 W $.0 W !:7.43172.3974/:..759 W 7/07.4:9 8098 . 0130 $!$. %025.:20398./08147.759478 !.4:9809 #0.:2039 ..4:98098 W $!8.3/1472.9449.:2039 4.9:70 $! $! 4.0847/07 W 3/4.4.8047/07 W 09.9.93.:2039 W !:7.

:2039 .934728 :95:9 !747.:2039 #05479 70.:2039 4.943 70.3974/:.4:9809 .:2039 4.93#054798 :95:9 !747.2 ! 472 $! $! 4.2 ! $! $! 4.93#05479'8 472 70.

:2039 4.:2039 :95:9 !747.943 $! $! 4.759 :95:9/090723.2 .431:7.943.3974/:.4:9809 472 !73907.943 42543039841$!$.

7 472.9890097.9.98/..9.943 W W :95:95747..90//.439431:7..9.943. 431:70825./.2 97.1742$!/.9.

807573907 -.4:9809 W !73907.4/0 44 W .7..

439.431:7.431:7.039 923.943 431:708970730.943.943 :95:9/090723.

943 ./0893.

.431:7.943 .0452039 42543039 :95:95747.943 25.0 !7084:7.0 :3.0 .807 439.7590.943 %0893 #084:7.2 .4:9809 :95:9/090723.3974/:. .88.0 !7084:7.943 !73907.431:7.9 %072.943.943 $!$.7084:7.431:7.

88.! .

! 3/ :807.

943..:3.

0 . !70874:.

039 W #0. .:20398-0357390/  90390$!8..759.4:9$09 $420.0393.039 /0503/039 W .4:98093..4:98093 430.0850.3:.8147 9089047.0.1.039 .-0390.1.454190..98 W 039850. W 490190.4:98098349 . 90/4..943 00543 430.42203/..

7.03/48  .7.08 W !.$.4:9809 39.90789738 W 3/48 W !.0883.7003 W 0.7...4:9$09020398 03: %44847/574.58 W ./07 W !.

90 902.0  !.907.03/48 905.7.3//01.843905.!7.79  !.907.79  !.4:9$09020398 425430398 $  !  .7.79  !.3/8041903/4843 .7594341.08 0307.014314 !48943.5.:9809938 439.7.3/9.08 .-314 43931493.314.5 08.79  !.2041905..0  !.   902.90 $4/ 94 $5 94 $  !  .08 !.79  !.0895.70.7.58 ./07 !.7.79 %49.79 W W W W W W 0.!7.90789738 3/48 !..

3/ 039 W 4903/4.4:9$09020398 !.3/ . 84:/.03 -90:5507019 .3/90/9.03/48 W 8941.5.3/903-0 .47307.447/3.70.0 2:891789-0/0130/:3/07 3/48 .908.550.903/4843 905.0 3/48 .743.09.908 W %0.447/3..//0/94905.

7/ .. '# '.-0894-057390/3 903/4 .4/0/9098.3/90 .3.3 .-0  $% 4389.7.3/48 /0130/14790..439.3 $50..39 W $488941.7.4:9$09020398 3/48 W %50413/48 .4:9809 W 3/4..

..4:9$09020398 3/48 %09002039 W 3/4.439.7/ .43903941903/4 W $50...7.4/0/9098.9078 01.3..9:..7.:95.-0894 -057390/3903/4 W %.4:23$50.7.3890 .3..5 .7.9 4190909 W %0930.1081472..4:23439.3/90...

422.3/30 .

42203930 .

%09002039 .

798 99030.4:9$09020398 3/48 %09002039 W %09002039...889.

3/ ..4393:089490309909 002039 .

4190988:774:3/0/ -.2 34990.9 .909002039  0  -4.4:9809 9.43974809074734994 5739. W 98904:95:95747.

-83.-08 .90.5 W '.7.7057390/ W %.7. .7.5.3/9047/073 .

943 W :89/0130.0 W %0..:78.0 850.08 W $48905.895.0.89801 .014 31472.4:9$09020398 !.10890309 5.0/0130890 3095.89 945.08 W %017895.90.0 70.

7.58 W 439.38.-8 .9.541909 W 439 W %. 5.943300/0/ 941472.7.7..4:9$09020398 !. 31472.7.

:91439174290 .58 %.-8 W $50..19.-894.4:98090.7.10/  /01.7.4:238147309028 W 13414398850.90 ./07 -0:80/ 439 .4:9$09020398 !.70.

0 W .7.50.:9.3-0:80/93 5.:9809938147 .077/0 90/01.7.7..7.7.907 8908850.5 .7.7.10/.5944..990 5..7..907$9738 W /01.4:9$09020398 .1047/89390 5.

:9809938 W !.9.4:9$09020398 0..01472./07 W /23897.9/1107039 147/1107039.4:39708 .0314 W 01.

.07..9438 W 0.   .7.30 308 5073...9078.55.

 .3.

2:203941 0.29439071..4:9 809 W %08957393/408349 9707904:95:9 5747.4:9809 W 982584890 2.419010/8 .4:9$09 %089!739 W 03:&99%089 5739 W $4890.0 990..4:9 /0834190..

3920 ...8-003 2.9..93.../0 .4:9809 .4:9$09 .90 W :89.9090 .30..9.4:9809..9.4:9$09 W 03:.

:08/:7357391472..83..3.993 W $2-48.70/03910/-.81448 W W W W $$%82-48 !# #82-48 $%#82-48 %%82-48 ..:/0/3  .3-0.705.20..04/078147..70.82-4..250 ' ' $2-48..0  W 0503/3439084:7.7.:041.80 80389.42081742  90.4:9$09 $2-4 W $2-48.9078 .0 90.90470/...

 439 0.708:550/-$!8.9098 443.43/8 !..7598 %0 .0 !. 4:78 3:908 $0.0 .7 %2041/.3-0:80/3.38 &3/0730 '079..90 .708941 1706:039:80/8890282-48 %   % # %  &#$ &%$ $ $ ! %! $! & ' :77039/.4:9$09 $2-4 W $$%82-48.30 ..03:2-07413095.

890.-0 %%% 147.759:8078 W '..902039 .4:9$09 $2-4 W !# #82-48..8832039.0397.29.943.90/-.04/078147.70..7.30/. 89..250   390.4:9809 %082-4..702.2 .20 W $%#82-4.3/10/9.:0841%%82-4.9.:08.$!8.894 -0/0130/390...70.4:98094:95:990:894207 83.39.705.:08-90 4:95:95747.420 1742905747..250.34309.9.

 $&   .

.3-0/4303 1443/1107039.8 $   $   $   $   $   $  # $  $ $    $   909 $  909  11809 039 19082-4839..38 #9 :8910/4:95:9 $:557088 .4:9$09 $2-4 W  #%%419082-4./30748 4257088-. 4:95:93493 $:5570880.

80 !# '!# $%   .2508 '!# %#   ' #  :7703. ' # .349.5. 83 0.903..2.993 543039.943 43..3/909 .01472.9434182-4.

.3-0:80/9390.43974 9014414.4:980994..3/8 W  $ ..4:9$09 422.250 .

 .

 .

 .

 .

 .

 '# ' #  "   !#  7 $  !#  78  !# .

.250 .4:9$09 422.3/.4:9 80994.3..3/8 W $ $.84-0:80/390.422. .439749014414.

 .

 .

.

 .

.

80  '! $ #%# $ .80  '! $ #%#  %#$ . $ ' ' #    .

 .9 $39.3-0850.0 -70.422.4:9$09 422.3-02....10/05.4:9809 %03095../0 3$!8.3/ ! .759.3548943-014709003/41905.5.9.0/0130/ 390.3/8 W &8390.0.

5.7.  !!( W 5. .5.93..0390/-:83 98.7.3-0570.3/!# %% !# %% $39.422.0-70.

 !# %% 909909909 .

 !# %% .

//7088.47/394905489..4:39741/0893.98 .89.943.7.20907 &%#  $39. .8/0130/390 5.3/.4:9$09 422.3/#$$ #$1472.7/84190 .3/8 W %0.422...3.

 #$$'#!##!5.7.5 !# #%574$308( .7.

.

 .

 .

 .

 .

 .

 .

 .

 .

 .

4/0 %.4:397  # &%#803/07.5039.//7088 3.20((( $%#%89734 !  54-4 .4/0( ! $% 5489.20 3.9 ..9( # /897. %%147241.9  &%#70.4:397 #$$ .20 3.20 3.

.//7088 .330 ..947-..//7088  !488-0.99390.701742943 1983495488-0941472.8039070/ 3905.20 .9.:08.7.7.3/.41308 90/.947-.20907$..//70883082...20 4:3973.81448        $ 47241..3/8 W !.330 .20907!# #%/01308.9.7 %05488-0.088.-01471472..20 ..:08.70.3/.-0 42990/ 130.//7088/.7..20 $9700930 930 W %05.9 .70./:094.4:9$09 422.20907!# #%842990/ ..

4:9$09 422..-01472.10/ %0.9010/8.70 1443       .3/$%% $ 19071472.422..250 ..98147/.3/0.90.8 850.7 /98 0.993./.3/8 W %0/.3-01472.7..990/:8390.. 43931:708 439347/8 0.704:95:9.7 /98 . 2439.

$%%$ .

.

.3543941920- .3-070809.9. W %01472.993.

$%%$ 472.770/4:9..8 /0130/-90$8902 .9938903.

.3-01472.704:95:9.993.3/ 80.-01472.3/8 W %0920.990/:8390.43/8 .10/ %0.250 4:78 3:908 $0.3/$%% $ 19071472...8 850.701443    $$ .43/8..981474:78 23:908..92010/8.422.4:9$09 422.

993.3543941920- .9..$%%$ $$ W %01472.3-070809.

$%%$ 472.770/4:9.9938903.8 /0130/-90$8902 ..

250 & '! %  %'! !##!% & $*%%  %%%$'!##!% W %070.7. &3.422.079.20 %4-0.7094/1107039950841909.7.3/49074308$%#%% .0 .3/0/3$!8..3909.3-03.:2039:83&.759  308 !!% %%.3/8 W 3$!8.9/039107!##!5.3:.:/0/.4:9$09 422.3 548943390/4..759 ..3/ $39.5 &.9.

..4:9$09 422.890/4.250.909-0438  %% %% # ' $.:/0.%09 '%% $520390.422.8907$%09 ' 439.-/.20 ..1089003.20 3903./07%09 %0 4-0.:20390./07%09 '' :894207.-/ 9/3. 9/3.3/8 W %0 3.3/8.3/903.-/7 9/3..3/.20 W %0909 4-0.743203994.9 850.08/4.8 %% 147$%#%%  .980307.7/909147 $%#%% W .20 .204189..9 8.:203934147 !!% %%.

./073490  $./11070399098./073490 .4:9$09 422.9  W %%  $.08/4.3-043944304-0.08/4.:20390.3/8 W $0.07.:20390..

9:708 W 0.8706:70/ 903/.430 %7..943. .07..3/...00.894-0.38.9.3/.480/ .2 .9.0890/.94-057390/3.841903.9.4:98092:89-045030/-01470-03.9433-090035747..422:3.4:9 8098/430..4:9809 W $97:. .0 W !747.9:7041!747.8 ..28 $9.943.2.-094 4:95:9/.4:9809.:943806:03.8.943%7070/ W 422:3.270970.:943411:3..943897:.38107.0411:3.3-097.:95:9!747.3/ .

 W 0307..943.2 :3.8 W &%   !* # W &%  #%* # W &%   $* # W &%   %# * # W &%  #*%% .:3.943.:95:9!747.

2 :3.:95:9!747. W &%   !* # ! #%  # & '  !% $    !!%  &       ! #% !% $ .943.

.250!#%#  $# % % !% $.0  .20 W W W W . !* #45038.9438:.4:9809..1905739570..2 :3.3-0:80/94 850.0.4:9809 147!7393 W !.8 5739073.:807.3706:089.3:.7.209078 W &/0130890 .303907 854431472.:95:9!747..545 :5 8.0950 .943.07843 '850.700343.108904:95:9 /0..

2 :3./ .4:9809889. W !488-0.059438 W ' W  # W !% $ 0..09503.4:9809/408349089  594383../ .943..0 W & $ .9..:95:9!747.

 W &%  #%* #   ! #% % %! &%        !% $ .2 :3.:95:9!747.943.

9.9.3810790/.943.20944:95:9 /. % 4850.1.9.209078 W 5.:08  W % ! 3/4 W W .. W #%* #97.1742. 300/9479903 !488-0.088..850.2 :3.94341  3.4:9 W !.9850. 94.20830.4190 3/4 070/.1.1% .7147 3/4 %!/01308.7.70.:95:9!747.3/ 3.

10/909002039 W 01..0/34:95:9  /039.943.9.850.0  W 3/4 W $% W !! W % 5503/94570.0 W %#3/4 W $% W !! W % 00904/.9. W &% /01308490/.4390398.:98$% .9.0/34:95:9 009090850.2 :3.10/ 390909002039894-079903390 70850.9$% 30110.3/4:95:930909 5503/94570.:95:9!747.

:95:9!747./ 3/4..70.83. W !488-0./ 3/4/408349089 .2 :3.059438 W % W &%  W %! W   W & ! %09/408349089 :3.94383.943..4:98095739334945030/ .

943.700347573907  !488-00.943 !* # 8.4:980945030/91:3.480/-01470 -03. W &%   $* #   ! #%#$&%  !% $ W .4:9809  W W .059438 W & !44503.4:98092:89-0.2 :3.9.-0944:95:990/.:95:9!747.4390 8.480/  .

43974..250!# %% !# %% !.3/ !488-00.759 .:90$!8.059438 & !.943.422.4:980957393.:95:9!747.3/8 ..2 :3.422.8349 -00345030/ W W W W W &$%#%4. W &%   %# * #    ! #%   !% $ W  %# * # .05990$!8.20907 .300.7.759 ..4:980945030/ .

2 :3.943. W &%  #*%%  ! #% %   & # $        ! #% %$ !% $ .:95:9!747.

:95:9!747.70.-0 % $ &#$ .8.3/$ ../07.943.10/ 8973 % # &$%#&%&#% % # W 47./07 2:89-0/0130/./174290910  #.439..3/909 31472.30.1907 8:.9.943909.0881:00.943.147909308 2:89-0/0130/.55. W 3.1470.70..3 39073.2 :3.8.3-0 70.:943 W 47.

.03.039077:590/ W ##* .2 :3...93. W !488-0.203.:95:9!747./ ..0806:03.3:./ %0934914:3/ %094-0.059438 W  W & W  W  %* & W % %093.943./ %093./ #010703.

4..38.943 5747.3 ' '! 3.0841/.:95:9!747... 4.08 7/07 0307.943 W $4:7.28. W 4.:2039 0  $.84-0 97070/./07902 $ ''! 0.0 '#'!# !:7.3.07490 ' '! !.9.-:83088 97.80 7/07  ..:2039 0.2 :3.943.

209078 .0  !7395.7.943 :95:9090723..943  33.4:9809949057393 5747..:20398  :95:9920  :95:9/0.2  !745483904:95:995014790 /4.431:7.

943 33.9438 :95:9 :95:9/090723.2$ W $03:$.8.90948.3/5747.0884:95:9.28 4.08 /4.943 !74. 4/:0 1:3.431:7.3/14728 88314728..:20398 W :95:9950.4:980994!747.

28.94800. 5747.2 .3/ .700394.0.4:9809 47274:930 W 44/8.0/:2 /09072308 !73935747. 39.

 3/1 W :8390  ##4:930  10/4:.2 W 4:95:9950.33/.  #397 503*472 1390739  08013907.4:9809  #397 3907.3-0 .20 5747..2.90/9908.884.4  #397 39073.90/1107039 03975439 949057393 5747.943 !747.2 .4 080139073.431:7.4:980994!747..2  #397 390739  33...

4384/.904.94334305747.7. .4:9809 .943-:994/1107039  ##4:9308  W 05894...42-3.2 .

4:980994!747.4:9 8098..908 01305739.9.3.83088.8303: 4/:0 !:7.8047/07 W 3.08 :95:9.2 W !:7.704:80.3..943883.28 W .0203903: .3/5747.4397414790 5:7.0203903:  :95:9 /090723.43974 01304:95:9.43974 :95:9.943 33.43974 .431:7.03947..

47 ..0..9.2 W 3. 4:9435.003:#  4/:0 !:894207 '03/47  .20398 !.943 33.20398:942.47708543/03.47708543/03.4:398309028 47708543/03.0 W 0.431:7.208147 57393.77 4:9.3.!739303: # !:83088 97.4:980994!747.20392094/..943 :943 5.0809938 013014723.0.38.

.3 800.943431:70 .

9.7.4/0 1449089058-04 W $00.4/0!7393 W %45739-..7.

8-..70.7.7.997-:90/ .300/9457390/.90.:/090-..4/014393$! W 70..4/09 9 W %0/.7..9078973 W 0  ..7.9078973.3/3.4/084:/-0..-.90.9.90.7.

  ' #$  .

 .

422.3/.$!8.5473/48 209.3-0.% 0903843% 10  W &805747.079904494..7/909 W !7399889.44!7393 W %45739.759& .-92.10  W 43.44 1449089058-04 W :9.07990%1094.7/909.3/ W 0  .43.3/.44 %810.2#$%94. 89..

 &   ! %%%$% .

$#% #$ $08843       .

W .

W .

W .

...93390$!472:/07 W .

W .

.

W .

.

W .

W .

   ! .

309  4.947 3907309 397.4.. #.9438 :83088 4330.55.

$8902  $:-88902 #.

$8902 4714 0.9743. 472 907 $89028 $! .

.308 W 0.0.9.30.30-09003/1107039 88902893430.250 #.30-09003/1107039 .304..80907/70.425././.425.3907.3907.9743..9743..3 W $89028.9.9 1470.

9#.

90/394490789.38. 47..3/.7/8 1470.090297.250&.

-094790/..943.:8084.8 47 -49 .%47$  - 8:-889028 W %0.17424.9.944.55.8 4770.8 14747 2:89 -0.//.9.

38107-09003$! $! .9.97.7434:8/.97.0-09003.9438349706:70/ W .38107 W :808105479 W 0893.W %0/110703.9.3/8 W  W 9883.

943 W .W  W 83.3810781742343$!94$! .9.5479 W #06:7080893.9.7434:8/.97.38107 W 971.97.

3/ 4..:2039 $!#.

4. $!#.$8902 4.

$8902 4.0 $:-88902 $! . $:-88902 088.

943  0307./0893.3 88902 .90905.0398  $09:571.79307574103803/3 88902 W  897-:9090/897-:94324/0 W  0307.7930757410370.431:7.90905.94389058 W W W W  $09:5.0.0398  88390.

 .3810790.7930757410 0 W % 4/01475479 0 W % 4/0147#/0893.1742803/38890294/0893.W  %7.9438 82 W 8833.943 88902 W % 4/0 1475.0398 8..9.

3490788902 W 9.439.9:8#0.9.9.3810790/.:2039 W .17424308890294 .904.3895084170.8:80/9497.#0.  W   390720/.47/  30472470 .47/8 W 43974#0.47/  30472470 W $9.47/ 43430 W .

38020398.0 0 % .3/0 W .942088.4397470.943/.7-09007.4393:08  W W W W W % .9:870..99.8574.4/0147/4.3 4.3.9.89470908030/3.4190808020398 W $9.7.708:9 903:2-074189.0 0 % .30.4/014789.70.31/4.3/70.0883.8947090.808.3 88902.9:870.47/8.4/08 0.47/. 8.3/ /08.4/01472088. 0 % .47/8.088389058 147904./090723090/0130/574.55..70.9.0.47/8147.4/0147.9:8.//7088 W .4/0147802039 0 % .

#.9.!74.0884$03/3.

:2039 0307. 574.38107/.904.9.0881:7907 9073.88902 $! .5. 0.$8902 !489/4.79307 13/5479 %7.

4.9.$09938$03/3. #.

0881:7907 4.79307!74108 !.:2039 7.5.$8902 !489/4. !.04..904.9. 7.. 0307.04.943 %448 %448 $! . 574.:2039.38107/.943 4.79307!74108 0.:2039.$8902 $:-88902 $:-88902 %7.79307 13/5479 !479013943 !479013943 9073.

0884#0.9.9.0.3.94 #.!74.$8902 $03//. 9073.

38107 #.$8902 97.

3/3 $! .$8902 0.79307 0307. !489/4.:2039 4 4 4 4 7747.5479 5.904.

4.94 #.0.$8902 $:-88902 $:-88902 $03//. 9073.9.9.$09938#0.3.

3/3 #. 7.:2039..79307!74108 7.:2039.04.04.943 %448 %448 !479013943 !479013943 !.5479 5.79307 0307.$8902 4.904..943 4.:2039 7747.79307!74108 !. !489/4. 0.

$8902 $! .

9435747.22339071....0 W %0!.04397403.94383907.9438 94.088-:830881:3..-0809073.9.! W ! :8308855..55..

88902-.3 !8974: :942.943 W %05.03$!#...

.995088....0/.4/08! .4/088  W %4.889020700..90 -:830884-0..9 #0548947 W %4.08890 #% .8:83088 -0.313/.99.08890!8/70.

447:89/ 4 410083.0:83088 -0.W 3$!889020.94324/ 4.88'0.90 !8  1:3.9%508:894207  .88083 4458 W ...20 4/0 70.30  $945 < <0989 < << .0 < <.0:83088 -0.995080.

55..9438' 70.9090!.04190!.447 -.08. $.4490730.9439490#.0.04397 89.0 $..-8.44907 .043974 -0.9 3389...88083 !8039 '0.3.44907 24/0  190039.4330.9.9.

$8902 70.9574507908.3/.9389.08 .90430472470-:830884-0.088:830884-0.3..

35:.90-:83088 4-0.98 44111742#.!8942.98 #00.47..80-:83088 -0.

88902 #00.9 .0439744-0.9.8090!.

 07.808 ..

Sign up to vote on this title
UsefulNot useful