sap/abapAll Screen Shots

Embed Size (px)

Citation preview

  • 8/16/2019 sap/abapAll Screen Shots

    1/511

    Tutorials on SAP-ABAP

    Dictionary• Creating a Transparent Table• Creating a structure in ABAP Dictionary• Creating Search helps (Elementary and collective• Creating a secondary index• !or"ing #ith table maintenance generator• Creation o$ a %ogical Database• Creation o$ a &ie# cluster• 'o# level loc"ing o$ database tables• Creation o$ a table pool and pooled table

    Reports• PD &ie#er• Convert internal table data into )T*% #ith out using unction *odules• Convert internal table data into )T*% using unction *odules• Adding custom context menu in classical list• Dynamic Selection Screen (Drop do#ns+ pushbuttons+ radio buttons+ icons• Creating Dynamic variant using table T&A'&• Display images (li"e company logo on the selection,screen• Custom Parameter,id Creation• Creating Dynamic Patterns• Scheduling a bac"ground -ob by triggering an event• Per$ormance Tuning using Parallel Cursor• Creating a Transaction &ariant• E,mailing the bac"ground -obs• ABAP Programming standards• ABAP Per$ormance Tuning Chec"list• .nderstanding S/% Trace• Changing the text 0Sales 1rder0 to 0Billing 'e2uest0 in the transactions &A34+&A35 and &A36• Creation o$ a #eb service in SAP• Calling a #eb service in ABAP that validates an email id• )andling $avorites in ABAP !or"bench• 7mplementing events in Table *aintenance• .sing Sorted table and 7ndex #hile processing internal tables• Displaying 8raphics using ABAP Program• The eatures o$ ABAPT* 9e# Editor , Part 5• The eatures o$ ABAPT* 9e# Editor , Part 4• !or"ing #ith *enu Painter• Dynamic &ariant in a report• Creating 4 helps #ith ease• 1b-ect oriented programming (11P explained #ith an example• Calling an ' C $unction module $rom one system to another• .pdating *aterial *aster long text (BAS7C DATA TE:T+ 79SPECT719 TE:T and79TE'9A% C1**E9T• System debugging , Explained in detail• *ESSA8E :::: 'A7S798 ::::; !hat is this

  • 8/16/2019 sap/abapAll Screen Shots

    2/511

    • Di$$erences bet#een %S*! and BDC• ABAP Per$ormance Standards• Create = *odi$y = Delete records in any table $rom CS& $ile• Do#nload data $rom tables #ith user de$ined delimiters• Creation o$ a 9umber 'ange 1b-ect• Creation o$ a Dynamic 7nternal table• )' 7n$otype Creation• A real,time example on sending PD $ile as an email (Complete program• Developing a simple interactive report• Demo on 7nteractive reporting (1ne more example• Do#nloading $ile on to the application server• Creating a unction *odule• Creating a dynamic selection screen on a report• Displaying 6D 8raphs in ABAP• Creating a Tabstrip on the selection screen• Dynamic SE%ECT statement• Do#nloading report output into Excel using 1%E• .nderstanding ABAP .nit• .nderstanding 0Chec"point 8roup0• .nderstanding 0Coverage Analy>er0• TP $ile trans$er in Bac"ground• Converting an :*% $ile #ith many hierarchy levels to ABAP $ormat

    Dialog Programming• Table Control using #i>ard• Splitter Controls and 8raphs• Text Edit Control .sage and Example• Displaying images on the screen• !or"ing #ith Screen Painter• Demo on Tabstrips

    • !or"ing #ith Chec"box• Demo using Table Control• Display %ogo on Screen

    BDC Programming• )o# to do BDC #ithout #riting BDC Program• Creating a simple database table using BDC• BDC recording $rom testing client to development client

    Creation of Transparent Table

    4; Enter the table name and press Create

  • 8/16/2019 sap/abapAll Screen Shots

    3/511

    5; Enter the description, Delivery class and check on table maintenance allowed. Then click on thetab Fields.

  • 8/16/2019 sap/abapAll Screen Shots

    4/511

    6; Enter the ZCHAR in ields tab and ZCHAR!DE in ield type tab.

    ?; Do"ble click on ZCHAR!DE. Then it will ask or #ave. $ress %&E#'.

  • 8/16/2019 sap/abapAll Screen Shots

    5/511

    @; #ave it as a local ob(ect on pressin) *ocal ob(ect b"tton

  • 8/16/2019 sap/abapAll Screen Shots

    6/511

    +. ow it will ask or the creation o the data element. $ress &es.

    -. Click on the Field label tab and enter the len)ths and descriptions accordin)ly.

  • 8/16/2019 sap/abapAll Screen Shots

    7/511

    . Then press De inition tab and enter the domain.

  • 8/16/2019 sap/abapAll Screen Shots

    8/511

    /. Do"ble click on that 0char!d to create domain, then it will ask or save be ore )oin) ne1t screen.

    $ress &es.

    43; #ave it as a local ob(ect.

  • 8/16/2019 sap/abapAll Screen Shots

    9/511

    22. ow it will ask or domain creation. $ress &es.

  • 8/16/2019 sap/abapAll Screen Shots

    10/511

    23. 4ive short description or that domain which yo" are creatin). And mention the data type in datatype ield and len)th in no. characters ield an press E TER.

  • 8/16/2019 sap/abapAll Screen Shots

    11/511

    25. Then press Ctrl6F5. 7t will ask or save be ore activation. #ave it as a local 8b(ect.

  • 8/16/2019 sap/abapAll Screen Shots

    12/511

    4?; $ress Enter.

    4@;Then the ollowin) screen appears. $ress on back b"tton.

  • 8/16/2019 sap/abapAll Screen Shots

    13/511

    4 ; $ress Ctrl6F5. &o" will )et the ollowin) screen. $ress 9ack b"tton.

    2-. &o" will )et the ollowin) screen.

  • 8/16/2019 sap/abapAll Screen Shots

    14/511

    2 . Create one more ield Z :; and )ive data element name as Z :;!DE. And do"ble click on%Z :;!DE

  • 8/16/2019 sap/abapAll Screen Shots

    15/511

    2/. #ave it by pressin) &es.

    53; ow it will ask or the data element creation. $ress &es.

  • 8/16/2019 sap/abapAll Screen Shots

    16/511

    32. 4ive short description o the data element. And )ive the len)ths and ield labels accordin)ly inField label tab.

    33. $ress on De inition tab and )ive the domain name in Domain ield. Do"ble click on Z :;!D.

  • 8/16/2019 sap/abapAll Screen Shots

    17/511

    56; 7t will ask or save. $ress &es.

    3=. #ave it as a local 8b(ect.

  • 8/16/2019 sap/abapAll Screen Shots

    18/511

    5@; ow it asks or Domain creation. $ress &es.

    3+. 4ive short description in short te1t ield. Enter the data type and no. characters, $ress Enter.

    Then $ress on Activate b"tton or $ress Ctrl6F5.

  • 8/16/2019 sap/abapAll Screen Shots

    19/511

    3-. #ave this as a local ob(ect.

  • 8/16/2019 sap/abapAll Screen Shots

    20/511

    3 . $ress enter.

  • 8/16/2019 sap/abapAll Screen Shots

    21/511

    5 ; ow yo" will )et the ollowin) screen. $ress 9ack b"tton.

  • 8/16/2019 sap/abapAll Screen Shots

    22/511

  • 8/16/2019 sap/abapAll Screen Shots

    23/511

    52. $ress enter.

  • 8/16/2019 sap/abapAll Screen Shots

    24/511

    65; $ress 9ack b"tton.

  • 8/16/2019 sap/abapAll Screen Shots

    25/511

    55. ow we created two ields. And Data elements and Domain or these two ields.

    ow we have to maintain the technical settin)s. $ress on Technical settin)s b"tton.

  • 8/16/2019 sap/abapAll Screen Shots

    26/511

    5=. 4ive the data class and si0e cate)ory o the table as per the re>"irement.

    And press the back b"tton.

  • 8/16/2019 sap/abapAll Screen Shots

    27/511

    6@; ow activate the table by pressin) the activate b"tton or CTR*6F5.

  • 8/16/2019 sap/abapAll Screen Shots

    28/511

    5+. $ress enter.

    5-. ow yo" will )et the ollowin) screen.

  • 8/16/2019 sap/abapAll Screen Shots

    29/511

  • 8/16/2019 sap/abapAll Screen Shots

    30/511

    5/. ow enter the data in the ields and #ave it.

  • 8/16/2019 sap/abapAll Screen Shots

    31/511

    ?3; &o" will )et the ollowin) screen a ter clickin) the Reset 9"tton.

  • 8/16/2019 sap/abapAll Screen Shots

    32/511

    =2. Enter the data or the second entry into the table.

    =3. #ave it and press reset.

  • 8/16/2019 sap/abapAll Screen Shots

    33/511

    =5. &o" will )et the ollowin) screen.

  • 8/16/2019 sap/abapAll Screen Shots

    34/511

    ==. A)ain enter the data or the third entry.

    =?. $ress save, Reset @8ptional and 9ack b"tton.

  • 8/16/2019 sap/abapAll Screen Shots

    35/511

    =+. ow yo" will )et the ollowin) screen.

  • 8/16/2019 sap/abapAll Screen Shots

    36/511

    ? ; To see the table contents )o to :tilities à Table contents à Display. 8r press Ctrl6#hi t6F2B.

  • 8/16/2019 sap/abapAll Screen Shots

    37/511

    = . &o" will )et the ollowin) screen.

  • 8/16/2019 sap/abapAll Screen Shots

    38/511

    =/. $ress on r"n b"tton or press F . ow it will display the table contents.

  • 8/16/2019 sap/abapAll Screen Shots

    39/511

    ow en(oy by creatin) tables on yo"r own.

    Creating a Structure in ABAP Dictionary

    4o to transaction #E22 and select the radio b"tton Data type'. Enter a str"ct"re name startin) with & orZ.

  • 8/16/2019 sap/abapAll Screen Shots

    40/511

  • 8/16/2019 sap/abapAll Screen Shots

    41/511

    Then press #A E , CHEC and ACT7 ATE .

    #tr"ct"re Created #"ccess "lly.

    Creating Search Helps (Elementary and Secondary)9y ikram Chellappa, ;o"ri Tech #ol"tions

    4o To #E22 T code.

    #elect the radio b"tton o search help.

    $rovide the search help name. #elect the create b"tton.

  • 8/16/2019 sap/abapAll Screen Shots

    42/511

    #elect E*E;E TAR& search help.

    $ress Enter.

    $rovide the short description, the selection method.

    $rovide the ields.

  • 8/16/2019 sap/abapAll Screen Shots

    43/511

    #ave it, Check 7t G Activate it.

    Then e1ec"te it.

    e can see the screen like this, and then press F= in this pa)e.

  • 8/16/2019 sap/abapAll Screen Shots

    44/511

    Then press F= iew the o"tp"t like this.

    This is the o"tp"t or elementary search help.

    The Collective #earch Help is like this.

  • 8/16/2019 sap/abapAll Screen Shots

    45/511

    4oto T Code #e22.

    $rovide name. #elect collective search help b"tton.

    $ress enter.

    $rovide the al"es

  • 8/16/2019 sap/abapAll Screen Shots

    46/511

    #elect incl"de search help.

    Then provide search help name, which is already de ine by the same ields.

    Then save it, activate it G e1ec"te it.

  • 8/16/2019 sap/abapAll Screen Shots

    47/511

    $ress F= we can see the o"tp"t like this.

    Di 9etween Elementary search helps G Collective search helps

    2 Elementary search helps describe a search path. The elementary search help m"stde ine where the data o the hit list sho"ld be read rom @selection method , how the

  • 8/16/2019 sap/abapAll Screen Shots

    48/511

    e1chan)e o val"es between the screen template and selection method is implemented@inter ace o the search help and how the online inp"t help sho"ld be de ined @onlinebehavior o the search help .

    3 Collective search helps combine several elementary search helps. Collective searchhelp th"s can o er several alternative search paths.

    5 An elementary search help de ines the standard low o an inp"t help.

    = A collective search help combines several elementary search helps. The "ser can th"schoose one o several alternative search paths with collective search help.

    ? A collective search help comprises several elementary search helps. 7t combines allthe search paths that are meanin) "l or a ield.

    + 9oth elementary search helps and other search helps can be incl"ded in a collectivesearch help. 7 other collective search helps are contained in collective search help, theyare e1panded to the level o the elementary search helps when the inp"t help is called.

    Creating a secondary inde

    There are two types o inde1esI $rimary inde1 and secondary inde1. $rimary inde1 is a"tomaticallycreated "sin) the primary keys de ined.

    #econdary inde1 co"ld be created as per the "ser re>"irement. This article disc"sses abo"tcreatin) a secondary inde1.

    4o to transaction #E22.

  • 8/16/2019 sap/abapAll Screen Shots

    49/511

    For o"r demo p"rpose, we have considered the table ZA:TH8R.

    To know i there are any secondary inde1es available, click on 4oto à 7nde1es

    Followin) pop"p appearsI

  • 8/16/2019 sap/abapAll Screen Shots

    50/511

  • 8/16/2019 sap/abapAll Screen Shots

    51/511

    #ave and activate.

    ow yo" can observe the inde1 created above in the list nowI

  • 8/16/2019 sap/abapAll Screen Shots

    52/511

    ;a1im"m n"mber o secondary inde1es we can have are /.

    How to make #E*ECT statement to make "se o any partic"lar secondary inde1K

    Secondary Indexes

    Consider the ollowin) e1ampleI#E*ECT L FR8; #$F*7 M!H7 T# 8RAC*E N7 DEO@P#$F*7P P#$F*7QBB2P N.......E D#E*ECT.

    7n the above e1ample, BB2 is the secondary inde1 o the table #$F*7. 7tNs a well known act that the e icientway o retrievin) data rom the database tables is by "sin) secondary inde1es. ;any database vendors providethe optimi0er hints or the same. From #A$ v=.?, optimi0er hints can be provided by the M!H7 T#parameter. This is dependent on the database systems that s"pport optimi0er hints. The point to be noted hereis these optimi0er hints are not standardi0ed by the #S* standards. Each database vendor is ree to providethe optimi0er hints.ow to know which inde1 to "se or o"r tableI2. 4o to #E22 and there speci y the table name3. ow rom the men", )oto inde1es5. select the re>"ired inde1.

    ow s"ppose that the identi ier BB2 represents a non "ni>"e secondary inde1 comprisin) o the col"mnsC7T&FR8; and C7T&T8. The inde1 name sho"ld be de ined asI

    Utablename QU7nde1 7denti ierlike #$F*7QBB2 in the above e1ample.

    The se>"ence o ields in the HERE condition is o no relevance in "sin) this optimi0ers inde1. 7 yo" speci y

    hints incorrectly, A9A$ T; i)nores them b"t doesnNt ret"rn a synta1 error or r"ntime error.The code was written in RV5 =.+C.

    Code

    Consider the ollowin) e1ampleI

    RE$8RT #"resh!test.

    TA9*E#I sp li.

    DATA I t!sp li *7 E sp li 8CC:R# B 7TH HEADER *7 E.

    #E*ECT L FR8; sp li 7 T8 TA9*E t!sp li M!H7 T# 8RAC*E N7 DEO@P#$F*7P P#$F*7QBB2P N.

    *88$ AT t!sp li. R7TE IV t!sp li.E D*88$.

    !or"ing #ith Table $aintenance %enerator

  • 8/16/2019 sap/abapAll Screen Shots

    53/511

    4o to #E22 and enter the Z table name or which the table maintenance )enerator has to be )enerated.Click on Chan)e.

    Click on :tilities à Table ;aintenance 4enerator

  • 8/16/2019 sap/abapAll Screen Shots

    54/511

  • 8/16/2019 sap/abapAll Screen Shots

    55/511

    Enter the lo)ical database name as shown above .

    7 we are "sin) *o)ical Database or HR p"rpose, we sho"ld check the check 9o1 7n o types @HR only .$ress CREATE 9"tton as shown above.

    7t wo"ld prompt or packa)e name and workbench re>"est .

  • 8/16/2019 sap/abapAll Screen Shots

    56/511

    8n pressin) #ave b"tton, ollowin) screen appears, promptin) or the details o the root node.

    Click on create b"tton. Followin) screen appearsI

  • 8/16/2019 sap/abapAll Screen Shots

    57/511

    ow enter the details o all the tables "nder *FA2 @as shown below .

    Click on create 9"tton.

  • 8/16/2019 sap/abapAll Screen Shots

    58/511

    Click on create 9"tton.

    ow create a ode with hierarchically "nder *F92.

  • 8/16/2019 sap/abapAll Screen Shots

    59/511

  • 8/16/2019 sap/abapAll Screen Shots

    60/511

    #elect Transaction with parameters @$arameter transaction '

  • 8/16/2019 sap/abapAll Screen Shots

    61/511

  • 8/16/2019 sap/abapAll Screen Shots

    62/511

    Click on save.

    ow yo" can create the table entries thro")h the transaction created above.

    For o"r demo p"rposes, let "s provide search help or ;AT R and ER #.

  • 8/16/2019 sap/abapAll Screen Shots

    63/511

    *et "s "se the standard search help available or ;AT R and ER #.

  • 8/16/2019 sap/abapAll Screen Shots

    64/511

    The c"rrency and >"antity ields are a"tomatically maintained here.

  • 8/16/2019 sap/abapAll Screen Shots

    65/511

    4o back to the main screen

  • 8/16/2019 sap/abapAll Screen Shots

    66/511

    Here we can desi)n o"r own selection screen as per the re>"irements.

  • 8/16/2019 sap/abapAll Screen Shots

    67/511

  • 8/16/2019 sap/abapAll Screen Shots

    68/511

    Database pro)ram @with some incl"des are a"tomatically created "pon the creation o lo)ical databaseI

    4o back to the main screen.

    Here we can maintain te1ts or select options and parameters.

  • 8/16/2019 sap/abapAll Screen Shots

    69/511

    avi)ate to the main screenI

  • 8/16/2019 sap/abapAll Screen Shots

    70/511

    Here we can maintain doc"mentation or o"r created Z lo)ical database.

  • 8/16/2019 sap/abapAll Screen Shots

    71/511

  • 8/16/2019 sap/abapAll Screen Shots

    72/511

    Click on Display.

  • 8/16/2019 sap/abapAll Screen Shots

    73/511

    Creation of a 'ie# cluster

    9y T. .#wapna

    View Cluster

    A view cl"ster is the set o ob(ects, s"ch as views, reports or tables, which belon) to one b"siness"nction. The data can be arran)ed either hierarchically or non hierarchically in view cl"ster. A viewcl"ster transaction edits the comple1 cross table data in a view cl"ster. The transaction navi)ation bo1shows the comple1 b"siness ob(ect with its components or s"b ob(ects.

    Example:

    *et "s create a iew Cl"ster on ;aterial Details. The view cl"ster wo"ld incl"de three tables namely,;ARA, ;ARC and ;ARD. e need to create maintenance views or each o these tables.

    Maintenance view for a!le M"#"

    To create maintenance view or the table ;ARA ollow the proced"re below. 4o to transaction #E22.4ive a view name say Z;;! !;ARA and click on %Create

  • 8/16/2019 sap/abapAll Screen Shots

    74/511

    9y de a"lt all the key ields wo"ld be added. e can add more ields by clickin) on the b"tton Tableields.

    ow #ave and activate the view.

    Maintenance view for a!le M"#C

    Follow the same proced"re as above. 7n the Tab iew ields, )ive %#< in the col"mn %$< or the ields;A DT and ;AT R as shown in the screen shot belowI

  • 8/16/2019 sap/abapAll Screen Shots

    75/511

    This is beca"se the ields ;A DT and ;AT R wo"ld be illed in the view or ;ARA and th"s they act ass"bsets and appear as header data when we create entries in view cl"ster.

    Maintenance view for a!le M"#$

    Follow the same proced"re as above. 7n the Tab iew ields, )ive %#< in the col"mn %$< or the ields;A DT, ;AT R and ER # as shown in the screen shot belowI

    This is beca"se the ields ;A DT, ;AT R and ER # wo"ld be illed in the view or ;ARC and th"sthey act as s"bsets and appear as header data when we create entries in view cl"ster.

    a!le Maintenance %enerator for &MM V M"#"

    ow, or each view we need to create a table maintenance )enerator, which has to be done as ollowsI

  • 8/16/2019 sap/abapAll Screen Shots

    76/511

  • 8/16/2019 sap/abapAll Screen Shots

    77/511

  • 8/16/2019 sap/abapAll Screen Shots

    78/511

    ote that the 8verview screen n"mbers wo"ld chan)e or each view. 7t wo"ld be %3< or the viewZ;;! !;ARC and it wo"ld be %5< or the view Z;;! !;ARD.

    Creatin( view cluster

    The pre re>"isites or creatin) the iew Cl"ster are now ready. 4o to transaction #E?= and select theb"tton %Edit iew Cl"ster

  • 8/16/2019 sap/abapAll Screen Shots

    79/511

    An in ormation messa)e wo"ld pop "p sayin)

    Contin"e by pressin) %Enter

  • 8/16/2019 sap/abapAll Screen Shots

    80/511

    8n Clickin) the %8b(ect #tr"ct"re< the ollowin) screen appears. #elect the % ew Entries< b"tton to enterthe maintenance views created to orm a cl"ster.

    Enter the val"es as shown belowI

    The entries wo"ld be entered in a hierarchical manner. The short te1t is the description o the view. The%$redecess< col"mn speci ies the predecessor o that view. #o in this case, the predecessor oZ;;! !;ARA is Z;;! !;ARA itsel . The predecessor o Z;;! !;ARC is Z;;! !;ARA and thepredecessor o Z;;! !;ARD is Z;;! !;ARC. The %DE$< col"mn e1plains whether the entry is aHeader entry or a Dependent entry. 7t is %R< or the view Z;;! !;ARA, beca"se it is a header entry anddoes not depend on any other view. hereas, it is %#< or Z;;! !;ARC and Z;;! !;ARD, beca"seZ;;! !;ARC is dependent on Z;;! !;ARA and Z;;! !;ARD is dependent on Z;;! !;ARC.The col"mn %$8#< speci ies the se>"ence o the views. 7n the col"mn %#tart< select the radio b"ttona)ainst the entry or Z;;! !;ARA as it comes irst in the hierarchy.

    A ter enterin) the above entries, press %Enter

  • 8/16/2019 sap/abapAll Screen Shots

    81/511

    ow select each line and click on %Field dependence< b"tton. A pop "p appears sayin) %Fielddependencies s"ccess "lly )enerated

  • 8/16/2019 sap/abapAll Screen Shots

    82/511

    The view cl"ster is now created s"ccess "lly.

    )ote:

    2. The view cl"ster can be created on the tables whose data has to be stored in a hierarchicalmanner.

    3. 8ne has to check whether proper orei)n key relationships are maintained between the tablesappearin) in the cl"ster. #ometimes while )eneratin) the Field dependencies, errors may occ"r ithe orei)n keys are not maintained properly.

    estin( the View Cluster

    From the initial screen o the transaction %#E?=< )ive the view cl"ster name and click on %Test

  • 8/16/2019 sap/abapAll Screen Shots

    83/511

  • 8/16/2019 sap/abapAll Screen Shots

    84/511

    o# le el loc"ing of database table

    9y #wetabh #h"kla, 7n osys Technolo)ies

    ormally i a person opens table maintenance )enerator and tries to maintain the table, no one else canmaintain the same table at the same time. This is beca"se o table level lock by de a"lt in #A$. 8nly one "sercan maintain any table at a time thro")h #;5B or any transaction that calls table maintenance )enerator. 7n thet"torial below we will see how to remove table level lock and apply row level lock. This way any n"mber o"sers can modi y the table at same time. 9"t any partic"lar row can be modi ied by only one "ser at a time. ewill create a transaction or this p"rpose. The transaction will call o"r c"stom report. This c"stom report will callthe table maintenance )enerator o the table a ter deletin) table level lock.

    7n c"rrent e1ample let

  • 8/16/2019 sap/abapAll Screen Shots

    85/511

    e will make sin)le screen maintenance or this table. #ave it. #o inally we have table maintenancecode a"tomatically )enerated in "nction )ro"p ZTE#T!#H: #5.

    5. Create lock ob(ect E&T##!E=55#H in #E22. 4ive it name as EZTE#T!#H: #5.

  • 8/16/2019 sap/abapAll Screen Shots

    86/511

    ow save and activate the *ock ob(ect. #A$ creates two "nction mod"les correspondin) to lock ob(ector en>"e"e and de>"e"e o the table.

    =. ow create a report ZRE$!#H: #5 and transaction code ZTE#T!#H: #5 to call this report. Thistcode will call table maintenance )enerator o table ZTE#T!#H: #5 .

  • 8/16/2019 sap/abapAll Screen Shots

    87/511

    ?. ormally i a person opens table maintenance )enerator and tries to maintain the table, no one elsecan maintain table at the same time. This is beca"se o table level lock by de a"lt in #A$. 8nly one"ser can maintain any table at a time. 7n report ZRE$!#H: #5 we will delete the table level lock andp"t row level lock so that m"ltiple "sers can maintain table at same time. Rows locked by one "serwill not be editable by other "ser. Check the report and comments )iven below.

    LG LLG Report ZRE$!#H: #5LGLGLG A"thor I #wetabh #h"klaLG Date I B?V33V3BB/LG Description I To delete table level lock rom table.LG LRE$8RT 0rep!sh"ks5.

    LL#election ran)e or view maintenanceDATAI 9E47 8F selekttab 8CC:R# 2. P#elektionsbereich 7 C*:DE #TR:CT:RE vimsellist.DATAI E D 8F selekttab,

    LLTable o inactive C:A "nctions or view maintenance9E47 8F e1cl!c"a! "nct 8CC:R# 2. Pinaktive C:A Fkt bei iew $ le)e 7 C*:DE #TR:CT:RE vime1cl "n.DATAI E D 8F e1cl!c"a! "nct.

    DATAI lt!en>!del T&$E #TA DARD TA9*E 8F se>)5, lt!en>!read T&$E #TA DARD TA9*E 8F se>)-, lw!en>!read T&$E se>)-, lw!en>!del T&$E se>)5, lv!s"brc T&$E sy s"brc.

    LRead all the lock details in systemCA** F: CT78 NE S:E!READ3N EO$8RT7 4 )client W sy mandt )name W N N )"name W NLN TA9*E# en> W lt!en>!read.

    L e will search entry or table level lock or o"r table*88$ AT lt!en>!read 7 T8 lw!en>!read HERE )name ES NR#TA9*EN A D )ar) C# NZTE#T!#H: #5N.

    ;8 E C8RRE#$8 D7 4 lw!en>!read T8 lw!en>!del. A$$E D lw!en>!del T8 lt!en>!del.E D*88$.

    LDelete table level lock entry or o"r tableCA** F: CT78 NE S:E!DE*ETEN EO$8RT7 4 check!"pd!re>"ests W 2 7;$8RT7 4 s"brc W lv!s"brc

  • 8/16/2019 sap/abapAll Screen Shots

    88/511

    TA9*E# en> W lt!en>!del.

    L ow call the table maintenace )enerator.CA** F: CT78 N 7E !;A7 TE A CE!CA**N EO$8RT7 4 action W N:N view!name W NZTE#T!#H: #5N show!selection!pop"p W NON TA9*E# dba!sellist W selekttab e1cl!c"a! "nct W e1cl!c"a! "nct.

    +. X"st one more chan)e in table maintenance screen. ow open table maintenance "nction)ro"p@ZTE#T!#H: #5 in #E B. e know or table maintenance #A$ a"tomatically creates code inthe "nction )ro"p. ow we will make some modi ication in that e1istin) code to chan)e the behavior.8pen the screen yo" created thro")h table maintenance and add one mod"le.

    8pen the screen BBB2 and add one mod"le in $98 o the screen as shown in i)"re below.

  • 8/16/2019 sap/abapAll Screen Shots

    89/511

    Check the code below to be added in the mod"le m!chan)e!lockin).

    ;8D:*E m!chan)e!lockin) 8:T$:T.LCall the "nction mod"le correspondin) to the lock ob(ect we created CA** F: CT78 NE S:E:E!EZTE#T!#H: #5N EO$8RT7 4 matnr W 0test!sh"ks5 matnr werks W 0test!sh"ks5 werks EOCE$T78 # orei)n!lock W 2 system! ail"re W 3 8THER# W 5. 7F sy s"brc E B.L row is locked..hence )ray.. *88$ AT #CREE . screen inp"t W B. ;8D7F& #CREE . E D*88$. E D7F.E D;8D:*E. P m!chan)e!lockin) 8:T$:T

    -. ow we are ready or testin). Call the transaction once and make some entries in table. 7n belowscreenshot 7 have entered some random val"es. #ince we have not maintained any check tables etc,so val"es may be invalid. That can be taken care in real scenario.

  • 8/16/2019 sap/abapAll Screen Shots

    90/511

    #ave data.

    *et

  • 8/16/2019 sap/abapAll Screen Shots

    91/511

    #o the entry opens in chan)e mode.

    ow open a second session o the transaction and see. ow the same material and plant combinationcan not be chan)ed by any other "ser or session.

    Session 2

    8pen transaction ZTE#T!#H: #5

  • 8/16/2019 sap/abapAll Screen Shots

    92/511

    #o we can see that o"r transaction is able to achieve a row level lockin) and has removed table levellockin).

    Creation of a table pool and pool table

    9y iran "mar andakatla, 7ntelli)ro"p

    7n this T"torial, we create a Table pool irst and then createV @add a table to Table pool a $ooled Table.

    #tep 2I

    4o to transaction #E22. 4o to :tilities à 8ther Dictionary 8b(ects

  • 8/16/2019 sap/abapAll Screen Shots

    93/511

    #tep 3I

    #elect Radio b"tton Table poolVCl"ster 4ive table $ool ameI ZT9*!$88*.

    Then press F? or choose Create.

    #tep 5I

    Then #elect Radio b"tton Table $ool. $ress Enter.

  • 8/16/2019 sap/abapAll Screen Shots

    94/511

    #tep =I

    Then yo" )o to maintain $oll #creen there )ive #hort Description.

    #tep ?I

    Then )o to Technical settin)s.

  • 8/16/2019 sap/abapAll Screen Shots

    95/511

    #tep +I

    7n the ;aintain technical #ettin)s' screen $rovide #i0e cate)ory.

    #ave and activate the table $ool. 4o back to #E22.

    #tep -I

  • 8/16/2019 sap/abapAll Screen Shots

    96/511

    4o to #E22 A9A$ DictionaryI 7nitial #creen.

    Create a Z table.

    #tep I

    ;aintain Delivery and ;aintenance attrib"tes or the Z table.

  • 8/16/2019 sap/abapAll Screen Shots

    97/511

    Add ields to the Z table.

    ;aintain Technical settin)s and Enhancement Cate)ory.

    #tep /I

    Then 4o to E1tras à Chan)e table cate)ory

  • 8/16/2019 sap/abapAll Screen Shots

    98/511

    #tep 2BI

    Choose Table type.

    7n o"r E1ample it is $ooled table.

    #tep 22I

    4o back to Delivery and ;aintenance tab and provide $oolVCl"ster val"e.

  • 8/16/2019 sap/abapAll Screen Shots

    99/511

    e have s"ccess "lly created Table pool and $ooled table.

    PD* 'ie#er

    9y #ai "mar 9, Ente)

    This $ro)ram helps yo" to view any o"tp"t in $DF viewer as shown below. 7t

  • 8/16/2019 sap/abapAll Screen Shots

    100/511

    INITIALIZATION.LS_#ONTROL_PARAM-'ETOTF + , ,.LS_#ONTROL_PARAM-NO_DIALO' + , ,.

    START-OF-SELE#TION.

    #ALL F"N#TION , B#DWB SF//////01, E PORTIN'* AR#$IVE_INDE +* AR#$IVE_INDE _TAB +* AR#$IVE_PARAMETERS + #ONTROL_PARAMETERS + LS_#ONTROL_PARAM P_VBELN + P_VBELN* MAIL_APPL_OB( +* MAIL_RE#IPIENT +* MAIL_SENDER +* O"TP"T_OPTIONS +* "SER_SETTIN'S + , , IMPORTIN'

    * DO#"MENT_O"TP"T_INFO + L_DO#"MENT_O"TP"T_INFO (OB_O"TP"T_INFO + L_(OB_O"TP"T_INFO* (OB_O"TP"T_OPTIONS + L_(OB_ O"TP"T_OPTIONS E #EPTIONS FORMATTIN'_ERROR + INTERNAL_ERROR + 2 SEND_ERROR + 0 "SER_#AN#ELED + 1 OT$ERS + % . IF SY-S"BR# ) /.* MESSA'E ID SY-MS'ID TYPE SY-MS'TY N"MBER SY-MS'NO* WIT$ SY-MS'V SY-MS'V2 SY-MS'V0 SY-MS'V1. ENDIF.

    #ALL F"N#TION ,#ONVERT_OTF, E PORTIN' FORMAT + ,PDF, IMPORTIN' BIN_FILESIZE + PDF_FSIZE TABLES OTF + L_(OB_O"TP"T_INFO-OTFDATA LINES + LT_PDF E #EPTIONS ERR_MA _LINEWIDT$ + ERR_FORMAT + 2 ERR_#ONV_NOT_POSSIBLE + 0 OT$ERS + 1.

    * o34ert p56 to 78tr93 8tr93 LOOP AT LT_PDF INTO LS_PDF. ASSI'N LS_PDF TO )FS_ #ASTIN'. #ON#ATENATE LV_#ONTENT )FS_ INTO LV_#ONTENT IN BYTE MODE. ENDLOOP.

    #ALL S#REEN //.

  • 8/16/2019 sap/abapAll Screen Shots

    101/511

    *&---------------------------------------------------------------------**& Mo5;

  • 8/16/2019 sap/abapAll Screen Shots

    102/511

    Con ert internal table data into HT$& format #ithout using *unction$odules

    9y #"man "mar Chinnam

    The o"tp"t o this T"torial is same as previous one b"t in this we are not "sin) any "nction mod"les toconvert internal table data to HT;* table.

    *&----------------------------------------------------------------**& Report YTEST_TABLE_$TML*&

    http://www.saptechnical.com/Tutorials/ABAP/HTML/usingFM.htmhttp://www.saptechnical.com/Tutorials/ABAP/HTML/usingFM.htm

  • 8/16/2019 sap/abapAll Screen Shots

    103/511

    *&----------------------------------------------------------------*REPORT ?te8t_t>===< t>=35 F9et>

  • 8/16/2019 sap/abapAll Screen Shots

    104/511

    APPEND t_@t

  • 8/16/2019 sap/abapAll Screen Shots

    105/511

    TABLES 5>t>_t>= + t_@t < E #EPTIONS 69t @ + 2 ;9_re6;8e_69386er + 0 934>;t@or9t? + % ;3H3o 3_error + J @e>5er_3ot_>tor_3ot_>

  • 8/16/2019 sap/abapAll Screen Shots

    106/511

    Con ert internal table data into HT$& format using *unction $odules

    9y #"man "mar Chinnam

    Followin) F"nction ;od"les are "sed to convert internal table data to HT;* Table.

    2. !7TA9!T8!HT;*!HEADER# is "sed to pop"late col"mn headin)s.5; !7TA9!T8!HT;*!*A&8:T is "sed to pop"late col"mn cell properties. 6; !7TA9!T8!HT;* is "sed to convert internal table data to HT;*.

    *&---------------------------------------------------------------------**& Report YTEST_TABLE_$TML

  • 8/16/2019 sap/abapAll Screen Shots

    107/511

    *&*&---------------------------------------------------------------------*REPORT ?te8t_t>=

  • 8/16/2019 sap/abapAll Screen Shots

    108/511

    @e>5er + t_@e>5er.*-Pop;te #o=5er + >_@e>5er TABLES

    @t < + t_@t < 69e5er 9t>=

  • 8/16/2019 sap/abapAll Screen Shots

    109/511

  • 8/16/2019 sap/abapAll Screen Shots

    110/511

    Adding custom conte t menu in classical list

    *y +oy,it %hosh- *M ndia

    *&---------------------------------------------------------------**& Report Z_#ONTE T_MEN"_DEMO*&*&---------------------------------------------------------------**& p;=t SAPTe @39 >=t9o3DATA: 9_4=>H TYPE STANDARD TABLE OF 4=>H INITIAL SIZE / 9_4=>p TYPE STANDARD TABLE OF 4=>p INITIAL SIZE /.* WorH>re> 5e r>t9o3DATA: _4=>H TYPE 4=>H _4=>p TYPE 4=>p.START-OF-SELE#TION.

    * Set ;8to 8t>t;8 SET PF-STAT"S ,BASI#,.* Fet @ @e>5er 5>t> SELE#T * FROM 4=>H INTO TABLE 9_4=>H "P TO %/ ROWS. IF 8?-8;=r + /.* Fet @ t> SELE#T * FROM 4=>p INTO TABLE 9_4=>p FOR ALL ENTRIES IN 9_4=>p W$ERE 4=ep-4=e89 H INTO _4=>H. FORMAT #OLOR #OL_$EADIN'. WRITE : / _4=>H-4=eH-er5>t 0% _4=>H-er et %% _4=>H-er3> . $IDE: _4=>H-4=e

  • 8/16/2019 sap/abapAll Screen Shots

    111/511

    WINDOW STARTIN' AT 2/ 2/ ENDIN' AT 2/ /. END#ASE.*&---------------------------------------------------------------**& For o3_ t e3;_re ;e8t*&---------------------------------------------------------------** #re>t9o3 o6 ;8to o3te7t e3;- It 98 >

  • 8/16/2019 sap/abapAll Screen Shots

    112/511

    From this method @D7#$ATCH it calls the ro"tine 8 !CT;E :!RES:E#T which is de ined in o"rpro)ram.

  • 8/16/2019 sap/abapAll Screen Shots

    113/511

  • 8/16/2019 sap/abapAll Screen Shots

    114/511

  • 8/16/2019 sap/abapAll Screen Shots

    115/511

    $etail list:

    Dynamic Selection Screen (Drop do#ns+ pushbuttons+ radio buttons+icons)

    9y #warna #, Tata Cons"ltancy #ervices

    Followin) is the code in which the selection screen chan)es based on the "serNs click on the radio b"ttons. Theentire selection screen is chan)ed. The F b"tton is disabled and selection screen p"sh b"tton which chan)esdynamically based on radio b"tton and does the "nctionality o the F b"tton.

    *&----------------------------------------------------------------**& Report Z_88 r ** P;=t SAPTe @39 >= e /C t>= e 85t>= e @rt>= e.*DE#LARATIONS FOR SELE#TION S#REEN STAT"SDATA 9t_; o TYPE TABLE OF 8?-; o .***********SELE#TION-S#REENS**********************SELE#TION-S#REEN BE'IN OF BLO#! =

  • 8/16/2019 sap/abapAll Screen Shots

    116/511

    SELE#TION-S#REEN #OMMENT 2 JC te7t_// .*DYNAMI# LIST BO BASED ON "SER SELE#TIONSPARAMETERS o3e AS LISTBO VISIBLE LEN'T$ 2/ MODIF ID o5.PARAMETERS t o AS LISTBO VISIBLE LEN'T$ 2/ MODIF ID r>5.PARAMETERS t@ree AS LISTBO VISIBLE LEN'T$ 2/ MODIF ID >5.SELE#TION-S#REEN END OF BLO#! =

  • 8/16/2019 sap/abapAll Screen Shots

    117/511

    8 ree3-> t94e + /. 8 ree3-598p?_05 + ,/,. MODIFY S#REEN. ENDIF. ENDLOOP. ENDIF.*#LI#! OF T$IRD RADIO IF p + , ,. 88 r69e3 Re8o;r e8,. WRITE 9 o3_3e _e p t94e + /. 8 ree3-598p?_05 + ,/,. MODIFY S#REEN. ENDIF. IF 8 ree3- ro;p + ,MOD,. 8 ree3-93te38969e5 + ,/,. 8 ree3-> t94e + /.

    8 ree3-598p?_05 + ,/,. MODIFY S#REEN. ENDIF. IF 8 ree3- ro;p + ,#AD,. 8 ree3-93te38969e5 + , ,. 8 ree3-> t94e + . 8 ree3-598p?_05 + , ,. MODIFY S#REEN. ENDIF. ENDLOOP. ENDIF.*#"STOMISIN' T$E TOOLBARS OF T$E SELE#TION S#REEN*WIT$ F B"TTON DISABLED APPEND : ,PRIN, TO 9t_; o ,SPOS, TO 9t_; o ,ONLI, TO 9t_; o . #ALL F"N#TION ,RS_SET_SELS#REEN_STAT"S, E PORTIN' p_8t>t;8 + 8?-p6He? TABLES p_e7

  • 8/16/2019 sap/abapAll Screen Shots

    118/511

    85t>===. PERFORM 61_4>

  • 8/16/2019 sap/abapAll Screen Shots

    119/511

  • 8/16/2019 sap/abapAll Screen Shots

    120/511

    OT$ERS + 2. IF 8?-8;=r ) /. MESSA'E ID 8?- 8 95 TYPE 8?- 8 t? N"MBER 8?- 8 3o WIT$ 8?- 8 4 8?- 8 42 8?- 8 40 8?- 8 41. ENDIF.ENDFORM. 61_4>=== e.*pop;p to 598p? te@ 8e=35

  • 8/16/2019 sap/abapAll Screen Shots

    121/511

    *#o3t93;e =;tto3 98

  • 8/16/2019 sap/abapAll Screen Shots

    122/511

    8n click o the 9"tton in the Application toolbar, here %#ales and Distrib"tion

  • 8/16/2019 sap/abapAll Screen Shots

    123/511

    Dynamic 'ariant using the table T'A '

    9y Xoy(it 4hosh, 79; 7ndia

    *et "s say or the )iven selection screen we need to create a dynamic variant.

    0tep 4. First maintain a variable with val"es in table T AR . This can be done rom transaction #T AR .*ater this variable needs to be assi)ned to the variant.

    0tep 5. e1t create the dynamic variant by pressin) the #A E b"tton on the selection screen.

    7n the ne1t screen @A9A$I #ave as ariant enter ariant name, description, set the %#election variable<@* radio b"tton and press %#election variable< p"sh b"tton.

  • 8/16/2019 sap/abapAll Screen Shots

    124/511

    7n the ne1t screen check that )reen tra ic li)ht is on "nder col"mn T @TI Table variable rom T AR .

    Then click on the b"tton.

    ow rom the pop"p select the variable name created in #tep2 and save the variant.

  • 8/16/2019 sap/abapAll Screen Shots

    125/511

  • 8/16/2019 sap/abapAll Screen Shots

    126/511

    7t will pop"late %Airline< select option with the val"es maintained in T AR table a)ainst variableZA7R*7 E!C8DE.

    Display images (li"e company logo) on the selection,screen

    *y %aura! *aner,i- Cap(emini ndia

    4o to #; B and or "ploadin) the ima)e.

  • 8/16/2019 sap/abapAll Screen Shots

    127/511

    #elect 9inary Data

    #elect the Find 9"tton

    $ress

    $ress the Create b"tton

    Enter name and description

    #elect the ima)e to "pload

  • 8/16/2019 sap/abapAll Screen Shots

    128/511

    Assi)n a packa)e @m"st

    $ress #ave and 8

  • 8/16/2019 sap/abapAll Screen Shots

    129/511

    rite the ollowin) report

    CodeI

    REPORT =_pro /J.* START OF DO NOT #$AN'E***********************************DATA: 5o H93 TYPE REF TO 93er p9 t;re_ o3tror> -ret_ o5e o3te3t_t?pe LI!E 0p>r> - o3t_t?pe o3te3t_r> - o3t_t> LI!E 0 9 e O##"RS / p9 _89 e TYPE 9.* END OF DO NOT #$AN'E*************************************DATA : 8; 1C 3; 1C 3; 2 1C.PARAMETERS: p_5; ? 1C DEFA"LT ,1, .PARAMETERS: p_5; ? 1C DEFA"LT ,%, .AT SELE#TION-S#REEN O"TP"T. PERFORM 8@o _p9 .START-OF-SELE#TION.*&-------------------------------------------------------------------*& For 8@o _p9*&-------------------------------------------------------------------FORM 8@o _p9 . DATA: rep95 LI!E 8?-rep95. rep95 + 8?-rep95. #REATE OB(E#T p9 t;re_ o3tro

  • 8/16/2019 sap/abapAll Screen Shots

    130/511

  • 8/16/2019 sap/abapAll Screen Shots

    131/511

    4iven below is the desired o"tp"t

    Custom Parameter,id Creation

    9y Abhi(it Daptary, Cap)emini 7ndia

    0tep4 I Creation o parameter 7D.

    $arameter 7D can be created in the table T$ARA. X"st enter the name o the parameter id in thetable and that parameter 7D will be created.

  • 8/16/2019 sap/abapAll Screen Shots

    132/511

  • 8/16/2019 sap/abapAll Screen Shots

    133/511

    7t will ask or the te1t o the parameter 7d. Enter the te1t o the parameter 7D and click on the 0aveb"tton.

    Enter the $acka)e and the transport n"mber.

    The parameter id can be seen in the table P"#" .

  • 8/16/2019 sap/abapAll Screen Shots

    134/511

    #tep3I :sin) the parameter 7d that yo" have created.

    ow )o to the 0E44 transaction or creatin) a data element and enter the parameter id at theurther Characteristics tab at the parameter 7d section.

    Activate the data element and "se it with the pro)ram. 7t will act the same )ood as a standard one.

    Create Dynamic Patterns

    9y Xoy(it 4hosh, 79; 7ndia

    0tep4 . Create a pattern with only one line that contains 7898E .

  • 8/16/2019 sap/abapAll Screen Shots

    135/511

    $"t this above e1pression and press save b"tton.

    0tep5. ow rom C;8D create a pro(ect and incl"de enhancement #E:EDBB2 in it.

  • 8/16/2019 sap/abapAll Screen Shots

    136/511

  • 8/16/2019 sap/abapAll Screen Shots

    137/511

    ow insert the ollowin) code block in the incl"de pro)ram and activate it.

    *&---------------------------------------------------------------------**& I3 :,. APPEND _=;66er TO =;66er. _=;66er + ,*& Mo5; t:,. APPEND _=;66er TO =;66er. _=;66er + ,*& F;3 t. Spe . Re6. :,. APPEND _=;66er TO =;66er. _=;66er + ,*& De4e3?C:,. APPEND _=;66er TO =;66er.

    _=;66er + ,*& #re>te D>te :,. APPEND _=;66er TO =;66er. _=;66er + ,*& Pro r> T?pe :,. APPEND _=;66er TO =;66er. _=;66er + ,*& ProQe t P@>8e :,. APPEND _=;66er TO =;66er. _=;66er + ,*& De8 r9pt9o3 :,. APPEND _=;66er TO =;66er. _=;66er +,*********************************************************************,.

  • 8/16/2019 sap/abapAll Screen Shots

    138/511

    APPEND _=;66er TO =;66er. W$EN OT$ERS.* Do 3ot@93END#ASE.

    *astly activate the pro(ect

    Scheduling bac"ground -obs by triggering e ents

  • 8/16/2019 sap/abapAll Screen Shots

    139/511

    Step1 : Create event from transaction SM62.

    Give event name and description and press save button

    Step2 : Create a program that triggers this event by calling the FM ‘ BP_ ! "T_RAIS # .

    *&---------------------------------------------------------------------*

  • 8/16/2019 sap/abapAll Screen Shots

    140/511

    *& Report Z_TRI''ER_EVENT **& **&---------------------------------------------------------------------**& **& **&---------------------------------------------------------------------*REPORT Z_TRI''ER_EVENT .#ALL F"N#TION ,BP_EVENT_RAISE, E PORTIN' e4e3t95 + ,Z_TRI''ER_(OB,

    E #EPTIONS BAD_EVENTID + EVENTID_DOES_NOT_E IST + 2 EVENTID_MISSIN' + 0 RAISE_FAILED + 1 OT$ERS + % .IF 8?-8;=r ) /. Wr9te: ,E4e3t 6>9

  • 8/16/2019 sap/abapAll Screen Shots

    141/511

    #n the popup screen press $ After event” button and give the event name and then press save button.

  • 8/16/2019 sap/abapAll Screen Shots

    142/511

  • 8/16/2019 sap/abapAll Screen Shots

    143/511

    ow )o back to the initial screen and press 0tep; b"tton

    $rovide pro)ram and variant name and a ter providin) all the val"es press save b"tton.

  • 8/16/2019 sap/abapAll Screen Shots

    144/511

    7n the initial screen press save b"tton.

  • 8/16/2019 sap/abapAll Screen Shots

    145/511

    0tep< I ow e1ec"te the pro)ram to tri))er the event and as well check the back)ro"nd (ob.

  • 8/16/2019 sap/abapAll Screen Shots

    146/511

    R"n transaction #;5-

    Check the stat"s o (ob de ined above

  • 8/16/2019 sap/abapAll Screen Shots

    147/511

  • 8/16/2019 sap/abapAll Screen Shots

    148/511

  • 8/16/2019 sap/abapAll Screen Shots

    149/511

    FROM

  • 8/16/2019 sap/abapAll Screen Shots

    150/511

    Enter the transaction code ;;B2. ow click on b"tton CREATE.

    Followin) in ormation messa)e wo"ld appearI

    Click Enter to proceed.

    ow the ;;B2 transaction wo"ld appear.

  • 8/16/2019 sap/abapAll Screen Shots

    151/511

  • 8/16/2019 sap/abapAll Screen Shots

    152/511

    Click on E1it and #ave'.

    Followin) pop"p wo"ld appearI

    Click Enter to proceed. Followin) screen wo"ld appearI

  • 8/16/2019 sap/abapAll Screen Shots

    153/511

    #ave yo"r entries and )o back to the main screen.

    ow enter the transaction variant name and click on Chan)e b"tton as shown belowI

    ow click on 7nsert Row.

    Enter the name o the screen variant created earlier or "se F= help to select the val"eI

  • 8/16/2019 sap/abapAll Screen Shots

    154/511

    ow click on 4oto à Create ariant Transaction

    Enter the val"es as shown above. Click on Enter. The ollowin) #E/5 transaction wo"ld appearI

  • 8/16/2019 sap/abapAll Screen Shots

    155/511

    The name o the Transaction ariant is a"tomatically proposed. #ave yo"r entries.

    ow )o to Transaction Z;;B2 and check yo"r transaction variantI

    &o" can observe that the ield 7nd"stry sector and ;aterial type de a"lt to the val"e we have )iven earlierand are o"tp"t enabled only.

    E,$ailing the bac"ground -obs

    *y /arini

  • 8/16/2019 sap/abapAll Screen Shots

    156/511

    This t"torial deals abo"t the proced"re in a"tomatic e mailin) o the back)ro"nd (obs. The o"tp"t o theback)ro"nd (ob is sent to the recipient as an email.

    Consider the ollowin) simple pro)ramI

    'EP1'T >bac"ground test;

    !'7TEF Ghello SAPTechnical;com teamG;

    e wo"ld sched"le the above pro)ram as a back)ro"nd (ob and send the o"tp"t o the same as anemail.

    4o to Transaction #;5+.

    Enter the (ob name.

    $ress Enter. Followin) pop"p screen appearsI

  • 8/16/2019 sap/abapAll Screen Shots

    157/511

    Enter yo"r pro)ram name as shown above and click on #A E.

    Click on 9ack b"tton to navi)ate to the main screen.

  • 8/16/2019 sap/abapAll Screen Shots

    158/511

    Click on the b"tton #pool list recipient' as shown above.

    Enter the name o the recipient to which the o"tp"t to be sent.

    ow come back to the main screen and click on #tart Condition'.

    #elect 7mmediate and click on save.

  • 8/16/2019 sap/abapAll Screen Shots

    159/511

    #ave yo"r (ob. 8nly a ter yo" save, the (ob wo"ld be set to stat"s Released.

    &o" can )o to transaction #;5- to monitor the back)ro"nd (ob.

    ow )o to #A$ inbo1 @transaction #9 $V#8B2 to check the stat"s o the back)ro"nd (obI

    7n the above screenshot, yo" can observe an email related to the (ob we created earlier. 8pen theattachment to see the o"tp"t o the back)ro"nd (obI

  • 8/16/2019 sap/abapAll Screen Shots

    160/511

    ABAP Programming . /aming Standards

    9y #"priya Xoshi

    Followin) are the per ormance standards need to be ollowin) in writin) A9A$ pro)ramsI

    or all "*"P Pro(rams > ransaction Codes

    "dd the !elow header at the !e(innin( of Every "*"P pro(ram ************************************************************************* OB(E#T ID :* PRO'RAM TITLE :* MOD"LE :* PRO'RAM TYPE :* INP"T :

    * O"TP"T :* #REATED BY :* #REATION DATE :*-----------------------------------------------------------------------------------------------------------* DES#RIPTION :***************************************************************************

  • 8/16/2019 sap/abapAll Screen Shots

    161/511

    * Mo5969 >t9o3 @98tor?:*----------------------------------------------------------------------------------------------------------* DATE "8er ID TS Ver Tr>38port Re ;e8t De8 r9pt9o3*----------------------------------------------------------------------------------------------------------*************************************************************************

    Naming conventions to be followed :

    Other Objects

  • 8/16/2019 sap/abapAll Screen Shots

    162/511

  • 8/16/2019 sap/abapAll Screen Shots

    163/511

    %pplication area corresponds to the application area you are &or ing li e

    ' ( 'asis C ( C) F( F# * ( +M

    S , S- S%M M , MM Supply

    ABAP Performance Standards

    9y Aveek 4hose, 79; 7ndia

    $escription #esult ?@-) or )>"A Comments

    R"n E1tended synta1 checks with character literals checkbo1switched on G Code 7nspector to recti y all relevant errors and

    warnin) @e.). :se the res"lts o the above checks to remove allvariablesVconstants etc that are declared b"t are not "sed

    Transaction #E5B @A9A$ R"ntime Analysis m"st be checked to

  • 8/16/2019 sap/abapAll Screen Shots

    164/511

    meas"reVcompare pro)ram per ormanceVr"ntime i pro)ram hasm"ltiple ine icient databases selects or complicated internal table

    operations:se transaction #TB? @#S* Trace to see what indices yo"r

    database accesses are "sin). Check these indices a)ainst yo"rwhere' cla"se to ass"re they are si)ni icant. Check other indices

    or this table and where yo" have to chan)e yo"r where' cla"se to"se it. Create new indices i necessary, b"t do not or)et to checkthe impact by cons"ltin) onsite coordinator.

    T&$E @data element command is "sed while declarin) the ieldswhenever easible instead o *7 E. Remember not always the data

    element name matches with the table ield name

    7nternal Table is de ined with T&$E #TA DARD TA9*E 8F' Gork Areas is "sed instead o header lines

    4lobal variables are minimi0ed by declarin) local variables or bypassin) variables thro")h parameters G ar)"ments while creatin)

    internal s"bro"tine@s

    7n #E*ECT statement, only the re>"ired ields are selected in the

    same order as they reside on the database tableVstr"ct"reVview

    For selectin) sin)le row rom a database table, #E*ECT :$ to 2Rows' is "sed. #elect #in)le' is "sed only when "ll primary key

    combination is known

    o #E*ECT L is "sed :se #E*ECT 7 T8 TA9*E' rather than #E*ECT 7 T8

    C8RRE#$8 D7 4 F7E*D# 8F TA9*E'

    Always speci y as many primary keys as possible in HEREcla"se to make the #elect e icient

    Always select into an internal table, e1cept when the table will bevery lar)e @i.e., when the internal table will be )reater than ?BB,BBBrecords . :se :p to Rows' when the n"mber o records needed

    is known

    #elect statement within a 4ET event is not "sed ild cards like %AM< is avoided as m"ch as possible

    ested #elect is not "sed instead 7nner Xoin' andVor For allEntries' is "sed. For all Entries' is to be "sed over *oop at 7TA9 V#elect V E D*88$' @F8R A** E TR7E# retrieves a "ni>"e res"lt

    set so ens"re yo" retrieve the "ll key rom the database

    hen creatin) (oins over database tables there sho"ld be an inde1at least on the inner table or the ields in the (oin condition else

    "se F8R A** E TR7E#' select statement

    :sa)e o X87 is limited to a ma1im"m o 3 i.e. not more than 5database tables are (oined at one time

    CHEC that the internal table "sed in F8R A** E TR7E# is 8Tempty as this will retrieve all entries rom the table

    Delete ad(acent d"plicate entries rom internal table be oreselection rom database table "sin) F8R A** E TR7E#'

    statement

    For copyin) internal tables "se %W< operator instead o *oopin) G Appendin)

    #8RT inside a *88$ is not "sed #ort internal table by ields in the correct order, which are "sed in

  • 8/16/2019 sap/abapAll Screen Shots

    165/511

    a READ TA9*E statement "sin) 97 AR& #EARCH. 7 the order osortin) is invalid the 97 AR& #EARCH will never work

    For lar)e internal tables where only some rows are to beprocessed, "se #8RT and then the READ TA9*E command is"sed to set inde1 to irst relevant row be ore loopin) rom that

    inde1. :se CHEC or 7FYEO7TYE D7F as appropriate to e1it

    rom the loop

    #ort ields and #ort 8rder on the #8RT statement sho"ld bementioned e1plicitly @e.). #8RT 7TA9 9& F*D2 F*D3

    A#CE D7 4

    Hashed table is "sed or processin) lar)e amo"nt o data@provided that yo" access sin)le records only, and all with a "lly

    speci ied key

    DE*ETE or #8RT is not "sed on a hashed table since it increasesmemory cons"mption

    #orted table is "sed or ran)e accesses involvin) table key orinde1 accesses

    Fields speci ied in the HERE condition with the critical operators

    8T and U @ne)ative #S* statements cannot be "sed or asearch "sin) database inde1es. henever possible orm"late #S*statements positively

    hen codin) 7F or CA#E, testin) conditions are nested so that themost re>"ently tr"e conditions are processed irst. Also CA#E is

    "sed instead o 7F when testin) m"ltiple ields e>"al to' somethin)

    *88$ AT 7TA9 7 T8 8R AREA HERE W %OOO< sho"ld be"sed instead o *88$ AT 7TA9 7 T8 8R AREA V CHEC

    7TA9 W %OOO

  • 8/16/2019 sap/abapAll Screen Shots

    166/511

    • *ock data to be edited• Read c"rrent data rom the database

    • $rocess data and write it to the database

    • Release the locks set at the be)innin)Try to avoid lo)ical databases. 7 yo"r pro)ram "ses a lo)icaldatabase, b"t does not re>"ire all ields belon)in) to a certain

    4ET event, always "se the F7E*D# addition to red"ce the amo"nto data selected by the lo)ical database

    Avoid the a))re)ate @Co"nt, ;a1, ;in "nctions in the databaseselection

    :se $arallel C"rsor methods or nested loop into the internaltables i second internal table contains considerable n"mber o

    records

    7n #mart ormV #apscript do not make red"ndant data retrievalwhere data is available in inter ace

    0nderstanding S1& Trace

    9y Aveek 4hose, 79; 7ndia

    Performing an S ! "race:

    4; %ccess transaction S/01. From the initial screen clic the chec bo3 for S45 traceunder the trace re uests clic "race on#

    2. 7un the program containing the S45 uery that needs to be analy8ed in the S9" editor.6; Come bac to S"$% screen under /race re uests clic "race off . ?; Click =ist trace to view the trace o the c"rrent statement.

    Screen shot of the initial S"$% screen

  • 8/16/2019 sap/abapAll Screen Shots

    167/511

    After clic&ing list trace

  • 8/16/2019 sap/abapAll Screen Shots

    168/511

    'asic !ist "race

  • 8/16/2019 sap/abapAll Screen Shots

    169/511

    The basic list trace shows the se>"ence o database operations that are takin) place while a >"ery isprocessed, it incl"des prepare, etch, open, reopen, e1ec"te. 7n addition the basic list trace also )ives thed"ration e1ec"tion or each o the operations with color le)end.

    Summari(ing the basic trace list )menu path: *oto + Summar,-

    A basic trace list can be s"mmari0ed to see the s"mmation o e1ec"tion times o similar databaseoperations. :se men" pathI 4oto à #"mmary. The above screen shot depicts the s"mmed "p e1ec"tion

    time. The s"mmary option lists the s"mmed "p e1ec"tion time o all the >"eries that the #S* trace hascapt"red at its r"ntime, b"t the identi ication o a partic"lar >"ery can be done "sin) the P $ B Process $which is displayed as the irst col"mn o the above screen shot. For e1ample, D6 is the process 7D orone o the #S* statements.

    Summar, of a particular trace

  • 8/16/2019 sap/abapAll Screen Shots

    170/511

    To )et the total e1ec"tion time, speci ically or a partic"lar #S* #tatement, select all the P $correspondin) to it and click s"mmari0e in the application toolbar. This leads to a compressed data o#S* trace as above.

    .olor legends indicating the processes in a trace 1

    :se the men" pathI 4oto #how color le)end to know abo"t the color speci ication in the trace.

    Color legends indicating the processes in a trace 2

  • 8/16/2019 sap/abapAll Screen Shots

    171/511

    The above screen shot indicates that the >"ery e1ec"tion time has e1ceeded its threshold with the linkpink color. A chan)e in ob(ect name is indicated with the chan)e in color to yellow. These colors therebyindicate whether the >"ery is well written and also the c"rrent stat"s o the database server.

    Extended list

    @From basic trace listI click e1tended list b"tton in application toolbar to view the e1tended list . Thee1tended list shows the c"rsor id declared or the #S* statement, the connection type also .

    Cursors: A c"rsor is a handle or name or an area in memory in which a parsed statement and otherin ormation or processin) the statement are kept s"ch an area is also called a private #S* area.

    Altho")h most 8racle "sers rely on the a"tomatic c"rsor handlin) o the 8racle "tilities, the pro)rammaticinter aces o er application desi)ners more control over c"rsors. 7n application development, a c"rsor is a

  • 8/16/2019 sap/abapAll Screen Shots

    172/511

    named reso"rce available to a pro)ram and can be "sed speci ically or the parsin) o #S* statementsembedded within the application.

    Identical select statements

    :se the men" pathI 4oto à 7dentical #elects to view a comprehensive list o identical select statementse1ec"ted d"rin) the trace and the n"mber o times they were e1ec"ted. 7dentical select statements are)ro"ped based on the where clause.

    ote that identical select statements have similar execution plan "sed or their processin) therebysavin) time o e1ec"tion and provide increased per ormance, too.

    Identical select statements displayed

  • 8/16/2019 sap/abapAll Screen Shots

    173/511

    The above screen shot shows the list o identical select statements and the n"mber o time they )ote1ec"ted.

    Database Operations Measured by SQL Trace

    The #S* Trace analysis helps in meas"rin) the e1ec"tion time o the ollowin) data base operations that

    are per ormed when e1ec"tin) an #S* statement.

    4A $EC="#E: This operation declares a new c"rsor and assi)ns the #S* statement to that c"rsorcreated.

    5A P#EP"#E: This operation converts the #S* statement into native #S* and rames o"t an e1ec"tionplan or that statement.

    3A 1PE): This operation opens the declared c"rsor and passes the parameters or database access.

  • 8/16/2019 sap/abapAll Screen Shots

    174/511

    7n ;en" bar 4o to #ystem #tat"s

    Do"ble click on the #creen n"mber 2B2

  • 8/16/2019 sap/abapAll Screen Shots

    175/511

    Do"ble click on ;8D:*E C:A!#ETZE

    Do"ble Click on $ERF8R; C:A!#ETZE .

  • 8/16/2019 sap/abapAll Screen Shots

    176/511

  • 8/16/2019 sap/abapAll Screen Shots

    177/511

    #croll down "p to the line 2=3?. Here we need to create an Enhancement.

  • 8/16/2019 sap/abapAll Screen Shots

    178/511

    Ri)ht Click on the pa)e 4o to Enhancement 7mplementation Create

    The below screen will appear ;ark the check bo1

    Click on create enhancement 7mplementation @F

  • 8/16/2019 sap/abapAll Screen Shots

    179/511

    Enter the Enhancement 7mplementation, #hort te1t and Click on Create Composite 7mplementation.

    The 9elow screen will appear

  • 8/16/2019 sap/abapAll Screen Shots

    180/511

    Enter the name or Composite enhancement implementation and #hort Te1t.

    Then Click on Creation o Enhancement @Enter

  • 8/16/2019 sap/abapAll Screen Shots

    181/511

    Click on #ave and Assi)n it in correspondin) $acka)e.

    9y scrollin) down select the already created Enhancement 7mplementation,

    Click on contin"e.

  • 8/16/2019 sap/abapAll Screen Shots

    182/511

    4o to #E B create a new 0pro)ram named 0title.

    Click on &es.

  • 8/16/2019 sap/abapAll Screen Shots

    183/511

    Enter the $ro)ram name and contin"e.

    Enter the Title o the created pro)ram and Assi)n Type as ;od"le $ool.

    Click on #ave.

  • 8/16/2019 sap/abapAll Screen Shots

    184/511

    #ave it in $acka)e.

    Ri)ht Click on 0title Create 4:7 Titles

    Enter the Title Code And Title.

  • 8/16/2019 sap/abapAll Screen Shots

    185/511

    Click on Trans er or @Enter

    Create another Title code.

    Assi)n the Title code and title.

  • 8/16/2019 sap/abapAll Screen Shots

    186/511

    Repeat the above same proced"re.

    Ri)ht Click on Ztitle and Click on Activate.

  • 8/16/2019 sap/abapAll Screen Shots

    187/511

    The created 4:7 title will display "nder 4:7 Title.

  • 8/16/2019 sap/abapAll Screen Shots

    188/511

    Type #A$; =?A in $ro)ram 4o to #"bro"tines.

    #croll down in C:A!#ETZE .

  • 8/16/2019 sap/abapAll Screen Shots

    189/511

    The 9elow screen will display.

    Type the 9elow Code

    IF 8?-t o5e + ,VA/ ,.

  • 8/16/2019 sap/abapAll Screen Shots

    190/511

    SET TITLEBAR ,Z/ , OF PRO'RAM ,ZTITLE, WIT$ )TFS .ELSEIF 8?-t o5e + ,VA/2,. SET TITLEBAR ,Z/2, OF PRO'RAM ,ZTITLE, WIT$ )TFS .ELSEIF 8?-t o5e + ,VA/0,. SET TITLEBAR ,Z/0, OF PRO'RAM ,ZTITLE, WIT$ )TFS .ENDIF.

    Click on save and Click on activate Enhancements @Ctrl6F5

  • 8/16/2019 sap/abapAll Screen Shots

    191/511

    4o to $ro)ram and Click on 4enerate.

  • 8/16/2019 sap/abapAll Screen Shots

    192/511

    ow yo" can )o and view the transaction screen.

    4o to AB2.

    4o to AB3.

    4o to AB5.

  • 8/16/2019 sap/abapAll Screen Shots

    193/511

    Creation of a #eb ser ice in SAP

    9y Ra)hava akada, ;o"ri Tech #ol"tions

    7n this #cenario, 7 wo"ld like to e1plain abo"t creatin) a eb #ervice with a simple scenario.'

    Creatin) a eb #ervice

    7n the "nction library @#E5- , display the "nction mod"le.

    8pen the "nction ;od"le I ME_GET_CURRENT_USER_ID

    Choose Utilities More Utilities Creating a Web Service From Function Module

  • 8/16/2019 sap/abapAll Screen Shots

    194/511

  • 8/16/2019 sap/abapAll Screen Shots

    195/511

    7n the ollowin) screen, enter the re>"ired data and select the checkbo1 Name Ma!!ing . 7 the checkbo1 NameMa!!ing is ticked, the wi0ard accepts the e1istin) names or the end point.

    Choose Continue .

    7n the ollowin) screen, enter the re>"ired data and select the checkbo1 Release Service "or runtime .

  • 8/16/2019 sap/abapAll Screen Shots

    196/511

  • 8/16/2019 sap/abapAll Screen Shots

    197/511

    #ave as local ob(ect.

    Testin) a eb #ervice.

    Prerequisites

    8pen the transaction #AD;7 .

    #elect the eb service de inition yo" have created "nder S#$% $!!lication "or RFC&Com!liant FMs

    #elect and e1pand the Z E9!4ET!C:RRE T!:#ER' and select the eb #ervice as shown inscreen.

  • 8/16/2019 sap/abapAll Screen Shots

    198/511

    &o" have entered the address o the application server on which the X3EE En)ine is r"nnin) intransaction #AD;7 "nder Goto $dministration Settings .

    Check the X3EE #erver and check in yo"r server.

    C'oose Web Service (ome!age )E*ecute +utton ,

  • 8/16/2019 sap/abapAll Screen Shots

    199/511

    #elect the Doc"ment #tyle' "nder #tyle de inition in #D*.

    The !eb service re2uires authentication;

    Enter the "ser and password

  • 8/16/2019 sap/abapAll Screen Shots

    200/511

    Click on the Test'.

    #elect the 8perations'.

  • 8/16/2019 sap/abapAll Screen Shots

    201/511

    Fill in val"es or the method parameters "nderneath the headin) Re-uest i" re-uired . Choose Send

    The re>"ired val"es are displayed "nder the Res!onse headin). The eb service has not been testeds"ccess "lly.

  • 8/16/2019 sap/abapAll Screen Shots

    202/511

  • 8/16/2019 sap/abapAll Screen Shots

    203/511

    E #EPTIONS >r ; e3t_3ot_6o;35 + p t94e + 2 93ter3>9te + 2. #ALL MET$OD @ttp_ t9o3_6>9te + 2 @ttp_pro e8893 _6>99< >55re88,. ENDIF.

    8"tp"tI

    Handling fa orites in ABAP !or"bench

    *y 0unitha

  • 8/16/2019 sap/abapAll Screen Shots

    204/511

    This doc"ment details the proced"re in handlin) the avorites in the A9A$ orkbench. 7 wo"ld alwayswant to add my re>"ently "sed ob(ects in the avorites. For o"r learnin) p"rpose, let "s add the packa)e# D$!DE;8!T:T8R7A*# @Demo t"torials or eb Dynpro A9A$ to the avorite list.

    4o to Transaction #E B and select $acka)e' rom the list bo1. Enter the packa)e name# D$!DE;8!T:T8R7A*# as shown belowI

    ow open the list bo1 Favorites' and click on AddI

    The ollowin) messa)e appearsI

    ow veri y the same by openin) the avoritesI

  • 8/16/2019 sap/abapAll Screen Shots

    205/511

  • 8/16/2019 sap/abapAll Screen Shots

    206/511

  • 8/16/2019 sap/abapAll Screen Shots

    207/511

  • 8/16/2019 sap/abapAll Screen Shots

    208/511

    ow click on Environment ;odi ication Events

    Followin) screen is displayed.

  • 8/16/2019 sap/abapAll Screen Shots

    209/511

  • 8/16/2019 sap/abapAll Screen Shots

    210/511

    Click on the b"tton in the Editor col"mn and enter the ollowin) codeI @$lease note that yo" sho"ld also

    code F8R; and E DF8R; as well .

    #ave and activate the table.

    estin( the scenario I

    4o to #;5B and try creatin) new entries. Do not enter the val"es or Created on' and Created by'.

  • 8/16/2019 sap/abapAll Screen Shots

    211/511

    Check yo"r entries in the database table. &o" can observe that the date and "ser name are a"tomaticallyilled in. #ee the screenshot belowI

    0sing Sorted table and 9nde #hile processing 9nternal tables

    *y 0uresh Fumar Parvathaneni

    There wo"ld have been many instances where we wo"ld have to process lar)e entries in an internal tablewith a HERE condition. This article is intended to demonstrate the comparison between three di erentmethods in handlin) this sit"ation.

    irst Method I The normal method "sed by most o "s. #tandard internal table processin) "sin) HEREcondition

    0econd Method I #ame as above, b"t here we wo"ld be "sin) the #orted table

    hird Method I #orted table and "sin) the 7nde1

    Followin) is the demo pro)ram ill"stratin) the above three methodsI

    REPORT ZINTERNAL_TABLE_OPERATIONS.* Pro r> to 6935 t@e =e8t et@o5 93 re>593 t@e 93ter3>< t>=r P>r4>t@>3e39* T?pe 5e r>t9o3TYPES: BE'IN OF TY_MARA MATNR LI!E MARA-MATNR MTART LI!E MARA-MTART END OF TY_MARA.* I3ter3>< t>=t9o3DATA: T_MARA TYPE STANDARD TABLE OF TY_MARA T_MARA TYPE SORTED TABLE OF TY_MARA WIT$ NON-"NI "E !EY MTART.* V>r9>=t9o3DATA: W_#O"NTER TYPE I W_R"NTIME TYPE I W_R"NTIME2 TYPE I W_TABI LI!E SY-TABI .

    * T>=re> 5e6939t9o3DATA: WA_MARA TYPE TY_MARA.SELE#T MATNR M>ter9>< N; =er MTART M>ter9>< T?pe FROM MARA INTO TABLE T_MARA.T_MARA G + T_MARA G.* #ASE : Pro e8893 93ter3>< t>=

  • 8/16/2019 sap/abapAll Screen Shots

    212/511

    LOOP AT T_MARA INTO WA_MARA W$ERE MTART E ,F$MI,. ADD TO W_#O"NTER.ENDLOOP.'ET R"N TIME FIELD W_R"NTIME2.* #>< ;te R;3t9 eW_R"NTIME2 + W_R"NTIME2 - W_R"NTIME .WRITE W_R"NTIME2.#LEAR W_#O"NTER.* #ASE 2: "893 > Sorte5 t>=< ;te R;3t9 eW_R"NTIME2 + W_R"NTIME2 - W_R"NTIME .WRITE W_R"NTIME2.#LEAR W_#O"NTER.* #ASE 0: "893 INDE o3 > 8orte5 t>=< ;te R;3t9 eW_R"NTIME2 + W_R"NTIME2 - W_R"NTIME .WRITE W_R"NTIME2.

    Followin) is the analysis report in microseconds, as per the data vol"meI

    #ecords I 32,5/B

    teration)o

    2sin( )ormal =11P 9G/E#E

    2sin( 0orted ta!le =11P9 G/E#E

    2sin( )$E on 0ortedta!le

    2 /- - 223 5/ -/ 2B5 5/ -- 2B= 5= B /? =3 5- 2B

    #ecords I 253,+/5

    teration)o

    2sin( )ormal =11P 9G/E#E

    2sin( 0orted ta!le =11P9 G/E#E

    2sin( )$E on 0ortedta!le

    2 5=35/ 5?--= 5?+-3 5=3-2 5 3?B 5?/3

  • 8/16/2019 sap/abapAll Screen Shots

    213/511

    5 5==/3 5+?5= 5??== 5=2/ 5?+/? 5? =

    #orted table mi)ht have )iven a better per ormance here i the ield in the HERE condition is the irstield in the internal table. However, rom the above statistics, we can say that method 5 is better than theother 3 methods. 7n prod"ction environment, the data wo"ld be h")e and the per ormance co"ld be m"ch

    improved with this simple techni>"e.

    Displaying %raphics using an ABAP Program

    9y Ra)hava akada, ;o"ri Tech #ol"tions

    7 wo"ld like to e1plain abo"t a simple report pro)ram to display )raphics. The #A$ 4raphics can be "sedor vario"s b"siness p"rposes'.

    7n this article 7 am e1plainin) abo"t a simple #ales analysis on a yearly basis.

    *&---------------------------------------------------------------------**& Report Z'RAP$_TEST*&*&---------------------------------------------------------------------*REPORT Z'RAP$_TEST.DATA: BE'IN OF TAB O##"RS % #LASS %C TYPE # VAL 2C TYPE I VAL2 2C TYPE I VAL0 2C TYPE I END OF TAB.DATA: BE'IN OF OPTTAB O##"RS # 2/C END OF OPTTAB.

    MOVE: ,6>3, TO TAB-#LASS 2 TO TAB-VAL TO TAB-VAL2 % TO TAB-VAL0.APPEND TAB.#LEAR TAB.MOVE: , oo

  • 8/16/2019 sap/abapAll Screen Shots

    214/511

    DIM + ,Ye>r8, TITL + ,S>

  • 8/16/2019 sap/abapAll Screen Shots

    215/511

  • 8/16/2019 sap/abapAll Screen Shots

    216/511

    • Click or chan)es to e ect.

    eatures in "*"P M )ew Editor

    irst =ooJ:

    iew o the new A9A$ T; Editor @ rom #E5 I

    $isplay eatures

    Followin) are some o the eat"res that co"ld be observed while writin) the codeI

  • 8/16/2019 sap/abapAll Screen Shots

    217/511

    =ine )um!ers

    As observed in the above screenshot, the new A9A$ T; editor displays the line n"mbers or easy navi)ationthro")h the code.

    Chan(ed line indicators

    The chan)ed lines in the c"rrent session are marked with .

    These indicators wo"ld vanish once yo" come o"t o the pro)ram.

    *ooJmarJs

    9ookmarks allow in navi)atin) and code editin). There are / n"mbered bookmarks provided by #A$ and"nlimited "nn"mbered bookmarks. 9ookmarks co"ld be accessed by the ri)ht click o the mo"se in the7ndicator ;ar)in @The complete le t portion o the A9A$ T; editor .

    To set a bookmark, ri)ht click on the 7ndicative ;ar)in, click on 9ookmarks 9ookmark B @9ookmarks aren"mbered B to / . A 9l"e la) with the bookmark n"mber wo"ld appear on the 7ndicative ;ar)in.

    To navi)ate to any bookmark marked earlier, ri)ht click on the 7ndicative ;ar)in, 4o to 9ookmark 9ookmark B.

    Code /ints

    Code hints appear as yo" type in A9A$ T; editor. For e1ample, i yo" start typin) or $arameters, ollowin)occ"rsI

    • hen typed $, nothin) appears.• hen typed $A, code hint $AC appears.

  • 8/16/2019 sap/abapAll Screen Shots

    218/511

    • hen typed $AR, code hint $ARA;ETER# appears.

    $ress TA9 to choose the )iven code hint.

    Chan(in( the ont and Colors of codin( environment

    Click on , available at the ri)ht side bottom o the editor. Click on Fonts and Colors' on the le t side o thewindow that is appeared a ter clickin). From here, we can set di erent colors and onts or di erent elementson the editor.

    Gindow 0plitter

    The window splitter allows yo" to work on di erent parts o the code sim"ltaneo"sly.

    The window co"ld be set to splitter mode by do"ble clickin) the splitter line above thevertical scrollbar @shown below .

    The split screen is seen as belowI

  • 8/16/2019 sap/abapAll Screen Shots

    219/511

    Also visit Feat"res o A9A$ ew Editor $art 3

    The *eatures of ABAP /e# Editor Part 7

    9y #"resh "mar $arvathaneni

    GorJin( with Colors and onts I

    #witch to the new editor @i the de a"lt editor shown is the old editor .

    7n the ew A9A$ editor, click on the b"tton options' available at the bottom o the ri)ht hand side, asshown in the below screen shotI

  • 8/16/2019 sap/abapAll Screen Shots

    220/511

    Followin) pop "p appearsI

    ow select Fonts and Colors' available on the le t side.

  • 8/16/2019 sap/abapAll Screen Shots

    221/511

    :sin) this, yo" can desi)n how the screen sho"ld look like, For e1ample, yo" can dictate how thecomments sho"ld appear @like Font, si0e, ore)ro"nd color and back)ro"nd color . *et "s take the samecomments' section or o"r scenario here.

    Comments are c"rrently displayed as shown belowI

    ow click on the options b"tton and select Fonts and Colors'. #elect Comments' rom the list bo1I

  • 8/16/2019 sap/abapAll Screen Shots

    222/511

    ow chan)e the way yo" wo"ld like the options to appear in this sectionI

    #ave and check how the way comments appear now.

  • 8/16/2019 sap/abapAll Screen Shots

    223/511

  • 8/16/2019 sap/abapAll Screen Shots

    224/511

    Above screenshot is or D8'. e wo"ld "se this or o"r demo p"rpose to better "nderstand the codetemplate.

    rite some sample code in yo"r editor.

    ow select yo"r pro)ram code and click the ri)ht b"tton o the mo"se. #elect Format #"rro"nd bytemplate Do @ @as shown in the ollowin) screenshot

  • 8/16/2019 sap/abapAll Screen Shots

    225/511

    ow observe yo"r codeI

    &o"r code is now s"rro"nded by the code template D8'.

    Creatin( custom code template I

    ow we wo"ld work on creatin) o"r own code template or o"r "t"re "se.

    As observed in the earlier screenshots, there is no code template available or s"bro"tine. *et "s create acode template or the same.

  • 8/16/2019 sap/abapAll Screen Shots

    226/511

    #elect yo"r code and click on ri)ht b"tton. #elect Format E1tract template

    Enter the name or yo"r code template.

    Click on 8 .

  • 8/16/2019 sap/abapAll Screen Shots

    227/511

    ow we need to de ine the position where the selected te1t @s"rro"nded te1t to appear.

    Click on the empty line between orm' and end orm' and click on 7nsert ta)'

    #elect #"rro"nded Te1t rom the )iven options.

  • 8/16/2019 sap/abapAll Screen Shots

    228/511

    #ave and e1it.

    To test o"r code template, write a sample code in o"r pro)ram.

    Ri)ht click and select o"r code template.

  • 8/16/2019 sap/abapAll Screen Shots

    229/511

    8"r code template is displayed as belowI

    ow ("st enter the orm name to complete yo"r s"bro"tine de inition.

    0ettin( *reaJHpoints I

    8pen the new A9A$ editor and write some sample code in it.

  • 8/16/2019 sap/abapAll Screen Shots

    230/511

    Activate yo"r pro)ram.

    To set the break point, click on indicator mar)in, available on the le t side o the line n"mbers. @#ee thescreenshot below I

    9reak point in set now.

    !or"ing #ith $enu Painter

    9y Ra)hava akada, ;o"ri Tech #ol"tions

    For theoretical concepts on ;en" $ainter, please visit 0"P.help.com

    Create a program in S9" /( Code.

    http://help.sap.com/saphelp_erp2004/helpdata/en/d1/801d0f454211d189710000e8322d00/frameset.htmhttp://help.sap.com/saphelp_erp2004/helpdata/en/d1/801d0f454211d189710000e8322d00/frameset.htm

  • 8/16/2019 sap/abapAll Screen Shots

    231/511

    9nter the /itle of the +rogram %nd Select the /ype as 93ecutable +rogram.

    %nd clic on save. Save it in a 7elevant +ac age.

    Go to /(code S9;<

    9nter the +rogram name and Status name.

  • 8/16/2019 sap/abapAll Screen Shots

    232/511

    Clic on create

    9nter the Short te3t for Status.

  • 8/16/2019 sap/abapAll Screen Shots

    233/511

    Clic on Menu 'ar.

    Specify a Menu =ame file

    -ouble clic on File.

  • 8/16/2019 sap/abapAll Screen Shots

    234/511

    9nter the Code and te3t >alues.

    Clic on save chec and %ctivate.

    +ress 93ecute or F .

  • 8/16/2019 sap/abapAll Screen Shots

    235/511

    Clic on Continue and 9nter.

    Created Menu is displayed here.

  • 8/16/2019 sap/abapAll Screen Shots

    236/511

    "o create a "itle/ .lic& on "itle !ist#

    Clic on create.

    9nter the /itle Code and /itle. Clic on continue.

  • 8/16/2019 sap/abapAll Screen Shots

    237/511

  • 8/16/2019 sap/abapAll Screen Shots

    238/511

    Created /itle -isplayed.

    Clic on Save.

    *&---------------------------------------------------------------------**& Report ZMEN"_PAINTER*&*&---------------------------------------------------------------------**&*&*&---------------------------------------------------------------------*REPORT ZMEN"_PAINTER.TABLES: MARA.DATA: MATNR TYPE MARA-MATNR ERSDA TYPE MARA-ERSDA ERNAM TYPE MARA-ERNAM DISPLAY TYPE # SAVE TYPE # DELETE TYPE # #LEAR TYPE # E IT TYPE # O!_#ODE LI!E SY-"#OMM.#ALL S#REEN / .*&---------------------------------------------------------------------*

  • 8/16/2019 sap/abapAll Screen Shots

    239/511

    *& Mo5;

  • 8/16/2019 sap/abapAll Screen Shots

    240/511

    9nter M%7% in the /able Fieldname /e3t 'o3 /hen clic on Get From -ictionary.

  • 8/16/2019 sap/abapAll Screen Shots

    241/511

    Select the re uire fields and clic on continue.

    #nsert these bo3es on the screen.

  • 8/16/2019 sap/abapAll Screen Shots

    242/511

  • 8/16/2019 sap/abapAll Screen Shots

    243/511

  • 8/16/2019 sap/abapAll Screen Shots

    244/511

    Create re uire chec bo3 from toolbo3.

    Give the re uired =ame /e3t and Function Code =ame .

    Clic on Save Chec and %ctivate.

  • 8/16/2019 sap/abapAll Screen Shots

    245/511

    Output:

    9nter the Material number and +ress -isplay.

    Clic on -isplay.

  • 8/16/2019 sap/abapAll Screen Shots

    246/511

    >alues are displayed as sho&n belo&.

    Similarly ?ou Can >ie& Clear %nd 93it.

    Clear , #t &ill clear all the displayed contents.

  • 8/16/2019 sap/abapAll Screen Shots

    247/511

    93it ( #t &ill return to code..

    *e can @se the same operation in Function Aeys.

    F? ClearF+ DisplayF- E1it.

  • 8/16/2019 sap/abapAll Screen Shots

    248/511

  • 8/16/2019 sap/abapAll Screen Shots

    249/511

    #tep 2I 4o to transaction #E5 to speci y the $ro)ram name and select % ariant< radio b"tton and%Display

  • 8/16/2019 sap/abapAll Screen Shots

    250/511

    #tep 5I 7n this step, provide s"itable meanin) or the variant. As we need to de ine selection variable or%Date created< item on selection screen, check the bo1 "nder * as shown in the selection screen belowI

  • 8/16/2019 sap/abapAll Screen Shots

    251/511

    #tep =I 7n the previo"s step, select %#election ariables< on the men". 7t leads to the ne1t screen as

    shown below. As we have decided to create selection variable or %Date created< item only, in this screenyo" )et to see the variable as %Date created

  • 8/16/2019 sap/abapAll Screen Shots

    252/511

  • 8/16/2019 sap/abapAll Screen Shots

    253/511

    Creating *6 helps in ease

    9y 4a"rab 9aner(i

    4o to #E+2 and create a )eneral te1t TO like the one shown below.

    • #elect 4eneral Te1t rom Doc"ment Class• #elect *an)"a)e• Type ame and press create

    Type in what yo" want to see in o"tp"t

    :2 is or the *old ext yo" see in the headin) o the F2 Help. 7 yo" don

  • 8/16/2019 sap/abapAll Screen Shots

    254/511

    D(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((D D D(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((

    REPORT Z'B_TEST_SEAR#$_$ELP .

    * INTERNAL TABLE FOR STORIN' NAMES IN SELE#TION LIST5>t>: =e 93 o6 t_9t>= o ;r8 / 3> e /C t?pe e35 o6 t_9t>=.*FIELDNAME AND TAB NAME FOR T$E SELE#TIONDATA :69e= LI!E 569e8 O##"RS / WIT$ $EADER LINE.*T$E TABLE FOR RET"RNIN' T$E NAME OF T$E SELE#TED ITEMDATA : ret;r3_t>= LI!E 558@ret4>< O##"RS / WIT$ $EADER LINE.*START T$E SELE#TION S#REEN BLO#!8er> eter8: p_3> e /C t?pe .8e== + t_9t>= FIELD_TAB + 69e=

  • 8/16/2019 sap/abapAll Screen Shots

    255/511

  • 8/16/2019 sap/abapAll Screen Shots

    256/511

    3b-ect oriented programming (33P) e plained #ith an e ample

    9y 4a"rab 9aner(i

    Create a class that keeps track o a bank acco"nt balance. Then write a pro)ram to "se this class.

    Steps in'ol'ed I

    • R"n the class b"ilder "tility @ 0E5< . • Create a class called ZACC8: T11, where 11 is the last two di)its o yo"r lo)on7D. • Declare a $R7 ATE attrib"te 9A*A CE o type D;9TR to store the acco"ntbalance. • Create the ollowin) $:9*7C methodsI

    o #ET!9A*A CE @#ets the balance to a new val"e 7;$8RT7 4 E !9A*A CE T&$E D;9TR

    o DE$8#7T @Adds a deposit amo"nt to the balance and ret"rns the newbalance

    7;$8RT7 4 A;8: T T&$E D;9TR RET:R 7 4 E !9A*A CE T&$E D;9TR

    o 7THDRA @#"btracts a deposit amo"nt rom the balance and ret"rnsthe new balance.

    7;$8RT7 4 A;8: T T&$E D;9TR RET:R 7 4 E !9A*A CE T&$E D;9TR EOCE$T78 # 7 #:FF7C7E T!F: D#

    • Activate all elements o yo"r class. • rite a pro)ram called Z!:#E!ACC8: T!11, where 11 is the last two di)its oyo"r lo)on 7D. This pro)ram sho"ld do the ollowin)I

    o 7nstantiate an instance o the Acco"nt class. o #et the acco"nt balance to some initial val"e. o *a"e several deposits and #ithdra#als+ printing the ne#balance each time; Do not allo# the balance to become lessthan >ero; (.se the exception to detect this;

  • 8/16/2019 sap/abapAll Screen Shots

    257/511

    • Test and deb") yo"r pro)ram.

    KExtra CreditK: 7 yo" have e1tra time, try any o the ollowin)I

    • Replace the #ET!9A*A CE method with a constr"ctor. $ass the openin) balance whenyo" instantiate the acco"nt ob(ect. • Create a static attrib"te and methods to set and )et the name o the bank that holds theacco"nts.

    0tepH!yHstep approach with screenHshots

    4o to #E3= @Class b"ilder

    Type in ZACC8: TAA as the name o the class and press Create.

    De ine 5 methods DE$8#7T, #ET!9A*A CE and 7THDRA .

    $lace the mo"se c"rsor in DE$8#7T and hit the $arameters b"tton.

  • 8/16/2019 sap/abapAll Screen Shots

    258/511

    rite the parameters imported V e1ported or DE$8#7T method.

    #imilarly or #ET!9A*A CE

    And 7THDRA

    For withdraw we de ine an e1ception.

    e can see the attrib"tes and methods by pressin) Display ob(ect list' b"tton on top.

    ow we 7;$*E;E T the 5 methods. Do"ble click the method DE$8#7T.

  • 8/16/2019 sap/abapAll Screen Shots

    259/511

  • 8/16/2019 sap/abapAll Screen Shots

    260/511

    ow we are almost done creatin) the ob(ect. $ress CTR* 6 F5 to activate or hit the ;atchstick.

    e will see this in the stat"s

    ow we are done b"ildin) the )lobal class we can test it. $ress F .

    Click #ET!9A*A CE. rite the E !9A*A CE and press E TER.

    e come back to 7nitial #creen. ow click DE$8#7T.

    e see the ret"rn al"es now.

  • 8/16/2019 sap/abapAll Screen Shots

    261/511

    ow let

  • 8/16/2019 sap/abapAll Screen Shots

    262/511

    4iven below is an e1ample code or "sin) the )lobal class we de ined.

    RE$8RT Z49!88$#!9A .

    DATAI acct2 type re to 0acco"ntaa.

    DATAI bal type i.

    create ob(ectI acct2.

    selection screen be)in o block a.parametersI p!amnt type dmbtr, p!dpst type dmbtr, p!wdrw type dmbtr.selection screen end o block a.

    start o selection.

    call method acct2 set!balance@ p!amnt .writeIV N#et balance to N, p!amnt.

    bal W acct2 deposit@ p!dpst .writeIV NDeposited N, p!dpst ,N b"cks makin) balance to N, bal.

    bal W acct2 withdraw@ p!wdrw .writeIV N ithdrew N, p!wdrw ,N b"cks makin) balance to N, bal.

    This is the o"tp"t.

    Calling an *C function module from one system to another

    9y 4a"rab 9aner(i

    0ollo ing are the participant s,stem for our demo purpose :

    -01 , System &here 7FC function module e3ists

    -S" , Calling system Ian 7FC call is made from this system to -01J

    Scenario :

  • 8/16/2019 sap/abapAll Screen Shots

    263/511

    *e &ould develop a small 7FC function module in -01 system &hich &ould add t&o variables.*e &ould pass t&o variables from -S" to -01 and get bac the sum of those t&o variables bacto -S".

    Activities to be performed in the s,stem $%

    Go to S9"B.

    @nder @tilities K Create Function Group Isay EG' F@=CJ if doesnHt e3ists.

    =o& create a =e& Function Module EG' F@=C0<

    @nder #M+)7/ /ab define the follo&ing variables

    @nder 9L+)7/ /ab

  • 8/16/2019 sap/abapAll Screen Shots

    264/511

    #n the Source Code

    =o& set the function module as $7emote(enabled module in the attributes tab.

  • 8/16/2019 sap/abapAll Screen Shots

    265/511

    Activities to be performed in the S,stem S3

    Create an 7FC destination from -S" to -01.

    Go to SM1N +ress Create.

    9nter the 7FC -estination name: -01(201(/9S/

    Connection /ype: "

    #n -escription: /est Connection to -01

    #n /he /echnical Settings /ab enter the system details

    #n /he 5ogon Security /ab enter the logon details.

    Clic on Save. % +opup &ill imply that connection has been created

    =o& +ress the /9S/ C)==9C/#)= to chec the connection.

  • 8/16/2019 sap/abapAll Screen Shots

    266/511

    /his means the connection to the remote system &as successful.

    #f the connection fails &e get an error li e this

    However establishin) a connection will not ens"re lo))in) on to the tar)et system. For that we have totest RE;8TE *848 .

    $ress the RE;8TE *848 b"tton

    7 we can see this

    And this

    Then o"r connection was s"ccess "l.

    However i we see the screen as shown below then there is a