Sie sind auf Seite 1von 102

1 ABAP FAQs on Reports / Scripts / BDC / Dialogs ABAP Reporting SAP TERMINOLO !

Master "ata is 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 general information such as the vendors name and address, but also specific information, such as payment terms and delivery instructions. Generally for end users, master data is reference data that you ill loo! up and use, but not create or change. Transactional "ata is data related to a single business event such as a purchase re"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 the system. #henever you complete a transaction in $%&, that is, hen you create, change, or print a document in $%&, this document number appears at the bottom of the screen. #or$%lo& % routing tool in $%& that forwards documents for review or approval. For example, a re"uisition that needs to be approved is sent to the appropriate approver's inbox. #or!flo is also used to route journal vouchers, credit card charges, and other documents in $%&. Cost 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! ,rea!do n $tructure. /lement -see below for definition.. Cost Center) General or operating Cost Objects are !no n in $%& as (ost (enters. (ost (enters are budgeted on the fiscal year* Internal Or"er) % non0sponsored (ost )bject -for example, funding from the 1*2 &rovost. used to track costs over periods other than fiscal years. *nternal )rders are often created to trac! gifts or endo ments at 1*2. #BS Ele+ent) #,$ /lements are funded by outside sponsors and are used to trac! costs of a particular research project over the entire span of its activity. 2hey may also be created to trac! other sponsored activities, such as gifts. /L Acco,nt)

