Академический Документы
Профессиональный Документы
Культура Документы
SAP ERP
2009 SAP AG
Page 1-1
SAP ERP
Introduction to SAP
Navigation Sales & Distribution Materials Management Production Planning Financial Accounting Controlling
2009 SAP AG
Page 1-2
SAP ERP
SAP
R/3 stands for Runtime System Three. It is one of the ERP (Enterprise Resource Planning) systems around. Similar products are Oracle and Peoplesoft. ERP is used by companies to plan, organize, integrate and manage their various operations like accounting, finance, manufacturing and human resources. The main aim is to improve efficiency and accuracy.
2009 SAP AG
Page 1-3
SAP ERP
Who is SAP?
SAP AG
- Founded in Walldorf, Germany in 1972 - Worlds Largest Business Software Company - Worlds Third-largest Independent Software Provider
Company Statistics
Over 40,000 employees in more then 50 countries 1500 Business Partners 36,200 customers in more then 120 countries 12 million users 100,600 installations
Source: SAP AG website
2009 SAP AG
Page 1-4
SAP ERP
Oracle Applications
- Oracle, JD Edwards, PeopleSoft, Siebel, Retek
2009 SAP AG
Page 1-5
SAP ERP
SAP Architecture
World-wide usage
Designed to satisfy the information needs for business sizes (small local to large all international)
- Multi-lingual - Multi-currency
2009 SAP AG
Page 1-6
SAP ERP
SAP ERP
Real-time environment
Scalable and flexible
2009 SAP AG
Page 1-7
SAP ERP
SD
FI CO SAP PLM
MM
PP
SAP R/3
QM PM Client/Server ABAP Basis HR IS WF
AM PS
SAP SRM
SAP ECC
SAP SCM
SAP CRM
SAP NetWeaver
2009 SAP AG
Page 1-8
SAP ERP
Solutions
SAP ERP SAP CRM SAP PLM SAP SCM SAP SRM SAP Analytics SAP Manufacturing SAP Service SAP Mobile Solutions SAP xApps
Platforms
- Enterprise Services Architecture - SAP NetWeaver Platform
2009 SAP AG
Page 1-9
SAP ERP
2009 SAP AG
Page 1-10
SAP ERP
Logistics
Sales & Distribution Plant Maintenance Materials Management Production Planning Quality Management
Accounting
Financial Accounting Controlling Asset Management Treasury
2009 SAP AG
Page 1-11
SAP ERP
Industrial Machinery
Insurance Life Sciences Logistics Service Prod.
Wholesale Distribution
2009 SAP AG
Page 1-12
SAP ERP
2009 SAP AG
Page 1-13
SAP ERP
2009 SAP AG
Page 1-14
SAP ERP
2009 SAP AG
Page 1-15
SAP ERP
Program Attribute
2009 SAP AG
Page 1-16
SAP ERP
ABAP Editor
2009 SAP AG
Page 1-17
SAP ERP
2009 SAP AG
Page 1-18
SAP ERP
2009 SAP AG
Page 1-19
SAP ERP
2009 SAP AG
Page 1-20
SAP ERP
2009 SAP AG
Page 1-21
System:
Client:
Password :
welcome1
ABAP Language ABAP stands for Advanced Business Application Programming. It is a high-level programming languages used in the software SAP for customization and other development purposes.
All ABAP programs are stored inside the SAP databases and executed under the control of the runtime system, which is part of the SAP kernel. ABAP is the programming language used by SAP developers to build transactions that make up the R/3 application. It is a fourth-generation programming language with some features similar to some modern programming languages such as C, Visual Basic and Power Builder. ABAP syntax is almost similar to COBOL language. It was the first language that includes the concept of Logical Databases.
It allows variables to be defined, modulation of programs via subroutines and function calls, access to the database via open SQL and some event-oriented programming.
ABAP Development Workbench Tools a. ABAP Editor for writing and editing program code. b. ABAP Dictionary for editing tables and other ABAP Dictionary Objects. c. Menu Painter for designing the user interface (menu bar, standard toolbar, application toolbar)
ABAP syntax includes the following: ABAP programs are made up of individual statements Each statement ends with a period. The first word in a statement is called a key word. Words must always be separated by at least one space. Statements can be indented. Statements can take up more than one line
Date Type d
t i f String XString c x n
Description Date
Time Integer Float String Byte character Byte (hex) numeric
Length
8 Characters 6 Characters
4 bytes
8 bytes variable
variable
1-65535 1-65535 1-65535 1-16 bytes
packed
Output- 1123
REPORT ZY_FIRST. data v type p decimals 2 value '1.228'. write v. Output 1.23
REPORT ZY_FIRST. data v type p decimals 4 value '1.2223'. write v. Output 1.2223 ********************************************** REPORT ZY_FIRST. data v type p decimals 6 value '1.456234'. write v. Output 1.456234
Write Statement Syntax write <format> <field> <options>. <format> is optional. <format> specification begins with a / to indicate a new line. It can also specify the column number to begin the field in, and the
output length.
Write /03 (5) . . . means begin a new line, starting from column 3 ,for a length of 5.
Write 15 . . . means write the data starting from column 15 in the current
line. If the length is too small for the field, character fields are truncated, and
ABAP Language write statement is used to output data on the screen. write Hello World. write i. write / hello. write : hello, i. In the default setting, you cannot create empty lines with the WRITE statement.
WRITE 'First line.'. WRITE 'Still first line. WRITE / 'Second line. WRITE /13 'Third line. output on the screen: First Line. Still first line. Second line. Third line.
REPORT ZY_SECOND. DATA: number TYPE i VALUE 1234567890, text(10) TYPE c VALUE 'patiala'. WRITE: (5) number, /(5) text. Output is *7890 patia Note - If the output length <len> of write is too short, fewer
characters are displayed. Numeric fields are truncated on the left and prefixed with an asterisk (*). All other fields are truncated on the right, but no indication is given that the field is shorter.
REPORT ZY_SECOND. SET BLANK LINES ON. DO 5 TIMES. WRITE / ' '. ENDDO. WRITE '*****'.
REPORT ZY_SECOND. WRITE: 'One', / ' ', / 'two'. What is the output? One Two The system suppresses lines that contain nothing but blanks.
Use of skip
To create blank lines, use the SKIP statement as follows: Syntax SKIP [<n>]. The system writes <n> blank lines into the current list, starting at the current line. If you omit the <n> option, the system creates one blank line.
The following restrictions apply for this operation: If the number of lines remaining on the current page is too small, the SKIP statement produces a page break, displaying the page footer if any.
The system positions the next output to the first line beneath the page
header of the new page. At the beginning of a page, the system executes the above statement
only, if this page is the first page of a list level or if the page was created
using the NEW-PAGE statement. For all other pages, the system ignores this statement at the beginning of a page.
If the above statement is the last output statement of the last list page
(that is, there are no more WRITE or ULINE statements), the system ignores it.
In the default setting, the system does not output any blank lines created using the WRITE statement with the AT / option. A blank line is a line that contains character strings only and whose individual fields consist of nothing but blank characters. However, if you intend to output blank lines created by WRITE statements when outputting character strings, use this statement: Syntax SET BLANK LINES ON|OFF.
New line in ABAPNew-line : Terminates the current line and moves the cursor to the next line. If there has been no output (with WRITE or SKIP ) since the last NEW-LINE , the NEW-LINE is ignored, i.e. no new line is started.
Positioning Output Underneath Other Output You can position a WRITE output in the same column as a previous WRITE output. Use the formatting option UNDER of the WRITE statement: Syntax WRITE <f> UNDER <g>.
Data Declaration data a type c. data b type i. data c type c. data d type i. You can also use data: a type c, b type i, c type c, d type i. b = 10. To declare float variable and its initialization data v1 type f. v1 = '3.50'. write v1.
Control structures :loops 1. While loop while <logical expression>. <instructions> endwhile. 2. Do ENDDO do n times. <instructions> enddo.
Control structures :branching 1. If : IF<logical expression>. <intstruction1 >. ELSEIF <logical expression>. <intstruction2>. ELSE. <intstruction3>. ENDIF.
Control structures :branching 2. CASE : CASE <data object>. when <value1>. <instruction1>. when <value2>. <instruction2>. when others. <instruction3>. Endcase.
program zy_first. DATA: number TYPE i. number = 10. write number. data: a type i, b type i. a = number. b = number. a = a + b. write a. write'hello'.
REPORT ZY_SECOND. data number type i. number = 10. write number. case number. when 10. write 'hello'. when 9. write 'second'. when 8. write 'third'. when others. write 'others'. endcase.
REPORT ZY_SECOND. data tm type t. write tm. Note It will print default time which is 000000
REPORT ZY_SECOND. types: begin of student, name(40) type c, fathername(40) type c, id type i, end of student. data std1 type student. std1-name = 'ss'. write std1-name.
Example of do - enddo
do 4 times. write xyz'. enddo.
We can also declare variable like data f(10) value 'hello'. data nm value 100.
sy is a structure with the ABAP Dictionary data type SYST. The components of sy are known as system fields. System fields contain values that provide information about the current state of the system. They are automatically filled and updated by the ABAP runtime environment. Examples of system fields: sy-subrc - Return code for ABAP statements (zero if a statement is executed successfully) sy-uname - User name sy-repid - Current ABAP program sy-tcode - Current transaction code sy-index - Number of the current loop pass sy-datum - current date and time sy-host name of application server sy-colno sy-linno
REPORT ZY_SECOND. types text10 type c length 10. data name type text10. name = 'abcdefgheiriri'. write name.
Data Manipulation
1. Move d1 to d2. or d2 = d1. 2. Add n to m. or m = m + n.
REPORT ZY_SECOND. data d1 type i. data d2 type i. d1 = 10. d2 = 20. add d1 to d2. write d2. write d1.
The CONCATENATE statement combines two or more separate strings into one.
String concatenationREPORT ZY_SECOND. DATA: c1(10) TYPE c VALUE 'Jan', c2(3) TYPE c VALUE 'Feb', c3(5) TYPE c VALUE 'March', c4(10) TYPE c VALUE 'April', c5(30) TYPE c, sep(3) TYPE c VALUE ' - '. CONCATENATE c1 c2 c3 c4 INTO c5. WRITE c5.
REPLACE - To replace a string in a field with a different string, use the replace statement. REPLACE <str1> WITH <str2> INTO <c> [LENGTH <l>]. The statement searches the field <c> for the first occurrence of the first <l> positions of the pattern <str1>. If no length is specified, it searches for the pattern <str1> in its full length. Then, the statement replaces the first occurrence of the pattern <str1> in field <c> with the string <str2>. If a length <l> was specified, only the relevant part of the pattern is replaced.
REPORT ZY_SECOND. DATA: T(30) VALUE 'thapar university thapar', STR1(6) VALUE 'thapar', STR2(6) VALUE 'punjab'. REPLACE STR1 WITH STR2 INTO T. WRITE T.
The CONDENSE statement deletes redundant spaces from a string: CONDENSE str [NO-GAPS]. This statement removes any leading blanks in the string str and replaces other sequences of blanks by exactly one blank. The result is a left-justified sequence of words, each separated by one blank. If the addition NO-GAPS is specified, all blanks are removed.
REPORT ZY_SECOND. DATA: string(25) TYPE c VALUE ' one two three len TYPE I.
four',
len = strlen( string ). WRITE: string, '!'. WRITE: / 'Length: ', len. new-line. CONDENSE string. len = strlen( string ). WRITE: string, '!'. WRITE: / 'Length: ', len.
What is the output if these statements are included in the program of previous slide
CONDENSE string NO-GAPS. len = strlen( string ). WRITE: string, '!'. WRITE: / 'Length: ', len.
Output: one two three four ! Length: 25 one two three four ! Length: 18 onetwothreefour ! Length: 15 Note that the total length of the field string remains unchanged, but that the deleted blanks appear again on the right.
Comments in ABAPAny line beginning with an * identifies a comment line. To comment part of a line use the double quote ()
Splitting string To split a character string into two or more smaller strings, use the SPLIT statement as follows: SPLIT c AT del INTO c1 ... cn. The system searches the string c for the separator del. The parts before and after the separator are placed in the target fields c1 ... cn. To place all fragments in different strings, you must specify enough target fields. Otherwise, the last target field is filled with the rest of the field c and still contains delimiters.
REPORT ZY_HELLOWORLD. DATA: string(60) TYPE c, p1(20) TYPE c VALUE 'hello', p2(20) TYPE c VALUE 'how', p3(20) TYPE c VALUE 'are', p4(20) TYPE c VALUE 'u?', del(3) TYPE c VALUE '***'. string = ' Part 1 *** Part 2 *** Part 3 *** Part 4 *** Part 5'. WRITE string. SPLIT string AT del INTO p1 p2 p3 p4. WRITE / p1. WRITE / p2. WRITE / p3. WRITE / p4.
To reset a variable var to the appropriate initial value for its type, use the following statement CLEAR var. Example DATA number TYPE i VALUE 10. WRITE number. CLEAR number. WRITE / number.
Exit a loop: TO terminate an entire loop immediately and unconditionally, use the EXIT statement in the block of the loop. Do 5 times. If sy-index = 3. Exit. Endif. Write sy-index.
Enddo.
Continue After this statement, the system ignores any remaining statements in the statement block and starts the next loop pass.
Do 5 times. If sy-index = 3. Continue. Endif. Write sy-index. Enddo.
CHECK CONDITION
Do 5 times. Check sy-index between 3 and 4. Write sy-index. Enddo.