abap material final

Upload: chaitanya-dev

Post on 07-Jul-2018

249 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/18/2019 Abap Material Final

    1/396

    Sun Shine Technologies

    SAP – R/3

    SYSTEM APPLICATIONS PRODUCTSINDATA PROCESSING

     ABAP/4

    Contents

    1

  • 8/18/2019 Abap Material Final

    2/396

    Sun Shine Technologies

    Introduction to sap5

    ABAP introduction and role of an abap consultant

    6Tcodes8

    Data Dictionary

    Tables9

    • Creation

    13• Structure

    3• Searc! !elp

      "

    #ie$s33

    • Data Base #ie$

      33• Pro%ection #ie$  38

    • &aintenance #ie$'

    • (elp #ie$  '8

    )oc* +b%ects51

    Perfor,ance -actors  53

    • Bu.erin/• Inde0es• )o/ Data C!an/es

    2

  • 8/18/2019 Abap Material Final

    3/396

    Sun Shine Technologies

    Pac*a/es56

    Introduction to pro/ra,,in/ $it! *ey$ords

      6Internal Tables

      65

    • Types of Internal tables  5

    • +perations of Internal tables 

    • -or all entries  99

    • Inner %oins  1'

    &essa/es  9

    +pen S2l8

    &odulariation Tec!ni2ues

    15

    • Includes15

    • &acros19

    • Subrourines  18

    • -unction &odules  111

    Control Brea* State,ents  1"

    Classical 4eports  1"3

    3

  • 8/18/2019 Abap Material Final

    4/396

    Sun Shine Technologies

    Interactie 4eports  1"

    • (ide

      1"8• etcursor

      131

    A)# 4eports  135

    • -iledcatalo/  136

    • 7ents1'

    • Bloc*ed1'3

    • (ierarical  1'6

    • Interacie  1'9

    #ariant15

    Perfor,ance Issues  161

    Debu//in/  165

    &odule Pool Pro/ra,,in/  169

    • Screen Desi/n

      169• 7ents

    1• Table Control

    11• Tab Strip

    11

    4

  • 8/18/2019 Abap Material Final

    5/396

    Sun Shine Technologies

    • #alidations  1"

    Scripts

    13S,artfor,s

      "6

    BDC"63

    • Call Transaction  "63

    • Session

    "8

    )S&"9'

    7n!ance,ents and &odications  311

    • 70its :: ;ser70its< Custo,er 70its

    BAdI

      338

    Cross Applications  3'

    BAPI  381

    5

  • 8/18/2019 Abap Material Final

    6/396

    Sun Shine Technologies

    SAP –R/3System Appl!"tons "n# P$o#%!ts

    In#"t" P$o!essn&

    Introduction to SAP

    SAP was founded in 1972 in walldorf, Geran!"

    It stands for S!ste A##licationProduct In $ata Processing o%erthe !ear it grows and e%ol%ed to &ecoes the world #reier

    #ro%ider for client'ser%er &usiness solutions for which it is so well

    toda!"

    It is an (r# Product"

    All the )odules of sa# can &e classi*ed into

    1+ Technical a+ -asis

      &+ A&a# 2+ .unctional a+ S$ /Sales and $istri&ution+

      &+ )) /)aterial )anageent+  c+ 0 /0uan esources+  d+ .i'co /.inance and ontrolling+ " (tc"

  • 8/18/2019 Abap Material Final

    7/396

    Sun Shine Technologies

    ABAP='>

    Adance Business Application

    Pro/ra,,in/>

    • A-AP is a #rograing language de%elo#ed &! SAP for the

    interacti%e de%elo#ent of a##lication #rograing"

    •  A-AP is a fourth generation language"

    •  IT is tightl! integrated across all the odules %i li6e S$,

    )), 0 etc""

    •  All a##lication #rogras, along with #arts of the '3 -asis

    s!ste, are written in the A-AP or6&ench using A-AP,

    SAP8s #rograing language" The indi%idual co#onents of

    a##lication #rogras are stored in a s#ecial section of the

    data&ase called the '3 e#ositor!" The '3 e#ositor!

    ser%es as a central store for all of the de%elo#ent o&ects inthe '3 S!ste

    • It contains the ross a##lication conce#t to e:change the

    data fro one s!ste to another s!ste

    • (; SAP to

  • 8/18/2019 Abap Material Final

    8/396

    Sun Shine Technologies

      =A

  • 8/18/2019 Abap Material Final

    9/396

    Sun Shine Technologies

    4 I C 7 - = - 4 I C 7

    4 ? 47P+4TS .etching data fro data&ase &ased on the

    gi%en in#ut and dis#la! in a #articular forat"

    I ? I@T74-AC7S onnect fro one ser%er to other ser%er"

      C ? C+@#74SI+@S on%ersion #rogras are used to

    igrate data

    fro the legac! s!ste to SAP s!ste

    7 ? 7@(A@C7&7@TS Adding (:tra .unctionalit! to the

    standard without distur&ing the standard"

    - ? -+4&S -usiness docuents which we need to gi%e as a#rintout are designed in for of fors"

    TC+D7S ?Transaction Codes

    TC+D7 D7SC4IPTI+@ TC+D

    7

    D7SC4IPTI+@

    S711 $ata $ictionar! d1 reate custoer

    S738 A&a# editor *1 reate %endorS73 .unction -uilder #a1 reate sales orderS7'1 )enu #ainter &,

    1

    reate aterial

    S751 Screen #ainter &e"1

    n

    Purchase order

    S71 .or -uilder Co1 Production orderS&3  Ta&le )aintenance

    generator

    #l1 $eli%er!

    S78 u#load logo #f1 -illingS7"1 Pac6age &uilder &e51

    n

    Purchase

    reFuisitionS7"' lass &uilderS791 )essage classS793  Tcode creation

    9

  • 8/18/2019 Abap Material Final

    10/396

    Sun Shine Technologies

    )S& BswS&A4T-+

    4&S

    Sartfors

    S718 -adi de*nition

    S719 -adii#leentation

    S&+D (:it de*nitionC&+D (:it

    i#leentationS78 C&ect na%igatorS!db ecording

    Tables

    TablesHna1

  • 8/18/2019 Abap Material Final

    11/396

    Sun Shine Technologies

    > $ata dictionar! descri&es the logical structures of the o&ectsused in a##lication de%elo#ent and shows how the! area##ed to the underl!ing relational data&ase in ta&les'%iews"

    > It is a central re#ositor!, which is a collection of re#ositor!

    o&ects li6e data&ase ta&les, %iews, and structures"etc"> e can create, change and dis#la! an! ta&le"> e can also 6now the ta&le de*nition and glo&al t!#es"> It is closel! integrated /lin6ed+ with A-AP $e%elo#ent

    or6&ench"> Transaction code J S(11> It is a %irtual data&ase, which consists of etadata /de*nition

    of underl!ing data&ase+

    -unctionality> $ata integrated /lin6ed with other ta&le+, aintains datasecurit! /authoriation+ and data consistenc! /accurac!+"

    > It a%oids data redundanc! /du#lication or re#etition+"

    Classication1" -ASIS /ta&le can &e client de#endent K client inde#endent+2" Technical /ta&les can &e trans#arent ta&les, cluster ta&les K

    #ooled ta&les+3" .unctional /ta&le can &e aster ta&les, transaction ta&les,

    con*guration ta&les K s!ste ta&les+

    1> BASIS ClassicationClient dependent Client independe

    Also called as lient s#eci*c Also called as cross client

    11

  • 8/18/2019 Abap Material Final

    12/396

    Sun Shine Technologies

    onsists of client /)AD$T+ as 6e! *eld)AD$T as data eleent

    BDT as data t!#e3 as length"

    $oesn8t consist of client /)A6e! *eld"DCT( ta&le data is de#endeclient"

     Ta&le structure is coon iclients"

    Transparent< Cluster and Pooled Tables

     Trans#arent Ta&le (:ists with the sae structure &oth indictionar! as well as in data&ase e:actl! with the sae data and*elds"

    Pooled Ta&le Pooled ta&les are logical ta&les that ust &e

    assigned to a ta&le #ool when the! are de*ned" Pooled ta&les areused to store control data" Se%eral #ooled ta&les can &eco&ined in a ta&le #ool" The data of these #ooled ta&les arethen sorted in a coon ta&le in the data&ase"

    luster Ta&le luster ta&les are logical ta&les that ust &eassigned to a ta&le cluster when the! are de*ned" luster ta&lescan &e used to store control data" The! can &e also used to storete#orar! data or te:ts, such as docuentation"

    DATA C)ASS7Sa> &aster Data are used to aintain aster data" )aster

    data is the data which is alost constant and rarel!changed" ("g" ustoer aster data, %endor aster data,aterial aster data, and 0 aster data"

    b> Transactional Data are used to aintain transactionaldata" Transactional data is the data which changesfreFuentl! and rarel! constant" ("g" sales docuent ite

    data, #urchase docuent ite data, &illing docuent itedata, deli%er! docuent ite data"

    c> Custo,iin/ Data or con/uration data aintainsorganiation data" Crganiation data is the data which isentered initiall! while setting u# a new organiation" ("g"clients J T, co#an! codes J T1, countr! J T5"

    12

  • 8/18/2019 Abap Material Final

    13/396

    Sun Shine Technologies

    d>Syste, data aintains s!ste data /or+ control datas!ste data is the data which is aintained and controlled&! SAP" ("g" language 6e! J T2, currenc! 6e!s J TL,unit of easureent J T"

    D7)I#74E C)ASS > S#eci*es the data to &e transferred &etween clients, while

    client co#! or u#grade"> It s#eci*es the owner of the ta&le" e"g" A>a##lication ta&le

    /aster K transactional data+> $ata can &e aster and transactional data, custoiing data,

    te#orar! data, etc"

    Sa%e

    Tec!nical Settin/s

    DATA C)ASS > S#eci*es the logical storage area /ta&le s#ace+ occu#ied &!

    current ta&le in the underl!ing data&ase" The ta&le s#acede#ends on t!#e of data"

    (: /t!#es of data+APPB aster data J transactional ta&lesAPPB1 transactional data J trans#arent ta&lesAPPl2 organiation data J custoiing ta&les

    13

  • 8/18/2019 Abap Material Final

    14/396

    Sun Shine Technologies

    LS(1 custoer data classLS(2 custoer data class

    SIF7 CAT7+4E

    > S#eci*es the nu&er of records e:#ected in the data&aseta&le"> Lsing technical settings ta& we can aintain data class, sie

    categor!, and &u@er o#tions"

    @otes> e can odif! standard ta&le technical settings"> In 6na1, !ou can enter 1, records J &ut if the reFuireent

    is to enter ore than 1, records then !ou can change thedata class and increase the nu&er of records"

    C47ATI@ A TAB)7 I@ DATABAS71" Go to S(112" Select data&ase ta&le /radio &utton+"3" Pro%ide a nae with ! or "4" lic6 on create"5" Pro%ide short descri#tion"" Pro%ide's#ecif! deli%er! class as A"7" $ata &rowser'ta&le %iew aintenance as

    dis#la!'aintenance allowed"" lic6 on sa%e"

    14

  • 8/18/2019 Abap Material Final

    15/396

    Sun Shine Technologies

    9" Lnder #ac6age !ou can either t!#e Mt# or clic6 on localo&ect"

    1" lic6 on technical settings ta&"a" $ata class ention APPB"

    &" Sie categor! "c" Sa%e and coe &ac6"

    11" Lnder *elds,

     To create *eld we fallow $ata (leent t!#e )ethod"

    $oain $oain de*nes Technical attri&utes of a ta&le *eld"  Technical attri&utes eans $ata t!#e and length"

    Se11Select the radio &utton doainShort descri#tion

    15

  • 8/18/2019 Abap Material Final

    16/396

    Sun Shine Technologies

    Pro%ide data t!#e and lengthSa%e, chec6 and acti%ate"

    $ata (leent $ata (leent $e*nes S!antec attri&utes of a

    ta&le *eld"  ollection of doain and short descri#tion"

    1

  • 8/18/2019 Abap Material Final

    17/396

    Sun Shine Technologies

    Se11Select the data t!#e radio &uttonSelect data eleentPro%ide short descri#tionPro%ide the doain and enter J autoaticall! data t!#e andlength are co#ied since doain is alread! created and acti%ated"oe to *elds ta&Pro%ide *eld la&els /i"e" short descri#tions+"Sa%e, chec6 and acti%ate"

    Cther wa! of creating the data &ase ta&le *elds"

    reate ta&lePro%ide *eld naePro%ide data eleent$ou&le clic6 on data eleentSa%e ?es

    Pro%ide short descri#tion for data eleentPro%ide doain$ou&le clic6 on doainSa%e ?esPro%ide short descri#tion for doainPro%ide data t!#e and length

    17

  • 8/18/2019 Abap Material Final

    18/396

    Sun Shine Technologies

    Sa%e chec6 and acti%ate-ac6Pro%ide *eld la&els for data eleentsSa%e chec6 &ac6

    Dow sa%e chec6 and acti%ate the ta&le"Ste#s to create entries"

    lic6 on utilities Ta&le contentsreate entries

    Ste#s to dis#la! the entriesontents

    Pro%ide fro to to %alues(:ecute  /Cr+lic6 on utilities Ta&le contents$is#la! %alues"

    1

  • 8/18/2019 Abap Material Final

    19/396

    Sun Shine Technologies

    .4 hel# creation for ta&le *eld

    -! Ta6ing $ata t!#es as N$ATS8 and NTI)S8 for $ate and tie *elds-! ta6ing *:ed %alues in $oain

    19

  • 8/18/2019 Abap Material Final

    20/396

    Sun Shine Technologies

    -! reating .oreign He! elationshi#-! reating Search hel#"

     Ta6ing .i:ed %alues in .oreign 6e! ser%es li6e interface &etween two ta&les"> Lsing foreign 6e!s we can esta&lish relationshi# &etween two

    ta&les"> hile de*ning foreign 6e! relationshi# cardinalit! has to &e

    s#eci*ed" ardinalit! entions how an! de#endent recordsor how referenced records are #ossi&le"

    A$ It generates .4 hel#"> In .4 hel#, chec6 ta&le 6e!*eld %alues are #o#ulated

    autoaticall!"> .4 hel# is useful while aintaining data into current ta&le with

    the hel# of other ta&le entries"> .oreign 6e! #erfors *eld %alidation /if the user #ro%ides a

    %alue fro the .4 list, onl! then the entr! is %alid+"

    (LI()(DThene%er we want to fetch the data fro two data&ase ta&lesand dis#la! out#ut, two ta&les ust ha%e relationshi#"> Ta&les can &e connected using foreign 6e!"> To create foreign 6e! coon *eld is reFuired in &oth ta&les"

    P(>(LISITI(S

    2

  • 8/18/2019 Abap Material Final

    21/396

    Sun Shine Technologies

    > At least two ta&les, with acti%e status /withdata'content'entries+"

    > Two ta&les ust ha%e coon *eld"> hec6 ta&le 6e!*eld ust ha%e data eleent"

    PC($L(> C#en the foreign 6e! ta&le in change ode"> lic6 on entr! hel#'chec6 ta&"> Place the cursor on foreign 6e! *eld and clic6 on foreign 6e!

    icon"> In dialogue &o:, #ro%ide short descri#tion, chec6 ta&le nae,

    and /e"g" chec6 ta&le nae is the other #rogra fro where!ou want to get the *eld+"

    > lic6 on generate #ro#osal ta& and continue /do not chec6 an!&o:es there+"> lic6 on hec6 and co#!"> Dotice the status essage and chec6 ta&le nae"> Acti%ate ta&le"

     T(STIDG' 0(HIDGLTIBITI(S >O TA-B( CDT(DTS >O (AT( (DTI(S"Place the cursor on foreign 6e! *eld in#ut *eld notice that s!stegenerated .4 hel#"

    S!ste ena&les chec6 ta&le ta&Q on successful creation offoreign 6e!"hec6 ta&le ta& is useful to cross chec6 the chec6 ta&le entries"

    A$IDABIT? is also called as ulti#licit!"> It de*nes the relationshi# with foreign 6e! ta&le"> It #recisel! de*nes the relationshi# &etween two ta&les"> It s#eci*es the nu&er of de#endent records for one record of

    chec6 ta&le"

    11 J each record in chec6 ta&le has one de#endent record"1 D J each recording chec6 ta&le has at least one de#endentrecord"1 J each record in chec6 ta&le has a: nu&er of de#endentrecord"

    21

  • 8/18/2019 Abap Material Final

    22/396

    Sun Shine Technologies

    1 D J each record in chec6 ta&le has an! nu&er of de#endentrecords"

    It is also called as .4 hel#, #ossi&le %alues hel#, #ossi&le

    entries hel#, in#ut hel# and hit list"> Search hel# can &e attached to"

    1" Ta&le *eld"2" Structure co#onent3" $ata eleent4" Screen *eld

    > Search hel# is also inde#endent re#ositor! o&ect" There are

    a lot of &uilt in search hel#s"> Search hel# can &e classi*ed into two"

    1" (leentar! search hel# It can &e created using selection ethod as

    • $ata&ase ta&le /*elds fro single ta&le+

    • $ata&ase %iew /*elds fro two ta&les withinner oin+

    • Proection %iew /*elds fro single ta&le+

    • 0el# %iew /*elds fro two ta&les with leftinner oin+"

    It #ro%ides .4 hel# for the ta&le *eld" It fetches the data related ta&les and dis#la!s as

    hit list"2" ollecti%e search hel#

    22

  • 8/18/2019 Abap Material Final

    23/396

    Sun Shine Technologies

    It is a collection of ore than one eleentar!search hel#s"

    1> 7)7&7@TA4E S7A4C( (7)P

    P(>(LISIT(> Ta&le status ust &e acti%e"> Ta&le *eld ust ha%e data eleent"> Ta&le ust contain soe data'entries which can &e

    dis#la!ed in the hit list to the end user"

    PC($L(Go to S(11"Select search hel# radio>&utton"Pro%ide search hel# nae starting with ? or R"lic6 on create >O eleentar! >O continue"

    > Pro%ide short descri#tion"> S#ecif! data collection J selection ethod as /ta&le nae

    &3e#aster+"> Lnder dialogue &eha%ior J dis#la! %alues iediatel!"> Pro%ide search hel# #araeter as e#no or hit .4 and select

    one"hec6 i#ort and e:#ort and BPCS AD$ SPCS as 1 and 1"0ere, data eleent coes &! default"$o the sae things for ()P nae"ith BPCS AD$ SPCS as 2and 2"Sa%e >O chec6 >O acti%ate and test it"

    LSAG( This is attaching the search hel# to ta&le *eld

    > C#en the ta&le> lic6 on entr!'chec6 ta&"> Place the cursor on *eld nae and clic6 on search hel# ta&"> In dialogue &o:, #ro%ide the search hel# nae which was

    created /&3shel#+"> ontinue"> $ialogue &o:, clic6 on co#!"

    23

  • 8/18/2019 Abap Material Final

    24/396

    Sun Shine Technologies

    > ?ou will notice essage in the &otto and !ou will *ndsearch hel# nae under search hel# ta& also origin of thein#ut /e:#licit J created outside and i#licit J createdinside+"

    > Sa%e >O chec6 >O acti%ate >O> Ltilities >O contents >O create entries /!ou *nd f4 hel# to

    ()P no and f4 hel# to ()P nae as well+"

    >>>>>>>K>>>>>>>>

    ATTA0)(DT C. S(A0 0(BP TC $ATA (B()(DT1" C#en the data eleent in change ode"2" lic6 on further characteristics ta&"

    3" Pro%ide search hel# nae and #araeters nae"4" Sa%e > O chec6 >O acti%ate"

    DCT(S CD S(A0 0(BP> Search hel# #araeter nae and *eld #araeter nae

    should &e sae"> I#ort chec6 &o: s#eci*es to i#ort the *eld %alues fro

    the data&ase and #o#ulate into hit list"> (:#ort chec6 &o: s#eci*es to e:#ort %alues fro hit list to

    screen *eld, which is chosen &! the user"

    > BPCS s#eci*es the current *eld a##earing #osition in the hitlist"

    > SPCS s#eci*es the current *eld #riorit! in the s!stegenerated i#licit select stateent"

    > S$IS this is selected for the *eld, we can8t de*ne furtherrestrictions in the s!ste #ro#osed %alue restriction dialogue&o:"

    > Lsing odi*ed chec6 &o: we can change the data eleentnae /data t!#e should atch+"

    > Lsing default %alue o#tion, we can #ro%ide default %alue tohit list"

    > S(A0 0(BP (;IT using this o#tion, we can change thestandard &eha%ior of search hel#"

    > 0CT H(? we can choose the current search hel# if it is usedin collecti%e search hel#"

    24

  • 8/18/2019 Abap Material Final

    25/396

    Sun Shine Technologies

    DIA)+;7 B7(A#I+4 /$ialogue t!#es+ Display alues i,,ediately %alues are dis#la!ed

    iediatel! when user chooses .4"

      Dialo/ue depends on set of alues s#ecif! this o#tion,

    if the .4 entries are ore than 1"

    Dialo/ue $it! alue restrictions if we s#ecif! theo#tion s!ste generates %alue restriction dialogue &o:"

    -ased on the user in#ut the result is dis#la!ed" 0ere, assoon as the end user enters an! %alue, the ulti#leselection &utton a##ears iediatel! which will hel# in*ltration" If !ou want to change the selection o#tion thenclic6 on the ulti#le selection &utton, and again clic6 on itto change the selection o#tion"

    Creatin/ 7le,entary Searc! (elpSearc! (elp

    25

  • 8/18/2019 Abap Material Final

    26/396

    Sun Shine Technologies

    Attac!,ent to t!e table eld>

    2

  • 8/18/2019 Abap Material Final

    27/396

    Sun Shine Technologies

      To c!ec* t!e searc! !elp

    27

  • 8/18/2019 Abap Material Final

    28/396

    Sun Shine Technologies

    2

  • 8/18/2019 Abap Material Final

    29/396

    Sun Shine Technologies

    "> C+))7CTI#7 S7A4C( (7)P

    > o&ines ore than 1 eleentar! search hel#"> (ach eleentar! search hel# is created using hel# %iew"

    RRS0(BP

    R(S0(BP1 R(S0(BP2

    R0(BP

  • 8/18/2019 Abap Material Final

    30/396

    Sun Shine Technologies

    > Go to S(11, under search hel# J collecti%e search hel#"> Short descri#tion"> Lnder de*nition >O search hel# #araeters >O *rst #ro%ide

    6e! *elds /atnr, s#ras, etc"+> Dow #ro%ide the reaining *elds /e#eated *elds should not

    &e ta6en+"> lic6 on included search hel#s ta&"> Lnder search hel# >O &3shel#1, &3shel#2"> Select *rst eleentar! search hel# and clic6 on #araeter

    assignent > O !es >O clic6 on co#!"> Select second eleentar! search hel# >O clic6 on #araeter

    assignent >O !es >O clic6 on co#!"

    P(>(LISITI(S> At least 2 eleentar! search hel#s"> Procedure

    o In the de*nition add the *elds fro &oth eleentar!search hel#s /no du#licate *eld naes+"

    o Lnder included search hel# ta& add eleentar! searchhel#"

    o Select eleentar! search hel# and clic6 on #araeterassignent /s!ste #ro#osing res#ecti%e eleentar!search hel# #araeters to collecti%e search hel##araeters+,

    A$$ITICDAB CPTICDSo Lsing hidden o#tion, we can hide an! eleentar!

    search hel# ta& in the *nal dis#la!"o After acti%ation, we can attach collecti%e search hel# to

    ta&le *eld or data eleent"

    : Creatin/ Collectie Searc! (elpSearc! (elp

    .irst we ha%e to create the (leentar! search hel#s"

    3

  • 8/18/2019 Abap Material Final

    31/396

    Sun Shine Technologies

     Then go to $ata &ase ta&le for which !ou want to assign thecollecti%e search hel#"

    31

  • 8/18/2019 Abap Material Final

    32/396

    Sun Shine Technologies

    32

  • 8/18/2019 Abap Material Final

    33/396

    Sun Shine Technologies

    ST4;CT;47S

    > Structure is a data t!#e de*ned in A-AP $ictionar!"> Structure is a collection of co#onents with di@erent data

    t!#es"> Structure is an inde#endent re#ositor! o&ect"> Structure is included into data &ase ta&le"> Cne structure can &e included into ulti#le data&ase ta&les

    /reusa&ilit!+"> Structure does not contain data"> hen structure co#onents are included in ta&le, it &ecoes

    ta&le *elds /data aintenance is #ossi&le+"> e can attach chec6 ta&le or search hel# to structure

    co#onent"> It is a co&ination of *elds"> Structure can hold onl! one record at a tie"

    33

  • 8/18/2019 Abap Material Final

    34/396

    Sun Shine Technologies

    C;ST+& C47ATI+@ +- ST4;CT;47> Go to S(11 >O data t!#e >O #ro%ide structure nae starting

    with ? or R >O clic6 on create >O select structure and continue"> Pro%ide short descri#tion"

    > Lnder C)PCD(DTS TA- >O #ro%ide co#onents nae andco#onents t!#e"

    > Sa%e >O hec6 >O Acti%ate"Dow the structure is read! to &e used"

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>K>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>I@C);DI@ T(7 ST4;CT;47 I@T+ TAB)7> Lnder data&ase ta&le, o#en the ta&le in which !ou want to use

    this structure"> Pro%ide "include in *eld colun and #ro%ide structure nae indata eleent ta& and #ress enter"

    STLTL( T?P(S1" .BAT STLTL( is a collection of an! co#onents" It

    does not consist of reference types'structures &! using"include"

    2" D(ST($ STLTL( one of the structure co#onents isreference to another structure"o Including a structure while creating a structure &! using

    "include is called nested structure"3" $((P STLTL( one of the structures is referring to ta&le

    t!#e"

    Dotes1" In standard ta&le, if !ou *nd an! *eld in &lue color, then it

    eans that the #articular *eld &elongs to include" And that*eld does not &elong to that ta&le"

    APP(D$ STLTL(> .or a standard ta&le, we cannot o#en in change ode if we

    want to add soe *elds &ut the solution for this is A##endStructure"

    o It is used to add additional *elds to standard ta&le /ta&leenhanceent+"

    34

  • 8/18/2019 Abap Material Final

    35/396

    Sun Shine Technologies

    o ithout odif!ing the e:isting ta&le structure, we canadd additional *elds to standard ta&le at the &otto"

    P4+C7D;47 -+4 APP7@DI@ -I7)DS T+ STA@DA4D TAB)7

    > C#en an! standard ta&le in dis#la! ode"> lic6 on a##end structure ta&"> Pro%ide the a##end structure nae starting with RR and

    continue"> Pro%ide short descri#tion J co#onent nae J co#onent t!#e

    /nae and t!#e should start with R+"> Sa%e J chec6 J acti%ate"> .ields are added at the &otto"

    $I..((D( -(T((D IDBL$( STLTL( AD$ APP(D$STLTL(S>I@C);D7 APP7@D

    > It is used to include *elds todata&ase ta&le or structure"

    > It is used to add additiona*elds to data&ase ta&le"

    > It is reusa&le" > Is not reusa&le"> an &e added at an! row of the

    data&ase ta&le"> It is alwa!s at the &otto

    data&ase ta&le"> It is #ossi&le for custo ta&le onl!" > It is #ossi&le for standard t

    > A##end structure is not #ocluster and #ooled ta&les"

    > .or trans#arent ta&les, whlong char /datat!#e+"

    $i@erence &etween %alue'chec6 ta&les

  • 8/18/2019 Abap Material Final

    36/396

    Sun Shine Technologies

    > .or L *eld we ha%e to #ro%ide ref ta&le nae and ref *eldnae"

    > Generating .4 hel#, clic6 on entr! hel# 'chec6 ta&"> Place the cursor on waers and clic6 on foreign 6e!"

    > ?ou can use TL as chec6 ta&le"> hene%er Fuantit! %alues are entered, it ust &e followed &!

    unit of easureent /data t!#e LAD followed &! LDIT+"> .or LAD *elds we ha%e to aintain ref" ta&le nae and ref"

    *eld nae"

    #ie$s

    Is a %irtual ta&le where we can store the data fro ulti#le

    ta&les"

     There are 4 t!#es of %iews

    1+ $ata -ase It is a collection of data fro ore than 1 logicall! related

    data&ase ta&les"> $- %iew i#leents inner oin while fetching the data"> Selection conditions are #ossi&le"> )aintenance status J read onl!"> Are used to *nd out ta&le relationshi#"

    > Are used alternati%e for inner oin"

    PC($L( TC (AT( $ATA-AS(

  • 8/18/2019 Abap Material Final

    37/396

    Sun Shine Technologies

    : lic6 on %iew *elds": lic6 on ta&le *elds and clic6 on 6na1 J select onl! 6e! *elds >

    *rst two *elds": lic6 on ta&le *elds and clic6 on 6n&1 J select onl! 6e! *elds >

    don8t select the *elds with the sae nae so onl! select&u6rs"

    : Dow again clic6 on ta&les *elds > 6na1 J select non>6e! *elds/4>5 *elds+ /note here 6e! *elds are alread! selected, don8tunchec6 the J chec6 the other *elds that are reFuired+"

    : Dow again clic6 on ta&les *elds J 6n&1 > select non>6e! *elds/4>5 *elds+"

    : Sa%e J chec6 J acti%ate": Ltilities J content >

    70trae don8t ha%e to enter oin conditions here, s!ste will #ro#oseit"lic6 on selection conditionHna1 J 6unnr > UV N28

    If  !ou want to add one ore condition then last ta& enter AD$Hna1 J land1 J ( J NLS8 /case>sensiti%e J should &e ca#ital lettersonl!+

    If !ou want to add one ore than last ta& AD$Hna1 J &u6rs J ( J N58

    @ote> There would &e relationshi# e%en if the date eleent nae is

    sae or doain nae is sae"> .ield nae ight &e di@erent e%en then there would &e soe

    relationshi# and that is wh! is shows the relationshi#"

    > .ield nae should not &e sae under %iew *elds ta&"> e should not select siilar *elds under %iews"> ase sensiti%e, if its ca#ital letters in data&ase ta&le then e%en

    in selection condition, it should &e ca#itals"> And co#arison %alue %alues ust &e in single Fuotes"> (:tra J create stateent > generates s!ste

    37

  • 8/18/2019 Abap Material Final

    38/396

    Sun Shine Technologies

    > (:tra J change %iew t!#e J used to change the %iew t!#e toanother t!#e"

    > $ata&ase %iew can &e created on using single ta&le also andaintenance is also #ossi&le for standard ta&le &ut we don8t do

    that"

    3

  • 8/18/2019 Abap Material Final

    39/396

    Sun Shine Technologies

    39

  • 8/18/2019 Abap Material Final

    40/396

    Sun Shine Technologies

    4

  • 8/18/2019 Abap Material Final

    41/396

    Sun Shine Technologies

    P4+H7CTI+@ #I7> It is used to hide soe data of single ta&le and in turn dis#la!

    other data"> It is alwa!s created on single ta&le onl!"> Selection conditions are not #ossi&le"> )aintenance status J read onl!" /it is #ossi&le &ut we don8t do

    it+> It is used in the #rogras whene%er we reFuire single ta&le

    #articular *eld8s data"PC($L( TC (AT( PC=(TICD Go to S(11 JO select %iew JO &3#%iew JO create JO

    #roection %iew JO co#!"> Pro%ide short descri#tion and &asis ta&le /ara+"> lic6 on ta&le8s *eld J select 6e! *elds and reFuired *elds J

    co#!"> ?ou will see all the selected ta&les under %iew *elds"> Sa%e J chec6 J acti%ate"

    > Ltilities J ta&le content J all the *elds will &e dis#la!ed"

    41

  • 8/18/2019 Abap Material Final

    42/396

    Sun Shine Technologies

    42

  • 8/18/2019 Abap Material Final

    43/396

    Sun Shine Technologies

    &AI@TAI@7@C7 #I7> It is used to fetch the data fro ore than one logicall! related

    ta&le"> It also used to aintain data /insert, change, delete+ into

    se%eral ta&les"> It i#leents left outer oin"

    43

  • 8/18/2019 Abap Material Final

    44/396

    Sun Shine Technologies

    > or6ing with aintenance %iew is a 2 ste# #rocedure1" )aintenance status is read, change, insert, delete"

      +#74#I7 SI@)7 SC477@

    > In the a&o%e #icture, in *rst #age which is o%er%iew #age, theuser can fetch data fro ore than one ta&le and he also hasaccess to read, change and delete data fro data&ase#eranentl!"

    > And in the second #age which is single screen #age, he caninsert new entries"

    > Ta&le aintenance generator is used to create ta&le

    aintenance #rogra to add, odif! or delete records in thedata&ase ta&le" This can &e accessed using transaction S)3,S(54 or in S(11 >O enu J utilities >O ta&le aintenancegenerator"

    LSTC) )AIDT(DAD( Go to S(11,> Pro%ide %iew nae starting with "> reate

    > )aintenance %iew Jco#!> Short descri#tion> Pro%ide ta&le nae as )AHT under ta&le'oin"> lic6 on relationshi#"> lic6 on %iew *elds, notice that left side s!ste 6e! *elds

    autoaticall! &ecause of left outeroin"> Select 6e! *elds fro right side ta&le"

    44

    IDS(T

    (A$0ADG($(B(T(

    )AHT )AA

  • 8/18/2019 Abap Material Final

    45/396

    Sun Shine Technologies

    > Select non>6e! *elds fro left and right ta&le"> Sa%e J chec6"> Dow if !ou go to contents under utilities, !ou will not get result

    so"

    > Dow ste# 2, which is ta&le aintenance generator"> Ltilities >O ta&le aintenance generator >O /S(55+"> Pro%ide authoriation grou# as KDK /hit .4+"

    o Authoriation we are editing data&ase ta&le"Authoriation grou# is created &! -ASIS #eo#le and#ro%ided to us &! the" It is used to restrict theunauthoried users while aintaining data"

    o .unction grou# /gi%e ta&le'%iew nae+ is res#onsi&le toaintain all the changes done &! the users"

    1" )aintenance t!#ea" Cne ste# J if it is one ste# then it is single ste#" ead, change,

    insert, delete o#erations are #ossi&le fro o%er%iew screen onl!"All #ossi&le in one screen"

    &" Ste# Two J uses o%er%iew screen for read, change, and deleteo#erations" It uses single screen for insert"

    2" In SAP, e%er! screen is identi*ed &! uniFue nu&er"3" Screen nu&er consists of 4 digits"a" O

    continue"5" ecording routine if it is CD then s!ste #ro#oses, wor6 &ench

    reFuest for odi*cations"" lic6 on create J sa%e J &ac6"7" Ltilities >O contents >O !ou will get result"

    " lic6 on change'dis#la! &utton"9" hange soething"1" It #ro#oses reFuest change nu&er"11" ontinue12" hanges here are #eranent"13" lic6 on new entries /it is the single screen+

    45

  • 8/18/2019 Abap Material Final

    46/396

    Sun Shine Technologies

    T>CodesS(55 ta&le aintenance generator"S)3 aintain ta&le %iews"

     Through aintain ta&le %iews"1" Go to S)3 ta&le'%iew aintenance,2" Ta&le nae a6t3" lic6 on > .ind aintenance dialogue"

    hene%er custo ta&le is created, aintain ta&le aintenancegenerator iediatel! /to #rotect ta&le entries against changes+"

    TAB)7 &AI@T7@A@C7 7@74AT+4 ITS 7#7@TS

    -! using this we can insert ulti#le records in to the ta&le at oneshot"

    !at is table ,aintenance /eneratorJ Ta&le )aintenance Generator is a tool used to custoie theta&les created &! end users and can &e changed as reFuired, suchas a6ing an entr! to that ta&le, deleting an entr! etc"In other words, ta&le aintenance generator is a user interfacetool which is used to change the entr! of the ta&le or delete anentr! fro the ta&le or create an entr! for the ta&le"Prere2uisite To a6e this feature wor6 care should &e ta6en while creating thedata&ase ta&le that in the W$eli%er! K )aintenanceW ta&, the WTa&le

  • 8/18/2019 Abap Material Final

    47/396

    Sun Shine Technologies

    In ta&le change ode, clic6 on Ltilities and then clic6 on Ta&leaintenance generator"

    .ollowing screen will &e dis#la!ed for setting u# the )aintenancegenerator

    47

  • 8/18/2019 Abap Material Final

    48/396

    Sun Shine Technologies

    .ollowing are the a%aila&le o#tions, choose the accordingl! Authorization Group  If the ta&le needs to &e aintained &! onl!#articular grou# of #eo#le, then the Authoriation grou# needs to&e *lled otherwise *ll it as KDK" To aintain the authoriation

    grou# refer to SL21"Function group is the nae to which the generated aintenanceodules will &elong to"Generall! .unction Grou# nae can &e sae as ta&lenae"Maintenance screens:  )aintenance can &e done in 2 wa!s" 1" )aintenance K C%er%iew &oth on one screen 2" )aintenance on one screen and o%er%iew will &e on anotherscreen"

    Pro%ide the desired screen nu&ers"

    Pro#ose screen nu&er/s+ eans what we ha%e to enter in to theo%er%iew screen &o:"

    4

  • 8/18/2019 Abap Material Final

    49/396

    Sun Shine Technologies

    After the a&o%e settings clic6 on the create &utton in the Ta&leaintenance generator"

    49

  • 8/18/2019 Abap Material Final

    50/396

    Sun Shine Technologies

    After sa%ing the changes, go to S)3 for aintaining the ta&le"

    5

  • 8/18/2019 Abap Material Final

    51/396

    Sun Shine Technologies

    If we found an! de%iations in the headers li6e *elds then we canchange those settings fro structure le%el of ta&le onl!" At thattie we ha%e to delete the Ta&le aintenance generator"Ctherwise we can get #re%ious S6elton onl! in S)3 /)aintain Ta&le It i#leents left outer oin"> Selection conditions are #ossi&le"

    > )aintenance status is read onl!"> It is used as selection ethod while creating eleentar!

    search hel#"

    51

  • 8/18/2019 Abap Material Final

    52/396

    Sun Shine Technologies

    52

  • 8/18/2019 Abap Material Final

    53/396

    Sun Shine Technologies

    53

  • 8/18/2019 Abap Material Final

    54/396

    Sun Shine Technologies

    )+CG +BH7CT> Boc6 o&ect is used to restrict the siultaneous access of

    data&ase ta&le entr! &! ulti#le users at a tie"

    54

  • 8/18/2019 Abap Material Final

    55/396

    Sun Shine Technologies

    : SAP su##orts record le%el or row le%el loc6ing": Boc6 o&ect can &e de*ned in A-AP dictionar! initial screen

    as a re#ositor! o&ect": Lser de*ned loc6 o&ect naes &egin with (? or (R"

    : e can loc6 #riar! ta&le entr! as well as de#endent ta&le/secondar! ta&le+ entr! also"

    : Boc6 ha##ens &! default on 6e! *elds": Boc6 odes /or+ loc6 t!#es

    o ( J e:clusi%e'write loc6 J if we set loc6 ode as N(8 onl!that #articular user can #erfor all o#erations" Cthershared or e:clusi%e loc6s are reected" Cthers, it will not&e %isi&le"

    o S J shared'read loc6 J if the user sets loc6 t!#e S, then

    all the users can access the ta&le entr!" )odi*cation &!an! user is not allowed"o ; J (:clusi%e not cuulati%e loc6 J this is e:clusi%e loc6

    onl! &ut it is used to #erfor the loc6 for one tie onl!"o C#tiistic Boc6 >

    Cnce the loc6 o&ect is de*ned centrall! and acti%ated itgenerates two function odules"

    1" (nFueueUloc6 o&ect naeO this function odule sets theloc6 on #articular ta&le onl!"

    "> $eFueueUloc6 o&ect naeO this function odule releasethe loc6"

    Boc6 echanis handled &! (nFueue wor6 #rocess"

    P4+C7D;471" $e*ne loc6 in A-AP dictionar!"2" Go to S(3, create A-AP e:ecuta&le #rogra and call

    (nFueue function odule and e:ecute it"

    3" Perfor the o#eration li6e u#date, odif!, delete"4" hec6 loc6s entr! using T"code S)12"5" elease the loc6 &! calling function odule $eFueue"

    P(>(LISITI(S> Boc6 ha##ens on 6e! *eld onl!"

    55

  • 8/18/2019 Abap Material Final

    56/396

    Sun Shine Technologies

    PC($L(1" Go to S(11, select loc6 o&ect nae starting with (? or (R"2" lic6 on create"3" Pro%ide short descri#tion"

    4" Lnder TA-B(S J PI)A? TA-B( J DA)( J &3e#aster"5" BCH )C$( J ( IT( BCH"" Lnder BCH PAA)(T( TA- J sa%e J chec6 J acti%ate"7" Go to )(DL J BCH )C$LB(S J" Go to S(3, #ro%ide the #rogra nae starting with ? or R"9" reate J short descri#tion J t!#e as e:ecuta&le #rogra J

    sa%e as local o&ect"1" lic6 on PATT(D /TBY.+ >O ABB .LDTICD

    (DL(L((RBCHC-="

    11" Lncoent e:#orting12" )ode V N(8" /(:clusi%e, shared or e:clusi%e notcuulati%e+"

    13" )andt V s!>andt14" (#no V N18"15" Cther #araeters are not reFuired, !ou can coent

    the"1" Go to S)12, clic6 on list J to chec6"17" Dow to unloc6 it >O call function odule

    NdeFueueeloc6o&8"

    >>>>>>>>>>>>>>>K>>>>>>>>>>>>>>>

    P74-+4&A@C7 -ACT+4S I@ DATABAS7 TAB)71" -L..(IDG it is a%aila&le under T(0DIAB S(TTIDGS TA-"2" S(CD$A? ID$(; (ATICD3" BCG $ATA 0ADGS

    B;--74I@

    1" It is a%aila&le under T(0DIAB S(TTIDGS TA-"2" (%er! a##lication ser%ers consists of local &u@er"3" -u@er stores te#orar! data, %olatile data"4" -! using &u@ering, it #ic6s the data fro &u@er directl! so it

    sa%es lot of tie" And &u@ering will &e #ro%ided for asterdata'ta&les &ecause there is a chance of losing data" /In onewa! it is useful &ut there is also a chance of losing data+"

    5

  • 8/18/2019 Abap Material Final

    57/396

    Sun Shine Technologies

    5" TA-B( >O T(0DIAB S(TTIDGS >O-L..(IDG TA- >O underthis

    a" -L..(IDG DCT ABBC($ if we select this o#tion ta&leentries are not &u@ered"

    &" -L..(IDG ABBC($ -LT SIT0($ C.. ta&le entriesare &u@ered, select this o#tion if we don8t 6now thenu&er of entries loaded into &u@er"

    c" -L..(IDG SIT0($ CD select this o#tion, if we areaware of e:#ected entries into &u@er" Lnder this, !oualso ha%e to s#ecif! the &u@ering t!#e also"

    i" .LBB? -L..(($ #ic6s all the data and stores in&u@er" All the ta&le entries are loaded into &u@ere%en if we select for single record also"

    ii" SIDGB( (C$ -L..( #ic6s onl! one data andstores in &u@er /the result of select singlestateent is single record+"

    iii" G(D(I A(A -L..( #ic6s onl! s#eci*ed dataand stores in &u@er"

    1" -! s#ecif!ing 6e! *elds, we are de*ning thegeneric 6e!"

    2" Cnl! generic 6e! atching entries are loadedinto &u@er"

    3" Generic 6e! is a co&ination of left usti*ed

    6e! *elds"

    Dote -? PASS -L..(IDGQ is used to s6i# &u@ering and go todata&ase ta&le"

    I@D7 : Priar! inde: is created &! SAP": It is used to i#ro%e #erforance" It is a data &ase

    anageent s!ste /$-)S+ conce#t for faster retrie%al of

    data" And it is of two t!#eso Priar! 6e! J #ro%ide uniFueness and a%oid du#lication

    of records" And we don8t create #riar! 6e!, it isalread! created in data&ase ta&les" All the 6e! *elds ina ta&le are called #riar! 6e!"

    57

  • 8/18/2019 Abap Material Final

    58/396

    Sun Shine Technologies

    o Secondar! inde:es or secondar! 6e! J to i#ro%e the#erforance of a Fuer! while searching for records" ecreate secondar! 6e! in S(11 and infor -ASIS T(A)"

    @oteSAP recoends ta6ing inde:es as the last o#tion to increase the#erforance and e%en if !ou use this, then a6e sure that !ouare not using not ore than 4>5 inde:es a:iu" And in realtie, if !ou need to create inde:es then write an eail to the&asis #eo#le regarding the sae"

    S7C+@DA4E I@D7 C47ATI+@> Inde: a6es faster access of data&ase ta&le entries"

    > Select stateent uses inde: of the ta&le while fetching thedata"> Inde: wor6s using &inar! search"> Inde: creates *eld %alues in sorted order"> e can create 9 inde: 6e!s"

    hene%er a data&ase ta&le is created and acti%ated #riar!inde: autoaticall! creates the s!ste on 6e! *elds"Path to %iew the inde:es of the ta&le"LTIBITI(S >O $ATA-AS( C-=(T >O $ATA-AS( LTIBIT? >O clic6 onID$(; TA-"

    e can create secondar! inde:es &ased on our reFuireents onnon>6e! *eld"

    Secondar! inde: creation ste#s1" C#en the ta&le in change ode"2" lic6 on ID$(; ta&"3" reate inde: and continue"

    4" Secondar! inde: creation"

    )+ DATA C(A@7Se can chec6 the chec6&o: under technical settings ta& of an!ta&le"

    5

  • 8/18/2019 Abap Material Final

    59/396

    Sun Shine Technologies

    Cnce this chec6 &o: is ena&led, s!ste records all the changesdone &! the users on the current ta&le and *nal out#ut isdis#la!ed is stored as ta&le histor!"  This is used if !ou want to store historical'#re%ious data

    which eans &efore a6ing changes" ("g" If the studentnu&er was 1234 earlier and later if it was changed to 457then this log data changes is used to chec6 what was the#re%ious data li6e in this e"g" it was 1234"

    And the transaction code is SL3 to see the #re%ious %alues"After entering the T"code !ou need to gi%e the ta&le nae" T"code to %iew ta&le histor! SL3"

    /in real tie we will not use this, &ecause it will slow downthe access and soeties it ight also get loc6ed e%en

    though if the other users are wor6ing with di@erenta##lications+

    +@)E C+@T7@TS is used to reo%e include and dis#la! all the*elds in it"("g" Lnder *elds, for address, we can use include and gi%e theaddress under include" So there !ou will see onl! include and !ouwill not *nd the co#onents under include &ut include has a dro#down'e:#and o#tion there" Cnce !ou clic6 on e:#and, !ou will seethe entire address" And here, if !ou clic6 on CDB? CDT(DTS, then!ou will not see the include *eld &ut directl! !ou will see theentire address'co#onents under include"

    I&P+4TA@T if !ou a6e soe changes to the 6e! *elds here,then it will i#act the data in data&ase" And !ou will not &e a&leto acti%ate it" In certain cases, !ou need to follow &elow #ath"LTIBITI(S >O $ATA-AS( C-=(TS >O $ATA-AS( LTIBIT? >O clic6 onacti%ate and adust records"Cr, !ou can go to S(14"

    PACGA7 S7"1> It is a collection of o&ects /re#ositor! o&ects+" It was also

    called as de%elo#ent class /old %ersion+"> SAP de*ned o&ects &elongs to SAP de*ned #ac6ages"> Lser de*ned o&ects &elongs to either Mt# /or+ custo

    #ac6age"

    59

  • 8/18/2019 Abap Material Final

    60/396

    Sun Shine Technologies

    > usto #ac6age can &e created &! -ASIS consultants using#ac6age &uilder"

    > Mt# is a default #ac6age de*ned &! SAP"> Mt# stores all the local o&ects"

    > Mt# o&ects are ne%er trans#orta&le"> R#ac6age > usto #ac6ages onl! can &e trans#orta&le"

    T!ere are t$o types of deelop,ent clauses

    Pac*a/es

    1+ Trans#orta&le $e%elo#ent lause"

    2+ Don Trans#orta&le $e%elo#ent lause"

    Transportable Deelop,ent Clause

    If we store our #rogra in to trans#orta&le de%elo#ent clause

    then we can trans#ort the #rogra to di@erent s!stes"

    @on Transportable Deelop,ent Clause

  • 8/18/2019 Abap Material Final

    61/396

    Sun Shine Technologies

    If we store our #rogra in to non>trans#orta&le de%elo#ent

    clause then we can8t trans#ort those #rogras fro one s!ste

    to other s!ste"

     TADSPCT CGADIR(reate reFuest /or+ change reFuest

    • It is generated &! the s!ste autoaticall!, &ased ons!ste internal seFuence nu&er"

    • It is useful to identif! the o&ect"

    • It records the usernae, client nu&er, #roect nae,o&ect status, tiesta#"

    • It is useful in the #roect anageent"> eFuest nu&er

    • UInstance or SI$O H U9nnnnO"  (: $( Instance is alwa!s 3 characters e: (, $( eFuest nu&er is alwa!s &egins with 9 a:iu it

    consists of digits"

    @ote

    hene%er !ou sa%e in #ac6age, it alwa!s shows #re%ious reFuestnu&er and short descri#tion so &e careful"

    eFuests are of 3 t!#es1" or6&ench reFuest

    a" hene%er the o&ect is sa%ed under #ac6age, thens!ste #ro#oses wor6&ench reFuest nu&er"

    2" ustoiing reFuesta" hene%er standard SAP is odi*ed /or+ new data is

    entered into SAP then s!ste #ro#oses custoiingreFuest nu&er"3" Trans#ort reFuest

    a" It is generated &! the s!ste while trans#ort at -ASISle%el"

    or6&ench reFuest

    1

  • 8/18/2019 Abap Material Final

    62/396

    Sun Shine Technologies

    > S!ste alwa!s #ro#oses the list o#eration concern reFuestnu&er and descri#tion in the dialogue &o:"

    Lser can #erfor 3 o#erationsa" If we want to sa%e the current o&ect under the sae

    reFuest nu&er and clic6 on continue"&" If !ou want to aintain new reFuest nu&er then clic6

    on create reFuest o#tion"c" If !ou want to assign the current o&ect to #re%ious

    reFuest nu&er then clic6 on own reFuest then choosethe e:isting reFuest"

    S(9 Trans#ort Crganier> It organies all the custoiing and wor6&ench reFuest"

    > It aintains list of all the custoiing and wor6&enchreFuests"> If the o&ect is a%aila&le under odi*a&le section, i"e"

    odi*cations allowed"> Cnce it is released, it will &e o%ed to release section"> Cnce the o&ect is released, odi*cations are not allowed"> elease strateg!

    • e ha%e to release all the su& tas6s under reFuest"

    • .inall! reFuest is released"> In general reFuest is created and released &! leads and it is

    gi%en to the users"•  Tas6 is created and released &! tea"

    @otee need to release the Tas6 *rst and a6e sure the o&ects areacti%e" Then the reFuest is released &! leads"eFuest J tas6 J #ac6age"In golden client, alwa!s N6ee# a co#!8"

    ProcedurePlace the cursor on tas6 and clic6 on release icon in tool &ar/truc6 s!&ol+"Place the cursor on reFuest and clic6 on release /generall! leadsdo this+"

    2

  • 8/18/2019 Abap Material Final

    63/396

    Sun Shine Technologies

    C&ect concern changes can &e aintained as di@erent

    %ersions"

    > C&ect along with di@erent %ersions are #eranentl! storedunder %ersion data&ase"

    > e can retrie%e an! %ersion and %iew is #ossi&le"> e can co#are an! two %ersions of the o&ect is also

    #ossi&le"> .or scri#t and sartfors, %ersion anageent is not

    #ossi&le"

    Dote

    > There are no %ersions in the %ersion data&ase default"> )enu #ath to create %ersion utilities enu >O %ersion >Ogenerate %ersion"

    > )enu #ath to %iew the %ersion utilities enu >O %ersion >O%ersion anageent"

    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    P4+4A&&I@:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    ABAP ? AD#A@C7D B;SI@7SS APP)ICATI+@P4+4A&&I@

    It is 4th generation language"It is high le%el language"

    It is structure #rograing language"It is #rocedure oriented #rograing language"It is e%ent dri%en #rograing language"It is o&ect oriented #rograing language"It is not case sensiti%e language"It is SAP #ro#rietar! #rograing language"It is used to de%elo# SAP s#eci*c in house a##lications"

    3

  • 8/18/2019 Abap Material Final

    64/396

    Sun Shine Technologies

    Lsing 4Z asse&l! language and Z of , YY A-AP runtieen%ironent is de%elo#ed" A-AP ($ITC S(3"

    It is used to de%elo# a custo #rogra or to %iew the standard#rogra"SA3 onl! to e:ecute an! #rogra" ?ou cannot write or changethe #rogra here"A-AP (ditor is closel! integrated with A-AP de%elo#entwor6&ench"A-AP Progra is also inde#endent re#ositor! o&ect"

    Sa#le #rogra1" Go to S(3"2" Pro%ide the #rogra nae starting with ? or R"3" Pro%ide short descri#tion with soe eaningful tittle"4" S#ecif! the ATTI-LT( >O T?P( >O (;(LTA-B( PCGA)"5" Sa%e it as local o&ect"" T!#e soe write stateent in single Fuotes /e"g" write

    NPA Lser de*ned #rogra nae ust &egin with ? or R"

    4

  • 8/18/2019 Abap Material Final

    65/396

    Sun Shine Technologies

    : (%er! #rogra ust &elong to one #rogra t!#e": (%er! #rogra ust ha%e *rst stateent as (PCT or

    PCGA)": (%er! stateent ust &egin with a 6e! word and end with

    #eriod": (%er! o#erator and o#erand &efore and after, we ha%e to

    #ro%ide s#ace" ("g" A V - Y ": Increent D1 V D1 Y 1" $ecreent D1 V D1 J 1"

    A4T(&ATIC +P74ATI+@o Addition Yo Su&traction J

    o )ulti#lication o General $i%ision 'o )odules od /#ro%ides reainder+o $i%ision di%o Power

    )+ICA) +P74AT+4So AD$o C

    o DCT

    47)ATI+@A) +P74AT+4So ( Vo D( UO OU /here &oth are %alid+o GT Oo G( OVo BT Uo B( UV

    o BIH(o DCT BIH(o IS IDITIABo -(T((D""AD$

    BASICSrite"" /This is used for out#ut stateent+

    5

  • 8/18/2019 Abap Material Final

    66/396

    Sun Shine Technologies

    rite ' Nai8" /' > #ro%ide new line+rite ' Nai8 color 2" /olor 2 J #ro%ides colors and the range isfro 1 to 7+rite ' 1 Nai8" /1 > Ucol#osO+

    N=ai8 /Strings are #laced with in single Fuotes+LBID(" /Cne co#lete horiontal line+LBID( '5/7+" /Ucol#osO, length+LBID( AT '5/4+"SHIP" /This 6e!word'stateent is to s6i# one &lan6line+"SHIP 2" /SHIP UnO #ro%ides nu&er of &lan6 lines"SHIP TC BID( 15" /SHIP TC BID( UDO it s6i#s *rst 15lines fro the to#"

    C))(DTS> These are used to descri&e soe ta&les or %aria&les as

    docuentation"> It increases the reada&ilit! of source code"> Single line coent

    o Place in the *rst colun #osition /write '8ai8"+> )ulti#le write coent

    o Select ulti#le lines #ress ctrl Y U for coent and#ress ctrl Y O to uncoent"

    o Cr select the line and right clic6 and coent oruncoent"

    > In line coento ithin the line #artial string can &e coented using

    $ou&le Fuotes"

    G7E+4DKs$ATA J is used to declare %aria&les, wor6 areas, internal ta&les" T?P(S J is used to de*ne LS( $(.ID($ /custo+ eleentar!

    data t!#es, structure t!#es, internal Ta&le t!#es"

  • 8/18/2019 Abap Material Final

    67/396

    Sun Shine Technologies

    e can create the selection>screen using 3 6e!words"

    1Para,eters

      Paraeter is a 6e!word which acce#ts thein#ut at runtie"  S!nta: #araeter UPara naeO t!#e Udata t!#eO"  Paraeter UPara naeO li6e Udata&ase ta&lenaeO>U*eldnaeO" Paraeter nae should not e:ceed character lengths"Paraeter cannot acce#t [oat data t!#e instead we can use#ac6ed decial /#+"

    +bli/atory It is a 6e!word which is used to #ro%ide thein#ut *eld as andator!"S!nta: #araeter UPara naeO t!#e Udata t!#eOo&ligator!"

    Default It is a 6e!word to #ro%ide the default %alues to thein#ut %aria&le"S!nta: #araeter UPara naeO t!#e Udata t!#eO defaultU%alueO"

    2+ Select:options  Select>o#tions are a 6e!word which acce#tssingle %alue, ulti#le range, ulti#le single %alues, singleranges and ulti#le ranges"

    S!nta: select>o#tions Unae of select o#tionsO forU%aria&leO"(:a#le data %1 /4+ t!#e c"

      Select>o#tions s%1 for %1" The nae of the select o#tions acts li6e an internal ta&lewith headerline" That eans the nae of wor6area and the nae of theinternal ta&le are siilar nae of the select>o#tion"

    Co,ponents of select options"

    7

  • 8/18/2019 Abap Material Final

    68/396

    Sun Shine Technologies

    1+ Bow >O lower liit %alue of the select>o#tions"2+ 0igh >O u##er liit %alue of the select>o#tions"3+ Sign >O include /I+ or (:clude /e+4+ C#tion >O &etween /-T+

      Dot &etween /n&+  (Fual /eF+  Dot eFual /ne+"-! default select>o#tions contains sign as include ano#tion as &etween" Do inter%als It is used to reo%e theinter%als"S! select>o#tions s%1 for %1 no inter%als"

    Do>e:tension It is used to reo%e the e:tension"

    S! select>o#tions s%1 for %1 no>e:tension"3+ Selection>screen"

      Selection>screen is also used to design theselection screen with a frae"S! selection>screen &egin of &loc6 U&loc6 naeO withfrae title te:t>UnoO"  >>>>>"  >>>>>"  Selection>screen end of &loc6 U&loc6 naeO"

     Te:t no is a three digit nu&er where we can enter thetitle for the title for the te:t"

    4+ Selection>screen &egin of line">>>>>>Selection>screen end of line"It is used to dis#la! selection screen co#onents /radio&uttons or chec6 &o:es+ in a single line"

    5+ Selection>screen coent :/!+ te:t>UnoO"

    + hec6 &o: in the selection screen"  S! #araeters Uchec6&o: naeO as chec6&o:"

    7+ adio -uttons in the selection screen"

  • 8/18/2019 Abap Material Final

    69/396

    Sun Shine Technologies

      S! #araeters Uradio &utton naeO radio &utton grou#Ugrou# naeO"

    internal tables

    internal ta&le is the collection of *elds with di@erent data t!#eswhere we can store the ulti#le records te#oraril!"

    Internal ta&les are structured data t!#es #ro%ided &! A-AP'4"

    Internal ta&les cannot &e accessed outside the #rograen%ironent"

    Pur#ose of internal ta&les

    1"Internal ta&les are used to reorganie the contents of data&aseta&les according to the needs of !our #rogra

    2"Internal ta&les are used to #erfor calculations on su&sets ofdata&ase ta&les"

    3"The nu&er of lines in an internal ta&le is not *:ed"

    4"Internal ta&les e:ist onl! during the run tie of a #rogra"

    In the internal ta&le we ha%e two *elds &od! and header

    hene%er we are assign the %alues *rst we will assign the %aluesto the header not to the &od!

    hene%er we are assign the second %alue then *rst %alue will &eo%erride &! the second record to a%oid this we use a##end6e!word so the *rst %alue will &e assign to &od!

    $ata &egin of UIta& naeO Cccurs D,

    U*eld nae1O t!#e Udata t!#eO,

    U*eld nae2 O t!#e Udata t!#eO,

      " ""

      "

    9

  • 8/18/2019 Abap Material Final

    70/396

    Sun Shine Technologies

    U*eld nae DO t!#e Udata t!#eO,

      (nd of UIta& naeO"

    Cccurs D J eans we are allocate the eor! d!naicall! for

    ulti#le *elds

    (:

    *// declaration of internal table

    data &egin of  ita& occurs ,  custno/1+ t!#e n,  cnae t!#e char1,  cit! t!#e char2,

      Ft! t!#e # decials 2,  end of  ita&"*// assign value to the itabita&>custno V 1"ita&>cnae V WsatiW"ita&>cit! VWnlgW"ita&>Ft! VW1"5W"a##end ita&"ita&>custno V 2"ita&>cnae V WgsrW"ita&>cit! V WsecW"ita&>Ft! V W15"2W"a##end ita&"*//display oput loo# at ita&"  write ' ita&>custno,ita&>cnae,ita&>cit!,ita&>Ft!"endloo#"

    Dote

    In the internal ta&le we are storing ore than one record so if wewant to #rint all the records the we will write the IT( stateentin &etween the BCCP""(D$BCCP"

    7

  • 8/18/2019 Abap Material Final

    71/396

    Sun Shine Technologies

    Dested structures

    Structure with in the another structure is called nested structure

    e can declare the nested structure in 3 wa!s

    a!1

    *&---------------------------------------------------------------------**& Report !"RA#*&---------------------------------------------------------------------*

    (PCT  R(-A7 DC STAD$A$ PAG( 0(A$IDG"*// declare the $rst structuredata  &egin of  stru1,

      stuno t!#e i,  stunae t!#e  char1,  end of  stru1"*// declare the second structuredata  &egin of  si%a ,  si%aco t!#e char12,  si%ae# t!#e char12"include structure stru1"data  end of  si%a"

    *// assign the values to the structurestru1>stuno V 239"stru1>stunae V WraW"si%a>si%aco V WlocalW"si%a>si%ae# V W234W"*//output write stru1>stuno, si%a>si%aco, si%a>si%ae#"

    Cut#ut

    239 local 234a! 2

    *&---------------------------------------------------------------------**& Report !"RA#*&---------------------------------------------------------------------*

    71

  • 8/18/2019 Abap Material Final

    72/396

    Sun Shine Technologies

    (PCT  R(-A7 DC STAD$A$ PAG( 0(A$IDG"*// declaredata  &egin of  stru1,  stuno t!#e i,

      stunae t!#e  char1,  end of  stru1"

    data  &egin of  e# ,  e#no t!#e i,  e#nae t!#e char12,  lcstuct li6e stru1, end of  e#"*// assign

    e#>e#no V 1"e#>e#nae V W($$?W"e#>lcstuct>stuno V 2"e#>lcstuct>stunae V WraW"

    *//output write e#>e#no, e#>e#nae, e#>lcstuct>stuno, e#>lcstuct>stunae"

    Cut#ut

    1 ($$? 2 ra

    a! 3

    *&---------------------------------------------------------------------**& Report !"RA#*&---------------------------------------------------------------------*

    (PCT  R(-A7 DC STAD$A$ PAG( 0(A$IDG"*// declare structuredata  &egin of  e# ,  e#no t!#e i,  e#nae t!#e char12,  &egin of  stru1,  stuno t!#e i,  stunae t!#e  char1,

    72

  • 8/18/2019 Abap Material Final

    73/396

    Sun Shine Technologies

      end of  stru1, end of  e#"*// assign values to structuree#>e#no V 1"

    e#>e#nae V W($$?W"e#>stru1>stuno V 2"e#>stru1>stunae V WraW"

    *//output write e#>e#no, e#>e#nae, e#>stru1>stuno, e#>stru1>stunae"

    Cut#ut 1 ($$? 2 ra

    Dew wa! to create the structure and internal ta&le

    -u using T?P(S 6e!word we are declare the structure and theinternal ta&le

     T?P(S is 6e!word is used to declare the user de*ne data t!#es

    S!nta: for creating our own data t!#es

     T?P(S -egin of UT!#es naeO,

      .ield1 T!#e Udata t!#eO,  .ield2 T!#e Udata t!#eO,

     

      "",

      .ield D T!#e Udata t!#eO,

      (nd of UT!#es naeO"

    S!nta: for declare the structure &! referencing the T?P(S

    $ATA UStructure DaeO T!#e UT!#es DaeO "

    S!nta: for declare the internal ta&le &! referencing the T?P(S

    $ATA UIta& naeO T!#e ta&le of UT!#es DaeO"

    73

  • 8/18/2019 Abap Material Final

    74/396

    Sun Shine Technologies

    Dote

    1"In the old st!le we can assign the %alues to the internal ta&ledirectl! and we can dis#la! the data fro internal ta&le"

    2"In the new st!le directl! we can8t assign the %alues to theinternal ta&le as we as directl! we can8t dis#la! the out#ut frothe internal ta&le

    3"If we want to assign the %alues to the internal ta&le *rst weha%e to assign the %alues to the wor6 area/Structure+ then &!using APP(D$ 6e!word we can assign the %alues fro wor6 areato internal ta&le

    4"If we want to dis#la! the data fro the internal ta&le *rst we

    #ass the data fro internal ta&le to wor6 area fro wor6 area wecan dis#la! the %alues as out#ut"

    (:

    *&---------------------------------------------------------------------**& Report vishnu*&---------------------------------------------------------------------*

    (PCT  R%ishnu no standard #age heading"

    *//declaring typest!#es  &egin of  t!e#,  nu&er/1+ t!#e n,  nae/1+ t!#e c,  street/1+ t!#e c,  cit!/1+ t!#e c,  aount/1+ t!#e # decials 2,  end of  t!e#"

    *//declaring internal tabledata  lte# t!#e ta&le of  t!e#"*//declaring structuredata  lse# t!#e t!e#"

    *//assigning values to the structures*//First Record

    74

  • 8/18/2019 Abap Material Final

    75/396

    Sun Shine Technologies

    lse#>nu&er V 1"lse#>nae V W#radee#W"lse#>street V Wehdi#atnaW"lse#>cit! V Wh!dera&ad8"

    lse#>aount V W1"2W"*//Appending the values fro% or' area to internal tablea##end lse# to lte#"*//second recordlse#>nu&er V 2"lse#>nae V W#radee#2W"lse#>street V Wehdi#atna2W"lse#>cit! V Wh!dera&ad2W"lse#>aount V W12"2W"

    *//Appending the values fro% or' area to internal table*//(rd recorda##end lse# to lte#"lse#>nu&er V 3"lse#>nae V W#radee#3W"lse#>street V Wehdi#atna3W"lse#>cit! V Wh!dera&ad3W"lse#>aount V W13"2W"*//Appending the values fro% or' area to internal tablea##end lse# to lte#"

    *//desplay output write  ' Wnu&erW, 2 WnaeW, 4 WstreetW,  Wcit!W,  WaountW"uline"loo# at lte# into lse#"write  ' lse#>nu&er, 2 lse#>nae, 4 lse#>street,  ls e#>cit!, 75 lse#>aount"endloo#"

    Cut#ut

    75

  • 8/18/2019 Abap Material Final

    76/396

    Sun Shine Technologies

    Soe other wa! $eclare the wor6 area and the internal ta&les

    a!1

    1"if we want to declare soe of the *elds fro an! one of the

    data&ase ta&les

    S!nta:

    $ATA -egin of Uwor6 areaO,

      Bist of *elds,

      (nd of Uwor6 areO"

    (: data &egin of wat1,

      -u6rs li6e t1>&u6rs,

      (nd of wat1"

    $eclaring the internal ta&le

    (: $ata lttoo1 li6e ta&le of wat1"

    a! 2

    If we want to declare the internal ta&le with all the *elds of an!

    data&ase ta&le

    S!nta: for declare the wor6 area

    $ata -egin of Uor6 area naeO"

      Include structure U$- ta&le naeO"

     $ata (nd of Uwor6 area naeO"

    (:

    $ata -egin of waT1"

      Include structure T1"

    $ata end of waT1"

    S!nta: for declare the internal

    7

  • 8/18/2019 Abap Material Final

    77/396

    Sun Shine Technologies

    $ata UIta&O li6e ta&le of Uwor6 areaO"

    (: ltt1 li6e ta&le of wat1"

    a! 3

    $eclaring the wor6 area and internal ta&le &! referencing the $-ta&le

    $ata waT1 t!#e T1"

    $ata ltT1 t!#e ta&le of T1"

      /or+

    $ata ltt1 t!#e ta&le of T1"

    $ata aT1 li6e line of ltT1"

    a! 4

    $eclaring the wor6 area &! using the TA-B(S 6e!words

    S!nta: TA-B(S UTa&le naeO"

    Dote -! default the TA-B(S 6e!word create one wor6 area withthe nae of data&ase ta&le nae and also contains all the *elds

    of $- ta&le(: TA-B(S T1"

    Internal ta&le and wor6 area &! referencing the Glo&al structure

    S!nta: for declare the wor6 are &! referring glo&al structure

    $ata Uor6 area naeO T!#e UGlo&al structure naeO"

    S!nta: for declare the internal ta&le &! referring glo&alstructure

    $ata UInternal ta&leO T!#e ta&le of UGlo&al structure naeO"

    S!nta: for declare the internal ta&le &! referring glo&al ta&let!#e

    $ata UInternal ta&leO T!#e UGlo&al Ta&le t!#eO"

    77

  • 8/18/2019 Abap Material Final

    78/396

    Sun Shine Technologies

    Dote while creating the internal ta&le &! referring the glo&alinternal ta&le no need to use the T?P( TA-B( C. 6e! word

    S!nta: for declare the wor6 are &! referring glo&al ta&le t!#e

    $ata Uor6 area O li6e line of UInternal ta&le naeO"

    Initialiing techniFues

    1"lear

    2"efresh

    3".ree

    learit clears the content of the wor6 area as well as internal

    ta&le

    S!nta: clear Uor6 areaO"

      lear UIta&O"

    Dote

     in real tie we ne%er use B(A to clear the content of theinternal ta&le" If we are wor6ing with internal ta&le with headerline then nae of wor6 area as well as the nae of the internal

    ta&le are sae in this case also B(A clears the content of thewor6 area onl!"

    If we want to clear the content of the internal ta&le then we use \]for internal ta&le

    S!nta: clear Ita&\]"

    efresh

    Alwa!s clears the content of the internal ta&le onl!

     S!nta: efresh UIta&O"

    .ree Act li6e refresh

    Dote

    7

  • 8/18/2019 Abap Material Final

    79/396

    Sun Shine Technologies

    1"efresh clears the content of the internal ta&le not the eor!which is allocated for that

    hereas .(( clears the content of the internal ta&le as well as

    eor! which is allocated for thatS!nta: .ree UIta&O"

    Types of internal table

     There are 3 t!#es of internal ta&les are there

    1"Standard internal ta&le

    2"Sorted internal ta&le

    3"0ased internal ta&le

    Standard internal ta&le

    1"It acce#t the du#licate records

    2"0ere all the *elds non>uniFue *elds

    3"Pushing data fro wor6 area to internal ta&le is alwa!s throughAPP(D$ 6e!word

    4"Searching of the records is linear searchS!nta:

    $ata UIta&O T!#e'li6e standard ta&le of Uwor6 areaO"

    A##end a##end is a 6e!word to transfer the data fro wor6 areato internal ta&le

    S!nta: A##end Uwor6 areaO TC UInternal ta&leO"

    Sorted internal ta&le

    1"It a! or a! not acce#t the du#licate records

    2"0ere we ust s#ecif! one *eld as the uniFue ' non>uniFue

    3"#ushing the data fro wor6 area to internal ta&le is alwa!sthrough IDS(T 6e! word

    79

  • 8/18/2019 Abap Material Final

    80/396

    Sun Shine Technologies

    4"Searching of the records &! using the &inar! search

    S!nta:

    $ata UIta&O li6e't!#e sorted ta&le of Uwor6 areaO with

    LniFue'non>uniFue 6e! U.ield1OU*eld2O"

    (: $ata ltT1 T!#e sorted ta&le of waT1 with non>uniFue6e! &u6rs"

    Insert

    It transfer the data fro wor6 area to internal ta&le &ased on the6e! *eld

    Insert Uwor6 areaO into ta&le Uinternal ta&leO"

    0ashed internal ta&les

    1"It won8t acce#t du#licate records

    2"0ere we ust s#ecif! at least one *eld as uniFue *eld

    3"#ushing the data fro wor6 area to internal ta&le is alwa!sthrough CBB(T 6e! word

    4"Searching of the records &! using the hash algoriths /)id#oint

    algorith +

    S!nta:

    $ata Uinternal ta&leO li6e't!#e hashed ta&le of Uwor6 areaOwith uniFue 6e! U*eld1OU*eld2O"

    ollect

    It chec6s the internal ta&le whether the inserted record isa%aila&le or not, if not it act li6e a insert otherwise it adds the

    nueric *elds fro wor6 area to nueric *elds in the internalta&le

    S!nta:

    ollect Uwor6 areaO into ta&le Uinternal ta&leO"

  • 8/18/2019 Abap Material Final

    81/396

    Sun Shine Technologies

    Internal table operations

    1"eading the data fro internal ta&le

      i" eading the single record J ead

      s!nta: ead Ta&le UIta&O into Uwor6 areaO with 6e!UconditionO"

      ead ta&le UIta&O into Uwor6 areaO inde: Uinde: nu&erO"

    (A$ TA-B( Uita&O \IDTC UwaO] IT0 H(? U6e!O \-IDA?

    S(A0]"

      ii" eading the ulti#le records > loo# at

    s!nta: Boo# at UIta&O into Uwor6 areaO where UconditionO"

      "

     

      (ndloo#"

    S!nta:

    2")odif! the data in the internal ta&le &! using the odif!6e!word

    S!nta: )odif! Uita&O fro Uwor6 areaO trans#orting U*eldnaeO where UconditionO"

    (:)C$I.? ltite .C) waite TADSPCTIDG ite#rice 0(( i

    teno V waite>iteno"

    3"$elete the data &! using the delete 6e!word

      i" deleting the du#licate records

      S!nta: delete adacent du#licate fro UIta&O"

    1

  • 8/18/2019 Abap Material Final

    82/396

    Sun Shine Technologies

      (: $elete adacent du#licate fro ltcust"

      ii" $elete the #articular record

      s!nta: delete UIta&O where UconditionO

      (: delete ltcust where custno V 1 and custnae VN%ishnu8"

      iii" $elete the #articular record record &ased on the inde:

      s!nta: $elete UIta&O inde: UInde: nu&erO

      delete ltcust inde: 3"

      i%" $elete the ulti#le record &ased on the inde:

    s!nta: $elete Uita&O inde: s!>inde:

      $elete ltcust inde: s!>inde:"

    S!>inde: is a s!ste *eld which counts the nu&er of therecords in the internal ta&le

  • 8/18/2019 Abap Material Final

    83/396

    Sun Shine Technologies

    5"ounting the nu&er of lines in the internal ta&le and *nd outwhich t!#e of internal ta&le we are using

    i" ounting the nu&er of records

      s!nta: $escri&e ta&le Uita&O BID(S U%aria&leO"

    BID(S is a 6e! word which return the nu&er of records a%aila&lein the internal ta&le

    (: $escri&e ta&le ltcust lines l%count"

      ii" .inding the t!#e of the internal ta&le

    s!nta: $escri&e ta&le Uita&O HID$ U%aria&leO"

    (: $escri&e ta&le ltcust 6ind l%count"

    HID$ is a 6e!word which return the t!#e of internal ta&les

    ")o%ing data fro one internal ta&le to another internal ta&le

      )o%ing data fro one internal ta&le to another internal ta&lewhich ha%e siilar structure

    Dote if the second internal ta&le is e#t!S!nta: UInternal ta&le2O V UInternal ta&le1O"

      Ita&2\] V ita&1\]"

    Dote if the internal ta&le contains the data then

    S!nta: A##end Uwor6 areaO to UIta&O"

      A##end lines of Uita&1O to Uita&2O"

    &essa/es  Tcode for essage class is S(91>

    e ha%e 5 t!#es of essages S! essage Uessage t!#eOUessage no"O /essage class+" 

    )essage t!#e is the t!#e of essage in the *%e t!#es" )essage no is 3 digits no" 

    3

  • 8/18/2019 Abap Material Final

    84/396

    Sun Shine Technologies

    )essage class is the collection of essage no8s and their shortdescri#tion"

    AB7@D &essa/es A The s!ste dis#la!s this t!#e of

    essage in a dialog window'&o: and after the user confors thisessage &! using enter 6e! then the s!ste terinates theentire transaction"

    (: essage A /sg+"

    7rror and $arnin/ &essa/e 7  The s!ste dis#la!s thist!#e of essage in a status &ar" (: essage (' /sg+"

    Infor,ation &essa/e I The s!ste dis#la!s this t!#e ofessage in a dialog window" After user confors &! entering

    enter 6e! then it goes to selection screen"(: essage I /sg+"

    Success &essa/eS The s!ste dis#la!s this t!#e of essagein the status &ar" (: essage s/sg+"

    eneralied synta0 of ,essa/e )essage Uessage t!#eOUessage noO/essage class+ withNessage8"

    +pen s2l

    1"o#en sFl is used to wor6ing with the data&ase ta&les not withthe internal ta&les

    2"Inser, L#date, )odif! a single record alwa!s through the wor6area and ulti#le records through the internal ta&le

    3"whene%er we are wor6ing with the data&ase ta&le then thestructure of the wor6 area and the internal ta&le ust &e siilarthrough the data&ase ta&le

     The o#en sFl stateents are

    1"select

    4

  • 8/18/2019 Abap Material Final

    85/396

    Sun Shine Technologies

    2"Insert

    3"$elete

    4")odif!

    5"u#date

    Select

    Select is used to retrie%e the data fro the data&ase ta&le

    -! using the select Fuer! we can retrie%e the single record wa!s

    S!nta:

    a!1Select fro U$- ta&leO into Uwor6 areaO where UconditionO"

    (ndselect"

    *&---------------------------------------------------------------------**& Report  )+,.0A1AR!1R!)!*&---------------------------------------------------------------------*

    (PCT  %ishnudataretrie%e DC STAD$A$ PAG( 0(A$IDG"*// 2or' area declaration$ATA  wacust T?P( caddress"

    *// 0esign selection screen for 3usto%er S(B(TICD>S((D -(GID C. -BCH  &l61 IT0 .A)(  TITB( te:t>1"PAA)(T(S  #custno T?P( caddress>custoerno"S(B(TICD>S((D (D$  C. -BCH  &l61"

    *// Retrieve data fro% zcaddressS(B(T  .C) caddress  IDTC wacust  0(( custoerno V #custno"(D$S(B(T"

    5

  • 8/18/2019 Abap Material Final

    86/396

    Sun Shine Technologies

    *// 3hec' the above select 4uery is success/ot I. s!>su&rc ( "  IT(  '1 wacust>custoerno, wacust>custoernae, wacu

    st>strret, wacust>cit!, wacust>PC$("(BS("  IT(  '1 WDo $ata foundW"(D$I."

    Cut#ut

    Dote Rcaddress is the custo ta&le if !ou dou&le clic6 on the

    ta&le nae the we can see the ta&le(:a#le2

    ***5A+1 R!36R0********************// or' area declarationdata  waarc t!#e arc"**// retrieve data fro% %arc tableselect  fro arc into waarc"(D$S(B(T"

    **// display output write  ' waarc>atnr, waarc>wer6s, waarc>#stat, waarc>l%or"

    out#ut the out#ut is last record in the arc ta&le

  • 8/18/2019 Abap Material Final

    87/396

    Sun Shine Technologies

    Dote arc is the standard )) ta&le

    Dote If we are not use the where condition with theselect""endselect then it will gi%e the last record as the out#ut

    If !ou use the select"endselect it chec6s till end of the ta&leand dis#la!ed last record as the out#ut

    a!2"

    Select U*eld1OU*eld2O"U*eld nO fro U$- ta&leO whereUconditionO"

    (ndselect"

    *&---------------------------------------------------------------------**& Report  )+,.0A1AR!1R!)!*&---------------------------------------------------------------------*

    (PCT  %ishnudataretrie%e DC STAD$A$ PAG( 0(A$IDG"*************+!5!31!0 F!50+ FR6M MAR3*****************// types declaration for %arct!#es  &egin of  t!arc,  atnr t!#e atnr,

      wer6s t!#e wer6sd,  #stat t!#e #stat,  end  of  t!arc"

    *// or' area declarationdata  waarc t!#e t!arc"

    *// retrieve data fro% %arcselect atnr wer6s #stat

      fro arc  into waarc"(D$S(B(T"

    *// display output write  ' waarc>atnr, waarc>wer6s, waarc>#stat"

    Cut#ut

    7

  • 8/18/2019 Abap Material Final

    88/396

    Sun Shine Technologies

    Dote In real tie we ne%er use the selectendselect toretrie%e the single record fro the data &ase ta&le we alwa!sused select single to retrie%e the single record

    a!3

    Select single fro U$- ta&leO into Uwor6 areaO whereUconditionO"

    (PCT  %ishnudataretrie%e DC STAD$A$ PAG( 0(A$IDG"

    ******FR+1 R!36R0********************************// or' area declarationdata  waara t!#e ara"*// retrieve data fro% %arc tableselect single  fro ara into waara"*// display output write  ' waara>atnr, waara>ersda, waara>erna, waara>tart"

    Cut#ut

    Dote if we use the select single then it will dis#la! the out#utiediatel! after satisf!ing the condition

    If we are not use the where condition then it dis#la!ed *rst recordas the out#ut

    a!4"

    Select single U*eld1OU*eld2O"U*eld nO fro U$- ta&leOwhere UconditionO"

  • 8/18/2019 Abap Material Final

    89/396

    Sun Shine Technologies

    (PCT  %ishnudataretrie%e DC STAD$A$ PAG( 0(A$IDG"*************+!5!31!0 F!50+ FR6M MARA*****************// types declaration for %arct!#es  &egin of  t!ara,

      atnr t!#e atnr,  ersda t!#e ersda,  erna t!#e erna,  end  of  t!ara"

    *// or' area declarationdata  waara t!#e t!ara"

    *// retrieve data fro% %arc

    select single atnr ersda erna  fro ara  into waara"*// display output write  ' waara>atnr, waara>ersda, waara>erna"

    Cut#ut

    a!5"

    Select fro U$- ta&leO into Uwor6 areaO u# to D rows whereUconditionO"

    (ndselect"

    (PCT  %ishnudataretrie%e DC STAD$A$ PAG( 0(A$IDG"***********.716 8 R62 A55 F!50+********************// or' area declarationdata  waara t!#e ara"*// retrieve data fro% %arc tableselect  fro ara into waara u# to 1 rows"(D$S(B(T"*// display output 

    9

  • 8/18/2019 Abap Material Final

    90/396

    Sun Shine Technologies

    write  ' waara>atnr, waara>ersda, waara>erna, waara>tart"

    Cut#ut

    a!

    Select U*eld1OU*eld2O"U*eld nO fro U$- ta&leO u# toD rows where UconditionO"

    (ndselect"

    (PCT  %ishnudataretrie%e DC STAD$A$ PAG( 0(A$IDG"

    ********.716 8 R62 +!5!31!0 F!50+********************// types declaration for %arct!#es  &egin of  t!ara,  atnr t!#e atnr,  ersda t!#e ersda,  erna t!#e erna,  end  of  t!ara"

    *// or' area declarationdata  waara t!#e t!ara"

    *// retrieve data fro% %arcselect atnr ersda erna  fro ara  into waara  u# to 1 rows"(D$S(B(T"

    *// display output write  ' waara>atnr, waara>ersda, waara>erna"

    Cut#ut

    9

  • 8/18/2019 Abap Material Final

    91/396

    Sun Shine Technologies

    $i@erence &etween the select fro and select fro u# to 1rows

    1"If we use the select fro it chec6 all the records and we will

    get last record as the out#ut2"If we use the select fro u# to 1 rows then it will chec6 all therecords and *nall! the! get the *rst record as the out#ut

    $o to this disad%antage we use the select single in real tie

    etrie%e the ulti#le records

    S!nta:

    Select U*eld1OU*eld2OU*eldnO

      .ro $- ta&le

      Into ta&le UIta& naeO

      here U*eldO ID Uselect>o#tionsO"

    (PCT  %ishnudataretrie%e DC STAD$A$ PAG( 0(A$IDG"

    *//table declaration9ta&les  ara"*//types declaration for %ara table9t!#es  &egin of  t!ara,  )ATD t!#e )ATD,  (S$A t!#e  (S$A,  (DA) t!#e (DA),  BA($A t!#e  BA($A,  A(DA) t!#e A(DA),

      end of  t!ara"*//internal table declaration9data  ltara t!#e ta&le of  t!ara"*//or' area declaration9data  waara t!#e t!ara"*//selection screen design9selection>screen  &egin of  &loc6 &l61 with frae title te:t>1"

    91

  • 8/18/2019 Abap Material Final

    92/396

    Sun Shine Technologies

    select>o#tions satnr for ara>atnr"selection>screen  end of  &loc6 &l61"if  satnr is not initial"*//retriving data fro% %ara9

    select atnr ersda erna laeda aena fro ara  into ta&le ltara  where atnr in satnr"  else"  essage W#l *ll selection screen *eldsW t!#e WIW"endif "*//0+75A 6.17.19loo# at ltara into waara"write  ' A)AA>)ATD,waara>ersda,waara>

    erna,waara>laeda,waara>aena"endloo#"

    Cut#ut

    Pro%ide the in#ut and clic6 on e:ecute

    Dote whene%er we are wor6ing with the select>o#tions we use IDinstead of ( in the here condition

    92

  • 8/18/2019 Abap Material Final

    93/396

    Sun Shine Technologies

    Insert

    Insert is a 6e!word which is used to insert the data into data&aseta&le

    Insert a single record

    Insert a single record into the data&ase ta&le if there is no achfound in the data&ase &ased on the 6e! *eld otherwise it willignores the records

    S!nta:

    Insert U$- ta&leO fro Uwor6 areaO"

    (:a#le

    *&---------------------------------------------------------------------**& Report  )+,.0A1AR!1R!)!*&--------------------------------------------------------------------

    (PCT  %ishnudataretrie%e DC STAD$A$ PAG( 0(A$IDG"

    *//internal table declaration$ATAlta6t T?P(  TA-B( C. a6t"

    *//or' area declaration$ATAwaa6t T?P( a6t"

    *//assigning $rst record into the or'areawaa6t>atnr V W47W"waa6t>s#ras V W(W"waa6t>a6t: V Wte:t eterialW"waa6t>a6tg V WT(;T )AT(IABW"APP(D$ waa6t TC lta6t"

    B(A waa6t"

    *//inserting one record into %a't insert a6t fro waa6t"if  s!>su&rc eF "  IT(  ' Winserting data succesfull!W"  else"

    93

  • 8/18/2019 Abap Material Final

    94/396

    Sun Shine Technologies

      write  ' Winserting failW"endif "

    Cut#ut

    e will get the out#ut as insert successfull! *rst tie if !oue:ecute the sae #rogra at the second tie then we will getinsert fail &ecause the record is alread! inserted in to thedata&ase so s!ste ignores the record if !ou tr! to insert secondtie

    )ulti#le records

    Insert ulti#le records fro the internal ta&le to data&ase ta&le ifthere is no atches found in the data &ase ta&le for all the

    records in the internal ta&le &ased on the 6e! *elds" If at lest onerecord is atches then it si#l! ignores all the records fro theinternal ta&le as well as terinate the #rogra

    S!nta:

    1"Insert U$-ta&leO fro ta&le UIta&O"

    2"Boo# at UIta&O into Uwor6 areaO"

      Insert U$- ta&leO fro Uwor6 areaO"

    (ndloo#"

    (:a#le

    *&---------------------------------------------------------------------**& Report  )+,.0A1AR!1R!)!*&---------------------------------------------------------------------*

    (PCT  %ishnudataretrie%e DC STAD$A$ PAG( 0(A$IDG"

    *//internal table declaration$ATAlta6t T?P(  TA-B( C. a6t"

    *//or' area declaration$ATAwaa6t T?P( a6t"

    94

  • 8/18/2019 Abap Material Final

    95/396

    Sun Shine Technologies

    *//assigning $rst record into the or'areawaa6t>atnr V W47W"waa6t>s#ras V W(W"waa6t>a6t: V Wte:t eterialW"

    waa6t>a6tg V WT(;T )AT(IABW"APP(D$ waa6t TC lta6t"B(A waa6t"*//assigning second record into the or'areawaa6t>atnr V W45W"waa6t>s#ras V WSW"waa6t>a6t: V W)(SAG(W"waa6t>a6tg V W)(SSAG(W"APP(D$ waa6t TC lta6t"

    B(A waa6t"

    *//assigning (rd record into the or'areawaa6t>atnr V W45W"waa6t>s#ras V W(W"waa6t>a6t: V W)(SSAG(W"waa6t>a6tg V W)(SSAG(W"APP(D$ waa6t TC lta6t"B(A waa6t"

    *//inserting %ultiple record into %a't loo# at lta6t into waa6t"insert a6t fro waa6t"(D$BCCP"if  s!>su&rc eF "  IT(  ' Winserting data succesfull!W"  else"  write  ' Winserting failW"endif "

    Cut#ut

    e will get inserted success

    (:a#le2

    95

  • 8/18/2019 Abap Material Final

    96/396

    Sun Shine Technologies

    *&---------------------------------------------------------------------**& Report  )+,.0A1AR!1R!)!*&---------------------------------------------------------------------*

    (PCT  %ishnudataretrie%e DC STAD$A$ PAG( 0(A$IDG"

    *//internal table declaration$ATAlta6t T?P(  TA-B( C. a6t"

    *//or' area declaration$ATAwaa6t T?P( a6t"

    *//assigning $rst record into the or'area

    waa6t>atnr V W43W"waa6t>s#ras V W(W"waa6t>a6t: V Wte:t eterialW"waa6t>a6tg V WT(;T )AT(IABW"APP(D$ waa6t TC lta6t"B(A waa6t"*//assigning second record into the or'areawaa6t>atnr V W41W"waa6t>s#ras V WSW"waa6t>a6t: V W)(SAG(W"

    waa6t>a6tg V W)(SSAG(W"APP(D$ waa6t TC lta6t"B(A waa6t"

    *//assigning (rd record into the or'areawaa6t>atnr V W41W"waa6t>s#ras V W(W"waa6t>a6t: V W)(SSAG(W"waa6t>a6tg V W)(SSAG(W"

    APP(D$ waa6t TC lta6t"B(A waa6t"

    *//inserting %ultiple record into %a't ith out loop9IDS(T a6t fro  TA-B( lta6t"I. s!>su&rc ( "  IT(  ' Winserting data succesfull!W"

    9

  • 8/18/2019 Abap Material Final

    97/396

    Sun Shine Technologies

    (BS("  IT(  ' Winserting failW"(D$I."

    Cut#utInserted successfull!

    If !ou tr! to insert the sae records once again the s!ste entersinto short du#

    Dote If we want to allow the du#licate records we use Acce#ting$u#licate He!sQ in the s!nta: of insert

    S!nta:

    Insert $-ta&leO fro ta&le UIta&O acce#ting du#licate 6e!s"

     The a&o%e insert Fuer! insert the non>du#licate records in to thedat