3 G/L accounts are also called (ost /lements in $%&. 2hey are a classification by expense or revenue type. *n the () -(ontrolling. module of $%&, the term (ost /lement is used. *n the F* -Financial. module, the term G/L %ccount is used. 2hese terms are used interchangeably for reporting, re"uisitions, and journal vouchers. Data'ase ta'les an" open SQL Add a single record to a database table insert into 4database table5 values 4 or! area5 Inserting all lines from an internal table into a database table insert 4database table5 from table 4internal table5 !elete all records $elect 6 from 7mellemtab. delete 7mellemtab. endselect. !eleting records using records from an internal table delete employees from table itab. Q-A BASIS LA!ER #.at are t.e central inter%aces o% t.e R// s0ste+ 1 0 &resentation interface 8atabase interface )perating system interface #.ic. inter%ace controls &.at is s.o&n on t.e p*c* 1 &resentation interface #.ic. inter%ace con2erts SQL re3,ire+ents in t.e SAP "e2elop+ent s0ste+ to t.ose o% t.e "ata'ase 1 8atabase interface #.at is SAP "ispatc.er 1 0 $%& dispatcher is the control agent hich manages the

9 resources for the :/9 applications. #.at are t.e %,nctions o% "ispatc.er 1 0 "#ual distribution of transaction load to the work processes $anagement of buffer areas in main memory *ntegration of the presentation levels )rgani7ation of communication activies #.at is a &or$ process 1 0 % or! process is here individual dialog steps are actually processed and the or! is done. /ach or! process handles one type of re"uest. Na+e 1. 3. 9. <. =. 2ario,s &or$ processes o% R// s0ste+ 1 8ialog or )nline - processes only one re"uest at a time . ,ac!ground - started at a specified time . ;pdate - primary or secondary . /n"ue- loc! mechanism . $pool - generated online or during bac! ground processing For printing .

#.at are t.e t0pes o% 4p"ate re3,ests 1 0 %n update re"uest can be divided into one primary %&'( and several )econdary update components %&*(. 2ime0critical operations are placed in >1 component and those hose timing are less critical are placed in >3 components. *f a >1 update fails, >3 components ill not be processed. #.at are t.e roll an" page areas 1 0 :oll and page areas are )A+ ,-. buffers used to store user contexts - process re"uests . . 2he $%& dispatcher assigns process re"uests to or! processes as they are received. *f the or! process is unavailable the process re"uests are "ueued in the roll and page areas. &aging area holds data from the application programs. :oll area holds data from previous dialog steps and data that characteri7es user. #.at is a Spool re3,est 1 0 $pool re"uests are generated during dialog or background processing and placed in the spool database ith information about the printer and print format. 2he actual data is placed in the 2em $e -2emporary $e"uential objects.. #.at are t.e "i%%erent "ata'ase integrities 1 - $emantic integrity 0 :elational integrity 5 &rimary !ey integrity 5 >alue set integrity 5 Foreign !ey integrity and 0 )perational integrity.

<

DATA DICTIONAR! * T0pe o% a ta'le or str,ct,re 2he table type determines ho the logical table description defined in the %,%&/< 8ictionary is reproduced on the database. 2here are the follo ing table types+ o transparent table o structure o append structure For internal purposes, such as storing control data or update texts, there are in addition the follo ing table types+ o pooled table o cluster table o generated vie structure Transparent ta'le 2here is a physical table on the database for each transparent table. 2he names of the physical tables and the logical table definition in the %,%&/< 8ictionary 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 bet een programs or bet een screens and programs. Appen" str,ct,re %n append structure defines a set of fields hich belong to another table or structure but hich are treated in the correction administration as its o n object. %ppend structures are used to support modifications. Poole" 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 be combined to form a table pool. 2he table pool corresponds to a physical table on the database in hich all the records of the allocated pooled tables are stored. Cl,ster ta'le (luster tables contain continuous text, for example, documentation. $everal cluster tables can be combined to form a table cluster. $everal

= logical lines of different tables are combined to form a physical record in this table type. 2his permits object0by0object storage or object0by0object access. *n order to combine tables in clusters, at least parts of the !eys must agree. $everal cluster tables are stored in one corresponding table on the database. enerate" 2ie& str,ct,re *n activation a structure is generated for a vie . 2his structure serves as interface for the runtime environment. *t does not generally appear in the %,%&/< 8ictionary. #.at is a Data Class1 2he 8ata class determines in hich tablespace the table is stored hen it is created in the database. #.at is a Si6e Categor01 2he $i7e category describes the probable space re"uirement of the table in the database. 7o& Man0 t0pes o% si6e categories an" "ata classes are t.ere1 2here are five si7e categories -@0<. and 11 data classes, only three of hich are appropriate for application tables+ 0 %&&L@ 0 1aster data -data fre"uently accessed but rarely updated. 0 %&&L1 0 2ransaction data -data that is changed fre"unetly. 0 %&&L3 0 )rganisational data -customi7ing data that is entered hen system is configured and then rarely changed. #.at are control ta'les1 2he values specified for the si7e category and data class are mapped to database0specific values via control tables. #.at is t.e %,nction o% t.e transport s0ste+ an" &or$'enc. organiser1 2he function of the transport system and the #or!bench )rgani7er is to manage any changes made to objects of the %,%&/< 8evelopment #or!bench and to transport these changes bet een different $%& systems. #.at is a ta'le pool1 % table pool -or pool. is used to combine several logical tables in the %,%&/< 8ictionary. 2he definition of a pool consists of at least t o !ey fields and a long argument field ->%:8%2%.. #.at are poole" ta'les1 2hese are logical tables hich must be assigned to a table pool hen they are defined. &ooled tables can be used to store control data -such as screen se"uences or program parameters..

A #.at is a ta'le cl,ster1 % table cluster combines several logical tables in the %,%&/< 8ictionary. $everal logical ro s from different cluster tables are brought together in a single physical record. 2he records from the cluster tables assigned to a cluster are thus stored in a single common table in the database. #.ic. o'(ects are in"epen"ent transport o'(ects1 8omains, 8ata elements, 2ables, 2echnical settings for tables, $econdary indexes for transparent tables, $tructures, >ie s, 1atchcode objects, 1atchcode *8s, Loc! objects. #.at are t.e Data t0pes o% t.e e8ternal la0er1 %((&, (B%:, (L?2, (;CD,(;::, 8%2$, 8/(, FL2&, *?21,*?23, *?2<, L%?G, L(B:,L:%#, ?;1(, &:/(, E;%?,:%# ,2*1$, ;?*2, >%:(. #.at are t.e Data t0pes o% t.e ABAP/9 la0er1 &ossible %,%&/< data types+ (+ (haracter. 8+ 8ate, format DDDD1188. F+ Floating0point number in 8);,L/ &:/(*$*)? -F bytes.. *+ *nteger. ?+ ?umerical character string of arbitrary length. &+ %mount or counter field -pac!edG implementation depends on hard are platform.. $+ 2ime stamp DDDD1188BB11$$. 2+ 2ime of day BB11$$. >+ (haracter string of variable length, length is given in the first t o bytes. H+ Bexadecimal -binary. storage. 7o& can &e set t.e ta'lespaces an" e8tent si6es 1 Dou can specify the extent si7es and the tablespace -physical storage area in the database. in hich a transparent table is to be stored by setting the si7e category and data class. #.at is a "ata "ictionar0 1 8ata dictionary is a central source of data in a data management system. *ts main function is to support the .*t has details about 0 #hat data is contained I 0 #hat are the attributes of the data I 0 #hat is the relationship existing bet een the various data elements I #.at %,nctions "oes a "ata "ictionar0 per%or+ 1 *n a data management system, the principal functions performed by the data dictionary are

J 0 1anagement of data definitions 0 &rovision of information for evaluation 0 $upport for soft are development 0 $upport form documentation 0 /nsuring that the data definitions are flexible and up0to0date. A %iel" containing c,rrenc0 a+o,nts :"ata t0pe C4RR; +,st 'e assigne" to a re%erence ta'le an" a re%erence %iel"* E8plain* %s a reference table, a system table containing all the valid currencies is assigned or any other table hich contains a field ith the currency !ey format. 2his field is called as reference field. 2he assignment of the field containing currency amounts to the reference field is made at runtime. 2he value in the reference field determines the currency of the amount. #.at is t.e signi%icance o% Tec.nical settings :speci%ie" &.ile creating a ta'le in t.e "ata "ictionar0; 1 ,y specifying technical settings e can control ho database tables are created in the database.2he technical settings allo s us to 0 optimi7e storage space re"uiremnets 0 table access behaviour 0 buffering re"uired 0 changes to entries logged #.at is t.e signi%icance o% Deli2er0 Class 1 0 2he delivery class controls the degree to hich the $%& or the customer is responsible for table maintenance 0 hether $%& provides the table ith or ithout contents. 0 determines the table type. 0 determines ho the table behaves hen it is first installed, at upgrade, hen it is transported, and hen a client copy is performed. #.at is t.e +a8i+,+ n,+'er o% str,ct,res t.at can 'e incl,"e" in a ta'le or str,ct,re 0 ?ine. #.at are t.e t&o +et.o"s o% +o"i%0ing Sap stan"ar" ta'les 1 0 %ppend $tructures and 0 (ustomi7ing *ncludes. #.at is t.e "i%%erence 'et&een a S,'str,ct,re an" an Appen" Str,ct,re 1 0 *n case of a substructure, the reference originates in the table itself, in the forma of a statement .include... . - *n case of an append structure, the table itself remains unchanged and the refrence originates in the append structure.

F #.at are t.e t&o &a0s %or restricting t.e 2al,e range %or a "o+ain 1 0 ,y specifying fixed values. 0 ,y stipulating a value table. #.at is a Matc. Co"e 1 1atch (ode is a tool to help us to search for data records in the system. 1atch codes are an efficient and user0friendly search aid here !ey of a record is un!no n. #.at are t.e t&o le2els in "e%ining a Matc. Co"e 1 0 1atch (ode object 0 1atch (ode *d. #.at is t.e +a8i+,+ n,+'er o% +atc. co"e I"<s t.at can 'e "e%ine" %or one Matc. co"e o'(ect 1 0 9A. % match code *d is a one character *8 hich can be a letter or a number. Can &e "e%ine o,r o&n Matc. Co"e ID<s %or SAP Matc.co"es 1 Des, the numbers @ to K are reserved for us to create our o n 1atch (ode *8s for a $%& defined 1atchcode object. #.at is an 4p"ate t0pe &it. re%erence to a Matc. co"e ID1 *f the data in one of the base tables of a matchcode *8 changes, the matchcode data has to be updated. 2he update type stipulates hen the matchcode is to be updated and ho it is to be done. 2he update type also specifies hich method is to be used for ,uilding matchcodes . Dou must specify the update type hen you define a matchcode *8. #.at are con2ersion ro,tines 1 - ?on standard conversions from display format to sap internal format and vice0 versa are implemented ith so called conversion routines. Aggregate" O'(ects >ie s, matchcodes, and loc! objects are also called aggregate objects because they are formed from several related tables. #.at is a =ie& 1 0 % vie is a logical vie on one or more tables. % vie on one or more tables i.e, the data from a vie is not actually physically stored instead being derived from one or more tables. % vie can be used to summari7e data hich is distributed among several tables 7o& +an0 t0pes o% =ie&s are t.ere 1 Data'ase =ie& :SE>>; 8atabase vie s are implement an inner join, that is, only records of the primary table -selected via the join operation. for hich the corresponding records of the secondary tables also exist are fetched. *nconsistencies bet een primary and secondary table could, therefore, lead to a reduced selection set.

K *n database vie s, the join conditions can be formulated using e"uality relationships bet een any base fields. *n the other types of vie , they must be ta!en from existing foreign !eys. 2hat is, tables can only be collected in a maintenance or help vie if they are lin!ed to one another via foreign !eys. 7elp =ie& : SE?9; Belp vie s are used to output additional information hen the online help system is called. #hen the F< button is pressed for a screen field, a chec! is first made on hether a matchcode is defined for this field. *f this is not the case, the help vie is displayed in hich the chec! table of the field is the primary table. 2hus, for each table no more than one help vie can be created, that is, a table can only be primary table in at most one help vie . Pro(ection =ie& &rojection vie s are used to suppress or mas! certain fields in a table -projection., thus minimi7ing the number of interfaces. 2his means that only the data that is actually re"uired is exchanged hen the database is accessed. % projection vie can dra upon only one table. $election conditions cannot be specified for projection vie s. Maintenance =ie& - SE?9 ; 1aintenance vie s enable a business0oriented approach to loo!ing at data, hile at the same time, ma!ing it possible to maintain the data involved. 8ata from several tables can be summari7ed in a maintenance vie and maintained collectively via this vie . 2hat is, the data is entered via the vie and then distributed to the underlying tables by the system. #.at is Loc$ing 1 #hen t o users simultaneously attempt to access the same data record, this is synchronised by a loc! mechanism. #hen dialog transactions are programmed, loc!s are set and released by calling certain function modules. 2hese function modules are generated automatically from the definition of so0called loc! objects in the %,%&/< 8ictionary. 2o synchroni7e the access to a table by setting and removing loc!s, a Loc! object has to be defined in the %,%&/< 8ictionary. %ctivating the loc! object automatically creates function modules for setting and removing loc!s. 2hese function modules must be included hen programming interactive transactions. /ock $echanism 2o set loc!s, a loc! object must be defined in the %,%&/< 8ictionary. *n this loc! object, those tables in hich data records are to be loc!ed by calling a loc! are determined. %ll tables included in a loc! object must be connected to each other via foreign !eys. 2he !ey fields of the tables in a loc! object form the Loc! arguments for the tables. 2he loc!

1@ arguments are the basis for formulating the logical condition for identifying the records to be loc!ed. #hen activating this loc! object, t o function modules, ith the names /?E;/;/L4)bjectLname5 and 8/E;/;/L4)bjectLname5 are generated. E8a+ple ) +roblem Dou ish to prevent a user from being able to change the name of a course or the name of the professor ith responsibility for the course at a time hen another user is editing the course description - hich contains this information.. )olution 2he problem described above can be solved by defining a loc! object /L;C;:$. 2his is done by defining primary and secondary tables in the loc! object. 2able ;C;:$ is chec! table of table ;C:$,, so ;C;:$ should be selected as primary table and ;C:$, as secondary table of the loc! object. 2he Loc$ arg,+ent in this case is the field combination F%,?:, C:$?:, and $&:%$ -i.e &rimary Cey (ombination.. 2he Loc! mode $hared is to be selected here. 2his allo s several users to access the data simultaneously in display mode. 2he loc! mode in the generated function modules for setting -/?E;/;/L/L;C;:$. and releasing -8/E;/;/L/L;C;:$. loc!s is therefore set to shared as default, but can be overridden by calling the function modules. *f the function module /?E;/;/L/L;C;:$ is called ith F%,?: M '1' and C:$?: M '9', the record for course 9 in faculty 1 is loc!ed in table ;C;:$. Furthermore, all the course descriptions for this course are loc!ed in table ;C:$, since field $&:%$ as not specified hen the function module as called. *n such cases, the loc! is made generically for a field hich is not defined. *f the function module 8/E;/;/L/L;C;:$ is no called ith F%,?: M '1', C:$?: M '9' and $&:%$ M '8', the German course description is unloc!ed. %ll other course descriptions remain loc!ed. #.at is "ata'ase ,tilit0 1 8atabase utility is the interface bet een the %,%&/< 8ictionary and the underlying the $%& system.2he database utility is the interface bet een the %,%&/< 8ictionary and the relational database underlying the $%& system. Dou can call the database utility from the initial screen of the %,%&/< 8ictionary ith ;tilities N 8atabase utility. 2he database utility allo s you to create, delete and convert objects from the %,%&/< 8ictionary in the database.

11 MOD4LARI@ATION #.at is Mo",lari6ation an" its 'ene%its1 *f the program contains the same or similar bloc!s of statements or it is re"uired to process the same function several times, e can avoid redundancy by using modulari7ation techni"ues. ,y modulari7ing the %,%&/< programs e ma!e them easy to read and improve their structure. 1odulari7ed programs are also easier to maintain and to update. 7o& can &e create calla'le +o",les o% progra+ co"e &it.in one ABAP/9 Progra+1 %. ,y defining macros. ,. ,y creating include programs in the library. #.at are s,'ro,tines1 $ubroutines are program modules ithin the same program. hich can be called from other %,%&/< programs or

#.at are t.e t0pes o% S,'ro,tines1 %. *nternal $ubroutines+ 2he source code of the internal subroutines ill be in the same %,%&/< program as the calling procedure -internal call.. ,. /xternal $ubroutines+ 2he source code of the external subroutines ill be in an %,%&/< program other than the calling procedure. #.at are t.e "i%%erent t0pes o% para+eters1 Formal parameters+ &arameters hich are defined during the definition of subroutine ith the F):1 statement. %ctual parameters+ &arameters the &/:F):1 statement. hich are specified during the call of a subroutine ith

7o& can one "isting,is. 'et&een "i%%erent $in"s o% para+eters1 %. *nput parameters are used to pass data to subroutines. ,. )utput parameters are used to pass data from subroutines. #.at are t.e "i%%erent +et.o"s o% passing "ata1 %. (alling by reference+ 8uring a subroutine call, only the address of the actual parameter is transferred to the formal parameters. 2he formal parameter has no memory of its o n, and e or! ith the field of the calling program ithin the subroutine. *f e change the formal parameter, the field contents in the calling program also change. ,. (alling by value+ 8uring a subroutine call, the formal parameters are created as copies of the actual parameters. 2he formal parameters have memory of their o n. (hanges to the formal parameters have no effect on the actual parameters. (. (alling by value and result+ 8uring a subroutine call, the formal parameters are created as copies of the actual parameters. 2he formal parameters have their o n

13 memory space. (hanges to the formal parameters are copied to the actual parameters at the end of the subroutine. 0he method by which internal tables are passed is 1y ,eference. #.at is t.e "i%%erence 'et&een t.e %,nction +o",le an" a nor+al ABAP/9 s,'ro,tine1 *n contrast to normal subroutines function modules have uni"uely defined interface. $ub routines do not return values. $ub routines do not return exceptions. $ub routines cannot be tested independently. 8eclaring data as common parts is not possible for function modules. Function modules are stored in a central library. #.at is a %,nction gro,p1 % function group is a collection of logically related modules that share global data ith each other. %ll the modules in the group are included in the same main program. #hen an %,%&/< program contains a (%LL F;?(2*)? statement, the system loads the entire function group in ith the program code at runtime. /very function module belongs to a function group. #.at is t.e "i%%erence 'et&een internal ta'les an" e8tract "atasets1 %. 2he lines of an internal table al ays have the same structure. ,y using extract datasets, you can handle groups of data ith different structure and get statistical figures from the grouped data. ,. Dou have to define the structure of the internal table at the begining. Dou need not define the structure of the extract dataset. (. *n contrast to internal tables, the system partly compresses extract datasets hen storing them. 2his reduces the storage space re"uired. 8. *nternal tables re"uire special or! area for interface hereas extract datasets do not need a special or! area for interface. LO ICAL DATABASE* #.at are logical "ata'ases1 #.at are t.e a"2antages/"isa"2antages o% logical "ata'ases1 %ns +0 % Logical 8atabase is a hierarchical structure of tables. ;se the G/2 statement to process Logical 8atabases. - L8, consists of logically related tables grouped together O used for reading and processing data. - %dvantages M 1. ?o need of programming for retrieval , meaning for data selection 3. /asy to use standard user interface, have chec! completeness of user input. 8isadvantages M 1. Fast in case of lesser no. of tables ,ut if the table is in the lo est level of hierarchy, all upper level tables should be read so performance is slo er.

19 Preparation o% t.e "ata recor"s '0 t.e L*D*B an" rea"ing o% t.e "ata recor"s in t.e act,al report are acco+plis.e" &it. t.e co++an" pair* 0 &ut and Get. T.e t.ree +ain ele+ents o% LDB are 0 $tructure, $elections, 8atabase &rogram. #.at sort o% ta'les one can ,se in "esigning t.e .ierarc.0 o% a LDB 1 0 2ables hich are having Foreign !ey relations. T.e str,ct,re o% Logical Data'ases rel%ects t.e AAAAAAAAAAAAAAAA "epen"encies o% .ierarc.ical ta'les in t.e SAP S0ste+* 5 Foreign !ey I% 0o, &ant to i+pro2e t.e response ti+e : ti+e to access "ata ; Logical DataBases per+its 0o, to ac.ie2e t.is ,sing AAAAAAAAAAAAAA 0 >*/#$. #.at are t.e a"2antages o% Logical DataBases 1 *t offers an easy0to0use selection screen. Dou can modify the pre0generated selection screen to your needs. *t offers chec! functions to chec! hether user input is complete, correct, and plausible. *t offers reasonable data selections. *t contains central authori7ation chec!s for database accesses. /nhancements such as improved performance immediately apply to all report programs that use the logical database. Report FORMATTIN In or"er to s,ppress t.e lea"ing 6eros o% a n,+'er %iel" t.e $e0&or"s ,se" are ) ?)0P/:). T.e Co++an" t.at allo&s %or 2ertical align+ent o% %iel"s one 'elo& t.e ot.er* ;?8/:. In or"er to concatenate strings onl0 %or o,tp,t p,rposes t.e co++an" AAAAAAAAA can 'e ,se" in con(,nction &it. t.e <#rite< state+ent* ?)0G%&. Data can 'e +o2e" %ro+ one %iel" to anot.er ,sing a <#rite)< State+ent an" store" in t.e "esire" %or+at* 2:;/. #rite + 8ateL1 to 8ateL3 format 88/11/DD. In or"er to .a2e 'ol"%ace" te8t as o,tp,t t.e co++an" ,se" is #rite + 4f5 *?2/?$*F*/8. Bac$gro,n" an" %oregro,n" colors can 'e interc.ange" ,sing t.e co++an" Format inverse.

1< #.ic. "atat0pe cannot 'e ,se" to "e%ine para+eters* 2ype F. For eac. ne& e2entB t.e s0ste+ resets all %or+atting options to t.eir "e%a,lt 2al,es* 2:;/. T.e processing 'loc$ %ollo&ing END5OF5PA E is processe" onl0 i% 0o, reser2e lines %or t.e %ooter in t.e LINE5CO4NT option o% t.e REPORT state+ent* To e8ec,te a page 'rea$ ,n"er t.e con"ition t.at less t.an a certain n,+'er o% lines is le%t on a page is ac.ei2e" '0 AAAAAAAAAAAAAAAAAAAAAAAA* :/$/:>/ n lines. #.at is t.e li+it %or t.e lengt. o% a page i% t.e page lengt. is not speci%ie" in t.e report state+ent* A@,@@@ Lines. 7o& can S0+'ols or R// icons 'e o,tp,t on t.e screen1 #:*2/ 4symbol0name5 %$ $D1,)L. #:*2/ 4icon0name5 %$ *()?. REPORTIN 5 ENERAL

#.at are reports1 an" .o& "o 0o, set ,p reports1 % report program reads and analy7es data from one or more database tables ithout modifying the database. ;sually, the result of such a report program is in the form of a list hich is output to the screen or sent to a printer. #.at are t.e "i%%erent t0pes o% progra+s1 * *nclude &rogram 1 1odule &ool F Function 1odules $ /xternal $ubroutines 1 )nline program E2ents in Reporting 1 E8plain 1 2he follo ing events occur at runtime of a typical report program hich uses logical databases+ E2ent $e0&or" E2ent 55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555 INITIALI@ATION &oint before the selection screen is displayed #hen you start a program in hich a selection screen is defined -either in the program itself or in the lin!ed logical database program., the system normally processes this

1= selection screen first. *f you ant to execute a processing bloc! before the selection screen is processed, you can assign it to the event !ey ord *?*2*%L*P%2*)?. AT SELECTION5SCREEN user &oint after processing input on the selection screen hile the selection screen is still active 2he event !ey ord %2 $/L/(2*)?0$(://? provides you ith several possibilities to carry out processing bloc!s hile the system is processing the selection screen. START5OF5SELECTION &oint after processing the selection screen

2he event $2%:20)F0$/L/(2*)? gives you the possibility of creating a processing bloc! after processing the selection screen and before accessing database tables using a logical database. Dou can use this processing bloc!, for example, to set the values of internal fields or to rite informational statements onto the output screen. %t the $2%:20)F0$/L/(2*)? event, also all statements are processed that are not attached to an event !ey ord except those that are ritten behind a F):10/?8F):1 bloc! ET Cta'leD &oint at hich the logical database offers a line of the database table 4table5.

2he most important event for report programs ith an attached logical database is the moment at hich the logical database program has read a line from a database table -see %ccessing 8ata ;sing Logical 8atabases .. 2o start a processing bloc! at this event, use the G/2 statement as follo s+ $yntax G/2 4table5 QF*/L8$ 4list5R. %fter this statement, you can or! ith the current line of the database table 4table5. 2he data is provided in the table or! area 4table5. ET Cta'leD LATE &oint after processing all tables hich are hierarchically subordinate to the database table 4table5 in the structure of the logical database.

2o start a processing bloc! at the moment after the system has processed all database tables of a logical database that are hierarchically inferior to a specific database table, use the event !ey ord G/2 as follo s+

1A

$yntax G/2 4table5 L%2/ QF*/L8$ 4list5R. *n analogy to report programs that use only $/L/(2 statements -see table in (omparison of %ccess 1ethods ., the processing bloc! of a G/2 4table5 L%2/ statement ould appear directly before the /?8$/L/(2 statement in the $/L/(2 loop for the database table 4table5. END5OF5SELECTION &oint after processing all lines offered by the logical database.

2o define a processing bloc! after the system has read and processed all database tables of a logical database, use the !ey ord /?80)F0$/L/(2*)?. 2he follo ing events occur during the processing of the output list of a report program+ E2ent $e0&or" E2ent 55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555 TOP5OF5PA E END5OF5PA E &oint during list processing hen a ne page is started &oint during list processing hen a page is ended

2he follo ing events occur during the display of the output list of a report program+ E2ent $e0&or" E2ent 5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555 AT LINE5SELECTION AT 4SER5COMMAND &oint at hich the user selects a line &oint at hich the user presses a function !ey or enters a command in the command field. &oint at hich the user presses the function !ey ith the function code &F4n5

AT PFCnnD

#ith the selection screen, %,%&/< offers an interactive element also for report programs. Dou can define a selection screen ithout having to bother about all the details re"uired in dialog programming. 2he selection screen is al ays processed directly after a report program is started. 2he user can enter field values and selection criteria on this screen. 2he main purpose of the selection screen is to enable the user to control the database selections of the report program. *f a report program is started from another %,%&/<

1J program ith the $;,1*2 statement -see (alling :eports., the selection screen objects also serve as a data interface, #ith a selection screen defined in the report program, you can enable the user to S S assign values to variables ith the &%:%1/2/:$ statement determine selection criteria ith the $/L/(20)&2*)?$ statement

7o& "o 0o, rea" selecte" lines o% "ata'ase ta'le into an internal ta'le in pac$ages o% pre"e%ine" si6e* $/L/(2 6 F:)1 4$&FL*5 *?2) 2%,L/ 4*2%,5 PACEA E SI@E CND* here 'n< is variable. ?ame the #ILDCARD characters strings T n,+eric strings* 'U' and 'L'. hich are used for comparisions ith c.aracter

7o& to speci%0 a client %or "ata'ase ta'le processing* 2%,L/$ $&FL*. $/L/(2 6 F:)1 $&FL* (L*/?2 $&/(*F*/8 #B/:/ 1%?82 ,/2#//? '@@1' %?8 '@@9'. ... /?8$/L/(2. Acti2ation O 8uring activation, the runtime object of aggregate object or tables is created. 2he runtime object is buffered so that the application program can access it "uic!ly. :untime object has information about the follo ing objects of table 0 domain O data elements O field definition O table definition Loc$ Mec.anis+ O prevents a ne database operation being started an existing one has been correctly completed. #hen conversion is done, loc! is created automatically and released only hen conversion is successful. (learing of loc!s restart adjustment O attempt is made to continue conversion at the point of termination (ancel adjustment O loc! entry is simply deleted from table =ersion Manage+ent %,nctions F - (anceling changes O reset revised version to active version - $toring changes O active version ill be temporarily stored in version $ itching changes O s itch bet een active and revised versions Version catalog O list of all existing versions of an object - :evised version O produced hen e edit an existing object - %ctive version O produced hen e activate an object - 2emporary version O produced hen e copy the active version temporarily to the database ith store version functions

1F Bistorical versions O created hen 1. (orrection is created 3 correction is released

Ta'le B,%%ering ) Possi'le ',%%ering t0pes - full buffering O either, hole table or none of the table is located in the buffer -2ables up to 9@ !b done in client dependent fully buffered tables. - Generic buffering O generic areas of the table are fully buffered. - Generic !ey O left justified section of primary !ey of a table. - generic area O all records for hich fields of generic !ey correspond - $ingle record buffering O records actually being accessed are loaded to buffers, large records here fe records are accessed. Internal Ta'les T0pes 1 STANDARD ta'le Cey access to a standard table uses a linear search. 2his means that the time re"uired for a search is in linear relation to the number of table entries. Dou should use index operations to access standard tables. SORTED ta'le 8efines the table as one that is al ays saved correctly sorted. Cey access to a sorted table uses a binary !ey. *f the !ey is not uni"ue, the system ta!es the entry ith the lo est index. 2he runtime re"uired for !ey access is logarithmically related to the number of table entries. 7AS7ED ta'le 8efines the table as one that is managed ith an internal hash procedure Dou can only access a hashed table using the generic !ey operations or other generic operations - $):2, L))&, and so on.. /xplicit or implicit index operations -such as L))& ... F:)1 oe *?$/:2 itab ithin a L))&. are not allo ed. INDEG ta'le % table that can be accessed using an index. *ndex table is only used to specify the type of generic parameters in a F):1 or F;?(2*)?. 2hat means that you can't create a table of type *?8/H. $tandard tables and sorted tables are index tables. S0nta8 ) 8%2% itab 2D&/ table type of line type Q#*2B ;?*E;//?)?0;?*E;/ C/D 4!ey5R Q*initial si7e nR Q#*2B B/%8/: L*?/R #.at are DATA CL4STERS 1 Dou can group any complex internal data objects of an %,%&/< program together in data clusters and store them temporarily in %,%&/< memory or for longer periods in databases. Dou can store data clusters in special databases of the %,%&/< 8ictionary. 2hese databases are !no n as %,%&/< cluster databases and have a predefined

1K structure.$toring a data cluster is specific to %,%&/<. %lthough you can also access cluster databases using $EL statements, only %,%&/< statements are able to decode the structure of the stored data cluster. Descri'e t.e %,nctions o% t.e "e',gger screen* - Single step:F?; 0 ;se this option to step through the program state+ent '0 state+ent. 2his allo s you to branch into subroutines and function modules, and to execute these routines step by step as ell. )nce a subroutine or function module has been processed, control returns to the statement follo ing the (%LL F;?(2*)? or &/:F):1 statement. - E8ec,te:FH;5 ;se this option to process a program line '0 line. %ll of the statements on the current line are processed in a single step. *f you are positioned on a line that calls a subroutine and you choose "xecute, the 8ebugger processes the hole subroutine and then moves on to the line follo ing the subroutine call. 2his allo s you to jump through the statements ithin the subroutine. - Ret,rn:FI; 0 2he 8ebugger ret,rns from a routine to the point at hich control returns to the main program. ;se this option to return from a subroutine, function module, or called program to the calling program. - Contin,e:FJ;5 ;se this option to process the program up to the next dynamic or static brea!point or up to the cursor position. *f there are no more brea!points in the program and no cursor has been set, the system exits debugging mode and executes the rest of the program normally. 0 Ta'les 0 8isplay the contents of internal tables. Pro'le+)7o& to r,n a progra+ in 'ac$gro,n"1 $olution +/xecute the :eport *n the selection screen +%fter filling the screen fields press FK. % screen appears re"uesting ; to print the ,ac!ground &arameters 6/nter the output device-/g B&LV /$%&3 etc. 6*n the spool options ;nchec! &rint immedietly,;nchec! delete after output,and ne spool re"uest. &ress enter. %nother screen appears ith heading start time .; can press start immly ,then save ?o the ,ac!ground job is scheduled for the given program . 2o >ie the status of bac!ground Vob,2he transaction code is $19J. /xecute from the resulting screen .Vob overvie 005From the Vob list select ;r program and select $pool from the application toolbar )utput (ontroller +List of $pool :e"uests$elect ;r $pool re"uest and clic! 8isplay icon from the overvie screen . ; ill be displayed ith the List. (aution +$ee to that the list ith does not exceed 3== columns ,*f it exceeds the extra columns ill be truncated in ,ac!ground

3@ #.at are presentation an" application ser2ers in SAP1 % presentation server is actually a program named $apgui.exe. *t is usually installed on a users or!station. Application server is a set of executables that collectively interpret the %,%&/< programs and manage the input T output for them. In an ABAP/9 progra+ .o& "o 0o, access "ata t.at e8ists on a presentation ser2er 2/s on an application ser2er1 For presentation server use ;&L)%8 or #$L;&L)%8 function modules. For application server use )&/? 8%2%$/2, :/%8 8%2%$/2 and (L)$/ 8%2%$/2 commands. Descri'e t.e s0nta8 an" %,nction o% t.e A4T7ORIT! C7ECE co++an"1 %ns +0 %;2B):*2D O (B/(C ),V/(2 4object name5 *8 4name15 F*/L8 4f15 *8 4name35 F*/L8 4f35 W *F $D0$;,:( ?/ @. 0he A203O,I045C3"C6 checks whether a user has the appropriate authori7ation to execute a particular activity. E8plain t.e EGPORT an" IMPORT co++an"s1 7o& can 0o, pass +ore t.an one gro,p o% "ata '0 ,sing IMPORT co++an"s1 EGPORT )5 2o read data objects from an %,%& program into %,%& memory, use the follo ing statement+ $yntax /H&):2 4f15 QF:)1 4g 15R 4f 35 QF:)1 4g 35R ... 2) 1/1):D *8 4!ey5. 2his statement stores the data objects specified in the list as a cluster in memory. *f you do not use the option F:)1 4f i 5, the data object 4f i 5 is saved under its o n name. *f you use the F:)1 4g i 5 option, the data objet 4g i 5 is saved under the name 4f i 5. 2he name 4!ey5 identifies the cluster in memory. *t may be up to 93 characters long. 2he /H&):2 statement al ays completely over rites the contents of any existing data cluster ith the same name 4!ey5. IMPORT )5 2o read data objects from %,%& memory into an %,%& program, use the follo ing statement+ $yntax *1&):2 4f15 Q2) 4g 15R 4f 35 Q2) 4g 35R ... F:)1 1/1):D *8 4!ey5.

31 2his statement reads the data objects specified in the list from a cluster in memory. *f you do not use the 2) 4g i 5 option, the data object 4f i 5 in memory is assigned to the data object in the program ith the same name. *f you do use the option, the data object 4f i 5 is read from memory into the field 4g i 5. 2he name 4!ey5 identifies the cluster in memory. *t may be up to 93 characters long. Dou do not have to read all of the objects stored under a particular name 4!ey5. Dou can restrict the number of objects by specifying their names. *f the memory does not contain any objects under the name 4!ey5, $D0$;,:( is set to <. *f, on the other hand, there is a data cluster in memory ith the name 4!ey5, $D0$;,:( is al ays @, regardless of hether it contained the data object 4f i 5. *f the cluster does not contain the data object 4f i 5, the target field remains unchanged. E8plain t.e READ LINE an" MODIF! LINE co++an"s* :/%8 L*?/ +0 ;se the statements :/%8 L*?/ and :/%8 (;::/?2 L*?/ to read data from the lines of existing list levels. 2hese statements are closely connected to the B*8/ techni"ue. 1)8*FD L*?/ +0 2o modify the lines of a completed list from the 1)8*FD L*?/ statement. ithin the program, use

#.at are t.e "i%%erences 'et&een calling a progra+B transaction K&it. ret,rn an" K&it.o,t ret,rn an" .o& can eac. 'e acco+plis.e"1 &rogram 0$;,1*2 4rep5X-4field5. Q%?8 :/2;:?R Q4options5R. *f you use %?8 :/2;:?, the system stores the data of the calling executable program and returns to the calling after processing the called program. 2he system resumes executing the calling program at the statement follo ing the call. *f you omit the %?8 :/2;:? addition, all data and list levels of the calling program -the entire internal session. are deleted. %fter the called executable program has finished, control returns to the level from hich you started the calling program. 2ransaction 0(%LL 2:%?$%(2*)? 4tcod5 Q%?8 $C*& F*:$2 $(://?R Q;$*?G 4itab5R. 2his statement saves the data of the calling program, and starts transaction 4tcod5. %t the end of the transaction, the system returns to the statement follo ing the call in the calling report. 0L/%>/ 2) 2:%?$%(2*)? 4tcod5 Q%?8 $C*& F*:$2 $(://?R. 2his statement ends the calling program and starts transaction 4tcod5. 2his deletes the call stac! -internal sessions. of all previous programs. %t the end of the transaction, the system returns to the area menu from hich the original program in the call stac! as started. #.at are t.e "i%%erences 'et&een t.e para+eter SET an" ET1 SET &%:%1/2/: *8 4pid5 F*/L8 4f5. 2his statement saves the contents of field 4f5 under the *8 4pid5 in the $%& memory. 2he code 4pid5 can be up to 3@ characters long. *f there as already a value stored under

33 4pid5, this statement over rites it. *f the *8 4pid5 does not exist, double0clic! 4pid5 in the %,%& /ditor to create a ne parameter object. ET &%:%1/2/: *8 4pid5 F*/L8 4f5. 2his statement fills the value stored under the *8 4pid5 into the variable 4f5. *f the system does not find a value for 4pid5 in the $%& memory, it sets $D0$;,:( to <, other ise to @. #7AT are t.e co++an"s t.at allo& 0o, to process se3,ential %ile1 An" &.at is t.eir s0nta81 :/%8 8%2%$/2 -reading. and 2:%?$F/: - riting. )&/? 82%$/2 4dataset name5 for 4input output appending5 in 4binary text 5 mode at &)$*2*)? 4position5 1/$$%G/ 4field5 :/%8 8%2%$/2 4dataset name 5 *?2) 4field5 (L)$/ 8%2%$/2 4dataset name5 8/L/2/ 8%2%$/2 4dataset name5 2:%?$F/: 4field5 to 4dataset name5 #.at is t.e "i%%erence 'et&een opening a "ataset %or inp,tB o,tp,tB appen"ing1 F): );2&;2 )pens the file for riting if exists it is over ritten if not then it is created. F): *?&;2 )pens an existing file for reading. F): %&&/?8*?G )pens the file for riting at the end of the file .*f it does not exist, it is created, if opened, you return to the end. #.en an internal ta'le is create"B t.e settings criteria %or t.e 2al,e o% occ,rs1 2he objective of setting the value of an occurs for an internal table is a "uestion of optimi7ation. 2he follo ing facts should be ta!en into account hen ma!ing such decision. 1. 2he complete data area of a program is A<@@@ bytes. 3. 2he initial si7e declared is !ept in roll area -"uic!er access to program. 9. 8ata entered that exceeds the initial si7e stores in the roll file -$lo er access to program. Dou should also analy7e the expected volume and access rates before ma!ing the decision. De%ine LC.ec$ L state+entsB .o& it &or$s1 2o terminate a single loop pass conditionally, use the (B/(C 4condition5 statement in the statement bloc! of the loop. *f the condition is not true, any remaining statements in the current statement bloc! after the (B/(C statement are ignored, and the next loop pass starts. 4condition5 can be any logical expression.

39

E8plain Fiel" ro,p:e8tract "ataset;1 %n extract dataset consists of a se"uence of records. 2hese records may have different structures. %ll records ith the same structure form a record type. Dou must define each record type of an extract dataset as a field group, using the F*/L80G:);&$ statement. F*/L80G:);&$ 4fg5. 2his statement defines a field group 4fg5. % field group combines several fields under one name. For clarity, you should declare your field groups at the end of the declaration part of your program. % field group does not reserve storage space for the fields, but contains pointers to existing fields. #hen filling the extract dataset ith records, these pointers determine the contents of the stored records. #.at is t.e "i%%erence 'et&een Mo2e - assign state+ent1 Mo2e +0 2o assign the value of a data object 4f15 to a variable 4f35, use the follo ing statement+ 1)>/ 4f15 2) 4f35. or the e"uivalent statement 4f35 M 4f15. 2he contents of 4f15 remain unchanged. 4f15 does not have to be a variable 0 it can also be a literal, a text symbol, or a constant. Dou must al ays specify decimal points ith a period -.., regardless of the users personal settings. 1ultiple value assignments in the form 4f<5 M 4f95 M 4f35 M 4f15. Assign +0 %$$*G? 4f5 2) 4F$5. #hen you assign the data object, the system chec!s hether the technical attributes of the data object 4f5 correspond to any type specifications for the field symbol 4F$5. 2he field symbol adopts any generic attributes of 4f5 that are not contained in its o n type specification. Follo ing the assignment, it points to 4f5 in memory. 7o& "o 0o, r,n a report %or a ro& in ta'le1 ;sing Graphics 1ultiplexer. 2here is an option some thing similar to screen capture hich captures data only. ;sing that data you can dra graphs -98 and 38.. 2his option is available all the time from 1enuY 05 Generate Graphics hich captures the data then you need to drag and select the data you ant to dra a graph on. )nce you select you can clic! on Graphics, hich launches graphics multiplexer.

3< Me+or0 Manage+ent $%& memory -Global 1emory.+ 0 is available to a user during the entire duration of a terminal session. *ts contents are retained across transaction boundaries as ell as external and internal sessions. /xternal session+ 0 hen user logs on to :/9 system, the system creates a ne terminal session called external session. /.g. $ystem (reate $ession. *nternal session+ 0 created by calling a transaction - ith (%LL 2:%?$%(2*)?., a dialog module - ith (%LL 8*%L)G. or a report - ith $;,1*2 or :/2;:?.. For external session+ 0 internal sessions are allo ed. :oll area+ 0 8ata areas of used programs are created in roll areas for each internal session. &osting data bet een internal sessions+ 0 /H&):2 2) 1/1):D and *1&):2 F:)1 1/1):D. 1ain program group+ 0 (reated hen exporting an internal session. %dditional program group+ 0 *f a function module belonging to a function group not so far loaded, additional program group is created. $ubroutine call+ 0 #hen external subroutine is called, system loads the relevant program and adds it to the program group of calling program. #or! areas+ 0 ,oth table T common or!areas ith the same name are created once for each program group and then shared by all programs in the group. List system+ 0 (onsists of basic list and all details list belonging to basic list assigned to exactly one screen level. ;ser interface+ 0 )nly program has its o n user interface. *nternal sessions interface is initially empty. $pecial user interface has to be activated using $/2 &F0 $2%2;$ statement. %,%&/< memory+ 0 :etained only during the lifetime of an external session. 8ata cluster+ 0 Group of several data objects. 8ata objects+ 0 ;nits of data, hich a program processes at runtime. 7o& "o 0o, &rite a DATA o'(ect %ro+ ABAP/9 progra+ to ABAP/9 +e+or0 an" restore t.e sa+e %ro+ +e+or0 to progra+* /H&):2 4f15 QF:)1 4g15R 4f35 QF:)1 4g35R ... 2) 1/1):D *8 4!ey5. 2he *8 4!ey5, hich can be up to 93 characters long, identifies the data in memory. State+ent ,se" to "elete "ata o'(ects in ABAP/9 +e+or0* F:// 1/1):D Q*8 4!ey5R. 7o& &ill 0o, create a %ile on application ser2er )pen dataset 4dsn5 for output. ABAP/9 state+ent %or opening a %ile on application ser2er %or rea"ing AAAAAAAAAAA* )pen dataset 4dsn5 for input.

3= 7o& &ill 0o, trans%er "ata into a %ile in application ser2er 1 8ata fname-A@. value 'mDF*L/'. 8ata num type i. )pen dataset fname for output. 8o 1@ times. ?um M ?um Z 1. 2ransfer num to fname. /nddo. .....etc. Na+e t.e %,nction +o",les to &rite "ata %ro+ an Presentation Ser2er* 8)#?L)%8 and #$L8)#?L)%8. Na+e t.e %,nction +o",les to rea" "ata %ro+ Internal Ta'le* ;&L)%8 and #$L;&L)%8. Internal Ta'le to t.e

Presentation

Ser2er

into an

Na+e t.e %,nction +o",le t.at can 'e ,se" to gi2e in%or+ation a'o,t %iles on Presentation Ser2er an" a'o,t it<s Operating S0ste+* #$LE;/:D. Na+e t.e ABAP/9 $e0 &or" %or seac.ing a string in an Internal Ta'le* $/%:(B 4itab5 F): 4str5 4options5. 7o& &o,l" 0o, %in" t.e attri',tes o% a "ata t0pe or "ata o'(ect 1 8/$(:*,/ F*/L8 4f5 QL/?G2B 4l5R Q2D&/ 4t5 Q()1&)?/?2$ 4n5RR Q);2&;20L/?G2B 4o5R Q8/(*1%L$ 4d5R Q/8*2 1%$C 4m5R. #.ic. %,nction +o",le &o,l" 0o, ,se to c.ec$ t.e ,ser<s a,t.ori6ation to access %iles 'e%ore opening a %ile1 %;2B):*2DL(B/(CL8%2%$/2 Na+e t.e %,nction +o",le ,se" to con2ert logical %ile na+es to p.0sical %ile na+es in ABAP/9 progra+s* F*L/LG/2L?%1/. #.at "oes C7AIN ****END C7AIN "o1 $ometimes you ant to chec! several fields as a group. 2o do this, include the fields in a F*/L8 statement, and enclose everything in a (B%*?0/?8(B%*? bloc!. "xample 6666 $creen flo logic+ 6666 (B%*?. F*/L8+ $&FL*0(%::*8, $&FL*0()??*8.

3A 1)8;L/ (B/(CLFL*GB2. /?8(B%*?. #hen an error is found inside a chain, the screen is re0displayed, and all fields found any here in the chain are input0enabled. %ll non0chain fields remain disabled. #.at "oes an e8tract state+ent "o in t.e ABAP progra+1 Fills the fields groups ith values. #.at .appens &.en a ta'le is acti2ate" in DD1 0% table definition is generated 0 1ap to the database system 0For each table, a table of the same name ith the same fields and corresponding data type is created in database. &rimary index is generated automatically

#.at is a c.ec$ ta'le an" &.at is a 2al,e ta'le1 - #hen e define a foreign !ey in a table -%.. *f this !ey refers to primary !ey of another table -,.. 2able , is chec! table Fields referring to a domain may assume values contained in the corresponding fields of the value table. Field referring to the domain should have a foreign !ey #.at is CTS an" #.at "o 0o, $no& a'o,t it1 M CTS is Correction an" Transport S0ste+s N - (orrection system manages the internal system components li!e objects li!e only original version of the object exists. *t stores all changes made to the object. - 2ransport system allo s to transports the object from on $%& system to another -8evelopment system to &roduction system.. *t allo s to over rite or delete existing object in target system and import ne objects to target systems. 8uring development or! e start by opening a tas! -correction. to hich e can assign ne and changed objects. )nce changes have been made, transport ne or changed objects to other $%& system by means of transport -(hange. re"uest. 7a2e 0o, ,se" SAP s,pplie" progra+s to loa" +aster "ata1 - $%& supplied ,8( programs O :1@A,,*@ -&urchase re"uisitions. - :18%2*?8 -1aterial master. :F,*C:@@ ->endor 1asters. 0 :F,*8/@@ -(ustomer 1aster. :>*?>,@@ -$ales )rder. #.at are t.e Tec.ni3,es in2ol2e" in ,sing SAP s,pplie" progra+s1 Do 0o, pre%er to &rite 0o,r o&n progra+s to loa" +aster "ata1 #.01 - *dentify relevant fields - 1aintain transfer structure - &redefined O first one is al ays session record. - $ession record structure , Beader 8ata, *tem - $2D&/ O record type . - Fields in session structure O $2D&/, G:);& , 1%?82, ;$/:?%1/ , ?) 8%2%

3J Fields in header structure O consists of transaction code also O $2D&/, ,11@@, 2()8/,1%2?: and Fields in *tem 0 *2/1$ W 1aintain transfer file O sample data set creation

7o& "o 0o, set ,p 'ac$gro,n" (o's in SAP1 #.at are t.e steps1 #.at are e2ents "ri2en 'atc. (o's1 - (reate a job using function module V),0)&/? - (ollect the job specifications. - %dd a job step to the job ith the function module V),0$;,1*2. - (lose the job and pass it to ,ac!ground processing system for execution ith the function module V),0(L)$/ - />/?2 8:*>/? ,%2(B V),$ +0 - 2ypes M $ystem events O triggered hen activation of ne operation mode ta!es place ;ser events 0 2riggered from %,%&/< or external program. - 2riggering an event notifies the bac!ground processing that named condition has been reached. 2he ,ac!ground system reacts by starting any jobs that ere aiting for the event. 2ransaction codes related to bac!ground jobs creation and processing are +0 $19A-Vob creation. $19J-Vob selection and execution.. #.at are presentation an" application ser2ers in SAP1 0% presentation server is actually a program named $apgui.exe. *t is usually installed on a users or!station. 0 %pplication server is a set of executables that collectively interpret the %,%&/< programs and manage the input T output for them. In an ABAP/9 progra+ .o& "o 0o, access "ata t.at e8ists on a presentation ser2er 2/s on an application ser2er1 - For presentation server use ;&L)%8 or #$L;&L)%8 function modules. For application server use )&/? 8%2%$/2, :/%8 8%2%$/2 and (L)$/ 8%2%$/2 commands. #.at is t.e "i%%erence 'et&een S0nc.rono,s an" As0nc.rono,s ,p"ates 1 0 % program as!s the system to perform a certain tas!, and then either aits or doesn't ait for the tas! to finish. *n synchronous processing, the program aits+ control returns to the program only hen the tas! has been completed. *n asynchronous processing, the program does not ait+ the system returns control after merely logging the re"uest for execution. Trans%erring SPA/ PA Para+eters to Transactions 2o fill the input fields of a called transaction ith data from the calling program, you can use the $&%/G&% techni"ue. $&%/G&% parameters are values that the system stores in the global, user0related $%& memory. Dou use the $%& memory to transfer values bet een programs beyond the borders of transactions. % user can access the values stored

3F in the $%& memory during one terminal session for all modes used in parallel.

To fill an SPA/GPA parameter, use: $yntax $/2 &%:%1/2/: *8 4pid5 F*/L8 4f5. To read an SPA/GPA parameter into an ABAP program, use: $yntax G/2 &%:%1/2/: *8 4pid5 F*/L8 4f5. #.at is t.e "i%%erence 'et&een Co++it5#or$ an" Roll'ac$5#or$ tas$s 1 5 Co++it5#or$ statement [performs\ many functions relevant to synchroni7ed execution of tas!s. :ollbac!0#or! statement [cancels\ all re"uests relevant to synchroni7ed execution of tas!s. #.at are t.e "i%%erent "ata'ase integrities 1 - $emantic integrity 0 :elational integrity 5 &rimary !ey integrity 5 >alue set integrity 5 Foreign !ey integrity and 0 )perational integrity. #.at is SAP loc$ing 1 0 *t is a mechanism for defining and applying logical loc!s to database objects. #.at "oes a loc$ o'(ect in2ol2e 1 0 2he tables 0 2he loc! argument. #.at are t.e "i%%erent $in"s o% loc$ +o"es 1 0 $hared loc! 0 /xclusive loc! 0 /xtended exclusive list. 7o& can a loc$ o'(ect 'e calle" in t.e transaction 1 - ,y calling En3,e,e Cloc$ o'(ectD and De3,e,e Cloc$ o'(ectD in the transaction. #.at are t.e e2ents '0 &.ic. &e can progra+ O.elp te8tsP an" "ispla0 Opossi'le 2al,es listsP 1 0 &:)(/$$ )? B/L&0:/E;/$2 -&)B. 0 &:)(/$$ )? >%L;/0:/E;/$2 -&)>.. #.at are %,nction +o",les 1 T0pes o% para+eters 1 0 Function modules are general0purpose library routines that are available system0 ide.

3K 0 0 0 0 0 *n general, function module can have four types of parameters+ /H&):2*?G+ for passing data to the called function *1&):2*?G+ for receiving data returned from the function module 2%,L/$+ for passing internal tables only, by reference -that is, by address. (B%?G*?G+ for passing parameters to and from the function

7o& to sen" a report to t.e printer instea" o% "ispla0ing it on t.e screen 1 0 #e can send a report to the printer instead of displaying it on the screen. 2o do this, use the !ey ords 2) $%&0$&))L+ $;,1*2 :$FLF*?8 ... 2) $%&0$&))L 8/$2*?%2*)? 'L2=@'. 7o& can &e sen" "ata to e8ternal progra+s 1 0 ;sing $&%/G&% parameters -$%& memory. 0 ;sing /H&):2/*1&):2 data -%,%&/< memory. #.at are t.e "i%%erences 'et&een SELECT5OPTIONSB=ARIANTS AND PARAMETERS1 2o enter values for variables on the selection screen, you must define the variables using the &%:%1/2/:$ statement. 2o enter a range of values for the variables on the selection screen e use $/L/(20 )&2*)?$ statement. *f you ant to run the same report program ith the same selections at regular intervals -for example, for monthly sales statistics., *n, %,%&/< offers you combine the desired values for all these selections in one selection set. $uch a selection set is called a >%:*%?2$. #.at is SPA / PA 1 #.en "o 0o, ,se it1 2o fill the input fields of a called transaction ith data from the report, you can use the $&%/G&% techni"ue. $&%/G&% parameters are values that the system stores in the global, user0related $%& memory. Dou use the $%& memory to transfer values bet een programs. % user can access the values stored in the $%& memory during one terminal session for all modes used in parallel. ;sually, the input fields on the initial screen of a transaction are connected to $&%/G&% parameters. *f you fill these parameters from ithin your program before calling the transaction, the system fills the input fields ith the corresponding values. #.0 an" .o& "o 0o, "ispla0 a +essage1 #.at are t.e +essage t0pes1 %n %,%&/< module lets the system !no that an error has occurred by issuing information,error or arning messages. you can also use success messages hen a particular action is performed successfully. #hen the user presses /?2/:, the current process is interrupted. 2he system returns the user to the $%& main menu using %bend message. 1essage is displayed using 1/$$%G/ Hnnn, here H is the type of the message and nnn is the number of the message. Dou have to declare the *d of the message class in the program using 1/$$%G/0*8 cc, here cc is the message class.

9@

7o& an" &.ere "o !o, create Message class1 Dou can create a message class from t o places in the system+ 1. From an )bject class object list -in the )bject ,ro ser. 3. From an %,%&/< module -in the %,%&/< editor. #.at "o 0o, "e%ine in t.e Data ele+ent an" Do+ain1 8or !ata "lement 2he information includes the field's representation on the screen in the form of F*/L8 2/H2$, ()L;1? (%&2*)?$ in list outputs of the table contents and the format of the output via &%:%1/2/: *8$ and )nline field documentation. 8or !omain 8ata 2ype,Field Length and the allo ed data values are defined . #.at is t.e "i%%erence 'et&een a pool ta'le an" a transparent ta'le1 0ransparent 0able % tran table has a one to one relataionship in the database. 2he table in the dictionary has the same name, same no of fields, and the fields have the same name as in the :9 table defn. % transparent tabel has application data -1aster and 2ransaction.. +ooled 0able % pool table has +an0 to one relation ith the table in the database. For one table in the database there r many tables in the dictionary. 2ha table in the database has a diff name than in the table in the data dict, it has diff no of fields and field names are different. % pooled table is stored in the pool at the database level. % table poo is a databse table ith a special struct that enables the data of many :9 tables to be stored in it. *t can hold only pooled tables. #.at are %iel" s0+'ols an" %iel" gro,ps1 7a2e 0o, ,se" co+ponent i"8 o% str,ct,re &it. %iel" gro,ps1 % field symbol does not physically reserve space for a field, but points to a field hich is not !no n until runtime of the program. Field symbols are comparable to the concept of pointers as used in the programming language (. %n extract dataset consists of a se"uence of records. 2hese records may have different structures. %ll records ith the same structure form a record type. Dou must define each record type of an extract dataset as a field group, using the F*/L80G:);&$ statement. 1. 3. 9. <. =. #.at is t.e step '0 step process to create a ta'le in "ata "ictionar01 $electing the table fields 1aintaining foreign !eys (reating secondary indexes -optional. 1aintaining technical settings %ctivating a table

91 #.at is t.e a"2antage o% str,ct,res an" .o& "o 0o, ,se t.e+ in A'ap/9 progra+s1 % structure is defined in the %,%&/< 8ictionary li!e a table and can be accessed from %,%&/< programs. %ny change to the definition of the structure in the %,%&/< 8ictionary is automatically implemented in all programs. #hile data in tables is stored permanently in the database, structures contain data only during the runtime of a program. $tructures are used in abap/< programs to transfer data bet een programs as it is globally defined.$tructures are used in particular for defining data at the interface bet een module pools and screens and for standardi7ing parameters for function modules. #.at "oes an e8tract state+ent "o in t.e A'ap/9 progra+1 #ith the first /H2:%(2 statement of a report, the system creates the extract dataset and adds the first extract record. #ith each subse"uent /H2:%(2 statement, the system adds another extract record to the extract dataset. #.at is a collect state+ent an" .o& is it "i%%erent %ro+ t.e appen" state+ent1 2o fill an internal table ith lines hich have uni"ue standard !eys, e use the ()LL/(2 statement. *f an entry ith the same !ey already exists, the ()LL/(2 statement does not append a ne line as %&&/?8 statement, but adds the contents of the numeric fields in the or! area to the contents of the numeric fields in the existing entry. #.at is an open SQL 2s Nati2e SQL* )pen $EL allo s you to access all database tables !no n to the $%& system, regardless of the database manufacturer. $ometimes, ho ever, e may ant to use database0 specific $EL statements called ?ative $EL in your %,%&/< program. 2o avoid incompatibilities bet een different database tables and also to ma!e %,%&/< programs independent of the database system in use, $%& has created a set of separate $EL statements called )pen $EL. )pen $EL contains a subset of standard $EL statements as ell as some enhancements hich are specific to $%&. % database interface translates $%&'s )pen $EL statements into $EL commands specific to the database in use. ?ative $EL statements access the database directly. #.at "oes an EGEC SQL state+ent "o in ABAP1 #.at is t.e "isa"2antage o% ,sing it1 2o use a ?ative $EL statement, it must be preceded by an /H/( $EL statement and concluded by an /?8/H/( statement. %n %,%&/< program ith ?ative $EL statements does not generally run ith different databases. #.at are t.e e2ents ,se" in ABAP91 2he events are *?*2*%L*P%2*)? %2 $/L/(2*)?0$(://? %2 $/L/(2*)?0$(://? )? 4field5

93 $2%:20)F0$/L/(2*)? 2)&0)F0&%G/ 2)&0)F0&%G/ 8;:*?G L*?/ $/L/(2*)? /?80)F0&%G/ /?80)F0$/L/(2*)? %2 ;$/:0()11%?8 %2 L*?/0$/L/(2*)? %2 &F4??5 G/2 G/2 L%2/. %2 ;ser (ommand

#.at is an interacti2e reports 1 #.at is t.e o'2io,s "i%%erence o% s,c. reports &it. 7TML t0pe reports1 *nteractive reporting allo s the user to participate actively in retrieving and presenting data during the session. *nstead of one extensive and detailed list, ith interactive reporting you create a condensed basic list from hich the user can call detailed information by positioning the cursor and entering commands. *nteractive reporting thus reduces information retrieval to the data actually re"uired. 8etailed information is presented in secondary lists. % secondary list may either overlay the basic list completely or appear in an additional dialog indo on the same screen. 2he secondary list can itself be interactive again. %part from creating secondary lists, interactive reporting also allo s to call transactions or other reports from lists. 2hese programs then use values displayed in the list as input values. 2he user can, for example, call a transaction from ithin a list to change the database table hose data is displayed in the list. #.at .appens &.en a ta'le is acti2ate" in DD1 #hen the table is activated, a physical table definition in the database is added to the table definition stored in the %,%&/< 8ictionary. 2he database0independent table definition from the %,%&/< 8ictionary is translated into a definition of the relevant database. #.at is a c.ec$ ta'le an" #.at is a 2al,e ta'le1 2he relational data model contains not only tables, but also relationships bet een tables. 2hese relationships are defined in the %,%&/< 8ictionary by foreign !eys. %n important function of foreign !eys is to support data integrity in the relational data model. Foreign !ey fields may assume only those values allo ed by the chec! table, in other ords, values occurring in the primary !ey of the chec! table. % foreign !ey provides a lin! bet een t o tables, for eg.,21 and 23 by including a reference in table 21 to the primary !ey of table 23. For this purpose, Foreign !ey fields assigned to the primary !ey fields of 23 are included in 21. 2able 21, hich is the one being chec!ed, is called a foreign !ey table, and table 23 is called a chec! table. 2he terms dependent -foreign !ey. table and referenced -chec!. table are also used.

99 >%L;/ 2%,L/+*f the domain of the chec! field has a value table, this is proposed by the system as chec! table in the foreign field maintenance. 2he !ey fields of the value table are in this case assigned fields of the foreign !ey table ith the same domain. 2hese fields may assume only those values allo ed by the value table. 2he value range of the domain can be defined by specifying value table.%ll table fields referring to this domain can then be chec!ed against the corresponding field of this value table.*n order the chec! can be executed, a foreign !ey must be defined for the value table. #.at are +atc.co"es1 Descri'e1 % matchcode is a tool to search for data records in the system. 1atchcodes are an efficient and user0friendly search aid for cases here the !ey of a record is un!no n. *t consists of t o stages one is 1atch code object and the other is 1atchcode *8. % matchcode object describes the set of all possible search paths for a search term. 1atchcode *8 describes a special search path for a search term. #.at are ranges1 #.at are n,+'er ranges1 *t is often necessary to directly access individual records in a data structure. 2his is done using uni"ue !eys. ?umber ranges are used to assign numbers to individual database records for a commercial object, to complete the !ey. $uch numbers are e.g. order numbers or material master numbers. 7o& "o 0o, 2ali"ate t.e selection criteria o% a report1 An" .o& "o 0o, "ispla0 initial 2al,es in a selection screen1 2he selection criteria is validated in the processing bloc! of the %2 $/L/(2*)? $(://? event for the input values on the screen and respective messages can be sent. 2o display initial values in the selection screen+ ;se *?*2*%L*P%2*)? />/?2 ;se 8/F%;L2 >%L;/ option of &%:%1/2/:$ $tatement ;se $&%/G&% &arameters -&*8s.. #.at is t.e Client concept in SAP1 #.at is t.e +eaning o% Client in"epen"ent1 *n commercial, organi7ational and technical terms, the client is a self contained unit in the :9 system, ith separate set of 1aster data and its o n set of 2ables. #hen a change is made in one client all other clients are affected in the system 0 this type of objects are called (lient independent objects. #.at is Internal ta'le1 *nternal tables are table objects that only exist for the runtime of the program. 2here are several %,%& statements for or!ing ith internal tables, for example, append, insert, delete, or find lines. 2he number of lines of an internal table is extended dynamically at runtime as re"uired. Dou can use internal tables for table calculations on subsets of database tables. For example, you can read a part of one or more database tables into an internal table. 2hey also allo you to reorgani7e their contents to suit the needs of your program. Dou can, for example, read particular entries from one or more large customer tables into an

9< internal table, and then use them to create a list. #hen you run your program, you can access this data directly, instead of having to search for each record in the database. #.at is a 2ariant an" &.ere "o 0o, ,se it1 *f you ant to run a report program ith same selections at regular intervals -for example, for monthly sales statistics., you ould not ant to enter the same values each time. $o, %,%&/< offers you a possibility to combine the desired values for all these selections in one selection set. Dou can create as many different selection sets as you li!e 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 ,ac!ground &rocessing )nline, starting a report via variant saves the user or!,minimi7es input errors. *n bac!ground processing, a variant is the only possibility you have to pass values for the selections. 2o fill certain selections ith values that change according to the application, you use a variant, hich ta!es the variable values from 2able T=AR=. #.at is set para+eter an" get para+eter1 #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 a three0character code+ you can define these parameters in the object bro ser by selecting )ther objects on the first screen. 2he $&%/G&% storage is user0specific and valid throughout all the user's sessions.by using the $/2 &%:%1/2/: or G/2 &%:%1/2/: statements 2hese statements let you store and retrieve $&%/G&% values from an %,%&/< program. *f the selection screens for the t o transactions do not share the same re"uired fields, use these statements to store screen fields explicitly by name. ,efore calling the ne transaction from a &%* module, store the caller transaction's fields under one name+ $/2 &%:%1/2/: *8 ':*8' F*/L8 4F*/L8 ?%1/15. 2he system stores the value in 4field name15 in the $&% parameter ':*8'. 2he three0 character identifier ':*8' must be defined in the $%& table 2&%:%. *f the $&% parameter ':*8' already contains a value, the $/2 &%:%1/2/: statement over rites it - ith the contents of 4F*/L8 ?%1/15.. *n the &,) module for the called transaction, retrieve the fields under the other name+ G/2 &%:%12/: *8 ':*8' F*/L8 4F*/L8 ?%1/35. #.at is %iel" s0+'ol1 % field symbol does not physically reserve space for a field, but points to a field hich is not !no n until runtime of the program. $ometimes you only !no hich field you ant to process, and ho you ant to process it, at runtime.

9= For this purpose, you can create field symbols in your program. %t runtime, you can assign real fields to such field symbols. %ll operations hich you have programmed ith the field symbol are then carried out ith the assigned field. %fter successful assignment, there is no difference in %,%&/< hether you reference the field symbol or the field itself. 7o& to ,se a gri" list1 ;se Function 1odule 8isplayL6L*$2. *n ;r program .&ut all the data that ; output in its final format and then pass this internal table to the function module

ant to

0wo types of grid list . 8*$&L%DLG:*8LL*$2->ersion <.@b. 8*$&L%DL,%$*(LL*$2->ersion <.Ab. (alculate the subtotal etc and save it as a variant ,Bo ever hile printing it ill print all the enties of the fields 7o& to pass "ata %ro+ t.e %or+ to t.e S,'ro,tine progra+1 ;se structure *2($D 7o& can &e pass selection an" para+eter "ata to a report 1 5 2here are three options for passing selection and parameter data to the report. . using $;,1*2...#*2B . using a report variant . using a :%?G/ table Stan"ar" Progra+s t.at e2er0 ABAPer S.," Eno& :$%>GL@@ 2able adjustment across clients :$,8($;, :elease batch0input sessions automatically :$(L2()& (opy tables across clients :$*?(L@@ /xtended program list :$):%:/L Get the )racle :elease :$&%:%1 8isplay all instance parameters :$2H$(:& 2ransport $%&script files across systems :G;G,:@@ $ubstitution/>alidation utility :$;$:@@9 (hec! the pass ords of users $%&6 and 88*( in all clients :$;$:@@A List users last login :$2HL81( 2o Load L)G)s to application server Interacti2e Reporting *nteractive reporting allo s the user to participate actively in retrieving and presenting data during the session. *nstead of one extensive and detailed list, ith interactive reporting you create a condensed basic list from hich the user can call detailed information by positioning the cursor and entering commands. *nteractive reporting thus reduces information retrieval to the data actually re"uired.

9A

#.at are t.e e2ent $e0 &or"s in interacti2e reporting 1 E2ent $e0&or" E2ent %2 L*?/0$/L/(2*)? 1oment at hich the user selects a line by double0clic!ing on it or by positioning the cursor on it and pressing F3. %2 ;$/:0()11%?8 2)&0)F0&%G/ L*?/0$/L/(2*)? 1oment at hich the user presses a function !ey. 8;:*?G 1oment during list processing of a secondary list at hich a ne page starts.

#.at is secon"ar0 list 1 $econdary lists allo you to enhance the information presented in the basic list. 2he user can, for example, select a line of the basic list for hich he ants to see more detailed information. Dou display these details on a secondary list.$econdary lists may either overlay the basic list completely or you can display them in an extra indo on the screen. 2he secondary lists can themselves be interactive again. 7o& to select 2ali" lines %or secon"ar0 list 1 2o prevent the user from selecting invalid lines, %,%&/< offers several possibilities. %t the end of the processing bloc! /?80)F0$/L/(2*)?, delete the contents of one or more fields you previously stored for valid lines using the B*8/ statement. %t the event %2 L*?/0$/L/(2*)?, chec! hether the or! area is initial or hether the B*8/ statement stored field contents there. *n the latter case, create a secondary list, since you previously stored field contents for valid lines only. %fter processing the secondary list, clear the or! area again. 2his prevents the user from trying to create further secondary lists from the secondary list displayed. 7o& to create ,ser inter%aces %or lists 1 2he :/9 system automatically generates a graphical user interface -G;*. for your lists that offers the basic functions for list processing, such as saving or printing the list. *f you ant to include additional functionality, such as pushbuttons, you must define your o n interface status.2o create a ne status, the 8evelopment #or!bench offers the 1enu &ainter. #ith the 1enu &ainter,you can create menus and application toolbars.%nd you can assign Function !eys to certain functions. %t the beginning of the statement bloc! of %2 /?80)F0$/L/(2*)?, activate the status of the basic list using the statement+ $/2 &F0$2%2;$ '$2%2;$'. Can &e call reports an" transactions %ro+ interacti2e reporting lists 1 D/$.*nteractive reporting also allo s you to call transactions or other reports from lists. 2hese programs then use values displayed in the list as input values.2he user can, for example, call a transaction from ithin a list to change the database table hose data is displayed in the list.

9J 7o& to +aintain lists 1 2o return from a high list level to the next0lo er level -$D0L$*?8., the user chooses ,ac! on a secondary list.2he system then releases the currently displayed list and activates the list created one step earlier.2he system deletes the contents of the released list.2o explicitly specify the list level into hich you ant to place output, set the $D0 L$*?8 field. 2he system accepts only index values hich correspond to existing list levels.*t then deletes all existing list levels hose index is greater or e"ual to the index you specify.For example, if you set $D0L$*?8 to @, the system deletes all secondary lists and over rites the basic list ith the current secondary list. #.at are t.e page .ea"ers %or secon"ar0 lists1 )n secondary lists, the system does not display a standard page header and it does not trigger the event 2)&0)F0&%G/.2o create page headers for secondary list, you must enhance 2)&0)F0&%G/+ )yntax 2)&0)F0&%G/ 8;:*?G L*?/0$/L/(2*)?. 2he system triggers this event for each secondary list. *f you ant to create different page headers for different list levels, you must program the processing bloc! of this event accordingly, for example by using system fields such as $D0L$*?8 or $D0&FC/D in control statements -*F, (%$/.. #.at is +eant '0 stac$e" list 1 % $tac!ed list is nothing but secondary list and is displayed on a full0si7e screen unless you have specified its coordinates using the indo command. Is t.e 'asic list "elete" &.en t.e ne& list is create"1 ?).*t is not deleted and you can return bac! to it using one of the standard navigation functions li!e clic!ing on the bac! button or the cancel button. #.at is +eant '0 .otspots 1 Botspot is a list area here the mouse pointer appears as an upright hand symbol.#hen a user points to that area-and the hand cursor is active.,a single0clic! does the same thing as a double0clic!. Botspots are supported from :/9 release 9.@c. In &.ic. s0ste+ %iel" "oes t.e na+e o% c,rrent g,i stat,s is t.ere 1 2he name of the current G;* $2%2;$ is available in the system field $D0&FC/D. #.at is +eant '0 .i"e area 1 2he hide command temporarily stores the contents of the field at the current line in a system0controlled memory called the B*8/ %:/%.%t an interactive event,the contents of the field is restored from the B*8/ %:/%. #hen calling a secondary list from a list line for hich the B*8/ fields are stored, the system fills the stored values bac! into the variables in the program. *n the program code, insert the B*8/ statement directly after the #:*2/ statement for the current line. #.en t.e get c,rsor co++an" ,se" in interacti2e lists 1 *f the hidden information is not sufficient to uni"uely identify the selected line ,the

9F command G/2 (;:$): is used.2he G/2 (;:$): command returns the name of the field at the cursor position in a field specified after the addition field,and the value of the selected field in a field specified after value. 7o& to pass "ata %ro+ list to report 1 %,%&/< provides three ays of passing data+ 000&assing data automatically using system fields 000;sing statements in the program to fetch data 000&assing list attributes 7o& to call ot.er progra+s 1 Report (all and return $;,1*2 %?8 :/2;:? (all ithout $;,1*2 return Transaction (%LL 2:%?$%(2*)? L/%>/ 2) 2:%?$%(2*)?

S0ste+ %iel"s ,se" in interacti2e Reporting 2he S!5LSIND system field contains the index of the list currently created. #hile creating a basic list, $D0L$*?8 e"uals @. #ith each interactive event, the system automatically sets the follo ing system fields+ S0ste+ %iel" In%or+ation $D0L*?(2 $D0L*??) S!5LSIND $D0L*$2* $D0L*LL* $D0L*$/L $D0(;:)# total line count of a list current line no here cursor is placed. *ndex of the list currently created during the current event -basic list M @. *ndex of the list level from hich the event as triggered %bsolute number of the line from hich the event as triggered (ontents of the line from hich the event as triggered &osition of the line in the indo from hich the event as triggered -counting starts ith 1. $D0(;()L &osition of the column in the indo from hich the event as triggered -counting starts ith 3. $D0;()11 Function code that triggered the event $D0&FC/D %l ays contains the status of the current list. TOP5OF5PA E D4RIN LINE5SELECTION* 2he system triggers this event for each secondary list. *f you ant to create different page headers for different list levels, you must program the processing bloc! of this event accordingly, for example by using system fields such as $D0L$*?8 or $D0&FC/D in control statements -*F, (%$/.. Data %ro+ S0ste+ Fiel"s o% Interacti2e Lists From system fields, you retrieve the follo ing information+ the index of a list, the

9K position of the list in the output indo , and the location of the cursor. 2he only system field that contains the contents of the selected line is $D0L*$/L. Passing Data '0 Progra+ State+ents 2o pass individual output fields or additional information from a line to the corresponding processing bloc! during an interactive event, use these statements+ 7IDE 2he B*8/ statement is one of the fundamental statements for interactive reporting. ;sing the B*8/ techni"ue, you can at the moment you create a list level define, hich information later to pass to the subse"uent secondary lists. $yntax /g B*8/ 4f5. B*8/+ $&FL*0(%::*8, $&FL*0()??*8, ?;1.

READ LINE ;se the statements :/%8 L*?/ and :/%8 (;::/?2 L*?/ to explicitly read data from the lines of existing list levels. 2hese statements are tightly connected to the B*8/ techni"ue. $yntax + :/%8 L*?/ 4lin5 Q*?8/H 4idx5R QF*/L8 >%L;/ 4f15 Q*?2) 4g 15R... 4f n5 Q*?2) 4g n5RR Q)F (;::/?2 &%G/X)F &%G/ 4p5R. /g + :/%8 L*?/ $D0*?8/H F*/L8 >%L;/ ,)H. ET C4RSOR ;se the statements G/2 (;:$): F*/L8 and G/2 (;:$): L*?/ to pass the output field or output line on hich the cursor as positioned during the interactive event to the processing bloc!. $yntax G/2 (;:$): F*/L8 4f5 Q)FF$/2 4off5R QL*?/ 4lin5R Q>%L;/ 4val5R QL/?G2B 4len5R. SET C4RSOR 2o set the cursor, use the $/2 (;:$): statement. 2his statement sets the cursor in the most recently created list. #hile creating the basic list, this is al ays the basic list itself. #hile creating a secondary list, this is the previous list. $/2 (;:$): 4col5 4lin5.

<@ 2his statement sets the cursor to column 4col5 of line 4lin5 of the output indo . Calling Progra+s *f you need to program an extensive application, one single program ill become very complex. 2o ma!e the program easier to read, it is often reasonable to divide the re"uired functions among several programs. %,%& allo s you to call reports as ell as transactions using these statements+ :eport (all ithout return 2:%?$%(2*)? (all and return $;,1*2 $;,1*2 %?8 :/2;:? 2ransaction L/%>/ (%LL 2:%?$%(2*)? 2)

T0pical Str,ct,re o% ABAP Progra+ 1. 3. 9. <. =. A. J. :eport 8efinitions 2able and 8ata definitions *nitiali7ation event $creen $elect )ptions/*nputs $election0screen event $tart0of0selection event &erforms and other /vents statements F. /nd0of0selection event 6 6 6 6

>* Initiali6ation 2riggered prior to first display of selection screen 2o specify 8efault value in $/L/(20)&2*)?$ Q* At Selection5Screen &rocessed after the selection screen value are entered For validation of screen accepts :eturns bac! to $/L/(20)&2*)?$ <. START5OF5SELECTION - END5OF5SELECTION 2his is implicit in any %,%&/< program $tart T end of main processing logic 1ore in use ith logical database access %ll $tatements bet een $2%:20)F0$/L/(2*)? and /?80)F0/L/(2*)? is only executed ,y 8efault , no need to have /?80)F0$/L/(2*)?

<1 =. /ach procedural statement in an %,%& program automatically belongs to $2%:20)F0$/L/(2*)? For+ E2ent $imilar to &/:F):1/$;,:);2*?/$ $2%:2$ ith F):1 and ends ith /?8F):1 %ll statements bet een /?8F):1 and end of program are never processed $imilarly all statements bet een /?8F):1 and event !ey ord are never processed.

A. Li+itations o% Si+ple PERFORM >alues can be passed through &/:F):1 to F):1. Giving the flexibility to use the same subroutine multiple number of times. $yntax1+ &/:F):1 4HHHH5 using 4DDD5 changing 41115 F):1 4HHHH5 using 4DDD5 li!e 4PPP5 changing 41115 li!e 4???5 0 &ass by reference ): F):1 4HHHH5 using value -DDD. li!e 4PPP5 creates another copy of the variable. /xample1+ &/:F):1 date0invert using in0date (hanging out0date F):1 date0invert using in0date li!e datum $yntax3+ &/:F):1 function0name-program. *F F);?8. /xample3+ &/:F):1 B/%8/:-F):1&))L. *F F);?8. A. et e2ent G/2 4 table name 5 :eads data of all columns from all database table falling in the hierarchy ?eeds to mention table name in 2%,L/$+ parametersWWW )nly fields part of the tables mentioned in the 2%,L/$+ parameter can be vie ed T edited 0 &ass by value,

<3

J.

To E8it %ro+ an E2ent /xit O *t exits from the respective subroutine ere this syntax is used , generally condition for the /H*2 is stated before this syntax (hec! 0 here the conditional chec! is done at the same time . (B/(C 4condition5 *f the condition is not satisfied, the system leaves the subroutine and resumes the processing after the &/:F):1 statement

F.

$top O it is the abrupt stopping the program flo CALLing F,nctional Mo",les

$yntax+ (%LL F;?(2*)? 4module5 Q/H&):2*?G f1 M a1 .... fn M anR Q*1&):2*?G f1 M a1 .... fn M anR Q(B%?G*?G f1 M a1 .... fn M anR Q2%,L/$ f1 M a1 .... fn M anR Q/H(/&2*)?$ e1 M r1 .... en M rn /xample+ (%LL F;?(2*)? 'PL8%2/L()?>/:$*)?' /H&):2*?G $28L8%2/ M G/?L8%2/ *1&):2*?G (BL8%2/ M ?/#L8%2/

R* List E2ents 2)&0)f0&%G/, /?80)F0&%G/, %2 L*?/0$/L/(2*)?, %2 ;$/:0()11%?8 2hese events are triggered by the %,%& runtime environment hile a list is being created or hen a user performs an action on a list. 2he statement in these bloc!s can format the list or process the users re"uest. ABAP PERFORMANCE ISS4ES* ABAP/9 Opti+i6ation ;se the G/2 :;? 2*1/ command to help evaluate performance. *t's hard to !no hether that optimi7ation techni"ue :/%LLD helps unless you test it out. ;sing this

<9 tool can help you !no hat is effective, under hat !inds of conditions. 2he G/2 :;? 2*1/ has problems under multiple (&;s, so you should use it to test small pieces of your program, rather than the hole program. %void '$/L/(2 6', especially in tables that have a lot of fields. ;se $/L/(2 % , ( *?2) instead, so that fields are only read if they are used. 2his can ma!e a very big difference. Field0groups can be useful for multi0level sorting and displaying. Bo ever, they rite their data to the system's paging space, rather than to memory -internal tables use memory.. For this reason, field0groups are only appropriate for processing large lists -e.g. over =@,@@@ records.. *f you have large lists, you should or! ith the systems administrator to decide the maximum amount of :%1 your program should use, and from that, calculate ho much space your lists ill use. 2hen you can decide hether to rite the data to memory or s ap space. $ee the Fieldgroups %,%& example. ;se as many table !eys as possible in the #B/:/ part of your select statements. #henever possible, design the program to access a relatively constant number of records -for instance, if you only access the transactions for one month, then there probably ill be a reasonable range, li!e 13@@01F@@, for the number of transactions inputted ithin that month.. 2hen use a $/L/(2 % , ( *?2) 2%,L/ *2%, statement. Get a good idea of ho many records you ill be accessing. Log into your productive system, and use $/F@ 05 8ictionary )bjects -press /dit., enter the table name you ant to see, and press 8isplay. Go 2o ;tilities 05 2able (ontents to "uery the table contents and see the number of records. 2his is extremely useful in optimi7ing a program's memory allocation. 2ry to ma!e the user interface such that the program gradually unfolds more information to the user, rather than giving a huge list of information all at once to the user. 8eclare your internal tables using )((;:$ ?;1L:/($, here ?;1L:/($ is the number of records you expect to be accessing. *f the number of records exceeds ?;1L:/($, the data ill be !ept in s ap space -not memory.. ;se $/L/(2 % , ( *?2) 2%,L/ *2%, henever possible. 2his ill read all of the records into the itab in one operation, rather than repeated operations that result from a $/L/(2 % , ( *?2) *2%,... /?8$/L/(2 statement. 1a!e sure that *2%, is declared ith )((;:$ ?;1L:/($, here ?;1L:/($ is the number of records you expect to access.

<< 1any tables contain totals fields -such as monthly expense totals.. ;se these avoid asting resources by calculating a total that has already been calculated and stored. &rogram %nalysis ;tility 2o determine the usage of variables and subroutines ithin a program, you can use the %,%& utility called ]&rogram %nalysis included in transaction $/9F. 2o do so, execute transaction $/9F, enter your program name, then use the path ;tilities 05 &rogram %nalysis ABAP PERFORMANCE IMPRO=EMENTS =IA DATA DICTIONAR! *?8/H (:/%2*)? &/:F):1%?(/ $;GG/$2*)?$ :/L%2/8 2) 8%2%,%$/

S 2he columns at the beginning of an index are the most [common\. 2he most [common\ columns are those here reports are selecting columns ith no ranges 0 the here clause for these columns is an [e"ual to\ expression. :earrange columns of an index to match the selection criteria. For example, if a select statement is ritten to include columns 1 and 3 ith [e"ual to\ expressions in the here clause and column 9 and < are selected ith value ranges, then the index should be created ith columns in the se"uence of 1,3,9,<. S (olumns to ards the end of the index are either infre"uently used in selects or are part of reporting selects that involve ranges of values. 2%,L/ 2D&/ $;GG/$2*)?$ :/L%2/8 2) 8%2%,%$/ &/:F):1%?(/ S ;se >*/# tables to effectively join and [denormali7e\ related tables that are ta!ing large amounts of time to select for reporting. For example, at times here highly accessed tables normali7e description text into one table and the header data into another table, it may ma!e sense to create a vie table that joins the relevant fields of the t o associated ith 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. &))L/8 tables are supposed to be collections of smaller tables that are "uic!ly accessed from the database or are completely buffered in memory. &ooled tables containing more than a fe hundred ro s and are accessed many times in a report or transaction are candidates for &))L to 2:%?$&%:/?2 (onversion. For example, table A !" contains tax #urisdiction condition information and are accessed more t$an ten times in t$e sales order create transaction% &f t$e entire 'nited States tax codes are loaded into t$ese condition tables, t$e time to save a sales order increases to unacceptable levels% (onverting t$e tax condition table to transparent and creating an index based upon t$e )e* fields, decreases processing time from minutes to seconds%

<=

8o not allo the use of L*C/ in an $%& $EL statement accessing a large table.

S ;se internal tables in %,%&s to preselect values once and store values in memory for sorting and searching purposes -this is an assumption stated at the beginning of this discussion.. S %void logical databases hen not processing all ro s of a table. *n fact, a logical database is merely a group of nested $%& $EL $/L/(2 statements. *n general, hen processing a small number of ro s in a larger table is re"uired, the use of internal tables and ?)2 using a logical database or nested selects ill be much better for performance. ABAP IMPORTANT REPORTS :$,8(,2( $ubmit a ,8( job session.

ith an internal batch number and

ait for the end of the batch input

:$,8($;, :elease batch input sessions automatically ABAP IMPORTANT TCODES )$$1 $%& )nline $ervice $ystem $119 ;pdate monitor. #ill sho update tas!s status. >ery useful to determine hy an update failed. $@@1 %,%& 8evelopment #or!bench $/@1 )ld 2ransport T (orrections screen $/1@ ?e 2ransport T (orrection screen $/@K #or!bench )rgani7er $/1A 8ata ,ro ser+ *nitial $creen. $/9@ %,%&/< :untime %nalysis $/9A %,%&/<+ Logical 8atabases $/9J %,%&/< Function 1odules $/9F %,%& /ditor $/9K $plitscreen /ditor+ &rogram (ompare $/<1 1enu &ainter $/=1 $creen &ainter+ *nitial $creen. $/J1 $%&script layout set $/F@ %,%&/< 8evelopment #or!bench )bject ,ro ser $113 Loc! table entries -unloc! loc!ed tables. $131 >ie the system log, very useful hen you get a short dump. &rovides much more info than short dump $19= >ie ,atch *nput $essions $E@@ %,%&/< Euery+ $tart Eueries

<A

,8( > #.at s.o,l" 'e t.e approac. %or &riting a BDC progra+1 %ns.+ 1. %nalysis the 8ata. 3. Generate $%& structure. 9. 8evelop transfer program <. (reate se"uential file. =. (reate batch input program. A. &rocess batch input data #.at is t.e alternati2e to 'atc. inp,t session1 %ns. + (all transaction T call dialog #.at are t.e steps in a BDC session 1 2he first step in a ,8( session is to identify the screens of the transaction that the program ill process. ?ext step is to rite a program to build the ,8( table that ill be used to submit the data to $%&. 2he final step is to submit the ,8( table to the system in the batch mode or as a single transaction by the (%LL 2:%?$%(2*)? command. / 9 ? H #.at are t.e pro'le+s in processing 'atc. inp,t sessions1 7o& is 'atc. inp,t process "i%%erent %ro+ processing on line1 %ns.+ $essions cannot be run in parallel and not fast. #.at "o 0o, "o &.en t.e s0ste+ cras.es in t.e +i""le o% a BDC 'atc. session1 0(hec! no. of records already updated and delete them from input file and run ,8( again. #.at "o 0o, "o &it. errors in BDC 'atc. session1 0%nalysis and correct input file format and entries in internal table ,8(8%2%. #7AT are t.e co++an"s t.at allo& 0o, to process se3,ential %ile1 An" &.at is t.eir s0nta81 %ns +0 :/%8 8%2%$/2 -reading. and 2:%?$F/: - riting. )&/? 82%$/2 4dataset name5 for 4input output appending5 in 4binary text 5 mode at &)$*2*)? 4position5 1/$$%G/ 4field5 :/%8 8%2%$/2 4dataset name 5 *?2) 4field5 (L)$/ 8%2%$/2 4dataset name5 8/L/2/ 8%2%$/2 4dataset name5 2:%?$F/: 4field5 to 4dataset name5 #.at is t.e process %or trans%erring "ata %ro+ legac0 s0ste+ to SAP1 %ns +0 F2& file transfer, 1anufacturer Ospecific field transfer ?F$-net or! file system./,8(. E8plain t.e process to trans%er a recor" to a "ataset1 %ns +0 2:%?$F/: 4field5 to 4dataset name5. #.0 'atc. inp,t1 %ns +0 2o input a large amount of information at off pea! times.

I J R

<J

>S

Can "ata 'e p,t "irectl0 into t.e "ata'ase1 %ns +0 ?o, only after the data has been entered via transaction. E8plain at .ig. le2elB t.e 'atc. inp,t process1 %ns +0 ,atch data is placed into "ueues called batch input sessions , then placed into the application programs for maintenance into the database. #.at are t.e %,nction +o",les associate" &it. 'atc. inp,t1 %ns +0 ,8(L)&/?LG:);& , ,8(L(L)$/LG:);& , ,8(L*?$/:2 #.at is t.e str,ct,re o% t.e BDC ta'le1 %ns +0 &rogram/8ynpro/start/field name/ field content. #rite o,t a co"ing e8a+ple %or %illing a BDC Ta'le* %ns +0 F):1 4?%1/5 :/F//$B 4bdc table5 (L/%: 4bdc table5 1)>/ 4program name 5 to 4bdc table50&:)G:%1 4number15 2) 4bdc table508D?&:) ]H 2) 4bdc table508D?,/G*? %&&/?8 4bdc table5 (L/%: 4bdc table5 1)>/+ 4field15 2) 4bdc table50F?%1 4field35 2) 4bdc table50F>%L %&&/?8 4bdc table5 7o& "o 0o, %in" t.e transaction n,+'erB progra+ n,+'er an" %iel" na+es1 %ns +0 2ransaction no.,program no. O $ystem 05 status Field names 0 F1, 2echnical help #.at are t.e processing +o"es %or Batc. Inp,t1 %ns +0 &rocess on screen-foreground. , 8isplay errors only and process in the bac!ground #.at are t.e a2aila'le OE Co"es t.at can 'e ,tili6e" ",ring 'atc. inp,t processing1 %ns +0 /n O terminates current batch input transaction and mar!s as incorrect. /bdel O delete current batch input transaction from session. /bend O terminate batch input processing and mar! session as incorrect. /bda O change display mode to process the session on screen instead of displaying only errors. /bde O change display mode to display only errors instead of processing the session on the screen. #.at is t.e e%%ect o% t.e BDCAC4RSOR %iel" na+e in t.e BDC ta'le1

>> >Q >/ >9

>?

>H >I

>J

<F %ns +0 Dou can set the cursor and enter as a corresponding field value the name of the field on hich the cursor is to be positioned . 7o& +an0 t0pes o% BDCs 0o, .a2e "one1 #.0 0o, c.oose Call transaction an"/or session +et.o"1 (all transaction is mainly used hen you ant to update the database using a single transaction , you can also update the database in asynchronous mode, here as session is used to perform huge database updations using more than one transaction and hich ill last for a long time. 7o& 0o, trap errors in call Transaction /rrors hile updating the database using call transaction techni"ue are trapped using a structure bdcmsgcall, hose field msgtyp become ]e hen an error record is encountered. 2hose records are formatted using formatLmessage function call in the desired format and stored in an internal table for listing of all error records in one shot. #.at are "i%%erent t0pes o% 4p"ate +o"es *n ,8(s e have t o types of updation modes O 1. $ynchronous 3. %synchronous #.at is +ain "i%%erence 'et&een session +et.o" an" LSM# *n the context of session method, the method of updating is [,atch *nput\ , e re"uire a program to be coded, ,ut in the context of L$1# method, 2he methods of updating using [,atch *nput/8irection *nput\ from an *8)(, from a ,%&* structure. ?o source code is re"uired, the complete operation is performed in 1A steps se"uence #.at is +ain "i%%erence 'et&een CATT an" LSM# ;sing L$1# you can update any !ind of data but no changes to database are allo ed, here as (%22 tool can update only master data, hich also allo s changes to the master data and also a significant testing of data is possible #.at is BDC an" 7o& 0o, ,se it1 ,( ,asis (omponents00%,%& or!bench00,( ,asis &rogramming interfaces008ata transfer 8uring data transfer, data is transferred from an external system into the $%& :/9 $ystem. ^2ransfer data from an external system into an :/9 $ystem as it is installed. ^2ransfer data regularly from an external system into an :/9 $ystem. /xample+ *f data for some departments in your company is input using a system other

>R Q>

QQ

Q/ Q9

Q?

QH

<K than the :/9 $ystem, you can still integrate this data in the :/9 $ystem. 2o do this, you export the data from the external system and use a data transfer method to import it into the :/9 $ystem. ,atch input ith batch input sessions + 8ata consistency chec! ith the help of screen logic. #ith the batch input method, an %,%& program reads the external data that is to be entered in the :/9 $ystem and stores the data in a _batch input session_. 2he session records the actions that are re"uired to transfer data into the system using normal $%& transactions. #hen the program has generated the session, you can run the session to execute the $%& transactions in it. Dou can explicitly start and monitor a session ith the batch input management function -by choosing $ystem N $ervices N ,atch input., or have the session run in the bac!ground processing system. ;se the ,8(L)&/?LG:);& function module to create a ne session. )nce you have created a session, then you can insert batch input data into it ith ,8(L*?$/:2. ;se the ,8(L*?$/:2 function module to add a transaction to a batch input session. ;se the ,8(L(L)$/LG:);& function module to close a session after you have inserted all of your batch input data into it. #.at is Dataset an" .o& 0o, ,se it1 %,%&/< provides three statements for handling files+ 2he )&/? 8%2%$/2 statement opens a file. 2he (L)$/ 8%2%$/2 statement closes a file. 2he 8/L/2/ 8%2%$/2 statement deletes a file. 2o open a file for read access, use the F): *?&;2 option of the )&/? 8%2%$/2 statement 2o open a file for rite access, use the F): );2&;2 option of the )&/? 8%2%$/2 statement 2o open a file for appending data to the file, use the F): %&&/?8*?G option of the )&/? 8%2%$/2 statement 2o process a file in binary mode, use the *? ,*?%:D 1)8/ option of the )&/? 8%2%$/2 statement 2o process a file in text mode, use the *? 2/H2 1)8/ option of the )&/? 8%2%$/2 statement 2o open a file at a specific position, use the %2 &)$*2*)? option of the )&/? 8%2%$/2 statement

=@ #hen you or! ith the operating systems ;?*H or #*?8)#$ ?2, you can send an operating system command ith the statement )&/? 8%2%$/2. 2o do so, use the option F*L2/: 2o receive the operating system message after trying to open a file, use the 1/$$%G/ option of the )&/? 8%2%$/2 statement 2o close a file on the application server, use the (L)$/ 8%2%$/2 statement 2o delete a file on the application server, use the 8/L/2/ 8%2%$/2 statement 2o rite data to a file on the application server, use the 2:%?$F/: statement 2o read data from a file on the application server, use the :/%8 8%2%$/2 statement.

/H

i2e real ti+e &or$ "one '0 , in BDC 1 Transactions ,se" 1 para+eters passe" &it. %,nctions* &ill as$ , %or screen no<s an" "0npro na+es %or BDC t.at , sa0 , .a2e "one* #.ic. tec.nical %iel" in t.e BDCDATA ta'le .ol"s t.e last c,rsor position1 #.at is tr,e a'o,t t.e LSM#) :c.oose correct option/s; &art of the $%& system &rocesses hierarchical data files -header and position. ?eeds a source field for every target field

/I /R 9>

99 9? 9H

7o& "o 0o, rea" a LOCAL se3,ential %ile1 7o& "o 0o, &rite a se3,ential %ile1 7o& "o 0o, sen" t.e BDCDATA ta'le in a Call Transaction state+ent1

=1 9I ?> #.at loop "o 0o, co"e %or a READ DATASET state+ent1 #.at are t.e steps in a BDC session 1 2he first step in a ,8( session is to identify the screens of the transaction that the program ill process. ?ext step is to rite a program to build the ,8( table that ill be used to submit the data to $%&. 2he final step is to submit the ,8( table to the system in the batch mode or as a single transaction by the (%LL 2:%?$%(2*)? command. 7o& "o 0o, %in" t.e in%or+ation on t.e c,rrent screen 1 0 2he information on the current screen can be found by $ystem $tatus command from any menu. 7o& "o 0o, sa2e "ata in BDC ta'les 1 0 2he data in ,8( tables is saved by using the field name ],8(L)C()8/ and field value of ]/11 #.at is t.e last entr0 in all BDC ta'les 1 0 *n all ,8( tables, the last entry is to save the data by using the field name ,8(L)C()8/ and a field value of ]/11. #.at is a +,ltiple line %iel" 1 0 % multiple line field is a special !ind of field hich allo s the user to enter multiple lines of data into it. 7o& "o 0o, pop,late "ata into a +,ltiple line %iel" 1 - 2o populate data into a multiple line field, an index is added to the field name to indicate hich line is to be populated by the ,8( session -Line index .. #rite t.e BDC ta'le str,ct,re* 0 ,8( table structure T!PE (B%:-F. (B%:-<. (B%:-1. (B%:-9=. (B%:-F@. DESCRIPTION &rogram name of transaction $creen number of transaction *ndicator for ne screen ?ame of database field from $creen >alue to submit to field

?Q

?/ ?9

??

?H

?I

FIELD &rogram 8yn&ro 8yn,egin Fnam Fval ?J

Does t.e CALL TRANSACTION +et.o" allo& +,ltiple transactions to 'e processe" '0 SAP 1 0 ?o. 2he (%LL 2:%?$%(2*)? method allo s only a single transaction to be processed by $%&.

=3

?R

Does t.e BDCAINSERT %,nction allo& +,ltiple transactions to 'e processe" '0 SAP I 5 !es* #.at is t.e s0nta8 %or KCALL TRANSACTION 1 0 (%LL 2:%?$%(2*)? trans Q using bdctab 1)8/ mode R. 2hree possible entries are there for 1)8/. % 0 sho all screens / 0 sho only screens ith errors ? 0 sho no screens #hich mode of ](%LL 2:%?$%(2*)? method allo s bac!ground processing I 0 ? is the only mode that allo s bac!ground processing.

HS

H>

Is it possi'le to ,se KCALL TRANSACTION &it.o,t a BDC ta'le 1 0 Des, it is possible to use ](%LL 2:%?$%(2*)? ithout a ,8( table. *n such case, the current program is suspended, the transaction specified is brought up, and a user must enter the data into the screens. #.at is TCODE 1 0 2()8/ is the transaction code for the transaction that should be used to process the data in the ,8( table being inserted. #.at are t.e %,nction +o",les t.at nee" to 'e calle" %ro+ BDC progra+ to s,'+it t.e transactions %or processing 1 0 ,8(L)&/?LG:);& 0 ,8(L*?$/:2 0 ,8(L(L)$/LG:);& 7o& +an0 sessions &ill 'e opene" ,sing BDCAOPENA RO4P 1 - )nly one session can be created using the ,8(L)&/?LG:);& functon. #.at is KBATC7 INP4T or KBDC 1 - 2he $%& system offers t o primary methods -,8( $/$$*)? 1/2B)8, (%LL 2:%?$%(2*)? 1/2B)8. for transferring data into the system from other systems and ?on0$%& systems. 2hese t o methods are collectively called as ],%2(B *?&;2 or ],atch 8ata (ommunication -,8(.. #.at are t.e a"2antages in Batc. Inp,t 1 - 2he ,atch *nput ensures 8ata integrity. ?o manual interaction is re"uired during 8ata transfer. #.at is t.e %,nctionalit0 o% KClassical Batc. Inp,t 1 *n ](lassical ,atch *nput an %,%&/< program reads the external data that is to be entered in the $%& system and stores the data in a ,atch *nput session. 2his session

HQ H/

H9 H?

HH HI

=9 stores the actions that are re"uired to enter your data using normal $%& transactions. #.ic. F,nction Mo",les are ,se" in KClassical Batc. Inp,t 1 - ,8(L)&/?LG:);& , ,8(L*?$/:2, ,8(L(L)$/LG:);&. #.at is S0nc.rono,s Data'ase ,p"ate 1 - 8uring the processing no transaction is stored until the previous transaction has been ritten to the 8atabase. 2his is called $ynchronous 8atabase update. #.at are t.e "i%%erences 'et&een CALL TRANSACTION an" BATC7 INP4T SESSION 1 0 2he most important aspects of the batch session interface are+ 0 %synchronous processing 0 2ransfers data for multiple transactions 0 $ynchronous database update 8uring processing, no transaction is started until the previous transaction has been ritten to the database. 0 % batch input processing log is generated for each session 0 $essions cannot be generated in parallel 2he most important aspects of the (%LL 2:%?$%(2*)? ;$*?G interface are+ 0 $ynchronous processing 0 2ransfers data for a single transaction 0 $ynchronous and asynchronous database updating both possible 2he program specifies hich !ind of updating is desired. 0 $eparate L;# for the transaction 2he system performs a database commit immediately before and after the (%LL 2:%?$%(2*)? ;$*?G statement. - ?o batch input processing log is generated I> #.at are t.e t0pes o% Batc. Inp,t 1 - (lassical ,atch *nput - (all 2ransaction - (all 8ialog #.at is BDCAOECODE 1 - 2he command field is identified by a special name in batch input called ,8(L)C()8/. 2his name is constant and al ays identifies the command field. 7o& can &e e8ec,te a %,nction in a BDC session 1 - #e can execute a function in a transaction by entering the function code or function !ey number in the command field of an $%& session. % function !ey number must be prefixed ith the / -slash. character. % function code must be

HJ HR

IS

IQ

I/

=< prefixed ith the M character. /xample+ ,8(8%2%0F?%1 M ',8(L)C()8/' ,8(8%2%0F>%L M 'M;&8%'

I9

7o& can &e position t.e c,rsor on a partic,lar %iel" 1 - ,8(8%2%0F?%1 M ],8(L(;:$): ,8(8%2%0F>%L M 4F*/L8?%1/5

I?

#.o are Dialog ,sers an" &.o are Bac$gro,n" ,sers 1 - 8ialog users are normal interactive users in the $%& system. ,ac!ground users are user master records that are specially defined for providing authori7ations for bac!ground processing jobs. #.at is t.e ,se o% BDCAINSERT 1 - #e add a transaction to a ,atch *nput $ession by using this function. #.at are t.e ,p"ate +o"es in CALL TRANSACTION 1 - $ + $ynchronous - % + %synchrnous - L + Local #.at "oes t.e +essage para+eter in"icates 1 - 2he message parameter indicates there all system messages issued during a (%LL 2:%?$%(2*)? are ritten into the internal table 4itab5. 2he internal table must have the structure of ,8(1$G()LL. #.at is Direct Inp,t 1 - 2o enhance the batch input procedure, the system offers the direct input techni"ue especially for transferring large amount of data. 2his techni"ue doesnt create sessions but stores the data directly. 2he direct input programs must be executed in the bac! ground only. 2o maintain and start these programs, use program :,1>$B)# or the transaction ,1>). #.at are t.e %eat,res o% Recor"ing F,nction 1 - recording transaction runs - creating batch input sessions from the recorded transaction runs. - Generating a batch input program from the recorded data. #.at is s0nc.rno,s "ata'ase ,p"ate 1

IH II

IJ

IR

JS

J>

== JQ 8uring the processing, no transaction is stored until the previous transaction has been ritten to the database. 2his is called $ynchronous database update.

7o& "o 0o, set ,p 'atc. process1 8ata analysis+ %naly7e the data that is to be transferred to the $%& $ystem. XX Generate $%& structures+ Generate $%& data structures for incorporation into your data export program. XX 8evelop transfer program+ Dou can rite the program in %,%&/< or as an external program. 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 ill read the data to be transferred from the se"uential file. XX &rocess batch input data+ &rocess the data and add it to the $%& $ystem. Dou can do this either by+ batch0input session method or (all transaction method. XX %nalyse results+ (hec! that all data has been successfully processed. XX %nalyse /rror session+ (orrect and re0process erroneous data. #.ere "o 0o, ,se BDC1 transferring data from another system hen you install your $%& $ystem regularly transferring data that is captured by a non0$%& system in your company into the $%& $ystem. %ssume, for example, that data collection in some areas of your company is still performed by a non0$%& system. Dou can still consolidate all of your data in the $%& $ystem by exporting the data from the other system and reading it into the $%& $ystem ith batch input. Dou can also use batch input to transfer data bet een t o :/9 $ystems. Bo ever, there are more direct methods for doing this, such as :F( -remote function calls..

J/

J9

#.at .as to 'e "one to t.e pac$e" %iel"s 'e%ore s,'+itting to a BDC session1 8eclare these fields in the internal table as characters and the length of the field should be same as the field length of the field's data element. 2his internal table is used to hold the data fetched from the se"uential file using #$0upload function module #.at is LSM# 2he L$1# is a cross0application component -(%. of the $%& :/9 $ystem. 2he tool has interfaces ith the 8ata 2ransfer (enter and ith batch input and direct input processing as ell as standard interfaces ,%&* and *8oc in :/9.

=A 2he L$1# comprises the follo ing +ain %,nctions+ 1. :ead data -legacy data in spreadsheet tables and/or se"uential files.. Function ,ead data replaces and enhances functions )preadsheet interface and 3ost interface of L$1# version 1.@. Dou can use any combination out of &( and server files no . 3. (onvert data -from the source into the target format.. 9. *mport data -to the database used by the :/9 application.. TCODE 5 LSM#

SAP Scripts #.at is sap script an" la0o,t set1 %ns 0 $%&script is the integrated text management system of the $%& :/9 $ystem. $%&script is tightly integrated into the $%& $ystem. *t is used for many different ord0processing tas!s all over the $%& $ystem. #.at is la0o,t set1 % layout set in $%&script is used for page layout. 2he layout set contains various elements, hich are used for layout control of the individual pages and also contain layout information for texts hich are to be output on the individual pages. 2he 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 ith space reserved for variable data. Dou can use these text modules for different application. /very $%&script document uses a layout set. 2o ma!e 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 t&o &a0s o% %or+atting te8ts ,sing la0o,t sets) 2he text is entered and output in standard text maintenance. Dou can assign any layout set. 2ext can also be entered via the layout set a letter header, for example. 2he text is formatted via an %,%&/< program using a layout set. 2he program can either dynamically output individual predefined text modules, text elements or transfer entire texts, hich are to be output in the layout set. !o, can ,se $tyles to "e%ine t.e %or+atting o% t.e te8t in 0o,r "oc,+ents* A

=J st0le "eter+ines te8t %or+atting '0 setting t.e paragrap. an" c.aracter %or+ats ,se" in a "oc,+ent* !o, canB %or e8a+pleB ,se a st0le to .ig.lig.t c.aracter strings or &.ole paragrap.s* !o, can assign a st0le to an0 te8t* T0picall0B .o&e2erB 0o,ll ,se st0les pri+aril0 in t.e +ain &in"o&s o% la0o,t setsB &.ere ,sers t0pe or enter te8t "irectl0 in "oc,+ents* 7ea"er "ata is %o,n" in 'ot. st0le an" la0o,t set +aintenance* *n style maintenance, it is used primarily to present important information 0 designed to ma!e it easier for the end user to select a style. 2he header data in layout set maintenance, on the other hand, is used for information and control purposes. #indo s are defined in layout set maintenance. 2hey represent areas hich are positioned on pages as page indo s and in hich text is later output. %t least one indo must be defined for each layout set. *f not, a text cannot be formatted by $%& script. T.e %ollo&ing &in"o& t0pes can 'e ,se") MAIN O 1ain indo in hich continuous text is output. 2his is the indo used by dialog users of a print program and layout set. For example the body text of a letter ould be entered in 1%*?. =AR O #indo ith variable contents. 2he text can vary on each page in hich the indo is positioned. >ariable indo s are formatted for each page. CONST O #indo ith constant contents hich is only formatted once.

A la0o,t set .as t.e %ollo&ing ele+ents) 7ea"er "ata 0 8ata related to development -created by, development class, etc.. and layout set information - hich elements are used. are both stored in the header data. % start page must be entered here. Paragrap. %or+ats 0 &aragraph formats are re"uired in layout sets 0 as in styles 0 in order to format texts. Bo ever, they are also used for ord processing in layout sets, for example, to format text elements. C.aracter %or+ats 0 Dou can also use character formats to format texts or paragraphs. ;nli!e paragraph formats, ho ever, they are used to format text ithin a paragraph.

=F #indo s 5 #in"o&s are na+es an" &in"o& t0pesB &.ic. are not p.0sicall0 positione" ,ntil t.e0 are allocate" to pages an" ,nits o% +eas,re+ent are speci%ie"* Pages 0 &ages are defined to provide the system formatting. ith a start and end point in text

Page &in"o&s 0 &age indo s are the combination of indo s and pages, here the dimensions of a indo and its position on a page are specified. 2he purpose of SAP script control co++an"s is to allo control of the output formatting. 2hese commands are not interpreted by the $%&script editor, but are passed through to the $%&script (omposer for processing. 2he composer is the program that converts text from the form displayed in the editor to the form used for printing. #.at is SAPscript an" e8plain its p,rpose1 $%& $cript is the $%& systems o n text0proessing system. Doull find that it loo!s and feels a lot li!e other leading text0processing system that you may use on your personal computer. /very company needs to output documents *nvoices, delivery notes, etc... all the time. ith a uniformly defined layout -eg.

2he basic layout of the document is pre0defined , but in many cases, other data has to be merged ith it, such as address data or purchase order items. 2his data might be entered manually by a employee, or retrieved from a database table. Large "uantities of these documents have to be produced. From printing is usually a mattter of large print runs of documents such as payslips, chec!s, order confirmation, reminders etc. $%&script has been developed to meet the above re"uirements. *2 is an integrated tool for text entry and form printing in :/9 applications. 2hese documents are normally provided by $%& but every organi7ation have their uni"ue a"ys of these documents so to customi7e these and for creating ne er ones if re"uiredG $%& script is used. #.at are co+ponents o% SAPscript1 Layout set, $%&script 2ext, %,%& &rint program , symbols, function modules li!e openLform, closeLFrom, :eadLtext etc,. #.at are t.e ABAP/9 Co++an"s t.at lin$ to a la0o,t set1

=K (all function )&/?0form. (all function #:*2/0from. (all function (L)$/0from I+porting rap.ics :Logos; into SAPScript 2he program :$2HL81( can be used to upload graphics -file extension .tif on &( files. into individual standard text. Ot.er ,se%,l progra+s %or SAPScript :$2HF()? 0 (onverts page format :$2H$(:& 0 ;pload/8o nload layout sets :$2H8,;G 0 $%&$cript debugger De',g SAPScript Dou can debug a $%&$cript+ ;se 2ools 0 #ord &rocessing 0 Layout $et. /nter name of layout set and then ;tilities 0 %ctivate 8ebugger. *t is of no conse"uence hich layout set you enter hen selecting the $%&script debugger. -1enu path+ 2ools0#ord0processing 0 Forms, ;tilities 0 %ctivate 8ebugger. 2he next layoutset called ill invo!e the debugger. 2his is "uite handy hen verifying hich layoutset is being called ->erifying customi7ing settings.. %nother ay to set the $%&$cript debugger is to run program :$2H8,;G. #hen a Form is copied from one client to another .%nd *f ; try to display or change the form in the copied client .2he possible error message cud be + 1.Form not found 2ry coping again specifing the language . 3.*F *2 dispalys an error message saying 2hat the text file is inconsistent . 2hen go to $/9F and :un [:$2H(BC)\ . *t ill as! for the form name ,then chec! all the chec!boxes and then run the program. ?ote + all $cript related problems can be solved using &rogram ]:$2H6. 7o& to ta$e a 'ac$ ,p o% script la0o,t into 4r .ar" "is$ an" loa" it later ;se &rogram ,)09)C,+. ;se /H&):2 mode, hen do nloading and *1&):2 hen uploading a script. 8ont forget to give the form name in the object field. 2his ill create a script ith the same name as that of the original script . *f a script ith the same name exists in the same client ,then it ill give an error ])bject cannot be over ritten . I &ant to cop0 ta'le across clients ;se &rogram :$(L2()&

A@ To trans%er script %iles across s0ste+s -?ot (lients. 0 ,)09)C,+ To co+pare t.e contents o% a ta'le across clients+ :$2,$/:> To c.ange t.e "e2elop+ent class o% an0 o'(ect 0 :$#,)@=3 #.at t0pe o% 2aria'les nor+all0 ,se" in sap script to o,tp,t "ata1 T2ables name0 fieldsT. 7o& "o 0o, n,+'er pages in sap script la0o,t o,tp,ts1 T page T Tnext &age T #.at ta$es +ost ti+e in SAP script progra++ing1 8efining layout set up / sets. 7o& "o 0o, ,se ta' sets in la0o,t sets1 8efine paragraph ith defined tabs. 7o& "o 0o, 'ac$,p sap script la0o,t sets1 Can 0o, "o&nloa" an" ,ploa"1 7o&1 $%& script bac!up +0 *n transaction $/J1 goto ;tilities 05 (opy from client 05 Give source form name, source client -@@@ default., 2arget form name. 8o nload +0 $/J1, type form name 05 8isplay 05 ;tilities 05 form info 05 List 05 $ave to &( file. ;pload +0 (reate form ith page, indo , page indo ith the help of do nloaded &( file. 2ext elements for &age indo s to be copied from &( file. #.at is Co+pare Tool in SAP Script 1 $%& $cript offers tools for comparing objects across clients. #e can compare or copy the follo ing !inds of objects. $tyles Layout sets 8ocuments #ith the (ompare tool e can do the follo ing + (hec! hether an object exists in both clients 8isplay the differences bet een the versions of an object La0o,t Sets are used to control page layout and text formatting in documents . SAP Stan"ar" st0les and layout sets are al ays held in (lient @@@. In &.at %or+at "oes SAP Script store te8t 1

A1 $%&script texts are stored in *nterchange 2ext Format -*2F.. $%&script offers conversion programs for the text file formats :ich 2ext Format -:2F. and %$(** as an interface to other ord processors. T.e 2ario,s &in"o& t0pes in SAP Script are 1ain, >ariable and (onstant. T.e Ne&5Page co++an" is used to force a &age brea! in the text at any point. Protect *** En"protect command pairs can be nested -2rue / False.. False. Deli+iter - must be used immediately before and after the symbol. #.at "oes t.e co+poser "o1 2he final appearance of your documednt depends on interaction bet een the print program and the layout set. 2he $%&script print program initiali7es the printing process. /very command entered using the $%&script programming interfaces is transferred to the composer. 2he composer received layout information from the layout set specified by the print program. 2he documents are formatted according to this layout information. *f the documents contain variables, the compoer replaces these variables ith data from the :/9 system, such as the current date, or ith the userdata selected by the print program. 2he print program controls the completion of thelayout set. )nce this is done, the composer places the completed document in the spool. #.ere "o &e "e%ine Ta' space %or "ata in SAPScript1 #hen defining the paragraph for the text element e can define the 2%,$ then. 2here is parameter called 2%,$ to be defined in paragraph definition. &.at is "i%%erence 'et&een #in"o& - a Page #in"o&1 #indo + %n area that is predefined in the layout set. #indo s are text modules, hich are positioned on a document page. #e define the indo type, 8efault &aragraph, specify the text elements or a $%&script text to be included etc in the #indco (omponent.

A3

&age#indo + e define the parameters of the earlier defined #indo , appearance on the document li!e left or right margins, #idth T Beight. #.at are s0+'oles - state t.eir "i%%erent t0pes &it. E*g* % $ymbol is a constant, hich can be inserted in a document. *t saves the user unnecessary or! hen replacing sections of text, phrases, etc. /ach symbol has a name hich is encloses by T. /g. Tvariable name T $ystem symbols eg T8ateT, TtimeT etc. $tandard symbols +$tandard symbols are user0defined. 2hey are maintained centrally in table 2282G. /g. T$G8BT for the opening salutation + [dear sir/madam\. T1FGT for the closing salutation +\yours Faithfully\. &rogram $ymbols + &rogram symbols display data from the %,%&/< program has called the ord processing function /g. *tab0connid. hich

2ext symbols+ Dou can define a text symbol for any text module. 2his symbol is valid only in the text module for hich you have defined it. /g. 8efine T$ymbolT M ]value. 7o& "o &e "e%ine Te8t s0+'ols1 ;sing the control command 8/F*?/ Tx1T M ]=A. State %e& control co++an"s1* &rotect .. endprotect, define, ne 0page, include.. ifW endif. &.at is t.e p,rpose o% OProtect an" En"ProtectP1* Dou can specify either in the style or in the layout set that a particular paragraph should not be slit in t o by a page bea!. *f the page protect attribute is set then the complete paragraph is al ays output ona single page. 2his property applies only to that particular paragraph. $%&$cript provides the &:)2/(2W /?8&:)2/(2 command pair to allo you to define the areas to be protected against a page bea! on an individual basis. 2hus the &:)2/(2//?8&:)2/(2 commands may be regarded as a !ind of conditional ?/#0&%G/ command, the condition being hether or not the lines enclosed bet een the t o commands fit in the space remaining in the current main indo . 7o& "o &e set t.e "ateB ti+e %or+at1

A9 $/2 2*1/ 1%$C + ()?:)L$ 2B/ 2*1/ F*/L8 F):1%2. $/2 8%2/ 1%$C + ()?2:L$ 2B/ 8%2/ F*/L8 F):1%2. /G. $et 2ime 1as! M [ BB+11+$$\. &.at is t.e role o% an ABAP progr+ in SAPScript1 :etrieves :/9 application data from the database. 8efines the layout set processing logic - 2he 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 to beprinted. 7o& to re,se so+e co+ponents o% t.e script la0o,t to ot.er progra+1 Is this script layout is standard for all the printer: If not then y we are going for script layout: Give me couple of methods that I will take standard script layout printout for different printer. 3ow u will analysis script program: % which goes to main and how many windows etc;.( Can = inserte" logo on 0o,r progra+1* i2e +e t.e progra+ na+e &.ic. ,ploa"s +0 logo an" s0nta8 %or logo inserting in sap script* Des u can insert a logo on your script layout. ;se this :eport [RSTGLDMC\ hich ill uploads the logo. ;se the follo ing statement hich includes the logo on your script prog. /+ *?(L;8/ 'PB/H01%(:)0HHH' ),V/(2 2/H2 *8 $2 L%?G;%G/ '/'. HHH O object name, u ill gives ` runtime in rstxldmc program. i2e +e s0nta8 %or 'o8 co++an"* 1O9 9+O) * $$ <I!03 = C$ 3"IG30 >?.@> C$ 8,A$" '= 0< Script Co++an"s* 8efining a variable 8/F*?/ T(;$2T M '@@@@@@31'.

A<

De%ine an" insert a stan"ar" te8t) $tandard texts is predifined textst that can be used in more than one form. $tandard texts are can be created, changed and displayed using transaction $)1@. 2he text *8 is used to callsify texts. 2o include a stadard text in a form, use the *?(L;8/ command+ /+ *?(L;8/ PL,(<A@L/H<LBF ),V/(2 2/H2 *8 $8>8 #hen formatting the standard text the &%:%G:%&B parameter is used. 2o center the text use+ /+ *?(L;8/ PL,(<A@L/H<LBF ),V/(2 2/H2 *8 $8>8 L%?G;%G/ /? &%:%G:%&B (. Formatting addresses 2he %88:/$$0/?8%88:/$$ command formats addresses according to the postal norms of the recipient's country, as defined in the country parameter. %88:/$$ 8/L*>/:D &%:%G:%&B %8 ?%1/ TC?%10?%1/T $2://2 TC?%10$2:%$T &)$2()8/ TC?%10&$2LPT (*2D TC?%10):2@1T' ();?2:D TC?%10L%?81T F:)1();?2:D '8/' /?8%88:/$$ %voiding pagebrea!s in a paragraph /+ &:)2/(2 + + /+ /?8&:)2/(2 2he text lines to be protected are enclosed bet een the t o commands

A= (onditonal text ouput *F 0 /?8*F Dou can use *F//?8*F li!e in a normal %,%& program /+ *F condition + + /+ /?8*F and /+ *F condition + /+ /L$/ + /+ /?8*F /xample+ /+ *F T$&FL*0(*2D2)T M _,/:L*?_ ..... put some text here /+ /?8*F S*mbols and (ontrol commands $ymbols are placeholders for values that are inserted during print formatting. $ymbols are indentified by name surrounded by _T_ and are not case sensitive 0ypes of symbols $ystem symbols DATE 8ate DA! 8ay NAMEAOFADA! ?ame of day MONT7 1onth !EAR Dear TIME 2ime 7O4RS Bours MIN4TES 1inutes SECONDS $econds PA E &age number

AA NEGTPA E ?umber of next pagre DE=ICE )utput device SPACE ,lan! space 4LINE ;nderline =LINE >ertical line Stan"ar" s0+'ols $tandard symbols are user defined and are maintained in table TTD :ta'le is not a2aila'le111;. Dou use transaction $19@ to change or display standard symbols. %n examples of standard symbols is T1FGT fot _Dours faithfully_ $tandard text $tandard texts is predifined texts that can be used in more than one form. $tandard texts are can be created, changed and displayed using transaction $)1@. 2he text *8 is used to classify texts. 2o include a standard text in a form, use the *?(L;8/ command+ /+ *?(L;8/ PL,(<A@L/H<LBF ),V/(2 2/H2 *8 $8>8 #hen formatting the standard text the &%:%G:%&B parameter is used. 2o center the text use+ /+ *?(L;8/ 4name5 4&arameter5 4parameter5 M )bject, *8, Language, &aragraph /xample+ /+ *?(L;8/ PL,(<A@L/H<LBF ),V/(2 2/H2 *8 $8>8 L%?G;%G/ /? &%:%G:%&B (. ?ame+ PL,(<A@L/H<LBF )bject+ 2ext 2ext id+ $8>8 -2ext id from $)1@. Language+ /?

AJ

&aragraph+ ( -(entered. 2ip+ Dou can use menu *nsert052ext05$tandard to ma!e 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 the symbols. *n the print program+ 2%,L/$+ !na1. *n the form+ TC?%10?%1/1T Formatting T$D1,)LT Ao formatting T$D1,)LT9T )ffset 0 )utput begins here. )ffset refers to formatted value T$D1,)L:?;T Length 0 )utput data in the specified length T$D1,)L:I;T $uppress initial value 0 *f the field has been initiali7ed, nothing is output T$D1,)L:@;T $uppress leading 7eros T$D1,)L:C;T (ompress blan! spaces 0 (onsecutice spaces are compressed into a single space. Leading spacesare suppressed. T$D1,)L:R;T :ight align output T$D1,)L:S;T )perators are suppressed T$D1,)L:U;T 8ictionary length 0 2he data length is defined by the %,%& dictionary T$D1,)L:J*Q;T 8ecimal format. Length F decimals 3 T<te8t><S!MBOL<te8tQ<T 2ext can be inserted before and after the symbol (ontrol commands (ontrol command are used to modify text output. ;se format !ey /+ in the format column. /+ *?(L;8/ /+ 8/F*?/ /+ %88:/$$..../?8%88:/$$ /+ &:)2/(2...../?8&:)2/(2

AF

/+ ?/#0&%G/ /+ *F..../?8*F /+ (%$/.../?8(%$/ /xamples of control commands *?(L;8/ *?(L;8/ name 4parameter5 &arameters+ ),V/(2 /.g. 2/H2, 8)C; -8ocument., 8$D$ -Bypertext.. *8 2ext *8 02ext *8 is a ay to group texts 0 $e transaction $)1@ L%?G;%G/ *f the parameter is not specefied, the logon language ill be used &%:%G:%&B 2he text to be included is formatted using the style allocated. 2he &%:%G:%&B parameter can be used to redefine the standard paragraph for this style for the current call. %ll 60paragraphs in the included text ill then be formatted using the paragraph specified here. O'(ect &+ ,anguage Paragrap$ Standard texts are maintained in transaction S-. % E8a+ple >) Dou have created a standard text in $)1@ ?amed 1D2/H2 and ith 2ext *d $2 /+ *?(L;8/ 1D2/H2 ),V/(2 text *8 st E8a+ple Q) Dou can also use a dynamic name so that you can retreive a ext depeding of the name variable+ /+ *?(L;8/ T$(;$2)10?%1/T text *8 st. 8epending on the name in the variable T$(;$2)10?%1/T different texts ill be sho n. ?ote that a text ith the name in the variable T$(;$2)10?%1/T name must be created in $)1@. 8/F*?/ /+ 8/F*?/ T$D1,)LT M '$tring1 $tring3'

AK

/+ 8/F*?/ T(;$2T M '@@@@@@31'. %88:/$$0/?88:/$$ 2he %88:/$$0/?8%88:/$$ command formats addresses according to the postal norms of the recipient's country, as defined in the country parameter. /+ %88:/$$ 8/L*>/:D &%:%G:%&B %8 /+ ?%1/ TC?%10?%1/T /+ $2://2 TC?%10$2:%$T /+ &)$2()8/ TC?%10&$2LPT /+ (*2D TC?%10):2@1T /+ ();?2:D TC?%10L%?81T /+ F:)1();?2:D '8/' /+ /?8%88:/$$ Ti+e Date an" "eci+al %or+at /xamples+ /+ $/2 2*1/ 1%$C M 'BB+11' /+ $/2 8%2/ 1%$C M '88.1111.DDDD' /+ $/2 ();?2:D ';$%' Frames, lines and s$ading BOG 8ra s a box S0nta8) /+ ,)H 4xpos5 4ypos5 4 idth5 4height5 4frame5 4intensity5 2he intensity is the grey scale of the box as U. 2he frame parameters is the thic!ness of the frame. 8efault is @. /ach of the paramteters ypos, xpos, idth, height and frame muts be follo ed of the measurement unit+ T# -t ip. PT -point. IN -inch. MM -millimeter.

J@ CM -centimeter. LN -line. C7 -character.. /xamples+ /+ ,)H H&)$ '11.31' 11 D&)$ '=.91' 11 B/*GB2 '1@' 11 #*82B '3@' 11 *?2/?$*2D 1@ F:%1/ @ 2# /+ ,)H F:%1/ 1@ 2# 8ra s a frame around the current &2.. indo ith a frame thic!ness of 1@ 2# -M @.=

/+ ,)H *?2/?$*2D 1@ Fills the indo bac!ground ith shading having a gray scale of 1@ U. /+ ,)H B/*GB2 @ 2# F:%1/ 1@ 2# 8ra s a hori7ontal line across the complete top edge of the indo . /+ ,)H #*82B @ 2# F:%1/ 1@ 2# 8ra s a vertical line along the complete height of the left hand edge of the indo . /+ ,)H #*82B '1J.=' (1 B/*GB2 1 (1 F:%1/ 1@ 2# *?2/?$*2D 1= /+ ,)H #*82B '1J.=' (1 B/*GB2 '19.=' (1 F:%1/ 1@ 2# /+ ,)H H&)$ '1@.@' (1 #*82B @ 2# B/*GB2 '19.=' (1 F:%1/ 1@ 2# /+ ,)H H&)$ '19.=' (1 #*82B @ 2# B/*GB2 '19.=' (1 F:%1/ 1@ 2# 8ra s t o rectangles and t o lines to construct a table of three columns highlighted heading section. POSITION an" SI@E Dou can use the &)$*2*)? and $*P/ commands to set default parmeters for a box. 2his can be usefull if you have several boxes that share the same parameters. /xample+ /+ &)$*2*)? H):*G*? '11.31' D):*G*? '=.91' 11 /+ $*P/ B/*GB2 '3' 11 #*82B 'JA' 11 /+ ,)H F:%1/ 1@ 2# *?2/?$*2D 1@ ith a

J1 *f you ant to set the position realtively to the indo use &)$*2*)? #*?8)# to set the position to the top/left start of the indo . 2hen use &)$*2*)? to set the current position relatively to the start of the #indo . ?ote that you uses _Z_ or _0_ in the ):*G*? position to the set the position relatively. /+ &)$*2*)? #*?8)# /+ &)$*2*)? H):*G*? 'Z=' 11 D):*G*? 'Z1@' 11 the position is no = 11 from the left and 1@ 11 from the top of the indo . ?)2/+ %fter using the position command you can move the current position realtively to the last used position /+ &)$*2*)? H):*G*? 'Z1@' 11 D):*G*? 'Z3@' 11 ?o the position ill be H M 1= and D M 9@ 8ra ing a line Dou can dra a line by setting the Beight or #idth of a box to @ and add a frame. /.g. a hori7ontal line+ /+ $*P/ B/*GB2 '@' 11 #*82B '3@@' 11 /+ ,)H F:%1/ 1@ 2# H&)$ '11.31' 11 D&)$ '1<.F1' 11 *?2/?$*2D 1@@ #in"o& an" Page #*?8)# sets the values for the indo -default setting.. &%G/ $ets the values for the page. /xamples+ /+ $*P/ #*?8)# $ets #*82B and B/*GB2 to the current indo dimensions. /+ $*P/ #*82B '9.=' (1 B/*GB2 'J.A' (1 $ets #*82B to 9.= cm and B/*GB2 to J.A cm. /+ &)$*2*)? #*?8)# /+ &)$*2*)? H):*G*? 03@ 2# D):*G*? 03@ 2# /+ $*P/ #*82B Z<@ 2# B/*GB2 Z<@ 2# /+ ,)H F:%1/ 1@ 2# idth and height to the values of the current

idth and height to the values of the current output

J3 % frame is added to the current indo . 2he edges of the frame extend beyond the edges of the indo itself, so as to avoid obscuring the leading and trailing text characters. /.% (alling a form from SapScript 0111112 /+8/F*?/ T(;$2T M '@@@@@@31'. /+&/:F):1 G/2L?%1/ *? &:)G:%1 PL,(<A@L/H<LBF /+ ;$*?G T(;$2T /+ (B%?G*?G T?%1/T /+/?8&/:F):1. 8ear T?%1/T 2he %,%& routine could be defined as follo s+ *1&):2%?2+ 2he structure itcsy must be used for the parameters. :/&):2 PLB/?:*CFL$(:*&2LF):1 . tables scustom. form getLname tables inLtab structure itcsy outLtab structure itcsy.

read table inLtab index 1. select single 6 from scustom here id M inLtab0value. if sy0subrc M @. read table outLtab index 1. move scustom0name to outLtab0value. modify outLtab index sy0tabix. else. read table outLtab index 1. move '?o name' to outLtab0value. modify outLtab index sy0tabix. endif. 66 Dou could also fill the ouput parameter table this ay :/%8 2%,L/ outLpar #*2B C/D '?%1/1'. outLpar0value M lLname1.

J9 1)8*FD outLpar *?8/H sy0tabix. endform. ?ote that if you use more than one parameter you must use ;sing or (hanging before every parameter Y /+ &/:F):1 4form5 *? &:)G:%1 4prog5 /+ ;$*?G T*?>%:1T /+ ;$*?G T*?>%:3T ...... /+ (B%?G*?G T);2>%:1T /+ (B%?G*?G T);2>%:3T ...... /+ /?8&/:F):1 /3% Structure of a print program 2he print program is used to print forms. 2he program retieves the necesary data from datbase tables, defines the order of in hich text elements are printed, chooses a form for printing and selects an output device and print options. )pen form printing 0 1ust be called before or!ing function modules. call %,nction <OPENAFORM<***** 1ust be ended ith function module (L)$/ F):1 ith any of the other form

62o begin several indentical forms containing different data ithin a single spool re"uest, begin each form using $2%:2LF):1, and end it using /?8LF):1 call %,ntion <STARTAFORM<***** #rite text elements to a indo of the form call %,nction <#RITEAFORM<***** /nds form call %,ntion <ENDAFORM<***** (loses form printing call %,nction <CLOSEAFORM<*... /xamples of function calls

J<

OPEN FORM (%LL F;?(2*)? ')&/?LF):1' /H&):2*?G 6 %&&L*(%2*)? M '2H' 6 %:(B*>/L*?8/H M 6 %:(B*>/L&%:%1$ M 8/>*(/ M '&:*?2/:' 8*%L)G M 'H' 6 F):1 M'' 6 L%?G;%G/ M $D0L%?G; )&2*)?$ M )&2*)?$ 6 1%*LL$/?8/: M 6 1%*LL:/(*&*/?2 M 6 1%*LL%&&LL),V/(2 M 6 :%#L8%2%L*?2/:F%(/ M '6' *1&):2*?G 6 L%?G;%G/ M 6 ?/#L%:(B*>/L&%:%1$ M 6 :/$;L2 M /H(/&2*)?$ (%?(/L/8 M1 8/>*(/ M3 F):1 M9 )&2*)?$ M< ;?(L)$/8 M= 1%*LL)&2*)?$ MA %:(B*>/L/::): MJ *?>%L*8LF%HL?;1,/: MF 1):/L&%:%1$L?//8/8L*?L,%2(B M K )2B/:$ M 1@ . STARTAFORM (%LL F;?(2*)? '$2%:2LF):1' /H&):2*?G 6 %:(B*>/L*?8/H M F):1 M '1DLF):1' 6 L%?G;%G/ M'' 6 $2%:2&%G/ M'' 6 &:)G:%1 M'' 1%*LL%&&LL),V/(2 M

J= *1&):2*?G 6 L%?G;%G/ /H(/&2*)?$ F):1 M1 F):1%2 M3 ;?/?8/8 M9 ;?)&/?/8 M< ;?;$/8 M= )2B/:$ MA #RITEAFORM $ee '#:*2/LF):1' ENDAFORM (%LL F;?(2*)? '/?8LF):1' *1&):2*?G 6 :/$;L2 M /H(/&2*)?$ 6 ;?)&/?/8 M1 ,%8L&%G/F):1%2LF):L&:*?2 M 3 )2B/:$ M9 CLOSEAFORM $tructure for &rint options -return values. 0 &ages selected for printing, ?umber of copies etc. 8%2% ,/G*? )F :/$;L2. *?(L;8/ $2:;(2;:/ *2(&&. 8%2% /?8 )F :/$;L2. (%LL F;?(2*)? '(L)$/LF):1' *1&):2*?G :/$;L2 M :/$;L2 6 :8*L:/$;L2 M 2%,L/$ 6 )2F8%2% M /H(/&2*)?$ 6 ;?)&/?/8 M1 ,%8L&%G/F):1%2LF):L&:*?2 M 3 6 $/?8L/::): M9 6 )2B/:$ M <.

