SA P ABAP FAQ

download SA P ABAP FAQ

of 100

Transcript of SA P ABAP FAQ

  • 8/12/2019 SA P ABAP FAQ

    1/100

    ABAP FAQs on Reports / Scripts / BDC / Dialogs

    ABAP Reporting

    SAP TERMINOLOGY

    Master datais a collection of information about a person or an object, e.g. a cost object,vendor, or G/L account. For example, a vendor master record contains not only generalinformation such as the vendors name and address, but also specific information, suchas payment terms and delivery instructions. Generally for end users, master data isreference data that you will loo up and use, but not create or change.

    Transactional data is data related to a single business event such as a purchasere!uisition or a re!uest for payment. "hen you create a re!uisition, for example, #$%creates an electronic document for that particular transaction. #$% gives the transaction

    a document number and adds the document to the transaction data that is already in thesystem. "henever you complete a transaction in #$%, that is, when you create, change,or print a document in #$%, this document number appears at the bottom of the screen.

    Workflo$ routing tool in #$% that forwards documents for review or approval. For example, are!uisition that needs to be approved is sent to the appropriate approver&s inbox."orflow is also used to route journal vouchers, credit card charges, and otherdocuments in #$%.

    !ost O"#ect$$ 'ost (bject collects expenses and revenues for a particular purpose, such as a

    research project. )n #$% there are three types of cost objects* 'ost 'enter, )nternal(rder, and "+# "or +readown #tructure- lement see below for definition-.

    !ost !enter$General or operating Cost Objectsare nown in #$% as 'ost 'enters. 'ost 'enters arebudgeted on the fiscal year%

    Internal Order$$ nonsponsored 'ost (bject for example, funding from the 0)1 %rovost- used to trackcosts over periods other than fiscal years.)nternal (rders are often created to trac giftsor endowments at 0)1.

    WBS Ele&ent$ "+# lements are funded by outside sponsors and are used to traccosts of a particular research project over the entire span of its activity. 1hey may alsobe created to trac other sponsored activities, such as gifts.

    G'L Acco(nt$G/L accounts are also called 'ost lements in #$%. 1hey are a classification by expenseor revenue type. )n the '( 'ontrolling- module of #$%, the term 'ost lement is used.)n the F)

  • 8/12/2019 SA P ABAP FAQ

    2/100

    Financial- module, the term G/L $ccount is used. 1hese terms are used interchangeablyfor reporting, re!uisitions, and journal vouchers.

    )ata"ase ta"les and open S*L

    Add a single record to a database table

    insert into 2database table3 values 2wor area3

    Inserting all lines from an internal table into a database table

    insert 2database table3 from table 2internal table3

    !elete all records

    #elect 4 from 5mellemtab.delete 5mellemtab.

    endselect.

    !eleting records using records from an internal table

    delete employees from table itab.

    * + A

    BASIS LAYER

    W,at are t,e central interfaces of t,e R'- s.ste& /

    %resentation interface 6atabase interface

    (perating system interface

    W,ic, interface controls ,at is s,on on t,e p%c% /- %resentation interface

    W,ic, interface con0erts S*L re1(ire&ents in t,e SAP de0elop&ent s.ste&to t,ose of t,e data"ase /

    - 6atabase interface

    W,at is SAP dispatc,er /

    #$% dispatcher is the control agent which manages theresources for the 7/8 applications.

    W,at are t,e f(nctions of dispatc,er / "#ual distribution of transaction load to the work processes $anagement of buffer areas in main memory )ntegration of the presentation levels

    (rgani5ation of communication activies

  • 8/12/2019 SA P ABAP FAQ

    3/100

    W,at is a ork process / $ wor process is where individual dialog steps are actually processed

    and the wor is done. ach wor process handles one type of re!uest.

    Na&e 0ario(s ork processes of R'- s.ste& /9- 6ialog or (nline processes only one re!uest at a time -

    :- +acground started at a specified time - 8- ;pdate primary or secondary -

  • 8/12/2019 SA P ABAP FAQ

    4/100

    For internal purposes, such as storing control data or update texts,there are in addition the following table types*o pooled tableo cluster tableo generated view structure

    Transparent ta"le

    1here is a physical table on the database for each transparent table. 1henames of the physical tables and the logical table definition in the

    $+$%/< 6ictionary correspond.

    $ll business data and application data are stored in transparent tables.

    Str(ct(re

    ?o data records exist in the database for a structure. #tructures are

    used for the interface definition between programs or between screens andprograms.

    Append str(ct(re

    $n append structure defines a set of fields which belong to another tableor structure but which are treated in the correction administration asits own object.

    $ppend structures are used to support modifications.

    Pooled ta"le

    %ooled tables can be used to store control data e.g. screen se!uences,program parameters or temporary data-. #everal pooled tables can becombined to form a table pool. 1he table pool corresponds to a physicaltable on the database in which all the records of the allocated pooledtables are stored.

    !l(ster ta"le

    'luster tables contain continuous text, for example, documentation.#everal cluster tables can be combined to form a table cluster. #everallogical lines of different tables are combined to form a physical recordin this table type. 1his permits objectbyobject storage or

    objectbyobject access. )n order to combine tables in clusters, at leastparts of the eys must agree. #everal cluster tables are stored in onecorresponding table on the database.

    Generated 0ie str(ct(re

    )n activation a structure is generated for a view. 1his structure servesas interface for the runtime environment. )t does not generally appear inthe $+$%/< 6ictionary.

  • 8/12/2019 SA P ABAP FAQ

    5/100

    W,at is a )ata !lass/ 1he 6ata class determines in which tablespace the table is stored when it is created in the database.

    W,at is a Si4e !ategor./

    1he #i5e category describes the probable space re!uirement of the tablein the database.

    5o Man. t.pes of si4e categories and data classes are t,ere/ 1here are five si5e categories @

  • 8/12/2019 SA P ABAP FAQ

    6/100

    W,at are t,e )ata t.pes of t,e e6ternal la.er/$''%, 'A$7, 'L?1, ';BC,';77, 6$1#, 6', FL1%, )?19,)?1:, )?1* 'haracter string of variable length, length is given in the first two bytes.

    * Aexadecimal binary- storage.

    5o can e set t,e ta"lespaces and e6tent si4es /Cou can specify the extent si5es and the tablespace physical storage

    area in the database- in which a transparent table is to be stored by setting the si5e category and data class.

    W,at is a data dictionar. /6ata dictionary is a central source of data in a data management system. )ts mainfunction is to support the .)t has details about

    "hat data is contained H

    "hat are the attributes of the data H "hat is the relationship existing between the various data elements H

    W,at f(nctions does a data dictionar. perfor& /)n a data management system, the principal functions performed by the datadictionary are 0anagement of data definitions %rovision of information for evaluation #upport for software development #upport form documentation nsuring that the data definitions are flexible and uptodate.

    A field containing c(rrenc. a&o(nts 8data t.pe !2RR9 &(st "e assigned to areference ta"le and a reference field% E6plain%

    $s a reference table, a system table containing all the valid currencies is assigned orany other table which contains a field with the currency ey format. 1his field is called asreference field.1he assignment of the field containing currency amounts to the reference field is madeat runtime. 1he value in the reference field determines the currency of the amount.

  • 8/12/2019 SA P ABAP FAQ

    7/100

    W,at is t,e significance of Tec,nical settings 8specified ,ile creating a ta"le int,e data dictionar.9 /+y specifying technical settings we can control how database tables are created in thedatabase.1he technical settings allows us to

    optimi5e storage space re!uiremnets table access behaviour buffering re!uired changes to entries logged

    W,at is t,e significance of )eli0er. !lass / 1he delivery class controls the degree to which the #$% or the customer isresponsible for table maintenance whether #$% provides the table with or without contents. determines the table type. determines how the table behaves when it is first installed, at upgrade, when itis transported, and when a client copy is performed.

    W,at is t,e &a6i&(& n(&"er of str(ct(res t,at can "e incl(ded in a ta"le orstr(ct(re

    ?ine.

    W,at are t,e to &et,ods of &odif.ing Sap standard ta"les / $ppend #tructures and 'ustomi5ing )ncludes.

    W,at is t,e difference "eteen a S("str(ct(re and an Append Str(ct(re / )n case of a substructure, the reference originates in the table itself, in the formaof a statement .include... .- )n case of an append structure, the table itself remains unchanged and the

    refrence originates in the append structure.

    W,at are t,e to a.s for restricting t,e 0al(e range for a do&ain / +y specifying fixed values. +y stipulating a value table.

    W,at is a Matc, !ode /

    0atch 'ode is a tool to help us to search for data records in the system. 0atch codesare an efficient and userfriendly search aid where ey of a record is unnown.

    W,at are t,e to le0els in defining a Matc, !ode / 0atch 'ode object 0atch 'ode )d.

    W,at is t,e &a6i&(& n(&"er of &atc, code Id:s t,at can "e defined for oneMatc, code o"#ect /

  • 8/12/2019 SA P ABAP FAQ

    8/100

    8I. $ match code )d is a one character )6 which can be a letter or a number.

    !an e define o(r on Matc, !ode I):s for SAP Matc,codes /Ces, the numbers @ to J are reserved for us to create our own 0atch 'ode )6s for a #$%defined 0atchcode object.

    W,at is an 2pdate t.pe it, reference to a Matc, code I)/)f the data in one of the base tables of a matchcode )6 changes, the matchcode datahas to be updated. 1he update type stipulates when the matchcode is to be updated andhow it is to be done. 1he update type also specifies which method is to be used for+uilding matchcodes . Cou must specify the update type when you define a matchcode)6.

    W,at are con0ersion ro(tines /- ?on standard conversions from display format to sap internal format and vice

    versa are implemented with so called conversion routines.

    Aggregated O"#ects>iews, matchcodes, and loc objects are also called aggregate objects because they areformed from several related tables.

    W,at is a ;ie / $ view is a logical view on one or more tables. $ view on one or more tables i.e, thedata from a view is not actually physically stored instead being derived from one ormore tables. $ view can be used to summari5e data which is distributed amongseveral tables

    5o &an. t.pes of ;ies are t,ere /

    - )ata"ase ;ie 8SE

  • 8/12/2019 SA P ABAP FAQ

    9/100

    "hen the F< button is pressed for a screen field, a chec is first made on whether amatchcode is defined for this field. )f this is not the case, the help view is displayed inwhich the chec table of the field is the primary table. 1hus, for each table no morethan one help view can be created, that is, a table can only be primary table in atmost one help view.

    - Pro#ection ;ie

    %rojection views are used to suppress or mas certain fields in a table projection-,thus minimi5ing the number of interfaces. 1his means that only the data that isactually re!uired is exchanged when the database is accessed.

    $ projection view can draw upon only one table. #election conditions cannot bespecified for projection views.

    - Maintenance ;ie SE=7 9

    0aintenance views enable a businessoriented approach to looing at data, while at

    the same time, maing it possible to maintain the data involved. 6ata from severaltables can be summari5ed in a maintenance view and maintained collectively via this

    view. 1hat is, the data is entered via the view and then distributed to the underlyingtables by the system.

    W,at is Locking /- "hen two users simultaneously attempt to access the same data record, this is

    synchronised by a loc mechanism.

    "hen dialog transactions are programmed, locs are set and released by calling certainfunction modules. 1hese function modules are generated automatically from the

    definition of socalled loc objects in the $+$%/< 6ictionary.1o synchroni5e the access to a table by setting and removing locs, a Loc object hasto be defined in the $+$%/< 6ictionary. $ctivating the loc object automatically createsfunction modules for setting and removing locs. 1hese function modules must beincluded when programming interactive transactions.

    /ock $echanism

    1o set locs, a loc object must be defined in the $+$%/< 6ictionary. )n this loc object,those tables in which data records are to be loced by calling a loc are determined. $lltables included in a loc object must be connected to each other via foreign eys. 1heey fields of the tables in a loc object form the Loc arguments for the tables. 1he loc

    arguments are the basis for formulating the logical condition for identifying the recordsto be loced.

    "hen activating this loc object, two function modules+ with the names?D;;K2(bjectKname3 and 6D;;K2(bjectKname3 are generated.

    E6a&ple $

  • 8/12/2019 SA P ABAP FAQ

    10/100

    +roblem

    Cou wish to prevent a user from being able to change the name of a course or the nameof the professor with responsibility for the course at a time when another user is editingthe course description which contains this information-.

    )olution

    1he problem described above can be solved by defining a loc object K;B;7#. 1hisis done by defining primary and secondary tables in the loc object. 1able ;B;7# ischec table of table ;B7#+, so ;B;7# should be selected as primary table and;B7#+ as secondary table of the loc object.1he Lock arg(&entin this case is the field combination F$+?7, B7#?7, and #%7$#i.e %rimary Bey 'ombination-.1he Loc mode #hared is to be selected here. 1his allows several users to access thedata simultaneously in display mode.1he loc mode in the generated function modules for setting ?D;;KK;B;7#-

    and releasing 6D;;KK;B;7#- locs is therefore set to shared as default, butcan be overridden by calling the function modules.

    )f the function module ?D;;KK;B;7# is called with F$+?7 &9& and B7#?7 &8&, the record for course 8 in faculty 9 is loced in table ;B;7#. Furthermore, all thecourse descriptions for this course are loced in table ;B7#+ since field #%7$# wasnot specified when the function module was called. )n such cases, the loc is madegenerically for a field which is not defined.)f the function module 6D;;KK;B;7# is now called with F$+?7 &9&, B7#?7 &8& and #%7$# &6&, the German course description is unloced. $ll other coursedescriptions remain loced.

    W,at is data"ase (tilit. /- 6atabase utility is the interface between the $+$%/< 6ictionary and the

    underlying the #$% system.

    1he database utility is the interface between the $+$%/< 6ictionary and the relationaldatabase underlying the #$% system. Cou can call the database utility from the initialscreen of the $+$%/< 6ictionary with ;tilities M 6atabase utility.1he database utility allows you to create, delete and convert objects from the $+$%/ATION

    W,at is Mod(lari4ation and its "enefits/)f the program contains the same or similar blocs of statements or it is re!uired toprocess the same function several times, we can avoid redundancy by usingmodulari5ation techni!ues. +y modulari5ing the $+$%/< programs we mae them easyto read and improve their structure. 0odulari5ed programs are also easier to maintainand to update.

  • 8/12/2019 SA P ABAP FAQ

    11/100

    5o can e create calla"le &od(les of progra& code it,in one ABAP'7Progra&/

    $. +y defining macros.+. +y creating include programs in the library.

    W,at are s("ro(tines/

    #ubroutines are program modules which can be called from other $+$%/< programs orwithin the same program.

    W,at are t,e t.pes of S("ro(tines/

    $. )nternal #ubroutines* 1he source code of the internal subroutines will be in thesame $+$%/< program as the calling procedure internal call-.

    +. xternal #ubroutines* 1he source code of the external subroutines will be in an$+$%/< program other than the calling procedure.

    W,at are t,e different t.pes of para&eters/

    Formal parameters* %arameters which are defined during the definition of subroutinewith the F(70 statement.

    $ctual parameters* %arameters which are specified during the call of a subroutine withthe %7F(70 statement.

    5o can one disting(is, "eteen different kinds of para&eters/$. )nput parameters are used to pass data to subroutines.+. (utput parameters are used to pass data from subroutines.

    W,at are t,e different &et,ods of passing data/

    $. 'alling by reference* 6uring a subroutine call, only the address of the actualparameter is transferred to the formal parameters. 1he formal parameter has nomemory of its own, and we wor with the field of the calling program within thesubroutine. )f we change the formal parameter, the field contents in the callingprogram also change.

    +. 'alling by value* 6uring a subroutine call, the formal parameters are created ascopies of the actual parameters. 1he formal parameters have memory of theirown. 'hanges to the formal parameters have no effect on the actual parameters.

    '. 'alling by value and result* 6uring a subroutine call, the formal parameters arecreated as copies of the actual parameters. 1he formal parameters have theirown memory space. 'hanges to the formal parameters are copied to the actualparameters at the end of the subroutine.

    0he method by which internal tables are passed is 1y ,eference.

    W,at is t,e difference "eteen t,e f(nction &od(le and a nor&al ABAP'7s("ro(tine/)n contrast to normal subroutines function modules have uni!uely defined interface.#ub routines do not return values.

  • 8/12/2019 SA P ABAP FAQ

    12/100

    #ub routines do not return exceptions.#ub routines cannot be tested independently.6eclaring data as common parts is not possible for function modules. Function modulesare stored in a central library.

    W,at is a f(nction gro(p/

    $ function group is a collection of logically related modules that share global data witheach other. $ll the modules in the group are included in the same main program. "henan $+$%/< program contains a '$LL F;?'1)(? statement, the system loads the entirefunction group in with the program code at runtime. very function module belongs to afunction group.

    W,at is t,e difference "eteen internal ta"les and e6tract datasets/

    $. 1he lines of an internal table always have the same structure. +y using extractdatasets, you can handle groups of data with different structure and get statisticalfigures from the grouped data.

    +. Cou have to define the structure of the internal table at the begining. Cou need

    not define the structure of the extract dataset.'. )n contrast to internal tables, the system partly compresses extract datasets

    when storing them. 1his reduces the storage space re!uired.6. )nternal tables re!uire special wor area for interface whereas extract datasets

    do not need a special wor area for interface.

    LOGI!AL )ATABASE%

    W,at are logical data"ases/ W,at are t,e ad0antages'disad0antages of logicaldata"ases/

    $ns * $ Logical 6atabase is a hierarchical structure of tables. ;se the G1 statement to

    process Logical 6atabases.- L6+ consists of logically related tables grouped together N used for reading and

    processing data.- $dvantages 9. ?o need of programming for retrieval , meaning for data selection- :. asy to use standard user interface, have chec completeness of

    user input.

    6isadvantages 9. Fast in case of lesser no. of tables +ut if the table is in the lowestlevel of hierarchy, all upper level tables should be read so performance is slower.

    Preparation of t,e data records ". t,e L%)%B and reading of t,e data records int,e act(al report are acco&plis,ed it, t,e co&&and pair%

    %ut and Get.

    T,e t,ree &ain ele&ents of L)B are #tructure, #elections, 6atabase %rogram.

    W,at sort of ta"les one can (se in designing t,e ,ierarc,. of a L)B / 1ables which are having Foreign ey relations.

  • 8/12/2019 SA P ABAP FAQ

    13/100

    T,e str(ct(re of Logical )ata"ases relfects t,e ???????????????? dependenciesof ,ierarc,ical ta"les in t,e SAP S.ste&%

    3 Foreign ey

    If .o( ant to i&pro0e t,e response ti&e 8 ti&e to access data 9 Logical)ataBases per&its .o( to ac,ie0e t,is (sing ??????????????

    >)"#.

    W,at are t,e ad0antages of Logical )ataBases /

    )t offers an easytouse selection screen.Cou can modify the pregenerated selection screen to your needs.)t offers chec functions to chec whether user input is complete, correct, andplausible.)t offers reasonable data selections.)t contains central authori5ation checs for database accesses.nhancements such as improved performance immediately apply to all reportprograms that use the logical database.

    Report @ORMATTING

    In order to s(ppress t,e leading 4eros of a n(&"er field t,e ke.ords (sed are $?(O7(.

    T,e !o&&and t,at allos for 0ertical align&ent of fields one "elo t,e ot,er%;?67.

    In order to concatenate strings onl. for o(tp(t p(rposes t,e co&&and ?????????can "e (sed in con#(nction it, t,e :Write: state&ent%

    ?(G$%.

    )ata can "e &o0ed fro& one field to anot,er (sing a :Write$: State&ent and storedin t,e desired for&at%17;. "rite * 6ateK9 to 6ateK: format 66/00/CC.

    In order to ,a0e "oldfaced te6t as o(tp(t t,e co&&and (sed is"rite * 2f3 )?1?#)F)6.

    Backgro(nd and foregro(nd colors can "e interc,anged (sing t,e co&&andFormat inverse.

    W,ic, datat.pe cannot "e (sed to define para&eters%1ype F.

    @or eac, ne e0ent t,e s.ste& resets all for&atting options to t,eir defa(lt0al(es% 17;.

  • 8/12/2019 SA P ABAP FAQ

    14/100

  • 8/12/2019 SA P ABAP FAQ

    15/100

    AT SELE!TION3S!REEN %oint after processing userinput on the selection screenwhile the selection screen isstill active

    1he event eyword $1 #L'1)(?#'7? provides you with several possibilities to

    carry out processing blocs while the system is processing the selection screen.

    START3O@3SELE!TION %oint after processing the selectionscreen

    1he event #1$71(F#L'1)(? gives you the possibility of creating a processingbloc after processing the selection screen and before accessing database tables usinga logical database. Cou can use this processing bloc, for example, to set the values ofinternal fields or to write informational statements onto the output screen.

    $t the #1$71(F#L'1)(? event, also all statements are processed that are notattached to an event eyword except those that are written behind a F(70?6F(70

    bloc

    GETta"leC %oint at which the logical databaseoffers a line of the database table2table3.

    1he most important event for report programs with an attached logical database is themoment at which the logical database program has read a line from a database tablesee $ccessing 6ata ;sing Logical 6atabases -. 1o start a processing bloc at thisevent, use the G1 statement as follows*

    #yntax

    G1 2table3 PF)L6# 2list3Q.$fter this statement, you can wor with the current line of the database table 2table3.1he data is provided in the table wor area 2table3.

    GET ta"leC LATE %oint after processing all tables whichare hierarchically subordinate to thedatabase table 2table3 in the structure ofthe logical database.

    1o start a processing bloc at the moment after the system has processed all databasetables of a logical database that are hierarchically inferior to a specific database table,

    use the event eyword G1 as follows*

    #yntaxG1 2table3 L$1 PF)L6# 2list3Q.

    )n analogy to report programs that use only #L'1 statements see table in'omparison of $ccess 0ethods -, the processing bloc of a G1 2table3 L$1statement would appear directly before the ?6#L'1 statement in the #L'1 loopfor the database table 2table3.

  • 8/12/2019 SA P ABAP FAQ

    16/100

    EN)3O@3SELE!TION %oint after processing all lines offeredby the logical database.

    1o define a processing bloc after the system has read and processed all database

    tables of a logical database, use the eyword ?6(F#L'1)(?.

    1he following events occur during the processing of the output list of a report program*vent eyword vent

    TOP3O@3PAGE %oint during list processing whena new page is started

    EN)3O@3PAGE %oint during list processing when a pageis ended

    1he following events occur during the display of the output list of a report program*

    vent eyword vent

    AT LINE3SELE!TION %oint at which the user selects a line

    AT 2SER3!OMMAN) %oint at which the user presses afunction ey or enters a command in thecommand field.

    AT P@nnC %oint at which the user presses thefunction ey with the function code%F2n3

    "ith the selection screen, $+$%/< offers an interactive element also for report programs.Cou can define a selection screen without having to bother about all the details re!uiredin dialog programming.1he selection screen is always processed directly after a report program is started. 1heuser can enter field values and selection criteria on this screen.

    1he main purpose of the selection screen is to enable the user to control the databaseselections of the report program. )f a report program is started from another $+$%/)?>+@@ #ales (rder-

    W,at are t,e Tec,ni1(es in0ol0ed in (sing SAP s(pplied progra&s/ )o .o(prefer to rite .o(r on progra&s to load &aster data/ W,./- )dentify relevant fields- 0aintain transfer structure %redefined N first one is always session record-- #ession record structure , Aeader 6ata, )tem #1C% N record type -

    -Fields in session structure N #1C%, G7(;% , 0$?61, ;#7?$0 , ?( 6$1$

    - Fields in header structure N consists of transaction code also N #1C%, +00@@,1'(6,0$1?7 and Fields in )tem )10# W

    - 0aintain transfer file N sample data set creation

  • 8/12/2019 SA P ABAP FAQ

    27/100

    5o do .o( set (p "ackgro(nd #o"s in SAP/ W,at are t,e steps/ W,at are e0entsdri0en "atc, #o"s/- 'reate a job using function module U(+(%?- 'ollect the job specifications.- $dd a job step to the job with the function module U(+#;+0)1.- 'lose the job and pass it to +acground processing system for execution with the

    function module U(+'L(#- >?1 67)>? +$1'A U(+# *- 1ypes #ystem events N triggered when activation of new operation mode taes

    place- ;ser events 1riggered from $+$%/< or external program.- 1riggering an event notifies the bacground processing that named condition has

    been reached. 1he +acground system reacts by starting any jobs that were waitingfor the event.

    1ransaction codes related to bacground jobs creation and processing are *#08IUob creation-#08VUob selection and execution-.

    W,at are presentation and application ser0ers in SAP/$ presentation server is actually a program named #apgui.exe. )t is usually installed ona users worstation. $pplication server is a set of executables that collectively interpret the $+$%/$L; 1$+L*)f the domain of the chec field has a value table, this is proposed by thesystem as chec table in the foreign field maintenance. 1he ey fields of the value table

  • 8/12/2019 SA P ABAP FAQ

    33/100

    are in this case assigned fields of the foreign ey table with the same domain. 1hesefields may assume only those values allowed by the value table.1he value range of the domain can be defined by specifying value table.$ll table fieldsreferring to this domain can then be checed against the corresponding field of this valuetable.)n order the chec can be executed, a foreign ey must be defined for the valuetable.

    W,at are &atc,codes/ )escri"e/$ matchcode is a tool to search for data records in the system. 0atchcodes are anefficient and userfriendly search aid for cases where the ey of a record is unnown.)t consists of two stages one is 0atch code object and the other is 0atchcode )6.

    $ matchcode object describes the set of all possible search paths for a search term.0atchcode )6 describes a special search path for a search term.

    W,at are ranges/ W,at are n(&"er ranges/)t is often necessary to directly access individual records in a data structure. 1his is done

    using uni!ue eys. ?umber ranges are used to assign numbers to individual databaserecords for a commercial object, to complete the ey. #uch numbers are e.g. ordernumbers or material master numbers.

    5o do .o( 0alidate t,e selection criteria of a report/ And ,o do .o( displa.initial 0al(es in a selection screen/1he selection criteria is validated in the processing bloc of the $1 #L'1)(?#'7? event for the input values on the screen and respective messages can besent.1o display initial values in the selection screen* ;se )?)1)$L)O$1)(? >?1

    ;se 6F$;L1 >$L; option of %$7$017# #tatement ;se #%$/G%$ %arameters %)6s-.

    W,at is t,e !lient concept in SAP/ W,at is t,e &eaning of !lient independent/)n commercial, organi5ational and technical terms, the client is a self contained unit inthe 78 system, with separate set of 0aster data and its own set of 1ables."hen a change is made in one client all other clients are affected in the system thistype of objects are called 'lient independent objects.

    W,at is Internal ta"le/

    )nternal tables are table objects that only exist for the runtime of the program.1here are several $+$% statements for woring with internal tables, for example,append, insert, delete, or find lines.

    1he number of lines of an internal table is extended dynamically at runtime as re!uired.

    Cou can use internal tables for table calculations on subsets of database tables. Forexample, you can read a part of one or more database tables into an internal table.

  • 8/12/2019 SA P ABAP FAQ

    34/100

    1hey also allow you to reorgani5e their contents to suit the needs of your program. Coucan, for example, read particular entries from one or more large customer tables into aninternal table, and then use them to create a list. "hen you run your program, you canaccess this data directly, instead of having to search for each record in the database.

    W,at is a 0ariant and ,ere do .o( (se it/)f you want to run a report program with same selections at regular intervals for

    example, for monthly sales statistics-, you would not want to enter the same values eachtime. #o, $+$%/< offers you a possibility to combine the desired values for all theseselections in one selection set. Cou can create as many different selection sets as youlie for each report program and they remain assigned only to the report program in!uestion. #uch a selection set is called a variant.;sing >ariants (nline;sing >ariants in +acground %rocessing(nline, starting a report via variant saves the user wor,minimi5es input errors. )nbacground processing, a variant is the only possibility you have to pass values for theselections.

    1o fill certain selections with values that change according to the application, you use avariant, which taes the variable values from 1able T;AR;.

    W,at is set para&eter and get para&eter/

    "e can pass data to a called program using #%$/G%$ parameters. #%$/G%$parameters are field values saved globally in memory. ach parameter is identified by athreecharacter code* you can define these parameters in the object browser byselecting (ther objects on the first screen. 1he #%$/G%$ storage is userspecific andvalid throughout all the user&s sessions.by using the #1 %$7$017 or G1

    %$7$017 statements

    1hese statements let you store and retrieve #%$/G%$ values from an $+$%/< program.)f the selection screens for the two transactions do not share the same re!uired fields,use these statements to store screen fields explicitly by name.+efore calling the new transaction from a %$) module, store the caller transaction&s fieldsunder one name*

    #1 %$7$017 )6 &7)6& F)L6 2F)L6 ?$093.

    1he system stores the value in 2field name93 in the #%$ parameter &7)6&. 1he threecharacter identifier &7)6& must be defined in the #$% table 1%$7$. )f the #%$ parameter

    &7)6& already contains a value, the #1 %$7$017 statement overwrites it with thecontents of 2F)L6 ?$093-.)n the %+( module for the called transaction, retrieve the fields under the other name*

    G1 %$7$017 )6 &7)6& F)L6 2F)L6 ?$0:3.

    W,at is field s.&"ol/

  • 8/12/2019 SA P ABAP FAQ

    35/100

    $ field symbol does not physically reserve space for a field, but points to a fieldwhich is not nown until runtime of the program. #ometimes you only now which fieldyou want to process, and how you want to process it, at runtime.For this purpose, you can create field symbols in your program. $t runtime, you canassign real fields to such field symbols. $ll operations which you have programmed withthe field symbol are then carried out with the assigned field. $fter successful assignment,

    there is no difference in $+$%/< whether you reference the field symbol or the field itself.

    5o to (se a grid list/;se Function 0odule 6isplayK4L)#1. )n ;r program .%ut all the data that ; want tooutput in its final format and then pass this internal table to the function module

    0wo types of grid list .6)#%L$CKG7)6KL)#1>ersion GL@@ 1able adjustment across clients7#+6'#;+ 7elease batchinput sessions automatically 7#'L1'(% 'opy

    tables across clients7#)?'L@@ xtended program list7#(7$7L Get the (racle 7elease7#%$7$0 6isplay all instance parameters7#1#'7% 1ransport #$%script files across systems7G;G+7@@ #ubstitution/>alidation utility7#;#7@@8 'hec the passwords of users #$%4 and 66)' in all clients7#;#7@@I List users last login7#1L60' 1o Load L(G(s to application server

    Interacti0e Reporting

    )nteractive reporting allows the user to participate actively in retrieving and presentingdata during the session. )nstead of one extensive and detailed list, with interactivereporting you create a condensed basic list from which the user can call detailedinformation by positioning the cursor and entering commands. )nteractive reporting thusreduces information retrieval to the data actually re!uired.

  • 8/12/2019 SA P ABAP FAQ

    36/100

    W,at are t,e e0ent ke. ords in interacti0e reporting /

    E0ent ke.ord E0ent

    $1 L)?#L'1)(? 0oment at which the user selects a line bydoubleclicing on it or by positioning thecursor on it and pressing F:.

    $1 ;#7'(00$?6 0oment at which the user presses afunction ey.

    1(%(F%$G 6;7)?G L)?#L'1)(?

    0oment during list processing of asecondary list at which a new page starts.

    W,at is secondar. list /#econdary lists allow you to enhance the information presented in the basic list. 1heuser can, for example, select a line of the basic list for which he wants to see moredetailed information. Cou display these details on a secondary list.#econdary lists mayeither overlay the basic list completely or you can display them in an extra window on

    the screen. 1he secondary lists can themselves be interactive again.

    5o to select 0alid lines for secondar. list /1o prevent the user from selecting invalid lines, $+$%/< offers several possibilities. $tthe end of the processing bloc ?6(F#L'1)(?, delete the contents of one ormore fields you previously stored for valid lines using the A)6 statement. $t the event

    $1 L)?#L'1)(?, chec whether the wor area is initial or whether the A)6statement stored field contents there. )n the latter case, create a secondary list, sinceyou previously stored field contents for valid lines only. $fter processing the secondarylist, clear the wor area again. 1his prevents the user from trying to create furthersecondary lists from the secondary list displayed.

    5o to create (ser interfaces for lists /1he 7/8 system automatically generates a graphical user interface G;)- for your liststhat offers the basic functions for list processing, such as saving or printing the list. )f youwant to include additional functionality, such as pushbuttons, you must define your owninterface status.1o create a new status, the 6evelopment "orbench offers the 0enu%ainter. "ith the 0enu %ainter,you can create menus and application toolbars.$nd youcan assign Function eys to certain functions. $t the beginning of the statement bloc of

    $1 ?6(F#L'1)(?, activate the status of the basic list using the statement* #1%F#1$1;# $1;#&.

    !an e call reports and transactions fro& interacti0e reporting lists /C#.)nteractive reporting also allows you to call transactions or other reports from lists.1hese programs then use values displayed in the list as input values.1he user can, forexample, call a transaction from within a list to change the database table whose data isdisplayed in the list.

  • 8/12/2019 SA P ABAP FAQ

    37/100

    5o to &aintain lists /1o return from a high list level to the nextlower level #CL#)?6-, the user chooses +acon a secondary list.1he system then releases the currently displayed list and activatesthe list created one step earlier.1he system deletes the contents of the released list.1oexplicitly specify the list level into which you want to place output, set the #CL#)?6 field.1he system accepts only index values which correspond to existing list levels.)t then

    deletes all existing list levels whose index is greater or e!ual to the index you specify.Forexample, if you set #CL#)?6 to @, the system deletes all secondary lists and overwritesthe basic list with the current secondary list.

    W,at are t,e page ,eaders for secondar. lists/(n secondary lists, the system does not display a standard page header and it does nottrigger the event 1(%(F%$G.1o create page headers for secondary list, you mustenhance 1(%(F%$G*

    )yntax 1(%(F%$G 6;7)?G L)?#L'1)(?. 1he system triggers this event foreach secondary list. )f you want to create different page headers for different list levels,

    you must program the processing bloc of this event accordingly, for example by usingsystem fields such as #CL#)?6 or #C%FBC in control statements )F, '$#-.

    W,at is &eant ". stacked list /$ #taced list is nothing but secondary list and is displayed on a fullsi5e screen unlessyou have specified its coordinates using the window command.

    Is t,e "asic list deleted ,en t,e ne list is created/?(.)t is not deleted and you can return bac to it using one of the standard navigationfunctions lie clicing on the bac button or the cancel button.

    W,at is &eant ". ,otspots /Aotspot is a list area where the mouse pointer appears as an upright hand symbol."hena user points to that areaand the hand cursor is active-,a singleclic does the samething as a doubleclic. Aotspots are supported from 7/8 release 8.@c.

    In ,ic, s.ste& field does t,e na&e of c(rrent g(i stat(s is t,ere /1he name of the current G;) #1$1;# is available in the system field #C%FBC.

    W,at is &eant ". ,ide area /1he hide command temporarily stores the contents of the field at the current line in asystemcontrolled memory called the A)6 $7$.$t an interactive event,the contents of

    the field is restored from the A)6 $7$. "hen calling a secondary list from a list linefor which the A)6 fields are stored, the system fills the stored values bac into thevariables in the program. )n the program code, insert the A)6 statement directly afterthe "7)1 statement for the current line.

    W,en t,e get c(rsor co&&and (sed in interacti0e lists /)f the hidden information is not sufficient to uni!uely identify the selected line ,thecommand G1 ';7#(7 is used.1he G1 ';7#(7 command returns the name of thefield at the cursor position in a field specified after the addition field,and the value of the

  • 8/12/2019 SA P ABAP FAQ

    38/100

    selected field in a field specified after value.

    5o to pass data fro& list to report /$+$%/< provides three ways of passing data* %assing data automatically using system fields ;sing statements in the program to fetch data

    %assing list attributes

    5o to call ot,er progra&s /

    Report Transaction

    'all and return #;+0)1 $?6 71;7? '$LL 17$?#$'1)(?'all withoutreturn

    #;+0)1 L$> 1( 17$?#$'1)(?

    S.ste& fields (sed in interacti0e Reporting

    1he SY3LSIN) system field contains the index of the list currently created. "hilecreating a basic list, #CL#)?6 e!uals @.

    "ith each interactive event, the system automatically sets the following system fields*

    S.ste& field Infor&ation#CL)?'1 total line count of a list

    #CL)??( current line no where cursor is placed.

    SY3LSIN) )ndex of the list currently created during the current event basic list @-

    #CL)#1) )ndex of the list level from which the event was triggered#CL)LL) $bsolute number of the line from which the event was triggered#CL)#L 'ontents of the line from which the event was triggered#C';7(" %osition of the line in the window from which the event was triggered

    counting starts with 9-#C';'(L %osition of the column in the window from which the event was triggered

    counting starts with :-

    #C;'(00 Function code that triggered the event#C%FBC $lways contains the status of the current list.

  • 8/12/2019 SA P ABAP FAQ

    39/100

    TOP3O@3PAGE )2RING LINE3SELE!TION%

    1he system triggers this event for each secondary list. )f you want to create differentpage headers for different list levels, you must program the processing bloc of thisevent accordingly, for example by using system fields such as #CL#)?6 or #C%FBC

    in control statements )F, '$#-.

    )ata fro& S.ste& @ields of Interacti0e Lists

    From system fields, you retrieve the following information* the index of a list, the positionof the list in the output window, and the location of the cursor. 1he only system field thatcontains the contents of the selected line is #CL)#L.

    Passing )ata ". Progra& State&ents

    1o pass individual output fields or additional information from a line to the corresponding

    processing bloc during an interactive event, use these statements*

    5I)E1he A)6 statement is one of the fundamental statements for interactive reporting.;sing the A)6 techni!ue, you can at the moment you create a list level define, whichinformation later to pass to the subse!uent secondary lists.

    #yntax A)6 2f3.g A)6* #%FL)'$77)6, #%FL)'(??)6, ?;0.

    REA) LINE

    ;se the statements 7$6 L)? and 7$6 ';77?1 L)? to explicitly read data fromthe lines of existing list levels. 1hese statements are tightly connected to the A)6techni!ue.

    #yntax *

    7$6 L)? 2lin3 P)?6 2idx3QPF)L6 >$L; 2f93 P)?1( 2g 93Q... 2f n3 P)?1( 2g n3QQP(F ';77?1 %$GX(F %$G 2p3Q.

    g *

    7$6 L)? #C)?6 F)L6 >$L; +(.

    GET !2RSOR;se the statements G1 ';7#(7 F)L6 and G1 ';7#(7 L)? to pass the outputfield or output line on which the cursor was positioned during the interactive event to theprocessing bloc.

    #yntax

  • 8/12/2019 SA P ABAP FAQ

    40/100

    G1 ';7#(7 F)L6 2f3 P(FF#1 2off3Q PL)? 2lin3QP>$L; 2val3Q PL?G1A 2len3Q.

    SET !2RSOR

    1o set the cursor, use the #1 ';7#(7 statement. 1his statement sets the cursor inthe most recently created list. "hile creating the basic list, this is always the basic listitself. "hile creating a secondary list, this is the previous list.

    #1 ';7#(7 2col3 2lin3.1his statement sets the cursor to column 2col3 of line 2lin3 of the output window.

    !alling Progra&s

    )f you need to program an extensive application, one single program will become verycomplex. 1o mae the program easier to read, it is often reasonable to divide the

    re!uired functions among several programs.

    $+$% allows you to call reports as well as transactions using these statements*

    7eport 1ransaction'all without return #;+0)1 L$> 1( 17$?#$'1)(?'all and return #;+0)1 $?6 71;7? '$LL 17$?#$'1)(?

    T.pical Str(ct(re of ABAP Progra&

    9. 7eport 6efinitions 4

    :. 1able and 6ata definitions 4

    8. )nitiali5ation event

  • 8/12/2019 SA P ABAP FAQ

    41/100

    alues can be passed through %7F(70 to F(70.

  • 8/12/2019 SA P ABAP FAQ

    42/100

    Giving the flexibility to use the same subroutine multiple number of times.

    #yntax9* %7F(70 23 using 2CCC3changing 20003

    F(70 23 using 2CCC3 lie 2OOO3

    changing 20003 lie 2???3 %ass by reference(7

    F(70 23 using value CCC- lie 2OOO3 %ass by value,creates another copy of the variable.

    xample9*%7F(70 dateinvert using indate

    'hanging outdate

    F(70 dateinvert using indate lie datum

    #yntax:* %7F(70 functionnameprogram- )F F(;?6.

    xample:* %7F(70 A$67F(70%((L- )F F(;?6.

    I. Get e0ent

    G1 2 table name 3

    7eads data of all columns from all database table falling in the hierarchy

    ?eeds to mention table name in

    1$+L#* parametersWWW

    (nly fields part of the tables mentioned in the 1$+L#* parameter can beviewed S edited

    V. To E6it fro& an E0ent

    xit N )t exits from the respective subroutine were this syntax is used ,generally condition for the )1 is stated before this syntax

    'hec here the conditional chec is done at the same time .

    'A'B 2condition3)f the condition is not satisfied, the system leaves the subroutine and resumesthe processing after the %7F(70 statement

  • 8/12/2019 SA P ABAP FAQ

    43/100

    #top N it is the abrupt stopping the program flow

    E. !ALLing @(nctional Mod(les

    #yntax*

    '$LL F;?'1)(? 2module3P%(71)?G f9 a9 .... fn anQP)0%(71)?G f9 a9 .... fn anQP'A$?G)?G f9 a9 .... fn anQP1$+L# f9 a9 .... fn anQP'%1)(?# e9 r9 .... en rn

    xample*'$LL F;?'1)(? &OK6$1K'(?>7#)(?&

    %(71)?G #16K6$1 G?K6$1)0%(71)?G 'AK6$1 ?"K6$1

    % List E0ents

    1(%(f%$G, ?6(F%$G,

    $1 L)?#L'1)(?, $1 ;#7'(00$?6

    1hese events are triggered by the $+$% runtime environment while a list isbeing created or when a user performs an action on a list. 1he statement inthese blocs can format the list or process the users re!uest.

    ABAP PER@ORMAN!E ISS2ES%

    ABAP'7 Opti&i4ation

    ;se the G1 7;? 1)0 command to help evaluate performance. )t&s hard to nowwhether that optimi5ation techni!ue 7$LLC helps unless you test it out. ;sing thistool can help you now what is effective, under what inds of conditions. 1he G17;? 1)0 has problems under multiple '%;s, so you should use it to test smallpieces of your program, rather than the whole program.

    $void L'1 4&, especially in tables that have a lot of fields. ;se #L'1 $ + ')?1( instead, so that fields are only read if they are used. 1his can mae a very bigdifference.

    Fieldgroups can be useful for multilevel sorting and displaying. Aowever, they writetheir data to the system&s paging space, rather than to memory internal tables usememory-. For this reason, fieldgroups are only appropriate for processing large lists

  • 8/12/2019 SA P ABAP FAQ

    44/100

    e.g. over =@,@@@ records-. )f you have large lists, you should wor with the systemsadministrator to decide the maximum amount of 7$0 your program should use, andfrom that, calculate how much space your lists will use. 1hen you can decidewhether to write the data to memory or swap space. #ee the Fieldgroups $+$%example.

    ;se as many table eys as possible in the "A7 part of your select statements.

    "henever possible, design the program to access a relatively constant number ofrecords for instance, if you only access the transactions for one month, then thereprobably will be a reasonable range, lie 9:@@9E@@, for the number of transactionsinputted within that month-. 1hen use a #L'1 $ + ' )?1( 1$+L )1$+ statement.

    Get a good idea of how many records you will be accessing. Log into your productivesystem, and use #E@ 3 6ictionary (bjects press dit-, enter the table name youwant to see, and press 6isplay. Go 1o ;tilities 3 1able 'ontents to !uery the tablecontents and see the number of records. 1his is extremely useful in optimi5ing aprogram&s memory allocation.

    1ry to mae the user interface such that the program gradually unfolds moreinformation to the user, rather than giving a huge list of information all at once to theuser.

    6eclare your internal tables using ('';7# ?;0K7'#, where ?;0K7'# is thenumber of records you expect to be accessing. )f the number of records exceeds?;0K7'#, the data will be ept in swap space not memory-.

    ;se #L'1 $ + ' )?1( 1$+L )1$+ whenever possible. 1his will read all of therecords into the itab in one operation, rather than repeated operations that result

    from a #L'1 $ + ' )?1( )1$+... ?6#L'1 statement. 0ae sure that )1$+ isdeclared with ('';7# ?;0K7'#, where ?;0K7'# is the number of recordsyou expect to access.

    0any tables contain totals fields such as monthly expense totals-. ;se these avoidwasting resources by calculating a total that has already been calculated and stored.

    %rogram $nalysis ;tility1o determine the usage of variables and subroutines within a program, you can use the

    $+$% utility called ]%rogram $nalysis included in transaction #8E. 1o do so, executetransaction #8E, enter your program name, then use the path ;tilities 3 %rogram

    $nalysis

    ABAP PER@ORMAN!E IMPRO;EMENTS ;IA )ATA )I!TIONARY

    )?6 '7$1)(? #;GG#1)(?# 7L$16 1( 6$1$+$# %7F(70$?'

    R 1he columns at the beginning of an index are the most [common\. 1he most[common\ columns are those where reports are selecting columns with no ranges thewhere clause for these columns is an [e!ual to\ expression. 7earrange columns of an

  • 8/12/2019 SA P ABAP FAQ

    45/100

    index to match the selection criteria. For example, if a select statement is written toinclude columns 9 and : with [e!ual to\ expressions in the where clause and column 8and < are selected with value ranges, then the index should be created with columns inthe se!uence of 9,:,8,)" tables to effectively join and [denormali5e\ related tables that are tainglarge amounts of time to select for reporting. For example, at times where highlyaccessed tables normali5e description text into one table and the header data intoanother table, it may mae sense to create a view table that joins the relevant fields ofthe two associated with a poor performing $+$%.

    For %((L tables that contain large amounts of data and are highly accessed,convert the pooled table into a transparent table and add an index. %((L6 tablesare supposed to be collections of smaller tables that are !uicly accessed from thedatabase or are completely buffered in memory. %ooled tables containing more thana few hundred rows and are accessed many times in a report or transaction arecandidates for %((L to 17$?#%$7?1 'onversion. For example, table A!"contains tax #urisdiction condition information and are accessed more t$anten times in t$e sales order create transaction% &f t$e entire 'nited States taxcodes are loaded into t$ese condition tables, t$e time to save a sales orderincreases to unacceptable levels% (onverting t$e tax condition table totransparent and creating an index based upon t$e )e* fields, decreases

    processing time from minutes to seconds%

    R 6o not allow the use of L)B in an #$% #DL statement accessing a large table.

    R ;se internal tables in $+$%s to preselect values once and store values in memoryfor sorting and searching purposes this is an assumption stated at the beginning of thisdiscussion-.

    R $void logical databases when not processing all row s of a table. )n fact, a logicaldatabase is merely a group of nested #$% #DL #L'1 statements. )n general, whenprocessing a small number of rows in a larger table is re!uired, the use of internal tablesand ?(1 using a logical database or nested selects will be much better for performance.

    ABAP IMPORTANT REPORTS

    7#+6'+1'#ubmit a +6' job with an internal batch number and wait for the end of the batch inputsession.

    7#+6'#;+7elease batch input sessions automatically

  • 8/12/2019 SA P ABAP FAQ

    46/100

    ABAP IMPORTANT T!O)ES

    (##9 #$% (nline #ervice #ystem

    #098 ;pdate monitor. "ill show update tass status. >ery useful to determine why anupdate failed.

    #@@9 $+$% 6evelopment "orbench#@9 (ld 1ransport S 'orrections screen#9@ ?ew 1ransport S 'orrection screen#@J "orbench (rgani5er#9I 6ata +rowser* )nitial #creen.#8@ $+$%/< 7untime $nalysis#8I $+$%/

  • 8/12/2019 SA P ABAP FAQ

    47/100

    +6'

    $L 2F)L6?$03

    H= Who are Dialog users an! who are Bac3groun! users ?- 6ialog users are normal interactive users in the #$% system. +acground

    users are user master records that are specially defined for providingauthori5ations for bacground processing jobs.

    H What is the use o" BDC0,+S)R ?- "e add a transaction to a +atch )nput #ession by using this function.

    HH What are the up!ate $o!es in CA&& RA+SAC,-+ ?- # * #ynchronous- $ * $synchrnous- L * Local

    H What !oes the $essage para$eter in!icates ?- 1he message parameter indicates there all system messages issued during a

    '$LL 17$?#$'1)(? are written into the internal table 2itab3. 1he internaltable must have the structure of +6'0#G'(LL.

  • 8/12/2019 SA P ABAP FAQ

    55/100

    H What is Direct ,nput ?- 1o enhance the batch input procedure, the system offers the direct input

    techni!ue especially for transferring large amount of data. 1his techni!uedoesnt create sessions but stores the data directly. 1he direct inputprograms must be executed in the bac ground only. 1o maintain and startthese programs, use program 7+0>#A(" or the transaction +0>(.

    What are the "eatures o" Recor!ing Function ?- recording transaction runs- creating batch input sessions from the recorded transaction runs.- Generating a batch input program from the recorded data.

    < What is synchrnous !ata%ase up!ate ?- 6uring the processing, no transaction is stored until the previous transaction

    has been written to the database. 1his is called #ynchronous databaseupdate.

    Q 5o do .o( set (p "atc, process/6ata analysis* $naly5e the data that is to be transferred to the #$% #ystem.

    XXGenerate #$% structures* Generate #$% data structures for incorporation into yourdata export program. XX6evelop transfer program* Cou can write the program in $+$%/< or as an externalprogram.

    XX'reate se!uential file* xport the data that is to be transferred, to a se!uential file.

    XX'reate batch input program* $+$%/< batch input program that will read the data tobe transferred from the se!uential file.

    XX%rocess batch input data* %rocess the data and add it to the #$% #ystem. Cou cando this either by*batchinput session method or 'all transaction method. XX

    $nalyse results* 'hec that all data has been successfully processed. XX

    $nalyse rror session* 'orrect and reprocess erroneous data.

    - Where !o you use BDC?

    transferring data from another system when you install your #$% #ystem

    regularly transferring data that is captured by a non#$% system in yourcompany into the #$% #ystem. $ssume, for example, that data collection insome areas of your company is still performed by a non#$% system. Cou canstill consolidate all of your data in the #$% #ystem by exporting the data from theother system and reading it into the #$% #ystem with batch input.

  • 8/12/2019 SA P ABAP FAQ

    56/100

    Cou can also use batch input to transfer data between two 7/8 #ystems. Aowever,there are more direct methods for doing this, such as 7F' remote function calls-.

    7 What has to %e !one to the pac3e! "iel!s %e"ore su%$itting to a BDC session?6eclare these fields in the internal table as characters and the length of the fieldshould be same as the field length of the field&s data element. 1his internal table isused to hold the data fetched from the se!uential file using "#upload functionmodule

    What is &S'W1he L#0" is a crossapplication component '$- of the #$% 7/8 #ystem.1he tool has interfaces with the 6ata 1ransfer 'enter and with batch input and directinput processing as well as standard interfaces +$%) and )6oc in 7/8.1he L#0" comprises the following &ain f(nctions*

    9. 7ead data legacy data in spreadsheet tables and/or se!uential files-.Function ,ead datareplaces and enhances functions )preadsheet interfaceand 3ost interface of L#0" version 9.@. Cou can use any combination out of%' and server files now.

    :. 'onvert data from the source into the target format-.8. )mport data to the database used by the 7/8 application-.

    C-D) 4 &S'W

  • 8/12/2019 SA P ABAP FAQ

    57/100

    SAP Scripts

    W,at is sap script and la.o(t set/$ns #$%script is the integrated text management system of the #$% 7/8 #ystem.#$%script is tightly integrated into the #$% #ystem. )t is used for many differentwordprocessing tass all over the #$% #ystem.

    W,at is la.o(t set/

    $ layout set in #$%script is used for page layout. 1he layout set contains variouselements, which are used for layout control of the individual pages and also contain

    layout information for texts which are to be output on the individual pages.

    1he layot of a document is defined in a layot set.$ layout set specified the appearance and structure of a document.

    Layout sets contain predefined text modules with space reserved for variable data. Coucan use these text modules for different application.

    very #$%script document uses a layout set.

    1o mae changes to your documents, such as moving a piece of text, or changing fonts,paragraph formats, and tabs, you only need to change the layout set.

    T,ere are to a.s of for&atting te6ts (sing la.o(t sets$1he text is entered and output in standard text maintenance. Cou can assign anylayout set. 1ext can also be entered via the layout set a letter header, for example.1he text is formatted via an $+$%/< program using a layout set. 1he program caneither dynamically output individual predefined text modules, text elements ortransfer entire texts, which are to be output in the layout set.

    Yo( can (se #tylesto define t,e for&atting of t,e te6t in .o(r doc(&ents% Ast.ledeter&ines te6t for&atting ". setting t,e paragrap, and c,aracter for&ats

    (sed in adoc(&ent% Yo( can for e6a&ple (se a st.le to ,ig,lig,t c,aracter strings or,oleparagrap,s% Yo( can assign a st.le to an. te6t% T.picall. ,oe0er .o(Kll (sest.lespri&aril. in t,e &ain indos of la.o(t sets ,ere (sers t.pe or enter te6tdirectl.in doc(&ents%

  • 8/12/2019 SA P ABAP FAQ

    58/100

    5eader data is fo(nd in "ot, st.le and la.o(t set &aintenance%)n style maintenance, it is used primarily to present important information designedto mae it easier for the end user to select a style. 1he header data in layout setmaintenance, on the other hand, is used for information and control purposes.

    "indows are defined in layout set maintenance. 1hey represent areas

    which are positioned on pages as page windows and in which text islater output. $t least one window must be defined for each layout set. )fnot, a text cannot be formatted by #$% script.

    T,e folloing indo t.pes can "e (sed$

    MAINN 0ain window in which continuous text is output. 1his is the window used bydialog users of a print program and layout set. For example the body text of a letterwould be entered in 0$)?.

    ;ARN "indow with variable contents. 1he text can vary on each page in which thewindow is positioned. >ariable windows are formatted for each page.

    !ONSTN "indow with constant contents which is only formatted once.

    A la.o(t set ,as t,e folloing ele&ents$

    5eader data 6ata related to development created by, development class, etc.-and layout set information which elements are used- are both stored in the headerdata. $ start page must be entered here.

    Paragrap, for&ats %aragraph formats are re!uired in layout sets as in styles inorder to format texts. Aowever, they are also used for word processing in layoutsets, for example, to format text elements.

    !,aracter for&ats Cou can also use character formats to format texts orparagraphs. ;nlie paragraph formats, however, they are used to format text within aparagraph.

    Windows 4 Win!ows are na$es an! win!ow types5 which are not physically positione!

    until they are allocate! to pages an! units o" $easure$ent are speci"ie!6

    Pages %ages are defined to provide the system with a start and end point in textformatting.

    Page indos %age windows are the combination of windows and pages, where

    the dimensions of a window and its position on a page are specified.

    1he purpose of SAP script control co&&andsis to allow control of theoutput formatting. 1hese commands are not interpreted by the #$%scripteditor, but are passed through to the #$%script 'omposer for processing. 1hecomposer is the program that converts text from the form displayed in the editor tothe form used for printing.

  • 8/12/2019 SA P ABAP FAQ

    59/100

    W,at is SAPscript and e6plain its p(rpose/#$% #cript is the #$% systems own textproessing system. Coull find that it loosand feels a lot lie other leading textprocessing system that you may use on yourpersonal computer.

    very company needs to output documents with a uniformly defined layout eg.

    )nvoices, delivery notes, etc..- all the time.

    1he basic layout of the document is predefined , but in many cases, other data hasto be merged with it, such as address data or purchase order items. 1his data mightbe entered manually by a employee, or retrieved from a database table.

    Large !uantities of these documents have to be produced. From printing is usually amattter of large print runs of documents such as payslips, checs, order confirmation,reminders etc.

    #$%script has been developed to meet the above re!uirements. )1 is an integratedtool for text entry and form printing in 7/8 applications.

    1hese documents are normally provided by #$% but every organi5ation have theiruni!ue wa!ys of these documents so to customi5e these and for creating newerones if re!uired #$% script is used.

    W,at are co&ponents of SAPscript/Layout set, #$%script 1ext, $+$% %rint program , symbols, functionmodules lie openKform, closeKFrom, 7eadKtext etc,.

    W,at are t,e ABAP'7 !o&&ands t,at link to a la.o(t set/'all function (%?form.

    'all function "7)1from.'all function 'L(#from

    I&porting Grap,ics 8Logos9 into SAPScript1he program 7#1L60' can be used to upload graphics file extension .tif on %'files- into individual standard text.

    Ot,er (sef(l progra&s for SAPScript7#1F'(? 'onverts page format7#1#'7% ;pload/6ownload layout sets7#16+;G #$%#cript debugger

    )e"(g SAPScriptCou can debug a #$%#cript* ;se 1ools "ord %rocessing Layout #et.nter name of layout set and then ;tilities $ctivate 6ebugger.)t is of no conse!uence which layout set you enter when selecting the #$%scriptdebugger. 0enu path* 1ools"ordprocessing Forms, ;tilities $ctivate 6ebugger-1he next layoutset called will invoe the debugger. 1his is !uite handy when verifyingwhich layoutset is being called >erifying customi5ing settings-.

    $nother way to set the #$%#cript debugger is to run program 7#16+;G.

  • 8/12/2019 SA P ABAP FAQ

    60/100

    "hen a Form is copied from one client to another .$nd )f ; try to display or changethe form in the copied client .1he possible error message cud be *9.Form not found1ry coping again specifing the language .

    :.)F )1 dispalys an error message saying 1hat the text file is inconsistent .1hen go to #8E and 7un [7#1'AB(\ .)t will as for the form name ,then chec all the checboxes and then run theprogram.?ote * all #cript related problems can be solved using %rogram ]7#14.

    5o to take a "ack (p of script la.o(t into 2Kr ,ard disk and load it later;se %rogram ,)09)C,+.

    Use EXPORT mode, when downloading and IMPORT when uploading a script.

    Dont !orget to gi"e the !orm name in the o#$ect !ield. This will create a script

    with the same name as that o! the original script . I! a script with the same namee%ists in the same client ,then it will gi"e an error &O#$ect cannot #e o"erwritten .

    I ant to cop. ta"le across clients;se %rogram 7#'L1'(%

    To transfer script files across s.ste&s?ot 'lients- ,)09)C,+

    To co&pare t,e contents of a ta"le across clients* 7#1+#7>

    To c,ange t,e de0elop&ent class of an. o"#ect 7#"+(@=:

    W,at t.pe of 0aria"les nor&all. (sed in sap script to o(tp(t data/S1ables name fieldsS.

    5o do .o( n(&"er pages in sap script la.o(t o(tp(ts/S page SSnext %age S

    W,at takes &ost ti&e in SAP script progra&&ing/6efining layout set up / sets.

    5o do .o( (se ta" sets in la.o(t sets/6efine paragraph with defined tabs.

    How !o you %ac3up sap script layout sets? Can you !ownloa! an! uploa!? How?

    #$% script bacup * )n transaction #V9 goto ;tilities 3 'opy from client 3 Givesource form name, source client @@@ default-, 1arget form name.6ownload * #V9, type form name 3 6isplay 3 ;tilities 3 form info 3 List 3 #aveto %' file.;pload * 'reate form with page, window, pagewindow with the help of downloaded%' file. 1ext elements for %age windows to be copied from %' file.

  • 8/12/2019 SA P ABAP FAQ

    61/100

    W,at is !o&pare Tool in SAP Script /#$% #cript offers tools for comparing objects across clients. "e can compare orcopy the following inds of objects.#tyles

    Layout sets6ocuments"ith the 'ompare tool we can do the following *'hec whether an object exists in both clients6isplay the differences between the versions of an object

    La.o(t Sets are used to control page layout and text formatting in documents .

    SAP Standard st.lesand layout sets are always held in 'lient @@@.

    In ,at for&at does SAP Script store te6t /

    '(Pscript te%ts are stored in Interchange Te%t )ormat *IT)+. '(Pscript o!!erscon"ersion programs !or the te%t !ile !ormats Rich Te%t )ormat *RT)+ and ('II

    as an inter!ace to other word processors.

    T,e 0ario(s indo t.pes in SAP Script are0ain, >ariable and 'onstant.

    T,e Ne3Page co&&andis used to force a %age brea in the text at any point.

    Protect %%% Endprotectcommand pairs can be nested 1rue / False-.False.

    )eli&iter + must be used immediately before and after the symbol.

    W,at does t,e co&poser do/

    1he final appearance of your documednt depends on interaction between the printprogram and the layout set.

    1he #$%script print program initiali5es the printing process. very commandentered using the #$%script programming interfaces is transferred to the composer.

    1he composer received layout information from the layout set specified by the printprogram. 1he documents are formatted according to this layout information.

    )f the documents contain variables, the compoer replaces these variables with datafrom the 7/8 system, such as the current date, or with the userdata selected by theprint program.

    1he print program controls the completion of thelayout set. (nce this is done, thecomposer places the completed document in the spool.

  • 8/12/2019 SA P ABAP FAQ

    62/100

    W,ere do e define Ta" space for data in SAPScript/

    "hen defining the paragraph for the text element we can define the 1$+# then.1here is parameter called 1$+# to be defined in paragraph definition.

    ,at is difference "eteen Windo + a Page Windo/

    "indow* $n area that is predefined in the layout set. "indows are text modules,which are positioned on a document page.

    "e define the window type, 6efault %aragraph, specify the text elements or a#$%script text to be included etc in the "indcow 'omponent.

    %age"indow* we define the parameters of the earlier defined "indow, appearanceon the document lie left or right margins, "idth S Aeight.

    W,at are s.&"oles + state t,eir different t.pes it, E%g%

    $ #ymbol is a constant, which can be inserted in a document. )t saves the userunnecessary wor when replacing sections of text, phrases, etc. ach symbol has aname which is encloses by S.

    g. Svariable name S#ystem symbols eg S6ateS, StimeS etc.

    #tandard symbols *#tandard symbols are userdefined. 1hey are maintainedcentrally in table 1161G. g. S#G6AS for the opening salutation * [dear sir/madam\.

    S0FGS for the closing salutation *\yours Faithfully\.

    %rogram #ymbols * %rogram symbols display data from the $+$%/< program whichhas called the word processing function g. )tabconnid.

    1ext symbols* Cou can define a text symbol for any text module. 1his symbol is validonly in the text module for which you have defined it. g. 6efine S#ymbolS ]value.

    5o do e define Te6t s.&"ols/;sing the control command 6F)? Sx9S ]=I.

    State fe control co&&ands/%%rotect .. endprotect, define, newpage, include.. ifW endif.

    ,at is t,e p(rpose of Protect and EndProtect/%

  • 8/12/2019 SA P ABAP FAQ

    63/100

    Cou can specify either in the style or in the layout set that a particular paragraphshould not be slit in two by a page bea. )f the page protect attribute is set then thecomplete paragraph is always output ona single page. 1his property applies only tothat particular paragraph. #$%#cript provides the %7(1'1W ?6%7(1'1command pair to allow you to define the areas to be protected against a page beaon an individual basis. 1hus the %7(1'1/?6%7(1'1 commands may be

    regarded as a ind of conditional ?"%$G command, the condition being whetheror not the lines enclosed between the two commands fit in the space remaining inthe current main window.

    5o do e set t,e date ti&e for&at/

    #1 1)0 0$#B * '(?7(L# 1A 1)0 F)L6 F(70$1.#1 6$1 0$#B * '(?17L# 1A 6$1 F)L6 F(70$1.

    G. #et 1ime 0as [ AA*00*##\.

    ,at is t,e role of an ABAP progr& in SAPScript/

    7etrieves 7/8 application data from the database.

    6efines the layout set processing logic 1he order and repetition of text elements-.

    'hooses a layout set for printing.

    #elects the output device, such as printer,monitor, or fax.

    #ets print attributes such as immediate output, number of copies ,and pages tobeprinted.

    5o to re(se so&e co&ponents of t,e script la.o(t to ot,er progra&/Is this script layout is standard for all the printer: If not then y we are going for scriptlayout:

    Give me couple of methods that I will take standard script layout printout for differentprinter.

    3ow u will analysis script program: % which goes to main and how many windowsetc;.(

    !an ; inserted logo on .o(r progra&/% Gi0e &e t,e progra& na&e ,ic,(ploads &. logo and s.nta6 for logo inserting in sap script%Ces u can insert a logo on your script layout.;se this 7eport [RSTFL)M!\ which will uploads the logo.;se the following statement which includes the logo on your script prog./* )?'L;6 &OA0$'7(& (+U'1 11 )6 #1 L$?G;$G &&.

    N object name, u will gives ` runtime in rstxldmc program.

  • 8/12/2019 SA P ABAP FAQ

    64/100

    Gi0e &e s.nta6 for "o6 co&&and%1O9 9+O) * $$ 6

    "hen formatting the standard text the %$7$G7$%A parameter is used. 1o centerthe text use*

    /* )?'L;6 OK+'7C %$7$G7$%A $6

    ?$0 SB?$9?$0S#171 SB?$9#17$#S%(#1'(6 SB?$9%#1LOS')1C SB?$9(71@9S&'(;?17C SB?$9L$?69SF7(0'(;?17C &6&?6$667##

  • 8/12/2019 SA P ABAP FAQ

    65/100

    $voiding pagebreas in a paragraph

    /* %7(1'1**/* ?6%7(1'1

    1he text lines to be protected are enclosed between the two commands

    'onditonal text ouput )F ?6)F

    Cou can use )F/?6)F lie in a normal $+$% program

    /* )F condition**/* ?6)F

    and

    /* )F condition*/* L#*/* ?6)F

    xample*

    /* )F S#%FL)')1C1(S _+7L)?_..... put some text here/* ?6)F

    S*mbols and (ontrol commands

    #ymbols are placeholders for values that are inserted during print formatting.

    #ymbols are indentified by name surrounded by _S_ and are not case sensitive

    0ypes of symbols

    #ystem symbols

    )ATE6ate)AY6ayNAME?O@?)AY ?ame of dayMONT5 0onth

    YEARCear

  • 8/12/2019 SA P ABAP FAQ

    66/100

    TIME 1ime

    5O2RSAoursMIN2TES0inutesSE!ON)S#econdsPAGE%age number

    NEFTPAGE ?umber of next pagre)E;I!E(utput deviceSPA!E +lan space2LINE;nderline;LINE >ertical line

    Stan!ar! sy$%ols

    #tandard symbols are user defined and are maintained in table TT)G8ta"le is nota0aila"le///9. Cou use transaction #08@ to change or display standard symbols.

    $n examples of standard symbols is S0FGS fot _Cours faithfully_

    #tandard text

    #tandard texts is predifined texts that can be used in more than one form. #tandardtexts are can be created, changed and displayed using transaction #(9@.

    1he text )6 is used to classify texts.

    1o include a standard text in a form, use the )?'L;6 command*

    /* )?'L;6 OK+'

  • 8/12/2019 SA P ABAP FAQ

    67/100

    1ext id* #6>6 1ext id from #(9@-

    Language* ?

    %aragraph* ' 'entered-

    1ip* Cou can use menu )nsert31ext3#tandard to mae it easier to insert the text

    %rogram symbols

    %rogram symbols are for contents of database fields or global program symbols."hen you print the form, data from the database tables are printed isntead of thesymbols.

    )n the print program*

    1$+L#* na9.

    )n the form*

    SB?$9?$09S

    Formatting

    S#C0+(LS o formatting

    S#C0+(L7S (ffset (utput begins here. (ffset refers to formatted valueS#C0+(L8=9S Length (utput data in the specified lengthS#C0+(L8I9S #uppress initial value )f the field has been initiali5ed, nothing isoutputS#C0+(L8>9S #uppress leading 5erosS#C0+(L8!9S 'ompress blan spaces 'onsecutice spaces are compressed intoa single space. Leading spacesare suppressed.

    S#C0+(L8R9S 7ight align outputS#C0+(L8S9S (perators are suppressedS#C0+(L8U9S 6ictionary length 1he data length is defined by the $+$% dictionaryS#C0+(L8%Q9S 6ecimal format. Length E decimals :

    S:te6t

  • 8/12/2019 SA P ABAP FAQ

    68/100

    /* 6F)?/* $667##....?6$667##/* %7(1'1.....?6%7(1'1

    /* ?"%$G/* )F....?6)F

    /* '$#...?6'$#

    xamples of control commands)?'L;6

    )?'L;6 name 2parameter3

    %arameters*

    (+U'1 .g. 11, 6(B; 6ocument-, 6#C# Aypertext-.)6 1ext )6 1ext )6 is a way to group texts #e transaction #(9@L$?G;$G )f the parameter is not specefied, the logon language will be used

    %$7$G7$%A 1he text to be included is formatted using the style allocated. 1he%$7$G7$%A parameter can be used to redefine the standard paragraph for thisstyle for the current call. $ll 4paragraphs in the included text will then be formattedusing the paragraph specified here.

    -%7ect

    &+anguageParagrap$Standard texts are maintained in transaction S-.%

    E6a&ple

  • 8/12/2019 SA P ABAP FAQ

    69/100

    $667##?667##

    1he $667##?6$667## command formats addresses according to the postalnorms of the recipient&s country, as defined in thecountry parameter.

    /* $667## 6L)>7C %$7$G7$%A $6/* ?$0 SB?$9?$0S/* #171 SB?$9#17$#S/* %(#1'(6 SB?$9%#1LOS/* ')1C SB?$9(71@9S/* '(;?17C SB?$9L$?69S/* F7(0'(;?17C &6&/* ?6$667##

    i$e Date an! !eci$al "or$at

    xamples*

    /* #1 1)0 0$#B &AA*00&/* #1 6$1 0$#B &66.0000.CCCC&/* #1 '(;?17C &;#$&

    Frames, lines and s$ading

    B-8

    6raws a box

    S.nta6$

    /* +( 2xpos3 2ypos3 2width3 2height3 2frame3 2intensity3

    1he intensity is the grey scale of the box as T. 1he frame parameters is thethicness of the frame. 6efault is @.ach of the paramteters ypos, xpos, width, height and frame muts be followed of themeasurement unit*

    TWtwip-PTpoint-

    INinch-MMmillimeter-!Mcentimeter-LN line-!5 character-.

    xamples*

  • 8/12/2019 SA P ABAP FAQ

    70/100

    /* +( %(# &99.:9& 00 C%(# &=.89& 00 A)GA1 &9@& 00 ")61A &:@& 00)?1?#)1C 9@ F7$0 @ 1"

    /* +( F7$0 9@ 1"6raws a frame around the current window with a frame thicness of 9@ 1" @.=%1-.

    /* +( )?1?#)1C 9@Fills the window bacground with shading having a gray scale of 9@ T.

    /* +( A)GA1 @ 1" F7$0 9@ 1"6raws a hori5ontal line across the complete top edge of the window.

    /* +( ")61A @ 1" F7$0 9@ 1"6raws a vertical line along the complete height of the left hand edge of the window.

    /* +( ")61A &9V.=& '0 A)GA1 9 '0 F7$0 9@ 1" )?1?#)1C 9=

    /* +( ")61A &9V.=& '0 A)GA1 &98.=& '0 F7$0 9@ 1"/* +( %(# &9@.@& '0 ")61A @ 1" A)GA1 &98.=& '0 F7$0 9@ 1"/* +( %(# &98.=& '0 ")61A @ 1" A)GA1 &98.=& '0 F7$0 9@ 1"

    6raws two rectangles and two lines to construct a table of three columns with ahighlighted heading section.

    P-S,,-+ an! S,9)

    Cou can use the %(#)1)(? and #)O commands to set default parmeters for a box.1his can be usefull if you have several boxes that share the same parameters.

    xample*

    /* %(#)1)(? (7)G)? &99.:9& C(7)G)? &=.89& 00/* #)O A)GA1 &:& 00 ")61A &VI& 00/* +( F7$0 9@ 1" )?1?#)1C 9@

    )f you want to set the position realtively to the window use %(#)1)(? ")?6(" toset the position to the top/left start of the window. 1hen use %(#)1)(? to set thecurrent position relatively to the start of the "indow. ?ote thatyou uses _Z_ or __ in the (7)G)? position to the set the position relatively.

    /* %(#)1)(? ")?6("/* %(#)1)(? (7)G)? &Z=& 00 C(7)G)? &Z9@& 00

    the position is now = 00 from the left and 9@ 00 from the top of the window.

    ?(1* $fter using the position command you can move the current position realtivelyto the last used position

  • 8/12/2019 SA P ABAP FAQ

    71/100

  • 8/12/2019 SA P ABAP FAQ

    72/100

    )0%(71$?1* 1he structure itcsy must be used for the parameters.

    7%(71 OKA?7)BFK#'7)%1KF(70 .tables scustom.form getKname tables inKtab structure itcsy

    outKtab structure itcsy.

    read table inKtab index 9.

    select single 4 from scustomwhere id inKtabvalue.

    if sysubrc @.read table outKtab index 9.move scustomname to outKtabvalue.

    modify outKtab index sytabix.else.read table outKtab index 9.move &?o name& to outKtabvalue.modify outKtab index sytabix.endif.

    44 Cou could also fill the ouput parameter table this way7$6 1$+L outKpar ")1A BC &?$09&.outKparvalue lKname9.

    0(6)FC outKpar )?6 sytabix.

    endform.

    ?ote that if you use more than one parameter you must use ;sing or 'hangingbefore every parameter Y

    /* %7F(70 2form3 )? %7(G7$0 2prog3/* ;#)?G S)?>$79S/* ;#)?G S)?>$7:S......

    /* 'A$?G)?G S(;1>$79S/* 'A$?G)?G S(;1>$7:S....../* ?6%7F(70

    3% Structure of a print program

  • 8/12/2019 SA P ABAP FAQ

    73/100

    1he print program is used to print forms. 1he program retieves the necesary datafrom datbase tables, defines the order of in which text elements are printed, choosesa form for printing and selects an output device and print options.

    (pen form printing 0ust be called before woring with any of the other formfunction modules.

    call f(nction :OPEN?@ORM:%%%%%0ust be ended with function module 'L(# F(70

    41o begin several indentical forms containing different data within a single spoolre!uest, begin each form using #1$71KF(70, and end it using ?6KF(70call f(ntion :START?@ORM:%%%%%

    "rite text elements to a window of the formcall f(nction :WRITE?@ORM:%%%%%

    nds form

    call f(ntion :EN)?@ORM:%%%%%

    'loses form printingcall f(nction :!LOSE?@ORM:%...

    xamples of function calls

    -P)+ F-R'

    '$LL F;?'1)(? &(%?KF(70&

    %(71)?G4 $%%L)'$1)(? &1&4 $7'A)>K)?6 4 $7'A)>K%$7$0# 6>)' &%7)?17&6)$L(G &&4 F(70 & &4 L$?G;$G #CL$?G;(%1)(?# (%1)(?#

    4 0$)LK#?67 4 0$)LK7')%)?1

    4 0$)LK$%%LK(+U'1 4 7$"K6$1$K)?17F$' &4&)0%(71)?G4 L$?G;$G 4 ?"K$7'A)>K%$7$0# 4 7#;L1 '%1)(?#'$?'L6 96>)' :

  • 8/12/2019 SA P ABAP FAQ

    74/100

    F(70 8(%1)(?# K77(7 V

    )?>$L)6KF$K?;0+7 E0(7K%$7$0#K?66K)?K+$1'A J(1A7# [email protected]'

    '$LL F;?'1)(? $71KF(70&%(71)?G4 $7'A)>K)?6 F(70 &0CKF(70&

    4 L$?G;$G & &

    4 #1$71%$G & &4 %7(G7$0 & &0$)LK$%%LK(+U'1 )0%(71)?G4 L$?G;$G '%1)(?#F(70 9F(70$1 :;??66 8;?(%?6 #'7? statements control screen flow.

    W,at are field and c,ain state&ents /- 1he F)L6 and 'A$)? flow logic statements let you program your own field

    checs. F)L6 and 'A$)? tell the system which fields you are checing,andwhether the system should perform checs in the flow logic or call an $+$%/ #'7? 1( #'7? @. #ometimes we might want tolet an user call a popup screen from the main application screen to let them entersecondary information. $fter they have completed their entries, the users should beable to close the popup and return directly to the place where they left off in the mainscreen. Aere comes '$LL #'7? into picture. 1his statement lets us insert such ase!uence into the current one.

    !an e specif. t,e ne6t3screen n(&"er it, a 0aria"le% 8 Yes ' No 9%Ces.

    T,e field SY3)YNNR refers to ????????????????%?umber of the current screen.

    W,at is a dialog &od(le /$ dialog module is a callable se!uence of screens that does not belong to aparticular transaction. 6ialog modules have their own module pools, and can becalled by any transaction.

    T,e s.nta6 (sed to call a screen as a dialog "o6 8 pop(p 9 is

    ?????????????????%'$LL #'7? 2screen number3#1$71)?G $1 2start column3 2start line3?6)?G $1 2end column3 2end line3 .

    W,at is a call &ode /)n the $+$%/< world, each stacable se!uence of screens is a _call mode_. 1his isimportant because of the way you return from a given current se!uence. 1oterminate a call mode and return to a suspended chain, set the _next screen_ to @and leave to it*

    L$> 1( #'7? @ or #1 #'7? @ and L$> #'7? -. "henyou return to the suspended chain, execution resumes with the statement

    directly following the original '$LL #'7? statement. 1he originalse!uence of screens in a transaction is itself is acalling mode. )f you L$> 1( #'7? @ in this se!uence that is, withouthaving staced any additional call modes -, you return from the transactionaltogether.

    T,e &a6i&(& n(&"er of calling &odes stacked at one ti&e is ??????%?ine.

  • 8/12/2019 SA P ABAP FAQ

    82/100

    W,at is L2W or )ata"ase L2W or )ata"ase Transaction /$ [L;"\ logical unit of wor - is the span of time during which any databaseupdates must be performed in an [all or nothing\ manner. ither they are allperformed committed - , or they are all thrown away rolled bac -. )n the $+$%/ #'7?without a #1 #'7? before it, the current screen process will be terminated andbranch directly to the screen specified as the default nextscreen in the screenattributes.

    W,at is significance of t,e screen n(&"er JK /)n _calling mode_, the special screen number @ L$> 1( #'7? @- causes thesystem to jump bac to the previous call level. 1hat is, if you have called a screense!uence with '$LL #'7? leaving to screen @ terminates the se!uence and

    returns to the calling screen. )f you have not called a screen se!uence, L$> 1(#'7? @ terminates the transaction.

    W,at does t,e co&&and JS2PPRESS )IALOGK do /#uppressing of entire screens is possible with this command. 1his command allowsus to perform screen processing [in the bacground\. #uppresing screens is usefulwhen we are branching to listmode from a transaction dialog step.

    W,at is t,e significance of t,e &e&or. ta"le JS!REENK /$t runtime, attributes for each screen field are stored in the memory table called]#'7?. "e need not declare this table in our program. 1he system maintainsthe table for us internally and updates it with every screen change.

    W,at are t,e fields in t,e &e&or. ta"le JS!REENK / ?ame Length 6escription

    W,. gro(ping of fields is re1(ired / W,at is t,e &a6i&(& n(&"er of&odification gro(ps for eac, field / )f the same attributes need to be changed for several fields at the same timethese fields can be grouped together. "e can specify up to four modification groupsfor each field.

  • 8/12/2019 SA P ABAP FAQ

    83/100

    W,at is a screen gro(p / 5o it is (sef(l /#creen group is a field in the #creen $ttributes of a screen. Aere we can define astring of up to four characters which is available at the screen runtime in the #C6?G7 field. 7ather than maintaining field selection separately for each screen of a

    program, we can combine logically associated screens together in a screen group.

    W,at is a S("screen / 5o can e (se a S("screen /$ subscreen is an independent screen that is displayed in an area of another_main_- screen. 1o use a subscreen we must call it in the flow logic both %+( and%$) - of the main screen. 1he '$LL #;+#'7? statement tells the system toexecute the %+( and %$) events for the subscreen as part of the %+( or %$) eventsof the main screen. 1he flow logic of your main program should loo as follows*%7('## +F(7 (;%1%;1.'$LL #;+#'7? 2area3 )?'L;6)?G &2program3& &2screen3&.%7('## $F17 )?%;1.'$LL #;+#'7? 2area3.

    $rea is the name of the subscreen area you defined in your main screen. 1his namecan have up to ten characters. %rogram is the name of the program to which thesubscreen belongs and screen is the subscreen&s number.

    W,at are t,e restrictions on S("screens /

    #ubscreens have several restrictions. 1hey cannot*#et their own G;) statusAave a named (B code'all another screen'ontain an $1 )1'(00$?6 module#upport positioning of the cursor

    5o can e (se ' displa. ta"le data in a screen /$+$%/< offers two mechanisms for displaying and using table data in a screen.1hese mechanisms are 1$+L '(?17(L# and #1% L((%#.

    W,at are t,e differences "eteen TABLE !ONTROLS and STEP LOOPS / 1$+L '(?17(L# are simply enhanced #1% L((%# that display data withthe loo and feel of a table widget in a destop application. +ut from a programmingstandpoint, 1$+L '(?17(L# and #1% L((%# are almost exactly the same.(ne major difference between #1% L((%# and 1$+L '(?17(L# is in #1%L((%# their table rows can span more than one line on the screen. +y contrast the

    rows in a 1$+L '(?17(L# are always single lines, but can be very long. 1ablecontrol rows are scrollable -. 1he structure of table controls is different from steploops. $ step loop, as a screen object, is simply a series of field rows that appear asa repeating bloc. $ table control, as a screen object consists of * i - table fields displayed in the screen - ii - a control structure that governs the table display andwhat the user can do with it.

  • 8/12/2019 SA P ABAP FAQ

    84/100

    W,. do e need to code a LOOP state&ent in "ot, t,e PBO and PAI e0ents foreac, ta"le in t,e screen /"e need to code a L((% statement in both %+( and %$) events for each table inthe screen. 1his is because the L((% statement causes the screen fields to becopied bac and forth between the $+$%/< program and the screen field. For thisreason, at least an emp