Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
70 views

Programming Techniques: There Are 3 Parts

This document gives you a summarised concepts of programming tricks which may be helpful for developers and serves as a quick reference guide for facing any ABAP interviews.

Uploaded by

RenukhaRangasami
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views

Programming Techniques: There Are 3 Parts

This document gives you a summarised concepts of programming tricks which may be helpful for developers and serves as a quick reference guide for facing any ABAP interviews.

Uploaded by

RenukhaRangasami
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

The R/3 Basis System is the platform for all applications (logistics, FI, HR etc) in R/3 System

Programming Techniques

There are 3 parts :

A. Position of Basis System within R/3 System Logical View Software Oriente !iew "ser Oriente !iew B. A##lication Ser!er Structure of a##lication ser!er $is#atching ialog ste#s $is#atching an Programming mo els %. &or' Processes Structure of &or' Processes Ty#es of &or' Processes

Data o !ects:
A ata o()ect is a #art of the re#ository whose content can (e a resse an inter#rete (y the #rogram Physical units with which ABAP statements wor' at runtime. %ontents occu#y memory s#ace in a #rogram ABAP Statements access the contents (y a ressing the name of the ata o()ect ABAP Statements can write the contents of $ata o()ect in re#ort or in the ata(ase an also #ass/recei!e from routines an can (e change (y assigning new !alues $eclare o()ects statically or ynamically ABAP $ata o()ect has a set of technical attri(utes* efine at all times when the ABAP #rogram is running

Data Types
$ata Ty#es can (e efine in e#en ently* The efinition of a user+ efine ata ty#e is (ase on a set of #re efine elementary ata ty#es. $efine ata ty#es either locally in the eclaration #art of a #rogram using T,P-S Statement or glo(ally in the ABAP $ictionary. "se own ata ty#es to eclare ata o()ects or to chec' the ty#es of #arameters in generic o#erations. $ata ty#es can (e i!i e into -lementary* Reference an %om#le. ty#es. -lementary Ty#es/ are fi.e or !aria(le length that are not ma e u# of other ty#es. The ifference (etween !aria(le length ata ty#es an fi.e length ata ty#es is that the length an the memory s#ace require (y ata o()ects of !aria(le length ata ty#es can change ynamically uring runtime* an that these ata ty#es cannot (e efine irre!ersi(ly while the ata o()ect is (eing eclare

"ontrol statements
0. 1low %ontrol 2. Logical -.#ressions 3. %on itional Statements 1low of %ontrol 0. -.ternal 1low/ -!ents triggere (y user or the system

2. 3nternal 1low /%ontrol of #rocessing sequentially within a #rogram at one e!ent* Logical con itions an loo#s %ase $istinction / 31 44-5$31 an %AS- 44-5$%ASLoo#s / $o4.. -5$$O an &63L- 4.. -5$&63L%ontrol Statements/ %O5T35"-* %6-%7* -83T. Logical -.#ressions/ -9* 5-* :T* :-* LT*L-* B-T&--5 f0 an 12* 3S 353T3AL 3nternal control is #rocessing gui e (y (ranching ;li'e 31 an %AS-< an Loo#ing ;$O an &63L-< in a #rogram. -.ternal control is #rocessing gui e (y e!ents such as user in#ut. Logical -.#ressions inclu e using 5OT* A5$* an OR O#erators. Logical -.#ressions are similar to those in other com#uter languages an can (e s#ecifie (y either al#ha(etic or sym(olic relation o#erators such as -9 or =* 5- or >?* LT or >* L- or >=* :T or ?* :- or ?= etc.* 31/-LS-31/-LS-/-5$31 3m#lement con itional logic for ar(itrary con itions. %AS-/&6-5/-5$%AS- im#lement con itional logic accor ing to fi.e set of #ossi(le !alues. A $O loo# re#eats #rocessing either a fi.e num(er of time or until an -83T con ition is encountere . A &63L- Loo# Re#eats #rocessing as long as a logic e.#ression is true or until an -83T con ition is encountere . An -83T Statement is use to lea!e a loo# or a current su(routine. Logical -.#ressions inclu e using 5OT* A5$* an OR O#erators. Logical -.#ressions are similar to those in other com#uter languages an can (e s#ecifie (y either al#ha(etic or sym(olic relation o#erators such as -9 or =* 5- or >?* LT or >* L- or >=* :T or ?* :- or ?= etc.* 31/-LS-31/-LS-/-5$31 3m#lement con itional logic for ar(itrary con itions. %AS-/&6-5/-5$%AS- im#lements con itional logic accor ing to fi.e set of #ossi(le !alues. A $O loo# re#eats #rocessing either a fi.e num(er of time or until an -83T con ition is encountere .