JA

/"% (-4T5-,6F-57 8 (alling (ommands 'sing a program 2he function module ()?2:)LLF):1 can be used to create $ap$cript control statements from ithin an %,%& program. E8a+ple) call function '()?2:)LLF):1' /H&):2*?G ()11%?8 M '&:)2/(2'. call function '#:*2/LF):1'..................... call function '()?2:)LLF):1' /H&):2*?G ()11%?8 M '/?8&:)2/(2'. St0les $tyles are used to predefine paragraph and character formats for forms. $%& provides several standard styles e.g. for %ddress includes, on0line documentation and so on. Dou can define your o n styles. 2o find styles, create styles and maintaine styles, use transaction $/J3. Dou assign style to a text by using menu Format 05 $tyle Dou can ma!e temporary style changes using the control command /+ $2DL/

'sing grap$ics in SapScript ;se transaction $/JF to inmport graphics to $%&. *n the form painter, you can either include directly to the form using menu /dit0 5Graphic05(reate or using the *?(L;8/ statement in a indo . 2o use an *?(L;8/ stanment, goto into the oindo script editor and use menu *nclude05Graphic. 2he include can loo! li!e this for a bitmap+ /+ ,*21%& 1DL)G) ),V/(2 G:%&B*($ *8 ,1%& 2D&/ ,1)?

