460 likes | 633 Views
Introduction to ABAP/4. HISTORY OF SAP. SAP was founded in 1972 by five people: Wellenreuther, Hopp, Hector, Plattner and Tchira.
E N D
HISTORY OF SAP SAP was founded in 1972 by five people: Wellenreuther, Hopp, Hector, Plattner and Tchira. Wellenreuther , while working at IBM , developed a financial accounting package running in batch for an IBM customer – Naturin. SAP bought rights from Naturin and started to design and implement the real-time finance system as a standard package based on Wellenreuther ’s experience in the application. They sold the first copy of the standard system to ICI. Simultaneously, they developed a Materials management system as a bespoke software for ICI by reserving all property rights.
Staffing of SAP Projects Strategic Thinking SAP may be part of a larger change project Process Design Expertise in the design, change and documenting of business processes Project Management Essential throughout the project lifecycle Change Management Expertise is required in changing the organization System Architect Overall responsibility for feasibility of the design and integration issues Application Experts People with skills in configuring specific SAP modules Business Analysts Involved in piloting and must be trained Trainers Training must be given to the users and team members new to SAP SAP Developers People who can design and build bolt-on functionality Operations Staff Responsible for administration, performance and transition
ConfigurationTeam BusinessEnd Users DevelopmentTeam OperationsStaff SAP Products and People SAPManuals ConfigurationMenu ImplementationGuide Analyzer SAP Application Functionality SAP Development Environment BasisSystem Database Hardware
STAGES OF SAP IMPLEMENTATION. Scoping: 1 - 2 Months Decision making. Understanding the Organization. Analysis 3 - 6 Months Documentation, Discussions Design 2 - 3 Months Modules, Sub Modules, Interfaces, Databases, Dataflow. Servers, Terminals & Back up. Development Parallel with Design. ABAP/4, Configuration, Applications, Transactions,Reports. Configuration 3 - 4 days Settings to be done. ( IT department of Customer is involved) Implementation/ Testing/Training Post Implementation Support.
Client Server Structure – Three Levels (Stores all Data and Application Programs) Central DB Batch Processing Data Base Changes Reading Data Base and Updating Buffer Central DB buffer Central DB buffer Application Logic Output Data to User Input Data From User Output Data to User User Interaction
Where you fit in! After SAP installed , Analysts experienced in Business Process Re-engineering (BPR) , who are also configuration experts, customize the modules to meet the Corporation's need, or help the corporation change it's business practices to achieve the most efficiency out of SAP. This configuration does not usually involve programmers, but is instead done by Business Analysts. When the configuration process is nearing completion, the programmers ( Called ABAPers - specialists in ABAP/4) are brought in to extend any part of SAP that can not be configured to meet the needs of the corporation.
OK. Lets’ get straight into ABAP/4
ABAP/4 • Advanced Business Application Programming - 4 th generation Language. • ABAP/4 is the backbone of SAP R/3. • All the R/3 applications and parts of Basis system were developed in ABAP/4.
ABAP/4 Dictionary Object Browser ABAP/4 Editor ABAP/4 Function Library Transactions Menu Painter Translation menu Screen Painter
When you login to a SAP server the following screen appears
Enter SE38 in the space and click on ‘tick’ icon on extreme left for Editor Area - Initial Screen. Select TOOLS ABAP/4 Workbench for going into programming area. Or Use the other Procedure like This
This is the famous workbench they talk about ABAP/4 Development Workbench ! Click on ABAP/4 Editor button or enter the window for writing progrmas.
Enter the Name of the Program you want to Start. Without giving a name you can not proceed. The name shall start with Y or Z
ABAP/4 development ATTRIBUTES Attribute ABAP/4 program attributes Type ....................... Status ..................... Application ........... Class ...................... Reporting Test System Training 1 T S SCHU Type Status F4 F4 1: M: V: I: Report Module pool, interactive program Update program Include T: P: K: S: Test Productive use Customer program System program
Enter the following: Title for the report Type 1 Application *
Select Local Object and press the icon on the left side.
You Come back to this screen Press F3 to go back or use Back arrow.
To insert more lines for writing program. Place the cursor at the end of first line and press F7 or click on 5th icon from Left on toolbar.
Now you have completed your first program. Press CTRL + F2 for checking whether the syntax is right. ( 2 nd Icon from left) Press F11 or click on open book icon to save. Press F8 to execute the program you just wrote.
Congrats! You have just become an ABAPer.
Lets’ take a bigger program Take data from a table called TABNA and print the following fields NAME1, STREET, CITY. contents on the screen
Sy-tvar0 to sy-tvar9 are system variables. You can assign any value. They are used in header in this program. Ignore them for now.
Screen Attributes REPORT B170D034. FORMAT INTENSIFIED OFF. WRITE : ‘*********************************’. SKIP 2. FORMAT INTENSIFIED. WRITE : /5 ‘Date’. WRITE: 20 SY-DATUM DD/MM/YYYY. FORMAT INTENSIFIED OFF. WRITE: /5 ‘Time’, (8) SY-UZEIT UNDER SY-DATUM. Writes in BOLD Letters Turns Off BOLD Letters 1 31.01.1992 **************************************************** Date 31/01/1992 Time 09:06:51
Full Line Comment. Partial Line Comment. COMMENTS • Full line Comment. • A Star ( * ) is placed in the first position of the Line. • Partial line comment. • Double quote ( " ) is placed before you start a comment
Key Words • Declaratives (DATA,.) • Events (GET,...) • Control (IF,...) • Operational (WRITE,)
STATEMENTS *ABAP/4 Programs is built of Statements. * A Statement is a sequence of Words which always start with a ABAP/4 reserved keyword like Report, Data, Write etc. * All statements ( except comments ) shall terminate with a period (.) * A word in a statement is delimited by blank spaces on both sides. * Statements can begin anywhere on a line * Multiple statements can be placed on a single line * Single statement may be stretched across multiple lines
Colon Notation For readability Colon ( : ) can be used. Note the ( : ) after WRITE, ( , ) after first two lines and ( . ) at the end of the statement. OUT PUT ON SCREEN
CHAIN STATEMENTS WRITE ‘XYZ’. WRITE NAME. WRITE COUNTER. WRITE : ‘XYZ’ , NAME, COUNTER. ADD 1 TO COUNTER1. ADD 1 TO COUNTER2. ADD 1 TO COUNTER3. ADD 1 TO : COUNTER1, COUNTER2, COUNTER3.
* Variables must be declared in the program. * Variables can be upto 30 characters. * Key words of ABAP/4 shall not be used as variables. * The declaration process consists of telling the system what type of data will be stored in the temporary location associated with the variable. * These variables persist only during the execution of the program, and the data they contain is lost when execution is complete. * Variables can be declared at any point in a program. However it is preferable to define at the begining of a program. * Begin variable with a letter and then a combination of letters & numbers. Hyphen or Dash (-) is allowed. But do not use it. VARIABLES
DATA TYPES Type Characteristic Example. C Character “Any character” D Date "19980701" I Integer 500 N Numeric text 00500 T Time "223010" others F Floating point NUMBER 5e7 p PACKED DECIMAL 200.50 X Hexadecimal 23 A
DATA TYPES AND THEIR ATTRIBUTES Standard length Allowed length Data Type Meaning Initial value P Packed Number 0 8 1-16 I Integer 0 4 - F Floating point no. 0.000 . . . 8 - N Numeric text 00 . . . 0 1 1-max C Text Space 1 1-max D Date YYYYMMDD 00000000 8 8 T Time HHMMSS 000000 6 6 X Hexadecimal X ‘00’ 1 1-max
Conditional Operators # CASE # IF # ON CHANGE OF CASE: The case statement is used to indicate conditions for data that falls in a specific categories. Syntax: CASEfield. WHEN value1. Command lines. WHENvalue1. Command lines. WHENOTHERS. Command lines. ENDCASE. Example: DATA: w_year(4) . W_year = ‘1998’. CASE w_year. WHEN ‘1997’. WRITE ‘The year is ‘1997’. WHEN ‘1998’. WRITE ‘The year is ‘1998’. WHEN OTHERS. WRITE ‘The year is unknown. ENDCASE.
SELECT statement I Table description TABNA SHOW TABNA DDIC TABNA-COUNTRY CHAR C 3 TABNA-ID CHAR C 8 Table TABNA TABNA-NAME1 CHAR C 25 NAME Type Length Table work area TABNA PROGRAM B170D061. TABLES: TABNA. SELECT * FROM TABNA. WRITE: / TABNA-COUNTRY, TABNA-ID, TABNA-NAME1, . . . . ENDSELECT. Implied Loop
SELECT statement II REPORT B170D062. TABLES: TABNA. SELECT * FROM TABNA WHERE COUNTRY = ‘USA’. statements ENDSELECT. IF SY-SUBRC NE 0. statements ENDIF.
Internal Tables play major role in SAP.Understand the concept of Internal Tables well before you do something! SELECT * FROM <table> INTO TABLE <internal table> APPENDING <internal table> WHERE . . . ORDER BY . . . REPORT B180D06B. TABLES: TABNA. DATA: BEGIN OF TAB OCCURS 200. INCLUDE STRUCTURE TABNA. DATA: END OF TAB. * note the extra DATA: statement required for an INCLUDE. SELECT * FROM TABNA INTO TABLE TAB WHERE COUNTRY = ‘USA’. LOOP AT TAB. WRITE: /TAB-COUNTRY, TAB-ID, TAB-NAME1. END LOOP.
I have tried to give some info to take a look at ABAP/4. Go through training or refer books to master ABAP/4. SAP is difficult to master. Concentrate on what you are good at. ALL THE BEST !