Internal Ta les
3nternal ta(le is a !ery im#ortant conce#t in ABAP/@ #rogramming 3nternal Ta(les are local ta(les within a #rogram containing a series of lines ha!ing same ata ty#e ABAP O#en S9L allows single fiel * range of fiel s* entire ata(ase ta(le or !iew into an 3nternal ta(le 3nternal ta(le is a ynamic sequential ataset in which all recor s ha!e the same ata structure an a 'ey 3nternal ta(les are use for fetching large !olume of ata from the ata(ase* storing in ABAP wor'ing memory line+(y+line an #rocessing within a #rogram Although 3nternal ta(les are eclare with the other ata o()ects* at runtime they (eha!e as ynamic o()ects 3nternal ta(les #ro!i e a means of ta'ing ata from a fi.e structure an storing it in wor'ing memory in ABAP $ata is store line (y line in memory* an each line has the same structure A #articularly im#ortant use for internal ta(les is for storing an formatting ata from a ata(ase ta(le within a #rogram The num(er of internal ta(les in a #rogram must (e 'e#t minimum as #ossi(le .

%reating an internal of stan ar ty#e an going to #rocess small amount of ata its (etter to eclare a internal ta(le irectly using $ATA statement Try to a!oi using internal ta(le with hea er lineA eclare a se#arate wor' area com#ati(le to the internal ta(le line ty#e . Always try to use the system fiel s when you #rocessing the internal ta(le entries within the loo# APP-5$ statement always a s to the last line of the internal ta(le whereas BO$31, changes entry that is alrea y in the ta(le. "sing internal ta(le within a loo# that (eha!es ifferently at each #ass ma'e sure that you ha!e cleare the hea er line or wor' area "se the a##ro#riate statements for Stan ar * Sorte an 6ashe Ta(les S,+S"BR% C This is common to all the statements in ABAP. This system fiel is set to D when the statement is e.ecute successfully else it is set to @. S,+TAB38 C This system fiel contain the current line of an internal ta(le. The internal ta(le must of either Stan ar or Sorte ta(le. 1or 6ashe ta(le this fiel is not set. As this fiel is set only for 3n e. ta(les S,+TAB38 is set to the in e. for the following o#erations+ A##en * %ollect* loo# at an Rea . S,+T13LL C contains the num(er of lines in the internal ta(le S,+TL-5: C contains the length of the lines in the internal ta(le S,+TO%%" C contains the initial amount of memory allocate to the internal ta(le.

#o$%lari&ation:

im#ro!e #rogram structure ma'e the #rogram easier to maintain an u# ate im#ro!e rea a(ility re uce re un ancy allow for com#onent reuse e!ent #rocessing ABAP is an e!ent ri!en language. The #rocessing associate with each e!ent is written in a #rogram mo ule Ty#es of mo ules in an ABAP #rogram S% ro%tines / internal su(routines + source co e is in the same ABAP #rogram as the calling #roce ure '(ternal s% ro%tines + source co e of e.ternal su(routines is in an ABAP #rogram other than the calling #roce ure F%nctions: store in central li(rary offer a efine interface ')ent han$ling co$e loc*s

Difference et+een F# an$ Form: Bain ifference (etween su(routines an functions is a clearly efine interface for #assing ata (etween #rogram an function 1unction mo ules must (elong to a #ool calle a function grou#. They #ossess a fi.e interface for ata e.change. This ma'es it easier for you to #ass in#ut an out#ut #arameters to an from the function mo ule. 1or e.am#le* you can assign efault !alues to the in#ut #arameters. The interface also su##orts e.ce#tion han ling. This allows you to catch errors an #ass them (ac' to the calling #rogram for han ling. They use their own memory area. The calling #rogram an the function mo ule cannot e.change ata using a share memory area + they must use the function mo ule interface. This a!oi s un#leasant si e effects such as acci entally o!erwriting ata.

,ou call a function mo ule (y its name ;which must (e unique< in a %ALL 1"5%T3O5 statement To e!elo# an e.tensi!e a##lication* one #rogram can (ecome !ery com#le.. To ma'e the #rogram easier to rea * i!i e the require functions among se!eral #rograms. "sing e.ternal mo ulariEation* in which store the #roce ures in s#ecial non+ e.ecuta(le ABAP Programs li'e function grou#s* ABAP Statements allows to start e.ecuta(le #rogram or transaction. -.it the calling #rogram or ha!e the system return to it when the calle #rogram finishes running %all a transaction whose initial screen is fille with ata from the selecte list line The e!ent LOA$+O1+PRO:RAB is triggere each time a #rogram is calle -ach e.ecution of an e.ecuta(le #rogram actually has a S"BB3T statement as its source -nter the #rogram name in a transaction li'e S-3F or SA3F an choose Execute* a S"BB3T statement occurs in the transaction. Therefore* e.ecuta(le #rograms ha!e the attri(ute of (eing a(le to (e calle using S"BB3T* although their #rinci#al characteristic from a userGs #oint of !iew is that they are starte in the foregroun The following ABAP Statements allows to start e.ecuta(le #rogram or transaction %all with return -.ecuta(le #rogram C S"BB3T A5$ R-TR"5 Transaction C %ALL TRA5SA%T3O5 %all without return -.ecuta(le Program + S"BB3T Transaction + L-AV- TO TRA5SA%T3O5 There are two ways of #assing ata to a calle #rogram Passing $ata "sing 3nternal Bemory Areas SAP B-BOR, ABAP B-BOR, 1illing 3n#ut 1iel s on an 3nitial Screen 1illing the selection screen of a calle #rogram 1illing 3nitial Screens using SPA/:PA #arameters

"alling ,rograms:

You might also like