JJ

Mo"i%ications (onsiderations in connection ith modifications 2he standard $%& print program should only be changed hen it is absolutely necessary. *f additional data is needed, these can in many cases be retrieved using a a &/:F):1 statement in the form instead of changing the print program.. 2here can be the follo ing reasons to change the print program+ $tructureal changes ?e text eloements are needed &rint program to be used to print additional forms 8etermine/change hich forms and printprograms that are used for printing 2he forms and print programs for a given output type and application can be found in table 2?%&: &rocessing programs for output ;se vie >L2?%&: in -2ransaction $/9@. to change entries. I+port/E8port SapScript %or+ %ro+ PC %ile ;se %,%& program+ :$2H$(:& SD 5 Fin"ing t.e na+e o% t.e print progra+ For $8 dopcuments you can use table 2?%&: top find the name of the a printprogram Mo",le Pool Transactions) % transaction is a program that conducts a dialog ith the user. *n a typical dialog, the system displays a screen on hich the user can enter or re"uest information. ,ased on the the user input or re"uest, the program executes the appropriate actions li!e, it branches to the next screen, displays an output, or changes the database. E8plain &.at is a transaction in SAP ter+inolog0* 0 *n $%& terminology, a transaction is series of logically connected dialog steps. E8plain .o& SAP 4I .an"les o,tp,t screen %or t.e ,ser* ;ser terminal input is accepted by )A+ G2I and sent to the )A+ dispatcher. 2he dispatcher co0ordinates the information exchange bet een the $%& G;*s and the or! processes. 2he dispatcher first places the processing re"uest in re"uest

