Vous êtes sur la page 1sur 5

< >

= lt = gt

sy_subrc se91 = message class for giving our own messages MESSAGE Modularization: Function Module Addition Importing paparmaeter: a,b res=a+b. Exporting Parameter res.

# Use Pattern for creating the body of functional module # Imoporting parameter # Exporting parameter # Changing parameter #Subroutine pg.132 Keyword for defining subroutine FROM ...ENDFORM Keyword for calling subroutine PERFORM #Shadowing pg.134 Local var are visible n used if both local n global r defined

# Variable definition in subroutines var1 type any var type data //can accept any type of data //type defined during runtime

data, any are keywords # Ways of passing inteface parametes 1. Call by value 2. Call by value and result //For small values...jus 2-3 values 3. Call by reference // If a huge table is to be copied....and same m emory location that is passed

DAY -3 Defining and calling subroutines pg.136 #2 methods of calling subroutines are: 1. drag and drop...from side bar 2. by using pattern....from toolbar/menubar # # # Documentation for function module Handling exceptions in function module pg. 151 Funcion module Helps in achieving parallel processing{if we set it asynchronous} Not loaded again and again....once loaded...it is retained 2 ways to call the funtion module are: 1. drag and drop 2. call by manually typing 3. Using pattern # Exception handling parameters : pa_op1 type call function 'BC400_MOS_POWER' Exporting IV_BASE = IV_ pg.147

BAPI {business applicatin programming interface}

For remote enabled, RFC(remote function calls) are used to create the connection with other systems. Syntax is: CALL FUNCTION DESTINATION '........' Limitations for single BAPI: 1. no exceptions 2. no dialogs 3. Remote capability/ remote enabled # Conversion to external format by means of function module # conversion to internal format by means of function module TO use BAPI---Convert from external to Internal

Classes //only reference is crea

#creating a reference to class DATA: lo_ref TYPE REF TO CL_ABAP_TYPEDESCR ted in this step #creating instance CREATE OBJECT lo_ref

# There are exceptions for classes as well as function modules

# 2 types of exception handling for classes 1. classical based....specific to function modules 2. class based---global ...can be used by any one

# syntax for creating classes-----pg .179

DAY 3 # complex data objects 1. structure variables 2. internal tables # Structure (global or local)

use: 1. fetchin a single record frm table 2. fetcin t data from UI

# convention for local str: lty_s_flightinfo -> _s_ refers to str, lty refers to local type # defining a table from table DATA: ls_scarr TYPE SCARR " " SCARR is the table # TO define a table(more than 1 records) f a table type DATA: ls_SCARR TYPE TABLE OF SCARR gty_s_SCARR BC400_s_flight

//SCARR is t table name //gty_s_scarr is the local type //global str variable

Accessing the components of STR i.e. ls_scarr-carrid //carrid is the

[str variable]-[field name] field of str. #

Assigning a value to component

ls_scarr-carrid = 'LH'

# MOVE-CORRESPONDING ... TO {to copy contents of 1 str var to another} PG. Both the strs should have the same component names... The str might b diff... bt oth should have same component names... # INTERNAL TABLES 1.Work area

DAY -4 # AUTHORIZATION

su01 - creating an authorization / checking the profiles of various authorizatio ns su24 - displayin the athorization sci - advanced code inspector chcek

b4 releasing t product perform extended check and code inspector check

# After the development always perform code inspector and extended check # Field symbols //similar to pointers in C to declare a field symbol FIELD -SYMBOL <fv/fs/ft_name> TYPE ANY ANY---coz at runtime it gets intantiated... The above syntax is jus a ref var..no memory is created to create memory...use foll ASSIGN lv_var1 TO <fv_name> // where lv_var1 is a data variable

%% Check sy-subrc whether the field symbol is assigned check is performed using foll code

IF<fv_name> IS ASSIGNED . . . ENDIF # When we have a huge str. use field symbol of type str. to loop thru t in ternal table LOOP AT Itab Assign <fv_name> . . . ENDLOOP # Fetchin values from field symbols

GET COMPONENT 'carrid' OF STRUCTURE <FS_SFLIHT> INT lv_var1 #

Vous aimerez peut-être aussi