JF "ueues, hich it then processes. 2he dispatcher dispatches the re#uests to the available work process. 2he actual processing ta!es place in the or! process. #hen processing is complete, the result of a work process is returned via the dispatcher to the )A+ G2I. 2he $%& G;* interprets the received data and generates the output screen for the user. #.at is L4# or Data'ase L4# or Data'ase Transaction 1 - A B/2<C % logical unit of work ( is the span of time during hich any database updates must be performed . "ither they are all performed % committed ( D or they are all thrown away % rolled back (. /2< % or Bdatabase /2<C or Bdatabase transactionC ( 2his is the set of updates terminated by a database commit. % L;# lasts, at most, from one screen change to the next - because the $%& system triggers database commits automatically at every screen change .. L;#s help to guarantee database integrity. #hen an L;# has been successfully concluded, the database is once again in a correct state. *f, ho ever, an error occurs ithin an L;#, all database changes made since the beginning of the L;# are canceled and the database is then in the same state as before the L;# started. An ,'9 begins /ach time you start a transaction #hen the database changes of the previous L;# have been confirmed -database commit. or hen the database changes of the previous L;# have been cancelled -database rollbac!.

An ,'9 ends #hen the database changes have been confirmed -database commit. or #hen the database changes have been canceled -database rollbac!.

#.at is SAP L4# or 4p"ate Transaction 1 0 ;pdate transaction - or [$%& L;#\. 2his is a set of updates terminated by an %,%&/< commit. % $%& L;# may last much longer than a database L;#, since most update processing extends over multiple transaction screens.2he programmer terminates an update transaction by issuing a ()11*2 #):C statement. Does t.e e8ternal progra+ r,n in t.e sa+e SAP L4# as t.e callerB or in a separate one1 0 2ransactions run ith a separate $%& L;# 0 :eports run ith a separate $%& L;# 0 8ialog modules run in the same $%& L;# as the caller

JK Function modules run in the same $%& L;# as the caller 2he only exceptions to the above rules are function modules called ith *? ;&8%2/ 2%$C ->3 function only. or *? ,%(CG:);?8 2%$C -%L/ applications.. 2hese al ays run in their o n -separate. update transactions.

#.at are t.e re3,ire+ents a "ialog progra+ +,st %,l%ill 1 - % dialog program must fulfill the follo ing re"uirements . a user friendly user interface . format and consistency chec!s for the data entered by the user . easy correction of input errors . access to data by storing it in the database. #.at are t.e 'asic co+ponents o% "ialog progra+ 1 - $creens -8ynpros. /ach dialog in an $%& system is controlled by dynpros. % 8ynpro consists of a screen and its flo logic and controls exactly one dialog step. - %,%&/< module pool /ach dynpro refers to exactly one %,%&/< dialog program. $uch a dialog program is also called a module pool, since it consists of interactive modules. #.at is a "0npro 1 #.at are its co+ponents 1 - % dynpro -8Dnamic &:)gram. consists of a screen and its flo logic and controls exactly one dialog step. 0 2he different components of the dynpro are+ Flo logic+ (alls of the %,%&/< modules for a screen $creen layout+ &ositions of the texts, fields, pushbuttons, and so on for a screen $creen attributes+ ?umber of the screen, number of the subse"uent screen, and others Field attributes+ 8efinition of the attributes of the individual fields on a screen #.at is screen %lo& logic1 #.at are t.e selections in it1 E8plain PAI an" PBO1 Ans 5 Screen %lo& logic contains t.e proce",ral part o% a screen* T.e screen %lo& logic is li$e an ABAP progra+ in t.at it ser2es as a container %or processing 'loc$s* T.ere are %o,r e2ent 'loc$sB eac. o% &.ic. is intro",ce" &it. t.e screen $e0&or" PROCESS) &:)(/$$ ,/F):/ );2&;2. ... &:)(/$$ %F2/: *?&;2. ... &:)(/$$ )? B/L&0:/E;/$2. ...

F@ &:)(/$$ )? >%L;/0:/E;/$2. $elections are performed in &%*. PROCESS BEFORE O4TP4T -&,). is automatically triggered after the &%* processing of the previous screen and before the current screen is displayed. Dou can program the &,) processing of the screen in this bloc!. %t the end of the &,) processing, the screen is displayed. PROCESS AFTER INP4T -&%*. is triggered hen the user chooses a function on the screen. Dou can program the &%* processing of the screen in this bloc!. %t the end of the &%*. processing, the system either calls the next screen or carries on processing at the point from hich the screen as called. PROCESS ON 7ELP5REQ4EST -&)B. and PROCESS ON =AL4E5 REQ4EST -&)>. are triggered hen the user re"uests field help -F1. or possible values help -F<. respectively. Dou can program the appropriate coding in the corresponding event bloc!s. %t the end of processing, the system carries on processing the current screen. Can &e ,se #RITE state+ent in screen %iel"s 1 I% not .o& is "ata trans%erre" %ro+ %iel" "ata to screen %iel"s - #e cannot rite field data to the screen using the #:*2/ statement. 2he system instead transfers data by comparing screen field names ith %,%&/< variable names. *f both names are the same, it transfers screen field values to %,%&/< program fields and vice0versa. 2his happens immediately before and immediately after displaying the screen. 7o& "oes t.e interaction 'et&een t.e D0npro an" t.e ABAP/9 +o",les ta$es place 1 - % transaction is a collection of screens and %,%&/< routines, controlled and executed by a 8ialog processor. 2he 8ialog processor processes screen after screen, thereby triggering the appropriate %,%&/< processing for each screen. For each screen, the system executes the flo logic that contains the corresponding %,%&/< processing. 2he control passes from screen flo logic to %,%&/< code and bac!. 7o& "oes t.e Dialog .an"le ,ser re3,ests 1 0 #hen an action is performed, the system triggers the &:)(/$$ %F2/: *?&;2 event. 2he data passed includes field screen data entered by the user and a function code. % function code is a technical name that has been allocated in the $creen &ainter or 1enu &ainter to a menu entry, a pushbutton, the /?2/: !ey or a function !ey of a screen. %n internal or! field -o!0code. in the &%* module evaluates the function code, and the appropriate action is ta!en.

F1

7o& are t.e %,nction co"es .an"le" in %lo& logic 1 0 #hen the user selects a function in a transaction, the system copies the function code into a specially designated or! field called )CL()8/. 2his field is global in the %,%&/< module pool. 2he )CL()8/ can then be evaluated in the corresponding &%* module. 2he function code is al ays passed in exactly the same ay, regardless of hether it comes from a screen's pushbutton, a menu option, function !ey or other G;* element. #.at controls t.e screen %lo& 1 - 2he $/2 $(://? and L/%>/ $(://? statements control screen flo . #.at are O%iel"P an" Oc.ainP state+ents 1 - 2he F*/L8 and (B%*? flo logic statements let you program your o n field chec!s. F*/L8 and (B%*? tell the system hich fields you are chec!ing,and hether the system should perform chec!s in the flo logic or call an %,%&/< module. #.at is an on OU5inp,t %iel"P state+ent 1 - )? 60*?&;2 2he %,%&/< module is called if the user has entered a _6_ in the first character of the field, and the field has the attribute 60entry in the $creen &ainter. Dou can use this option in exceptional cases here you ant to chec! only fields ith certain !inds of input. #.at are con"itional c.ain state+ents 1 - )? (B%*?0*?&;2 similar to )? *?&;2. 2he %,%&/< module is called if any one of the fields in the chain contains a value other than its initial value -blan!s or nulls.. )? (B%*?0:/E;/$2 2his condition functions just li!e )? :/E;/$2, but the %,%&/< module is called if any one of the fields in the chain changes value. #.at is Oat e8it5co++an"P 1 - 2he flo logic !ey ord %2 /H*20()11%?8 is a special addition to the 1)8;L/ statement in the flo logic. %2 /H*20()11%?8 lets you call a module before the system executes the automatic field chec!s. #.ic. %,nction t0pe .as to 'e ,se" %or ,sing Oat e8it5co++an"P 1 - 2o use %2 /H*20()11%?8, e must assign a function type ]/ to the relevant function in the 1enu &ainter or $creen &ainter. #.at is t.e "i%%erence 'et&een SET SCREEN an" CALL SCREEN 1 #ith $/2 $(://?, the current screen simply specifies the next screen in the chain. control branches to this next screen as soon as the current screen has been processed.

F3 :eturn from next screen to current screen is not automatic. *t does not interrupt processing of the current screen. *f e ant to branch to the next screen ithout finishing the current one, use L/%>/ $(://?. #ith (%LL $(://?, the current -calling. chain is suspended, and a next screen -or screen chain. is called in. 2he called screen can then return to the suspended chain ith the statement L/%>/ $(://? 2) $(://? @. $ometimes e might ant to let an user call a popup screen from the main application screen to let them enter secondary information. %fter they have completed their entries, the users should be able to close the popup and return directly to the place here they left off in the main screen. Bere comes (%LL $(://? into picture. 2his statement lets us insert such a se"uence into the current one. Can &e speci%0 t.e ne8t5screen n,+'er &it. a 2aria'le* : !es / No ;* Des. T.e %iel" S!5D!NNR re%ers to AAAAAAAAAAAAAAAA* ?umber of the current screen. #.at is a "ialog +o",le 1 % dialog module is a callable se"uence of screens that does not belong to a particular transaction. 8ialog modules have their o n module pools, and can be called by any transaction. T.e s0nta8 ,se" to call a screen as a "ialog 'o8 : pop,p ; is AAAAAAAAAAAAAAAAA* (%LL $(://? 4screen number5 $2%:2*?G %2 4start column5 4start line5 /?8*?G %2 4end column5 4end line5 . #.at is a Ocall +o"eP 1 *n the %,%&/< orld, each stac!able se"uence of screens is a _call mode_. 2his is important because of the ay you return from a given current se"uence. 2o terminate a call mode and return to a suspended chain, set the _next screen_ to @ and leave to it+ L/%>/ 2) $(://? @ or - $/2 $(://? @ and L/%>/ $(://? .. #hen you return to the suspended chain, execution resumes ith the statement directly follo ing the original (%LL $(://? statement. 2he original se"uence of screens in a transaction is itself is a calling mode. *f you L/%>/ 2) $(://? @ in this se"uence - that is, ithout having stac!ed any additional call modes ., you return from the transaction altogether. T.e +a8i+,+ n,+'er o% calling +o"es stac$e" at one ti+e is AAAAAA* ?ine. #.at is L4# or Data'ase L4# or Data'ase Transaction 1

F9 % [L;#\ - logical unit of or! . is the span of time during hich any database updates must be performed in an [all or nothing\ manner. /ither they are all performed - committed . , or they are all thro n a ay - rolled bac! .. *n the %,%&/< orld, L;#s and transactions can have several meanings+ L;# - or [database L;#\ or [database transaction\ . 2his is the set of updates terminated by a database commit. % L;# lasts, at most, from one screen change to the next - because the $%& system triggers database commits automatically at every screen change .. #.at is SAP L4# or 4p"ate Transaction 1 ;pdate transaction - or [$%& L;#\. 2his is a set of updates terminated by an %,%&/< commit. % $%& L;# may last much longer than a database L;#, since most update processing extends over multiple transaction screens.2he programmer terminates an update transaction by issuing a ()11*2 #):C statement. #.at .appens i% onl0 one o% t.e co++an"s SET SCREEN an" LEA=E SCREEN is ,se" &it.o,t ,sing t.e ot.er1 *f e use $/2 $(://? ithout L/%>/ $(://?, the program finishes processing for the current screen before branching to 4scr no5. *f e use L/%>/ $(://? ithout a $/2 $(://? before it, the current screen process ill be terminated and branch directly to the screen specified as the default next0screen in the screen attributes. #.at is signi%icance o% t.e screen n,+'er KS 1 *n _calling mode_, the special screen number @ -L/%>/ 2) $(://? @. causes the system to jump bac! to the previous call level. 2hat is, if you have called a screen se"uence ith (%LL $(://? leaving to screen @ terminates the se"uence and returns to the calling screen. *f you have not called a screen se"uence, L/%>/ 2) $(://? @ terminates the transaction. #.at "oes t.e co++an" KS4PPRESS DIALO "o 1 $uppressing of entire screens is possible ith this command. 2his command allo s us to perform screen processing [in the bac!ground\. $uppresing screens is useful hen e are branching to list0mode from a transaction dialog step. #.at is t.e signi%icance o% t.e +e+or0 ta'le KSCREEN 1 %t runtime, attributes for each screen field are stored in the memory table called ]$(://?. #e need not declare this table in our program. 2he system maintains the table for us internally and updates it ith every screen change. #.at are t.e %iel"s in t.e +e+or0 ta'le KSCREEN 1 0 ?ame Length 8escription

F< #.0 gro,ping o% %iel"s is re3,ire" 1 #.at is t.e +a8i+,+ n,+'er o% +o"i%ication gro,ps %or eac. %iel" 1 0 *f the same attributes need to be changed for several fields at the same time these fields can be grouped together. #e can specify up to four modification groups for each field. #.at is a screen gro,p 1 7o& it is ,se%,l 1 $creen group is a field in the $creen %ttributes of a screen. Bere e can define a string of up to four characters hich is available at the screen runtime in the $D0 8?G: field. :ather than maintaining field selection separately for each screen of a program, e can combine logically associated screens together in a screen group. #.at is a S,'screen 1 7o& can &e ,se a S,'screen 1 % subscreen is an independent screen that is displayed in an area of another -_main_. screen. 2o use a subscreen e must call it in the flo logic - both &,) and &%* . of the main screen. 2he (%LL $;,$(://? statement tells the system to execute the &,) and &%* events for the subscreen as part of the &,) or &%* events of the main screen. 2he flo logic of your main program should loo! as follo s+ &:)(/$$ ,/F):/ );&2&;2. (%LL $;,$(://? 4area5 *?(L;8*?G '4program5' '4screen5'. &:)(/$$ %F2/: *?&;2. (%LL $;,$(://? 4area5. %rea is the name of the subscreen area you defined in your main screen. 2his name can have up to ten characters. &rogram is the name of the program to hich the subscreen belongs and screen is the subscreen's number. #.at are t.e restrictions on S,'screens 1 $ubscreens have several restrictions. 2hey cannot+ $et their o n G;* status Bave a named )C code (all another screen (ontain an %2 /H*20()11%?8 module $upport positioning of the cursor 7o& can &e ,se / "ispla0 ta'le "ata in a screen 1 %,%&/< offers t o mechanisms for displaying and using table data in a screen. 2hese mechanisms are 2%,L/ ()?2:)L$ and $2/& L))&$. #.at are t.e "i%%erences 'et&een TABLE CONTROLS an" STEP LOOPS 1 0 2%,L/ ()?2:)L$ are simply enhanced $2/& L))&$ that display data ith the loo! and feel of a table idget in a des!top application. ,ut from a programming standpoint, 2%,L/ ()?2:)L$ and $2/& L))&$ are almost exactly the same. )ne major difference bet een $2/& L))&$ and 2%,L/ ()?2:)L$ is in $2/& L))&$ their table ro s can span more than one line on the screen. ,y contrast the ro s in a 2%,L/ ()?2:)L$ are al ays single lines, but can be very long. - 2able

F= control ro s are scrollable .. 2he structure of table controls is different from step loops. % step loop, as a screen object, is simply a series of field ro s that appear as a 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 and hat the user can do ith it. #.0 "o &e nee" to co"e a LOOP state+ent in 'ot. t.e PBO an" PAI e2ents %or eac. ta'le in t.e screen 1 #e need to code a L))& statement in both &,) and &%* events for each table in the screen. 2his is because the L))& statement causes the screen fields to be copied bac! and forth bet een the %,%&/< program and the screen field. For this reason, at least an empty L))&....../?8L))& must be there. T.e %iel" S!5STEPL re%ers to AAAAAAAAAAAAAAAAAAA * 2he index of the screen table ro that is currently being processed. 2he system variable $D0$2/&L only has a meaning ithin the confines of L))&.../?8L))& processing. )utside the loop, it has no valid value. 7o& can &e "eclare a ta'le control in t.e ABAP/9 progra+ 1 ;sing the syntax controls 4table control name5 type tablevie no5. using screen 4scr

Di%%erentiate 'et&een static an" "0na+ic step loops* $tep loops fall into t o classes+ $tatic and dynamic. $tatic step loops have a fixed si7e that cannot be changed at runtime. 8ynamic step loops are variable in si7e. *f the user re0si7es the indo the system automatically increases or decreases the number of step loops bloc!s displayed. *n any given screen you can define any number of static step loops but only a single dynamic one. #.at are t.e t&o &a0s o% pro",cing a list &it.in a transaction 1 ,y submitting a separate report. ,y using lea2e to list5processing* #.at is t.e ,se o% t.e state+ent Lea2e to list5processing 1 Lea2e to list5processing statement is used to produce a list from a module pool. Lea2e to list5processing statement allo s to s itch from dialog0mode to list0mode ithin a dialog program. #.en &ill t.e c,rrent screen processing ter+inates 1 % current screen processing terminates hen control reaches either a Lea2e5screen or the end of PAI. 7o& is t.e co++an" S,ppress5Dialog ,se%,l 1 $uppressing entire screens is possible using this command. 2his command allo s

FA us to perform screen processing [in the bac!ground\. 2he system carries out all &,) and &%* logic, but does not display the screen to the user. $uppressing screens is useful hen e are branching to list0mode from a transaction dialog step. #.at .appens i% &e ,se Lea2e to list5processing &it.o,t ,sing S,ppress5Dialog 1 *f e don't use S,press5Dialog the next screen ill be displayed but as empty. hen the user presses /?2/:, the standard list output is displayed. 7o& t.e transactions t.at are progra++e" '0 t.e ,ser can 'e protecte" 1 ,y implementing an a,t.orit0 c.ec$. #.at are t.e +o"es in &.ic. an0 ,p"ate tas$s &or$ 1 $ynchronous and %synchronous. #.at is t.e "i%%erence 'et&een S0nc.rono,s an" As0nc.rono,s ,p"ates 1 % program as!s the system to perform a certain tas!, and then either aits or doesn't ait for the tas! to finish. *n synchronous processing, the program aits+ control returns to the program only hen the tas! has been completed. *n asynchronous processing, the program does not ait+ the system returns control after merely logging the re"uest for execution. #.at is t.e "i%%erence 'et&een Lea2e Transaction an" Call Transaction 1 *n contrast to L/%>/ 2) 2:%?$%(2*)?, the (%LL 2:%?$%(2*)? statement causes the system to start a ne $%& L;# . 2his second $%& L;# runs parallel to the $%& L;# for the calling transaction. O2erall .o& "o 0o, &rite transaction progra+ in SAP1 (reate the transaction using object bro ser -$/F@. 8efine the objects e.g. screen, 2ransactions. O 1odules O &,), &%*. %nd you can create a transaction from $/K9 also. Does SAP .as a 4I screen painter1 I% 0es #.at operating s0ste+s is it a2aila'le on1 #.at is t.e ot.er t0pe o% screen painter calle"1 Des )n hat )$ is it available O #indo based. )ther type of screen painter O alpha numeric screen painter. #.at are step loops1 7o& "o 0o, progra+ page "o&n page ,p in step loop1 $tep loops+ 1ethod of displaying a set of records. &age do n T &age up+ decrement / increment base counter *ndex M base Z sy0step1 O 1 Nor+all0 .o& +an0 an" &.at %iles get create" &.en a transaction progra+ is &ritten1 #.at is top GGGGGGTOP progra+1 1ain program ith % *ncludes * . 2)& *?(L;8/ O GL),%L 8%2%

FJ ** . *nclude for &,) ***. *nclude for &%* *>. include for Forms #.ere is processing logic locate" in an on5line progra+1 %ns +0 %,%&/< program -module pool. Descri'e t.e online processor* #.at is its %,nction1 %ns +0 (ontrols the flo of online program. 7o& are screen na+es "e%ine"1 Do 0o, create a screen %irst or "e%ine 0o,r progra+ %irst1 %ns +0 8efine the program first and then create a screen. #.at "oes PBO stan"s %or1 #.en is t.e PBO logic per%or+e"1 %ns +0 &:)(/$$ ,/F):/ );2&;2 O&rocessed before the screen is displayed. #.at "oes PAI stan"s %or1 #.en is t.e PAI logic per%or+e"1 %ns +0 &:)(/$$ %F2/: *?&;2 O&rocessed after the user has pressed /?2/:. 7o& is "ata passe" %ro+ t.e screen %iel"s to t.e ABAP/9 progra+1 %ns +0 2hrough the flo logic. #.at "oes t.e TOP Incl,"e "o %or 0o, as a progra++er1 %ns+ For global declarations. #.at are t.e steps in creating screen1 #.ere are t.e +o",le state+ent "eclare"1 #.ere is t.e logic &it.in eac. +o",le1 %ns +0 >* Go to $/<1 - $creen &ainter . /nter the program name and screen number . &ress /nter. Q* 8esign the screen and save, chec! and activate it. 1odule statements are in the flo module pool &rogram. logic ithin each module is in the %,%&/<

#.at is t.e signi%icance o% t.e &or" KO4TP4T in t.e "eclaration 1)8;L/ 2/$2LC?)#L/8G/ );2&;2 /?81)8;L/. %ns +0 2hen e !no that it is part of the &,), therefore is processed before the screen is presented.

FF Descri'e t.e %iel"s on t.e screen 1 %ns +0 %ttributes screen , $creen types ,follo up screens , cursor position etc. %fter you have entered the screen number, the screen branches to the screen attribute maintenance. /nter a short description , select the type ?):1%L and specify the number of the follo 0up screen. #.at are t.e t.ree co+ponents o% ON5LINE progra+1 %ns +0 $creen , %,%&/< program and transaction code. #.at is gaine" '0 ,sing t.e Dictionar0 Fiel"s +en, option &.en creating 0o,r screen1 %ns +0 2he fields you have created inherits the same attributes as those in the 8ata 8ictionary. 7o& to Create a c.ec$'o8 B %ra+eB p,s.',ttons an" ra"io ',ttons on a screen1 %ns +0 Vust type a name and go to graphic element push button. 7o& "o 0o, assign an OEACODE %or a p,s. ',tton1 7o& it is ,se" in 0o,r ABAP1 %ns +0 *n the field list ,name the element and give it the value that it ill represent hen pushed Dou must ma!e sure that you clear the field that represents the pushbutton after every chec!. #hat automatic chec!s does the screen performI -should be four. Descri'e all %o,r an" .o& t.e0 are ,se"1 %ns +0 2he field format, re"uired input, a foreign !ey table ,parameters. #.at are t.e t&o +et.o"s to "eclare inp,t %iel" as +an"ator01 *f you set re"uired field as program attribute, the user must enter a value in the field. :e"uired fields appear on the screen containing a "uestion mar! -I.. 7o& "oes %oreign $e0 &or$1 #.at 0o, .a2e to p,t in 0o,r screen to i"enti%0 t.e %oreign $e01 No1 T.en &.ere is t.e %oreign $e0 i"enti%ie"1 %ns +0 Dou have defined a screen field by referring to a 8ata 8ictionary, hich has a chec! table. #hen the foreign !ey is chec!ed the system compares the values of the fields to be chec!ed ith the contents of the !ey fields of the corresponding table. #.at are t.e t&o e%%ects o% t.e %oreign $e0 %ro+ a ,ser stan"point1 %ns +0 &ossible entries T a chec! against the !ey field contents. #.at is ,ser "e%ine" 2ali"ation c.ec$s in t.e %lo& logic1 %ns +0 F*/L8W$/L/(2 F*/L8W>%L;/$ or in the module pool F*/L8W 1)8;L/. Does t.e 2al,e co++an" in t.e %lo& logic go in t.e PAI or t.e PBO e2ent1 %ns +0 &%*.

FK

&f an error occurs in t$e module pool, :$ic$ fields are available for entr* and :$ic$ are displa* onl* fields; %ns +0 )nly those fields defined ith the F*/L8 statement before 1)8;L/ T relevant chec!s in a chain. #.en is t.e c.ain co++an" ,se" in t.e PBO e2ent1 %ns +0 *f you ant to ma!e more than one field ready for input after an error. #.at ta'le stores t.e online +essages1 #.at is t.e +essage class an" &.at is its signi%icance1 %ns +0 2able 21@@. 2he message class is a specific class of messages for a group of transactions. 9$at are t$e ! different message t*pes and $o: are t$e* $andled b* t$e s*stem; 9$at is t$en difference bet:een t$e 9arning and <rror messages; %ns +0 % + %bend 1essage displayed on the current screen and subse"uent tas! terminated * + *nformation 1essage displayed on the current screen , but user can continue program by pressing /?2/: /+ /rror 1essage displayed on the current screen. #ith F*/L8 statements , the fields concerned become ready again for input and user is re"uired to ma!e the entry /entries again # + #arning %s / message , but correcting input is optional $+ $uccess 1essage displayed on the follo 0up screen as an * message. #.at "oes #IT7 state+ent a"" to a +essage1 %ns +0 *n the place of the T or a the fields or values are placed in the error message. #.at e%%ect "oes t.e FIELD state+ent .a2e &it.in t.e %lo& logic1 %ns +0 2he field statement resets the fields so those fields are ready for input again. #.ere are t.e +essages "ispla0e" on t.e screen1 %ns +0 %t the bottom. Is t.e SET PARAMETER state+ent to 'e iss,e" in PBO or PAI +o",le1 #.01 %ns +0 &%*, the value must be input into the fields first before it can be placed in the buffer. 9$ere does t$e G<T PA5A7<T<5 statement get its values; 9$ic$ field gets populated :it$ t$e ne: value; %ns +0 From the buffer. #.ere can t.e SET C4RSOR co++an" 'e e8ec,te"1 #.at is its e%%ect1 %ns +0 *n &,), 2o position the (;:$): in a particular field after the screen is displayed.

K@

9$at are t$e matc$codes and $o: do t$e* affect t$e screen field; 9$ere are t$e* specified in t$e online program; %ns +0 *n the &roperties indo of the Field. #.at is t.e e%%ect o% an ON C7AIN5REQ4EST co++an" in 0o,r %lo& logic1 %ns +0 #hen value of any of the fields bet een (B%*?W../?8(B%*? is attempted to change. #.at co++an"s are ,se" to c.ange "ata'ase ta'le entries1 %ns +0 7o& can 0o, c.ec$ i% t.e c.anges to t.e "ata'ase &ere s,ccess%,l1 %ns +0 #.at is t.e "i%%erence 'et&een t.e Long %or+ an" t.e s.ort %or+ o% +a$ing "ata'ase c.anges1 %ns +0 Long Form+ ;pdate 1%:% and set brge M @ here matnr M ]1%2Y. 2his is a standard )racle $tatement to modify the entry in the 8atabase. $hort Form+ 1%:%01%2?: M ]1%21. 1%:%0,:G/# M @. 1odify 1%:%. 2his is an $%& defined statement to modify the table. *t is more secure and consistent. #.at is t.e a"2antages ,sing t.e SAP long %or+ o2er t.e s.ort %or+ o% "ata'ase c.anges1 %ns +0 1ay be Fast /ffect. Can K&.ere cla,se 'e ,se" &.en ,p"ating "ata'ase entries1 %ns +0 Des. Descri'e arra0 operations an" t.eir a"2antages1 %ns +0 #.at is logical ,nit o% &or$1 7o& is it "e%ine"1 %ns +0 Logical ;nit of or! is a bloc! of memory area here database contents are stored and manipulated. For every $%& application L;# is automatically created for database communication. ,esides this e have $%& L;# s also there. #.at %,nction is per%or+e" '0 t.e co++it &or$ co++an"1 %ns +0 #hen you perform (ommit , all the L;# s or! database. ill be reflected to the

K1

#.0 is it so i+portant %or a progra++er to c.ec$ t.e loc$ entries1 %ns +0 2o find out if record is loc!ed and also to maintain data integrity. 7o& can 0o, %in" a loc$ entr0 %or a "ata'ase ta'le1 %ns +0 2he function module ]/?E;/;/ 4loc! object5 chec!s hether a loc! as triggered for the same object. )ther ise an exception F):/*G?LL)(C is carried out. *f the object is not loc!ed the function module sets the loc!. #.at steps are necessar0 to set a loc$ on a recor" &it.in a "ata'ase ta'le1 %ns +0 /xecute (%LL F;?(2*)? statement (%LL F;?(2*)? [/?E;/;/ 4loc! object5 /H&):2*?GW /H(/&2*)?$W (%$/ $D0$;,:(. . . /?8(%$/. 7o& "o 0o, ,nloc$ t.e entr01 #.0 is t.is necessar01 %ns +0 /xecute the (%LL F;?(2*)? statement (%LL F;?(2*)? ]8/E;/;/ 4loc! object5 /H&):2*?GW *t is important to unloc! the entry so others can update it. #.at is t.e "i%%erence 'et&een KCALL SCREEN V V V K an" KSET SCREEN VVV W LEA=E SCREEN1 %ns +0 $/2 $(::/? statement sets or over rites the follo 0up screen. L/%>/ $(://? executes the screen number currently in the follo 0screen field (%LL $(://? interrupts the processing of the current screen to call a ne screen or a chain of screens, processing of the current screen is resumed directly after the call. After a (A,, S(5<<4 command :$ere does t$e processing return after t$e screen $as been executed; %ns +0 *t returns the processing to the calling screen. #.ic. is t.e +ore si+ilar to a call &it. ret,rnB t.e SET SCREEN or t.e CALL SCREEN1 %ns +0 2he (%LL $(://? command. #.at %,nction is per%or+e" '0 t.e SET SCREEN S co++an"1 %ns +0 :eturns to the original screen.

K3 #.at are t.e +ain "i%%erences 'et&een t.e repot stat,s an" screen stat,s1 %ns +0 #.ere +,st 0o, place t.e SET PF5STAT4S co++an" in 0o,r online progra+1 %ns +0 &lace it in the &,) module of the screen. #.0 is it goo" i"ea to clear OEACODE %iel" a%ter "eci"ing &.ic. action to ta$e1 %ns +0 Dou need to clear the )C code to avoid sending a screen that already has a function code. 7o& "o 0o, speci%0 t.at a %,nction is an e8it t0pe co++an"1 %ns +0 ,y specifying function type / for the pushbuttons or menu options in the screen painter or menu painter. #.at is t.e p,rpose o% t.e KAT EGIT5COMMAND1 %ns +0 ;sually there are many ays to leave a screen -bac!,exit,cancel. .2his command ill perform termination logic for all functions of type /. #.at are screen gro,ps1 %ns +0 % group of screen fields such as radio buttons or chec!boxes. #.at is t.e correct s0nta8 %or "0na+icall0 +o"i%0ing a large n,+'er o% screen %iel"s1 %ns +0 1)8;L/ 1)8*FD L$(://?L);2&;2 . . . L))& %2 $(://? *F $(://? OG:);& M 98 ]G:1 $(://?0*?&;2M98 1 /?8*F. *F $(://?0?%1/ M 98 ]2%,0F*/L8 $(://?0%(2*>/M98 @. /?8*F. 1)8*FD $(://?. /?8L))&. #.at is t.e na+e o% t.e internal ta'le t.at stores t.e screen in%or+ation1 %ns +0 $(://?. #.at is t.e p,rpose o% t.e MODIF! co++an" &.en per%or+ing t.e "0na+ic screen +o"i%ications1 %ns +0 after you activate or deactivate the field attributes by assigning them 1 or @, you save the modifications via 1)8*FD $(://? command.

K9 Direction %or t.e ,se o% c.ec$ 'o8 an" ra"io ',ttons in screen painter1 %ns +0 (reating :adio ,utton and (hec! ,oxes on the screen Go to the full screen editor. &lace an underscore at the point here you ant to place the field. 8efine the name of the field using 4Field %ttributes5 &lace the cursor on the field and press 4Graphic element5 2hen press 4:adio ,uttons5 or 4(hec! boxes5 depending on hich graphic element you ant 2hen you group related chec! boxes and radio boxes. #.at are ,ser E8its an" transactions1 %ns +0 Generally, user exits are the forms defined ithin $%& standard code -usually starting ith user exit.. 2hese predefined areas in the code allo programmers to insert custom defined code into the standard processing of a transaction -e.g. allo resorting of the batch se"uence in >%@1 batch processing.. 2here are many specific examples if you are interested, but usually user exits are searched for hen a specific use is being analy7ed. #.at .appens i% 0o, enter S in NEGT Screen attri',te1 %ns +0 *t does not go to any other screen and it moves bac! one level. Bo ever you can control this in run0time using $/2 $(://? command. 7o& to +o"i%0 t.e attri',tes o% screen %iel"s at r,n ti+e 1* #e loop through the fields of the screen. #hen you find the name of a screen field you ant to modify, set attributes for the field and use 1)8*FD $(://? to update the attribtes. Dou can find the attributes in the internal table $(://?. 2his loop ma!es some of the screen fields invisible ind a selection screen+ %2 $/L/(2*)?0$(://? );2&;2. L))& %2 $(://?. *F screen0name M '&L>/:%,' ): screen0name M '&L$2H21' ): screen0name M '&L$2H23' ): screen0name M 'UL&L>/:%,LUL%&&LU02/H2' ): screen0name M 'UL&L$2H21LUL%&&LU02/H2' ): screen0name M 'UL&L$2H23LUL%&&LU02/H2'. screen0active M '@'. 1)8*FD $(://?. /?8*F. /?8L))&. 7o& to lea2e "0npro allt.o,g. re3,ire" entr0 not +a"e 1

K< *n the menu painter 0 Function attributes for the button, set Functional type to / -/xit command. &:)(/$$ %F2/: *?&;2. (all module that leaves screen before ;serL(ommandLxxxx is executed 1)8;L/ :eturn/xit %2 /H*20()11%?8. 1)8;L/ userLcommandL1@@@. 1)8;L/ returnexit. (%$/ sy0ucomm. #B/? '(%?('. _)r hatever you ant to call it (lear Lscreen. L/%>/ 2) $(://? @. /?8(%$/. /?81)8;L/. Calling a report %ro+ a "0npro 2here are to ays to do this+ ;se leave to list0processing if you ant to do it in your module pool. Dou ill not be able to use selection0screens. ;se the submit statement to start a seperate report from your dynpro. %nyone ho have idea on ho to !no the selected value on run0timeI Bo can get the table control attribute selected value I * try to read the value in debuger hich is b -tableLcontrol0cols0selected.. 2here is no difference on the other ro hich is not selected. 2he tc0cols0selected is for column selection only. For ro scenarios selection you have t o

turn on the $el(olumn attribute in screen painter, give it a name and declare an abap variable ith the same name type ( length 1. *n your &%* loop at itab, hen the selected ro is processed the abap variable ill M 'H'. %t this point you can save the record or !ey. you can determine hich ro the cursor is on in your table control as follo s+ 8%2%+ L*?/L$/L L*C/ $D0$2/&L, 2%,*H L*C/ $D02%,*H G/2 (;:$): L*?/ L*?/L$/L.

K= 2%,*H M 4table control502)&LL*?/ Z L*?/L$/L 0 1. 2%,*H is no the index of the selected ro . F< Belp 0 (alling it from a program and limiting values I 2o avoid the standard F< help to be sho , insert the event &:)(/$$ )?0>%L;/0 :/E;/$2 in the program and add a field statement for the field that should trigger the F< help. *n the mdoule called from &:)(/$$ )?0>%L;/0:/E;/$2, call function module F<*FLF*/L8L>%L;/L:/E;/$2. /xample 1 0 8ynpro process before output. ..... process after input. ..... &:)(/$$ )? >%L;/0:/E;/$2. F*/L8 itL7sd@@@@90prctr 1)8;L/ f<LhelpLforLpctr. 1)8;L/ f<LhelpLforLpctr *?&;2. ?)2/+ 2abname/fieldname is the name of the table and field for hich F< should be sho n. 6 8ynprog/8ynpnr/8ynprofield are the &rogran/8ynpro/Field in hich the f< value should be returned. 6 >alue+ 2he value of the 8ynpro fuield hen calling the F< help. Dou can limit the values sho n, by inseting a value in this parameter e.g '=@6' to sho only values beginning ith =@ (%LL F;?(2*)? 'F<*FLF*/L8L>%L;/L:/E;/$2' /H&):2*?G tabname fieldname 6 $/%:(BB/L& M 'P$8@@@@9' M '&:(2:' M'' names of the

KA 6 $BL&&%:%1 M'' dynpprog M 'P$8@@@@3L,:;G/:C)?>LL*$2/' dynpnr M '@1@@' dynprofield M '*2LP$8@@@@90&:(2:' 6 $2/&L M@ value M '=@6' 6 1;L2*&L/L(B)*(/ M'' 6 8*$&L%D M'' 6 $;&&:/$$L:/():8L*$2 M'' 6 (%LL,%(CL&:)G:%1 M'' 6 (%LL,%(CLF):1 M'' 2%,L/$ 6 :/2;:?L2%, M /H(/&2*)?$ 6 F*/L8L?)2LF);?8 M1 6 ?)LB/L&LF):LF*/L8 M3 6 *?()?$*$2/?2LB/L& M9 6 ?)L>%L;/$LF);?8 M< 6 )2B/:$ M= . *F sy0subrc 45 @. 1/$$%G/ *8 $D01$G*8 2D&/ $D01$G2D ?;1,/: $D0 1$G?) #*2B $D01$G>1 $D01$G>3 $D01$G>9 $D01$G><. /?8*F. /?81)8;L/. _ F<LhelpLforLpctr *?&;2.

#.at 0o, can "o &it. a transaction 2ariant *nsert default values into fields hange the ready for input status for fields Bide various screen elements, menu functions or entire screens %djust table control settings ?ote+ 2ransaction variants can only be used ith dialog transactions. 7o& to create a transaction 2ariant 2ransaction variants are created ith transaction+ $B8@ *n the field 2ransaction on $B8@ enter the transactioncode for the screen you ant tpo modify -/.g. >%@9. . *n the field >ariant on $B8@ enter the name you ant to give the transaction variant -/.g. P>%@9. &ress (reate ?o the screen for the transaction is sho n and you can enter default values in the fields of the screen

KJ &ress /nter. ?o a screen that enbles you to ma!e further customi7ing -Bide, )utput only, *nvisible, 1andatory. if the screen fields is sho n. %fter you have finished customi7ing the screen press /nter to go to the next screen or ave and exit to save the 2ransaction variant 7o& to %in" ,ser e8its 8isplay the program here you are searching for and exit and search for (%LL (;$2)1/:0/H*2 *f you !no the /xit name, go to transaction (1)8. (hoose menu ;tillities05$%& /nhancements. /nter the exit name and press enter. Dou ill no come to a screen that sho s the function module exits for the exit. ;sing &roject management of $%& /nhancements #e ant to create a project to enahance trasnaction >%@1 Go to transaction (1)8 (reate a project called P>%@1 (hoose the /nhancement assign radio button and press the (hange button *n the first column enter ><=%@@@3 &redefine sold0to party in sales document . ?ote that an enhancement can only be used i 1 project. *f the enhancement is allready in use, and error message ill be displayed &ress $ave &ress (omponents. Dou can no see that enhancement uses user exit /H*2L$%&1><=%L@@3. 8ouble clic! on the exit. ?o the function module is displayed. 8ouble clic! on include PH>>%;@< in the function module *nsert the follo ing code into the include+ /LC;??: M '31=='. %ctivate the include program. Go bac! to (1)8 and activate the project. Goto transaction >%@1 and craete a salesorder. ?ote that $old0to0 party no automatically is _31==_ 2o run the transaction varian, you must create a ne 2ransaction code in $/K9 that referes to the 2ransaction variant. (hoose 2ransaction ith variant as $tart object. ?ote+ 2he transaction variant can also be called from a program that imcludes a call to function module :$LB8$D$L(%LLL2(L>%:*%?2 Can a %iel" e8it on a screen access t.e 2al,es entere" '0 a ,ser on t.at screen %or t.e screen %iel"s ot.er t.an t.e %iel" %or &.ic. t.e e8it .as 'een applie"* i% 0es t.en .o&1 1aybe this function helps you+ 8D?&L>%L;/$L:/%8. *t reads the dynpro0values before processing &%*.

KF

#.at are e2ents in "ialogs1 &rocess ,efore )utput and &rocess %fter *nput. &rocess )n >alue &rocess )n Belp 1odule output. 1odule input. #.at are signi%icance o% PBO an" PAI1 ,efore display the screen &,) is fired. 2his is for screen display %fter giving the user input &%* is fired. 2his is for input validation #.ere 0o, &ill 2ali"ate entries in t.e %iel"s1 /ntries can be validated in &%*. Dou can validate in Field /xits also. #.at is ,se o% C.ain an" En"C.ain1 For calling a particular &%* module if any one of fields in a group meets a condition, use to combine all such fields . 7o& to c.ange screen "0na+icall01 ,y modifying the screen attributes. 7o& to capt,re c.anges on t.e screen %iel"s1 Sa+e in case o% ta'le control1 #e can capture changes on the screen fields using module on input and on re"uest. I% 0o, are 2ali"ating contents o% %iel" ',t ,ser &ant to e8it %ro+ t.e transaction &it.o,t 2ali"ating contentsX 7o& to .an"le t.is scenario1 ,y at exit0command e can do. 7o& to pass %iel" 2al,es %ro+ one screen to ot.er screen1 ,y using set and get parameter id statements. #.at is t.e "i%%erence in ,sing COMMIT #ORE &it.in a calle" transaction an" &it.in a calle" "ialog +o",le in an e8isting +o",le* %ns.+ Transaction+ *t ill create a ne L;# and so you have to say ()11*2 #):C in a called transaction for getting any of the update statements to be fruitful inside the called transaction. Dialog +o",le+ $ince no ne L;# is created, ()11*2 #):C is not necessary. #.ic. Q transaction co"es are ,se" to +anage en.ance+ents1 %ns+ $1)8 and (1)8 #.ic. en.ance+ent is localB &.ic. is glo'al) e

KK Field /xits $creen /xits &rogram /xits 1enu /xits #.ere can 0o, create an en.ance+ent to s.o& 0o,r o&n F> 7elp on a %iel"1 %ns+ in &)B #.at en.ance+ents can 'e create" ,sing C+o"1 %ns+ (ustomer /nhancements, i.e., Field /xits. #.at is t.e co"e %or s.o&ing a list pro",ce" in a "ialog progra+1 %ns+ Leave screen. Leave to List0processing. )r $ubmit 4program name5. #.en is %iel" Na+e> transporte" to t.e progra+ in t.is co"ing) &rocess %fter *nput. 1odule %,(. Field ?ame1 1odule 8/F. #.at is t.e e%%ect o% S4PPRESS DIALO in PBO1 Field ?ame3 1odule GB*. I% an error +essage &as raise" in Mo",le 7IB &.ic. %iel"s &o,l" 'e rea"0 %or inp,t1 %ns+ 2he fields that are placed in (B%*?WWW/?8(B%*?. In &.ic. Q places co,l" 0o, set t.e 'o81 4I stat,s an" title 'ar %or a +o"al "ialog

#.at "oes C7AIN ****END C7AIN "o1 $ometimes you ant to chec! several fields as a group. 2o do this, include the fields in a F*/L8 statement, and enclose everything in a (B%*?0/?8(B%*? bloc!. /xample 6666 $creen flo logic+ 6666 (B%*?. F*/L8+ $&FL*0(%::*8, $&FL*0()??*8. 1)8;L/ (B/(CLFL*GB2. /?8(B%*?. #hen an error is found inside a chain, the screen is re0displayed, and all fields found any here in the chain are input0enabled. %ll non0chain fields remain disabled. 7o& can 0o, test %lo& logic1 (hec! function chec!s the syntax,data0consisteny and screen layout of the screen.

1@@ 2o test the syntax, from the menu path choose screen00005chec!00000005 syntax. 2o test the data consistency, from the menu path choose screen00005chec!0000005 consistency. 2o chec! the layout,from ythe menu path choose screen000005chec!000005layout. #.at .appens i% 0o, c.oose .ol" "ata option in screen atri',tes1 2o retain data entered by a user. 2he system automatically displays this data if the user returns to this screen. #.at .appens i% 0o, enter S in NEGT screen attri',te1 *n %,%&/< each stac!able se"uence of screens is a _call mode_. 2his is important because of the ay you return from a given current se"uence. 2o terminate a call mode and return to a suspended chain, set the _next screen_ to @ and leave to it+#hen you return to the suspended chain, execution resumes ith the statement directly follo ing the original (%LL $(://? statement.2he original se"uence of screens in a transaction is itself a calling mode. 2he original se"uence of screens in a transaction is itself a calling mode. *f you L/%>/ 2) $(://? @ in this se"uence -that is, ithout having stac!ed any additional call modes., you return from the transaction altogether. 7o& +an0 +en, titles 0o, can .a2e in a +ain +en,1 Dou can have six menus in a menu bar.*n addition to this system provides t o more menus ie system and help. Dou can have only one menu bar for a status. Dou can maintain 1= entries in a menu and upto three levels. #.at is t.e "i%%erence 'et&een t.e Lc.ange on5inp,tL an" LC.ange on re3,estL in t.e PAI o% a screen1 )? *?&;2 2he %,%&/< module is called only if the field contains a value other than its initial value. 2his initial value is determined by the field's data type+ blan!s for character fields, 7eroes for numerics. )? :/E;/$2 2he %,%&/< module is called only if the user has entered a value in the field value since the last screen display. 2he value counts as changed even if the user simply types in the value that as already there. #.at are ,ser e8its1 #.at is in2ol2e" in &riting t.e+1 #.at preca,tions are nee"e"1 ;ser defined functionality included to predefined $%& standards. &oint in an $%& program here a customer's o n program can be called. *n contrast to customer exits, user exits allo developers to access and modify program components and data objects in the standard system. )n upgrade, each user exit must be chec!ed to ensure that it conforms to the standard system. 2here are t o types of user exit+

1@1 ;ser exits that use *?(L;8/s. 2hese are customer enhancements that are called directly in the program. ;ser exits that use tables. 2hese are used and managed using (ustomi7ing. $hould find the customer enhancements belonging to particular development class. #.at are t.e "i%%erent &a0s in &.ic. 0o, can +a$e c.anges to SAP stan"ar" so%t&are 1 (ustomi7ing /nhancements to the $%& $tandard 1odifications to the $%& $tandard (ustomer 8evelopment #.at is c,sto+i6ing 1 (ustomi7ing is the setting of system parameters via $%&'s o n interface. #.0 "o 0o, nee" en.ance+ents 1 2he standard applications do not offer some of the functionality you need. 2he :/9 enchancement concept allo s you to add your o n functionality to $%&'s standard business applications. #.at are t.e "i%%erent t0pes o% en.ance+ents 1 /nhancements using customer exits (ustomers' potential re"uirements hich are not included in the standard soft are are incorporated in the standard as empty modification 'shells'. (ustomers can then fill these ith their o n coding. /nhancements can relate to programs, menus and screens. ;p ard compatibility is assured. *n other ords, $%& guarantees that the jump from the standard soft are to the exit and the interface hich call the exit ill remain valid in future releases. En.ance+ents to ABAP/9 Dictionar0 ele+ents 2hese are %,%&/< 8ictionary enhancements -creation of table appends., text enhancements -customer0specific !ey ords and documentation for data elements. and field exits -creation of additional coding for data elements.. #.at is c,sto+er "e2elop+ent 1 (reating customer0specific objects ithin the customer name range. #.at is SSCR 1 $$(: -$%& $oft are (hange :egistration. is a procedure, for registering all manual changes to $%& source coding and $%& 8ictionary objects. #.at is t.e "i%%erence 'et&een +o"i%ications an" en.ance+ents 1 1odifications mean ma!ing changes to the $%& standard functionality.

1@3 /nhancements mean adding some functionality to $%& standard functionality. #.at are t.e "isa"2antages o% +o"i%ication 1 1odifying standard code can lead to errors 1odifications mean more or! during soft are upgrades #.at are t.e a"2antages o% en.ance+ents 1 8o not affect standard $%& source code 8o not affect soft are upgrades &.en "o 0o, opt %or +o"i%ication 1 (ustomer exits are not available for all programs and screens ithin the :/9 standard applications. Dou can only use exits if they already exist ithin the $%& :/9 $ystem . )ther ise you have to opt for modifications . #.at are t.e 2ario,s t0pes o% c,sto+er e8its 1 1enu exits $creen exits Function module exits Cey ord exits #.at is a +en, e8it 1 %dding items to the pulldo n menus in standard :/9 applications . >/*#.at is a screen e8it 1 %dding fields to the screens ithin :/9 applications. $%& creates screen exits by placing special subscreen areas ithin a standard :/9 screen and calling a customer subscreen from ithin the standard dynpro's flo logic. #.at is a %,nction +o",le e8it 1 %dding functionality to :/9 applications. Function module exits play a role in both menu and screen exits. #.at is a $e0&or" e8it 1 %dd documentation to the data elements of !ey ords defined in the %,%&/< 8ictionary. 2he system displays this documentation henever a user presses F1 to get online help for a screen field. 7o& "o SAP organi6es its e8its 1 $%& organi7es its exits in pac!ages that are called $%& enhancements. /ach $%& enhancement can contain many individual exits. #.at is an a""5on pro(ect 1 2o ta!e advantage of the exits available ithin standard :/9 applications, you need to create an add0on project. 2his project lets you organi7e the enhancement pac!ages and exits you ant to use. 2he add0on project also allo s you to hang add0on functionality onto the exit hoo!s contained ith $%& enhancements.

Das könnte Ihnen auch gefallen