Common Questions and Answers About ABAP
Common Questions and Answers About ABAP
5221 -. sets ;*B.-<II to the index of the current line at the beginning of each loop lass. -t the end of the loop,
;*B.-<II is reset to the +alue that it had before entering the loop. It is set to ) if the table has the type @-;@/3
.-<5/.
6/-3 .-<5/ sets ;*B.-<II to the index of the table line read. If you use a binary search, and the system does
not find a line, ;*B.-<II contains the total number of lines, or one more than the total number of lines. ;*B
I:3/I is undefined if a linear search fails to return an entry.
;/-64@ FitabG F26 sets ;*B.-<II to the index of the table line in which the search string is found.
'(-#FI%%
-fter the statements 3/;46I</ .-<5/, 5221 -., and 6/-3 .-<5/, ;*B.FI55 contains the number of lines
in the rele+ant internal table.
'(-#%)*9
-fter the statements 3/;46I</ .-<5/, 5221 -., and 6/-3 .-<5/, ;*B.5/:= contains the length of the
lines in the rele+ant internal table.
'(-#O$$5
-fter the statements 3/;46I</ .-<5/, 5221 -., and 6/-3 .-<5/, ;*B.5/:= contains the initial amount of
memory allocated to the rele+ant internal table.
SAPScript Transaction codes
'):6 B Form painter
'):/ B ;tyle maintenance
'):= B ;ap;cript =raphics 9anagement
'O6@ B 4reate standard text module
!eading Te"t in SAPScripts
If you only need to output the text, you don't need to used 6/-3A./I. like in an -<-1 program,
just use the I:4583/ command in ;-1;cript.
It will read the text and output it to your form.
.he ;yntax is like this:
E: I:4583/ R.%%0B.I:-9R 2<J/4. R.%%0B.32<J/4.R I3 R.%%0B.3I3R 5-:=8-=/ R/002B
;16-;R
SAP Scripts Bo"es#$ines#S%ading
;etting default parameters for a box:
*ou can use the 12;I.I2: and ;IH/ commands to set default parmeters for a box.
!
Instead of:
E: <2I I12; '.!' 99 *12; '$."' 99 @/I=@. ')' 99 DI3.@ '!)' 99 I:./:;I.* ) F6-9/ ) .D
*ou can write:
E: 12;I.I2: I26I=I: '.!' *26I=I: '$."' 99
E: ;IH/ @/I=@. '!' 99 DI3.@ '&%' 99
E: <2I F6-9/ ) .D I:./:;I.* )
.his can be usefull if you ga+e se+eral boxes that share the same parameters.
If you want to set the position realti+ely to the window use 12;I.I2: DI:32D
to set the position to the topEleft start of the window. .hen use 12;I.I2:
to set the current position relati+ely to the start of the Dindow.
:ote that you uses OCO or OBO in the 26I=I: position to the set the position relati+ely.
E: 12;I.I2: DI:32D
E: 12;I.I2: I26I=I: 'C$' 99 *26I=I: 'C)' 99
the position is now $ 99 from the left and ) 99 from the top of the window
:2./: -fter using the position command you can mo+e the current position
realti+ely to the last used position
E: 12;I.I2: I26I=I: 'C)' 99 *26I=I: 'C!)' 99
:ow the position will be I = $ and * = ")
3rawing a line. *ou can draw a line by setting the @eight or Deidth to )
and add a frane. /.g. a horiKontal line:
E: ;IH/ @/I=@. ')' 99 DI3.@ '!))' 99
E: <2I F6-9/ ) .D I12; '.!' 99 *12; '#.'' 99 I:./:;I.* ))
SAP Printer commands in SAPScripts
.he command line in the editor must be as follows:
E: 16I:.B42:.625 xxxxx
or
E: 16I:.B42:.625 'xxxxx'
where xxxxx stands for the fi+eBcharacter name of the print control.
/xample:
E: 16I:.B42:.625 H9))
.he complete printer command normally resides in the print control.
If characters belonging to the print command follow after the print control in the text >only useful for the @15!
printer dri+er for 145B$ printers?, the text line following after the 16I:.B42:.625 command should begin with
an eMuals sign >=? in the format column.
"
/xample:
E: 16I:.B42:.625 ;/;41 = *c$=
If you do not use the eMuals sign, a space character is inserted between the print control ;/;41 and the character
*c$=.
6efer to 2;; note ;EE< - How can '"1script include printer commands?
Different font on t%e same line
*ou can ha+e different font on the same line by defining a character format.
For example < for bold text and 8 for 8nderline.
In your ;-1;cript apply like this :
F8G8nderline .extFEG F<G<old .extFEG
FORM GET_BARCODE TABLES IN_PAR STR#CT#RE ITCSY
O#T_PAR STR#CT#RE ITCSY.
DATA: PAGN#M LIKE SY-TABI%2 7p.3e 46/8er
NE%TPAGE LIKE SY-TABI%. 746/8er *1 4e9) p.3e
READ TABLE IN_PAR IT! KEY &PAGE&.
C!ECK SY-S#BRC " $.
PAGN#M " IN_PAR-'AL#E.
READ TABLE IN_PAR IT! KEY &NEXTPAGE&.
C!ECK SY-S#BRC " $.
NE%TPAGE " IN_PAR-'AL#E.
READ TABLE O#T_PAR IT! KEY &BARCODE&.
C!ECK SY-S#BRC " $.
IF PAGN#M " :.
O#T_PAR-'AL#E " &;&. 7Firs) p.3e
ELSE.
O#T_PAR-'AL#E " &;;&. 7Ne9) p.3e
ENDIF.
IF NE%TPAGE " $.
O#T_PAR-'AL#E<= " &L&. 7F>.3: >.s) p.3e
ENDIF.
MODIFY O#T_PAR INDE% SY-TABI%.
ENDFORM.
&'' (nd of Program
Print Footer notes only on t%e last page
4ommand to used in your sapscripts :B
E: IF R:/I.1-=/R /N )
whate+er footer you want.
#) (*DF
#
+rientations in SAPSC!PT
BBBBB2riginal 9essageBBBBB
;ubject: 2rientations in ;-1;46I1.
From: -shwini Jaokar
@i,
I ha+e ! pages for a Form in ;-1script .
4an I ha+e ! different 2rientations for ! pages
Ie 4an I assign 1age as 1ortrait R page! as 5andscape QQQ
If so , @ow QQQQ
.hanks in -d+ance.
-shwini Jaokar.
BBBBB6eply 9essageBBBBB
;ubject: 6e: 2rientations in ;-1;46I1.
From: jmersinger
-shwini,
:ot that I know of in the same layoutset...what you can do is create two layoutsets...one portrait, one
landscape...then in the print program call each one indi+idually.
jjm
BBBBB6eply 9essageBBBBB
;ubject: 6/: 2rientations in ;-1;46I1.
From: 6alph 0lassen
/ach form may only ha+e a single orientation but you can create two forms and include them in the same spool
output.
In your -<-1 program:
. call function '21/:AF269', don't pass a +alue in 'F269'
!. call function ';.-6.AF269', include parameter 'F269' passing the name of your first form
". call function 'D6I./AF269' as normal to output each element
#. call function '/:3AF269'
$. call function ';.-6.AF269', include parameter 'F269' passing the name of your second form
%. call function 'D6I./AF269' as normal to output each element
&. call function '/:3AF269'
'. call function '452;/AF269'
6epeat the ';.-6.AF269' ... '/:3AF269' seMuence as reMuired.
I ha+e not tried using page numbers with this techniMue, I suspect that each form will restart at .
$
6egards,
6alph 0lassen ;ylogist
How to ,pload grap%ics -.A/(0 to your Sapscript?
4ommand in your ;apscript
2? I*$%5+) FA(O5A%O9O O0G)$# #)C# I+ '# %"*95"9) )
.hese are the steps to be followed for uploading graphics in 6E" system
. First sa+e the file as <91
!. 2pen the <91 file in I9aging >=oto BG 1rograms BG -ccessories BG Imaging? and
make it Hoom as ))U and sa+e as *..IFF
". 2pen ')8= and execute program '#C%+!$
#. =i+e your .IFF file path name
$. ;elect <col >for 4olor?
%. ./I. I3 will be H@/IB9-462B*.
&. Inplace of * write your own logo name >H4291-:*52=2?
'. /xecute the program
(. :ow =oto '):6 create your HF269
). 4reate logo window
. =oto text element of logo window
or
In #.%x :B
. =oto '):6 4hange the mode to =6-1@I4-5
!. 4hoose the =raph .abstrips
". :ow type in some name for the 52=2 DI:32D
#. 1ress the I9126. <8..2: and then I9126. the <91 file from your 3/;0.21
$. .he code will be written automatically. *ou just need to drag and drop where+er you want
the graphics to be.
1lease note that in #.%c onwards, you can also used Windows 0itmap file B .0!17.
Picture doesn1t s%ow in Print Pre2iew
*ou ha+e uploaded the picture as ..IF in ;ap using -<-1 '#C%+!$ and ha+e also add the statement
2? I*$%5+) FH)C-'"!1%)-1I$#5) O0G)$# #)C# I+ '# %"*95"9) )*
in your ;ap;cript but the problem is that in print pre+iew it's not displaying the picture.
It is normal that the picture doesn't show in print pre+iew and you will be able to see the object only after printing.
3on't let this bother you as long as the picture is shown on the hardcopy printout.
SapScript Question
$ontent "uthor? 'hivanand 1atlolla
>? We get the total number of pages as e,pected b. using &'"1'$I1#-FO!1"9)'& in a duple, la.out.
In our case duple, case is alwa.s &#erms H $onditions&. We do not want the number of pages as in duple,
printing. What is the best possible solution?
%
-: 2n the .erms R 4onditions page, 4hange the 1age counter mode to '@253' to keep the page counter from
incrementing when you print the .erm R 4onditions.
>? $an I 1rint a logo on an Invoice?
-: ;a+e a 5ogo using 1aintshop 1ro or 4orel 3raw as .iff file. 8se 6;.I5394 to con+ert the logo to standard
text in ;ap;cript. Dhen the program is executed, the path and file name ha+e to be correctly specified.
1rocess could be like the following:
6un 6;.I5394
/nter file name 4:V9-I5V429152=2..IF
6esolution for .iff file
-bsolute IBposition
-bsolute *Bposition
-bsolute positioning
6eser+ed height
;hift to right
829 = 49
.ext title
5ine width for text = "!
.ext name H@/IB9-462B429152=2
.ext I3 ;.
.ext language = /
1ostscript scaling
Didth R @eight according to 1; scaling
:umber of .iff gray le+els >!,#,(? !
.hen 4reate a new window '4291' with attributesP
Dindow 4291 description 4ompany 5ogo
Dindow type 42:;.
5eft margin &.)) 4@ window width ).)) 4@
8pper margin 5: window height '.)) 5:
Finally in the text element , mention
E: I:4583/ 'H@/IB9-462B429152=2' 2<J/4. ./I. I3 ;. 5-:=8-=/ '/'.
1lease note that if object name is not indicated as 'H@/I...', the logo may not be printedL
*ou will not be able to see the logo in a test print. .he same will be printed in actual printout.
If you are using two logos in the same layout, the names of the logos should be uniMue. ;ay 'H@/IB9-462B
52=2' and 'H@/IB9-462B52=2!'. /lse all the information will be o+erwritten.
If the logo is not /I-4.5* .IFF %.), the same will not be printed.
;ee 2;; notes $(($, ')#$, "()" for some inputs.
ntroduction to SAP SmartForms
What is '"1 'mart Forms?
;-1 ;mart Forms is introduced in ;-1 <asis 6elease #.%4 as the tool for creating and maintaining forms.
;-1 ;mart Forms allow you to execute simple modifications to the form and in the form logic by using simple
graphical toolsP in ()U of all cases, this won't include any programming effort. .hus, a power user without any
programming knowledge can
configure forms with data from an ;-1 ;ystem for the rele+ant business processes.
&
.o print a form, you need a program for data retrie+al and a ;mart Form that contains the entire from logic. -s data
retrieval and form logic are separated, you must only adapt the ;mart Form if changes to the form logic are
necessary. .he application program passes the data via a function module interface to the 'mart Form. Dhen
activating the ;mart Form, the s.stem automaticall. generates a function module. -t runtime, the system
processes this function module.
*ou can insert static and dynamic tables. .his includes line feeds in indi+idual table cells, triggering events for
table headings and subtotals, and sorting data before output.
*ou can check indi+idual nodes as well as the entire form and find any existing errors in the tree structure. .he data
flow anal.sis checks whether all fields >+ariables? ha+e a defined +alue at the moment they are displayed.
;-1 ;mart Forms allow you to include graphics, which you can display either as part of the form or as
background graphics. *ou use background graphics to copy the layout of an existing >scanned? form or to lend
forms a companyBspecific look. 3uring printout, you can suppress the background graphic, if desired.
;-1 ;mart Forms also support postage optimiKing.
-lso read ;-1 :ote :o. %'"%' B ;mart Forms: :ew form tool in 6elease #.%4
What #ransaction to start '"1 'mart Forms?
/xecute transaction '!"#FO!' to start ;-1 ;mart Forms.
Ie. 0enefits of '"1 'mart Forms?
;-1 ;mart Forms allows you to reduce considerably the implementation costs of my;-1.com solutions since forms
can be adjusted in minimum time.
*ou design a form using the graphical Form 1ainter and the graphical .able 1ainter. .he form logic is represented
by a hierarchy structure >tree structure? that consists of indi+idual nodes, such as nodes for global settings, nodes
for te,ts, nodes for output tables, or nodes for graphics.
.o make changes, use +rag H +rop, $op. H 1aste, and select different attributes.
.hese actions do not include writing of coding lines or using a ;cript language.
8sing your form description maintained in the Form <uilder, ;mart Forms generates a function module that
encapsulates la.out, content and form logic. ;o you do not need a group of function modules to print a form,
but only one.
For Deb publishing, the system pro+ides a generated C!% output of the processed form.
;mart Forms pro+ides a data stream called I95 for ;mart Forms >I;F? to allow the use of "rd party printing tools.
I;F passes form content from 6E" to an external product without passing any layout information about the ;mart
Form.
Ad2antages of SAP Smart Forms
;-1 ;mart Forms ha+e the following ad+antages:
. .he adaption of forms is supported to a large extent by graphic tools for layout and logic, so that no
programming knowledge is necessary >at least ()U of all adjustments?. .herefore, power user forms can also make
configurations for your business processes with data from an ;-1 system. 4onsultants are only reMuired in special
cases.
!. 3isplaying table structures >dynamic framing of texts?
'
". 2utput of background graphics, for form design in particular the use of templates which were scanned.
#. 4olored output of texts
$. 8serBfriendly and integrated Form 1ainter for the graphical design of forms
%. =raphical .able 1ainter for drawing tables
&. 6eusing Font and paragraph formats in forms >;mart ;tyles?
'. 3ata interface in I95 format >I95 for ;mart Forms, in short I;F?
(. Form translation is supported by standard translation tools
). Flexible reuse of text modules
. @.95 output of forms ><asis release %.)?
!. Interacti+e Deb forms with input fields, pushbuttons, radio buttons, etc. ><asisB6elease %.)?
" 'imple 'martform #utorial
SAP Smartforms can be used for creating and maintaining forms for mass printing in SAP Systems3 T%e
output medium for Smartforms support printer4 fa"4 e'mail4 or t%e nternet -by using t%e generated 5.$
output03
According to SAP4 you need neit%er %a2e any programming knowledge nor use a Script language to
adapt standard forms3 Howe2er4 basic ABAP programming skills are re6uired only in special cases -for
e"ample4 to call a function module you created or for comple" and e"tensi2e conditions03
. 4reate a new smartforms
Transaction code S.A!TF+!.S
Create new smartforms call 7S.A!T
2. Define looping process for internal table
Pages and windows
First Page -> Header indow !Cursor at First Page t"en clic# (dit '8 *ode '8 Create$
Here% &ou can specif& &our title and page numbering
9SFS:'PA/(9 !Page '$ of 9SFS:'F+!.PA/(S-7;3<09 !Total Page$
(ain windows -> T)*+, -> D)T)
-n t"e +oop section% tic# -nternal table and fill in
TAB= !table in )*)P S().TF/.( calling function$ -0T/ TAB>
1. Define table in smartforms
/lobal settings 2
Form interface
3ariable name T&pe assignment .eference t&pe
TAB= T4P, Table Structure
=lobal definitions
7ariable name .ype assignment 6eference type
I#"0/ .*1/ .able ;tructure
#. .o display the data in the form
9ake used of the .able 1ainter and declare the 5ine .ype in .abstrips .able
(
e.g. @3A=/: for printing header details,
I.A=/: for printing data details.
*ou ha+e to specify the 5ine .ype in your .ext elements in the .abstrips 2utput options.
.ick the :ew 5ine and specify the 5ine .ype for outputting the data.
3eclare your output fields in .ext elements
.abstrips B 2utput 2ptions
For different fonts use this ;tyle : I+W#$)#'#(%)
For Nuantity or -mout you can used this +ariable H9'AI#"0-"!O5*#B6/./7H
$. 4alling ;9-6.F269; from your -<-1 program
6/126. H;9-6.F269.
* 4alling ;9-6.F269; from your -<-1 program.
* 4ollecting all the table data in your program, and pass once to ;9-6.F269;
* ;9-6.F269;
* 3eclare your table type in :B
* =lobal ;ettings BG Form Interface
* =lobal 3efinintions BG =lobal 3ata
* 9ain Dindow BG .able BG 3-.-
*
* Dritten by : ;-1 @ints and .ips on 4onfiguration and -<-1E# 1rogramming
* http:EEsapr".tripod.com
*
.-<5/;: 901F.
3-.-: F9A:-9/ .*1/ 6;"'5AF:-9.
3-.-: </=I: 2F I:.A901F 24486; ).
I:4583/ ;.684.86/ 901F.
3-.-: /:3 2F I:.A901F.
;/5/4.B21.I2:; ;A9<5:6 F26 901FB9<5:6 9/926* I3 )).
;/5/4. * F629 901F D@/6/ 9<5:6 I: ;A9<5:6.
927/B4266/;12:3I:= 901F .2 I:.A901F.
-11/:3 I:.A901F.
/:3;/5/4..
* -t the end of your program.
* 1assing data to ;9-6.F269;
call function ';;FAF8:4.I2:A92385/A:-9/'
exporting
formname = 'H;9-6.F269'
* 7-6I-:. = ' '
* 3I6/4.A4-55 = ' '
I9126.I:=
F9A:-9/ = F9A:-9/
/I4/1.I2:;
:2AF269 =
:2AF8:4.I2:A92385/ = !
2.@/6; = ".
!)
if syBsubrc FG ).
D6I./: E '/6626 '.
* 9/;;-=/ I3 ;*B9;=I3 .*1/ ;*B9;=.* :89</6 ;*B9;=:2
* DI.@ ;*B9;=7 ;*B9;=7! ;*B9;=7" ;*B9;=7#.
endif.
call function F9A:-9/
* /I126.I:=
* -64@I7/AI:3/I =
* -64@I7/AI:3/IA.-< =
* -64@I7/A1-6-9/./6; =
* 42:.625A1-6-9/./6; =
* 9-I5A-115A2<J =
* 9-I5A6/4I1I/:. =
* 9-I5A;/:3/6 =
* 28.18.A21.I2:; =
* 8;/6A;/..I:=; = 'I'
* I9126.I:=
* 32489/:.A28.18.AI:F2 =
* J2<A28.18.AI:F2 =
* J2<A28.18.A21.I2:; =
.-<5/;
=;A901F = I:.A901F
/I4/1.I2:;
F269-..I:=A/6626 =
I:./6:-5A/6626 = !
;/:3A/6626 = "
8;/6A4-:4/5/3 = #
2.@/6; = $.
if syBsubrc FG ).
9/;;-=/ I3 ;*B9;=I3 .*1/ ;*B9;=.* :89</6 ;*B9;=:2
DI.@ ;*B9;=7 ;*B9;=7! ;*B9;=7" ;*B9;=7#.
endif.
"dditional Fonts for .our '!"#FO!'
4ou can create additional fonts and st&le wit" transaction S.A!TST:$(S
T"is can t"en be define in t"e paragrap" and c"aracter formats% w"ic" &ou can t"en be assign to
te5ts and fields in t"e Smart Form.
.he character formats includes effects such as superscript, subscript, barcode and font attributes.
Difference wit% S.A!TF+!.S 2s3 SapScript-S(?=0
.he Following are the differences :B
a? 9ultiple page formats are possible in smartforms, which is not the case in ;-1;cripts
b? It is possible to ha+e a smartform without a main window.
c? 5abels cannot be created in smartforms.
d? 6outines can be written in smartforms tool.
!
e? ;martforms generates a function module when acti+ated.
4ontributed by : ;-1 -<-1E# 1rogramming, <asis -dministration, 4onfiguration @ints and .ips
f? 8nlike sapscripts >'#C'$1?, you cannot upload2download 'martform to your local harddisk.
It was said that it was pro+ided in 469 ".) +ersion, but not a+ailable in 6E". *ou can download smartforms into
5ocal 14 in a I95 format. In the same way you can upload this I95 format into ;martform. From the
smartform editor itself you can call download option, if you are working in 469 ".) en+ironment.
In 6" also, you can download into I95 format. @owe+er, it's not sure about uploading. 6efer to the program
''FAC'FA+)!O'.
In #.& /nterprise, other ha+e seen this utlity which is completey missing in #.%c. .here is functionality to downlaod
a complete form or only a particular node. >5tilities -J +ownload form?. It will create a I95 file and sa+e it in
the hard disk.
For others, if .ou want to download2upload the 'martforms source, .ou will need the help from the 0asis
people. What .ou can do is to create a #ransport and then F#1 down to .our local harddisk. When .ou
need the 'martform source in another s.stem, .ou have F#1 up the 'martforms file back to the '"1 server.
Finall., the 0asis team, will tp it into .our s.stem.
g? .he protect and endprotect command in sapscript doesn't work with smartforms. For example on a in+oice:
First data of position no '). is printed on page one, other data of position no ') is printed on page !. -nd there's
nothing you can do about it. -ctually, there is something you can do about it. <y using a folder node and
checking the &protect& checkbo,, e+erything in that folder will be page protected.
FA@ on .igrating SAPscript to SmartForms
Is it possible to migrate a '"1script form to a 'mart Form?
;mart Forms pro+ides a migration tool for this purpose which migrates layout and texts of a ;-1script form to a
;mart Form. It does not migrate ;-1script form logic of the print program. 8sing ;mart Forms, this logic is
described by the tree structure of the Form <uilder. .he effort in+ol+ed in migrating it depends on the complexity
of the print program.
Which 0asis elease do I need to use '"1 'mart Forms?
;-1 ;mart Forms is a+ailable as of 6E" <asis 6elease #.%4.
I have heard that 'mart Forms replaces '"1script. What does KreplaceK mean?
It does not mean that ;-1script is remo+ed from the <asis shipment. /+en as of <asis 6elease #.%4, ;-1script
remains part of the ;-1 standard and there are no plans to remo+e it. ;ince ;mart Forms is currently, and will
continue to be, the tool for form maintenance for my;-1.com solutions, our further de+elopment efforts will focus
on ;mart Forms, not on ;-1script.
+o we have to migrate all '"1script forms to 'mart Forms?
.here is no point in migrating all ;-1script forms already in use. ;ince ;-1script can still be used and will be
a+ailable in the future, there is no need to. If you plan to migrate a ;-1script form, it is recommended that you
check whether benefit is worth the effort in+ol+ed.
SmartForms System Fields
Dithin a form you can use the field string ;F;* with its system fields. 3uring form processing the system replaces
these fields with the corresponding +alues. .he field +alues come from the ;-1 ;ystem or are results of the
processing.
!!
'.stem fields of 'mart Forms
H'F'(-+"#)H
3isplays the date. *ou determine the display format in the user master record.
H'F'(-#I!)H
3isplays the time of day in the form @@:99:;;.
H'F'(-1"9)H
Inserts the number of the current print page into the text. *ou determine the format of the page number >for
example, -rabic, numeric? in the page node.
H'F'(-FO!1"9)'H
3isplays the total number of pages for the currently processed form. .his allows you to include texts such as'1age
x of y' into your output.
H'F'(-GO01"9)'H
4ontains the total page number of all forms in the currently processed print reMuest.
H'F'(-WI*+OW*"!)H
4ontains the name of the current window >string in the Dindow field?
H'F'(-1"9)*"!)H
4ontains the name of the current page >string in the 1age field?
H'F'(-1"9)0)"IH
Is set to 'I' after a page break >either automatic W1age &X or commandBcontrolled W1age #%X?
H'F'(-!"I*)*+H
Is set as soon as processing of the main window on the current page ends
H'F'(-)C$)1#IO*H
4ontains the name of the raised exception. *ou must trigger your own exceptions, which you defined in the form
interface, using the userAexception macro >syntax: userAexception Fexception name G?.
("ample Forms A2ailable in Standard SAP !#A
'FA)C"!1%)A@6
;imple exampleP in+oice with table output of flight booking for one customer
'FA)C"!1%)A@/
;imilar to ;FA/I-915/A) but with subtotals
'FA)C"!1%)A@8
;imilar to ;FA/I-915/A)!, whereby se+eral customers are selected in the application programP the form is
called for each customer and all form outputs are included in an output reMuest
Smart forms Fre6uently Asked @uestions
Forcing a page break within table loop
4reate a loop around the table. 1ut a 4ommand node before the table in the loop that forces a :/D1-=/ on
whate+er condition you want. .hen only loop through a subset of the internal table >based on the conditions in the
4ommand node? of the elements in the .able node.
!"
Font st.le and Font siLe
=oto .ransaction ;9-6.;.*5/;.
.here you can create 1aragraph formats etc just like in sapscript.
.hen in your window under 28.18. 21.I2:; you include this ;9-6.;.*5/ and use the 1aragraph and
character formats.
%ine in 'martform
/ither you can use a window that takes up the width of your page and only has a height of mm.
.hen you put a frame around it >in window output options?.
.hus you ha+e drawn a box but it looks like a line.
2r you can just draw OAAO accross the page and play with the fonts so that it joins each 8:3/6A;426/.
+ifference between &forminterface& and &global definitions& in global settings of smart forms
.he 3ifference is as follows.
.o put it +ery simply:
Form Interface is where you declare what must be passed in and out of the smartform >in from the print program to
the smartform and out from the smartform to the print program?.
=lobal defs. is where you declare data to be used within the smartform on a global scope.
ie: anything you declare here can be used in any other node in the form.
'martforms function module name
2nce you ha+e acti+ated the smartform, go to the en+ironment BG function module name. .here you can get the
name of funtion module name.
.he key thing is the program that calls it. for instance, the in+oice ;9-6.F269 5<A<I5AI:72I4/ is ran by the
program 65<AI:72I4/.
.his program uses another F9 to determine the name of the F9 to use itself. .he key thing is that when it calls this
F9 >using a +ariable to store the actual name?, that the parameters match the paramters in your smartform.
-nother thing to note is that the F9 name will change where+er the ;F is transported to.
;o you need to use the F9 to determine the name of the ;F.
@ere is the code that can be use to determine the internal name of the function module:
4ode:
if sfAlabel>? FG 'E'. O need to resol+e by name
mo+e sfAlabel to externalname.
call function ';;FAF8:4.I2:A92385/A:-9/'
exporting
formname = externalname
importing
fmAname = internalname
exceptions
noAform =
!#
noAfunctionAmodule = !
others = ".
if syBsubrc FG ).
message 'e#!&'.
endif.
mo+e internalname to sfAlabel.
endif.
It checks to see if the sfAlabel starts with a 'E', which is how the internal names start. if it does, the name has already
been con+erted. If not, it calls the F9 and con+erts the name.
*ou would then 4-55 F8:4.I2: sfAlabel.
Smartforms FA@ Part Two
'martforms output difference
1roblem with 'martforms? in a certain form for two differentl. configured printers, there seem to be a
difference in the output of characters per inch Bthe distance between characters which gives a la.out problem
- te,t in two lines instead of one.
It happens when the two printers ha+ing different 1rinter 4ontrols' if you go to ;1-3 9enu >;pool -dministrator
9enu? you can see the difference in the 1rinter 4ontrol and if you make the 1rinter control setting for both the
printers as same. then it will be ok. and also u ha+e to check what is the de+ice type used for both the output
de+ices.
'martForms Output to 1+F
.here is a way to download smartform in 13F format.
1lease do the following:
. 1rint the smartform to the spool.
!. :ote the spool number.
". 3ownload a 13F file >-crobat 6eader? +ersion of the spool by running 1rogram 6;.I13F.# and entering the
noted spool number.
'martForm +oublesided printing Muestion
(our customer wants .our 1O 'martForm to be able to print K#erms and $onditinosK on the back side of
each page. #he. don&t want to purchase pre-printed forms with the compan.&s logo on the front and terms H
conditions on the back. *ow this presents an interesting problem.
Has an.one else ever had a reMuest like this? If for e,ample there was a 8 page 1O to be printed, the. want 8
pieces of paper, the front side of each to containe the 1O information Bpage 6, /, and 87 and the back side of
each piece of paper to containg the static K#erms H $onditionsK information.
"n.one have a clue how to force this out?
/asy B page F62:. lists page 42:.-4.; as next page and 42:.-4.; lists F62:. as next page. ;ince
42:.-4.; does not contain a 9-I: window, it will print the contacts info and then continue on to F62:. for
the rest of the main items. -dditionally, set print mode on F62:. to 3 >duplex? and set 42:.-4.; to 'blank' >for
both resource name and print mode B this is the only way to get to the back of the page?.
#ransport 'mart Forms
How does one transport '!"#FO!? ')@6?
How do .ou make sure that both, the '!"#FO! H it&s function module gets transported? Or does the
F! with same name gets generated automaticall. in the transported client?
!$
- smartform is transported no differently than any other object. if it is assigned to a de+elopment class that is
atteched to a transport layer, it will be transported.
.he definition is transported, and when called, the function module is regenerated.
.his leads to an interetsing situation. 2n the new machine, it is +ery likely the function module name will be
different than the name on the source system. 9ake sure, before you call the function module, you resol+e the
external name to the internal name using the ';;FAF8:4.I2:A92385/A:-9/' function module.
.ypically, generate the ;F, then use the pattern to being in the interface. .hen change the call function to use the
name you get back from the abo+e function module.
'martforms? protect lines in main window.
How to protect lines in the main window from splitting between pages?
It was easy with ;-1script, but how to do it with ;F's. For #.& +ersion if you are using tables, there are two
options for protection against line break:
B *ou can protect a line type against page break.
B *ou can protect se+eral table lines against page break for output in the main area.
1rotection against page break for line types
B 3oubleBclick on your table node and choose the .able tab page.
B ;witch to the detail +iew by choosing the 3etails pushbutton.
B ;et the 1rotection against page break checkbox in the table for the rele+ant line type. .able lines that use this line
type are output on one page.
1rotection against page break for se+eral table lines
B /xpand the main area of your table node in the na+igation tree.
B Insert a file node for the table lines to be protected in the main area.
B If you ha+e already created table lines in the main area, you can put the lines that you want to protect again page
break under the file using 3ragR3rop. 2therwise, create the table lines as subnodes of the file.
B 4hoose the 2utput 2ptions tab page of the file node and set the 1age 1rotection option. -ll table lines that are in
the file with the 1age 1rotection option set are output on one page.
In #.%, -lternati+ely in a paragraph format use the 1age protection attribute to determine whether or not to display a
paragraph completely on one page. 9ark it if you want to a+oid that a paragraph is split up by a page break. If on
the current page >only in the main window? there is not enough space left for the paragraph, the entire paragraph
appears on the next page.
Details information about SAP Barcodes
- barcode solution consists of the following:
B a barcode printer
B a barcode reader
B a mobile data collection applicationEprogram
- barcode label is a special symbology to represent human readable information such as a material number or batch
number
in machine readable format.
.here are different symbologies for different applications and different industries. 5uckily, you need not worry to
much about that as the logistics supply chain has mostly standardiKed on " of ( and !' barcode symbologies B
which all barcode readers support and which ;-1 support nati+ely in it's printing protocols.
*ou can print barcodes from ;-1 by modifying an existing output form.
!%
<ehind e+ery output form is a print program that collects all the data and then pass it to the form. .he form contains
the layout as well as the font, line and paragraph formats. .hese forms are designed using ;-1;cript >a +ery easy
but frustratingly simplistic form format language? or ;martForms that is more of a graphical form design tool.
<arcodes are nothing more than a font definition and is part of the style sheet associated with a particular
;-1;cript form. .he most important aspect is to place a parameter in the line of the form that points to the data
element that you want to represent as barcode on the form, i.e. material number. :ext you need to set the font for
that parameter +alue to one of the supported barcode symbologies.
.he next part of the eMuation can be a bit tricky as you will need to get a printer to print that barcode font. 6egular
laser printers does not normally print barcode fonts, only specialiKed industrial printers that is specifically designed
to support that protocol and that uses specialiKed label media and heat transfer >resin? ribbon to create the sharp
image reMuired for barcodes.
:ot to fear though, there are two ways to get around this:
B *ou can ha+e your I. department do some research B
most laser printers can accept a font cartridgeEdimm chip >similar to computer memory?, called a <ar3I99 that
will allow a laser printer to support the printing of barcodes.
B ;econdly, you can buy software that you can upload in your ;-1 print ;er+er that will con+ert the barcode
symbology as an image that will print on a regular laser printer. I found that this option results in less sharper
barcodes. .his option is really if you need to con+ert a large Muantity of printers >G)? to support barcodes.
:ow you ha+e a barcode printed B what nextQ
Dell there are two options, depending on your business reMuirements:
B *ou can use an existing ;-1 transaction on a regular workstation and get a barcode wedge reader to hook up
between the keyboard and the 14. .hese wedge readers comes in a wand or scanner format. .here are e+en wireless
wedge scanners a+ailable that allows you to roam a few yards from the workstation to scan a label. .his approach is
mostly used where you want to pre+ent human errors in typing in long material, batch or serial numbers in
recei+ing or issuing of material. .he problem is that it's just replacing the keyboard input and you are basically
locked down in one location and ha+e to bring all the material to that location to process.
B -nother solution is to use ;-14onsole transactions
or write your own -<-1 3ialog programs that will fit onto a barcode enabled wireless handheld terminal and that
will follow the business logic as executed on the shop floor.
.hese programs are highly complex exercises in industrial engineering and ergonomics because of the limited
screen siKes and limited ability to accept keyboard input. .he user is instructed stepBbyBstep and only scan and push
FBkeys to interact with the ;-1 system. ;can, scan, beep, beep, enter B highly automated.
$ontent "uthor? 6a+ikumar 0andikonda
"at is )+3 Programming6
4ontent -uthor: :imesh Jhanwar
Dhat is -57 programming in -<-1Q Dhen is this grid used in -<-1Q
-57 is -pplication 5ist +iewer.
;ap pro+ides a set of -57 >-<-1 5I;. 7I/D/6? function modules which can be put into use to embellish the
output of a report. .his set of -57 functions is used to enhance the readability and functionality of any report
output. 4ases arise in sap when the output of a report contains columns extending more than !$$ characters in
length.
In such cases, this set of -57 functions can help choose selected columns and arrange the different columns from a
report output and also sa+e different +ariants for report display. .his is a +ery efficient tool for dynamically sorting
and arranging the columns from a report output.
!&
.he report output can contain up to () columns in the display with the wide array of display options.
.he commonly used -57 functions used for this purpose areP
. 6/8;/A-57A7-6I-:.A3/F-85.A=/.
!. 6/8;/A-57A7-6I-:.AF#
". 6/8;/A-57A7-6I-:.A/II;./:4/
#. 6/8;/A-57A/7/:.;A=/.
$. 6/8;/A-57A4299/:.-6*AD6I./
%. 6/8;/A-57AFI/534-.-52=A9/6=/
&. 6/8;/A-57A5I;.A3I;15-*
'. 6/8;/A-57A=6I3A3I;15-*
(. 6/8;/A-57A12181A.2A;/5/4.
1urpose of the abo+e Functions are differ not all the functions are reMuired in all the -57 6eport.
<ut either no.& or :o.' is there in the 1rogram.
How .ou call this function in .our report?
-fter completion of all the data fetching from the database and append this data into an Internal .able. say IAI.-<.
.hen use follwing function module.
4-55 F8:4.I2: '6/8;/A-57A=6I3A3I;15-*'
/I126.I:=
IA4-55<-40A162=6-9 = '1rog.name'
IA;.684.86/A:-9/ = 'IAI.-<'
IA3/F-85. = 'I'
IA;-7/ = '-'
.-<5/;
.A28..-< = IAI.-<.
IF ;*B;8<64 FG ).
D6I./: ';*B;8<64: ', ;*B;8<64 .
/:3IF.
/:3F269. O =/.AFI:-5A3-.-
How can - insert m& compan& logo in t"e standard report6
It is not possible to print logo in the ordinary report, but it can done through -57.
Drite the code in .opBofBpage e+ent in -57.
.he following is the code for inserting the logo in -57.
F269 .21A2FA1-=/.
4-55 F8:4.I2: '6/8;/A-57A4299/:.-6*AD6I./'
/I126.I:=
IA52=2 = '/:J2*;-1A52=2'
I.A5I;.A4299/:.-6* = =.A5I;.A.21A2FA1-=/.
/:3F269.
Sample programs on )+3 7rid
report Kbnstest.
************************************************************************
!'
* .-<5/; -:3 3-.- 3/45-6-.I2:.
************************************************************************
*.-<5/;: mara,makt.O,marc.
data syrepid like syBrepid.
data sydatum>)?. O 5I0/ syBdatum.
data sypagno>"? type n.
* D@/: 8;I:= 926/ .@-: 2:/ .-<5/ I: -57 D/ :///3 .2 3/45-6/ .@/ .*1/
* =6281 >.*1/B1225;BBBBBBBBBG;5I;?
typeBpools : slis.
************************************************************************
* I:./6:-5 .-<5/ 3/45-6-.I2:.
************************************************************************
* I:./6:-5 .-<5/ .2 @253 .@/ 7-58/; F629 .@/ 9-6- .-<5/
data: begin of tAmara occurs ),
matnr like maraBmatnr,
meins like maraBmeins,
mtart like maraBmtart,
matkl like maraBmatkl,
end of tAmara.
* I:./6:-5 .-<5/ .2 @253 .@/ 42:./:.; F629 .@/ /002 .-<5/
data : begin of tAmarc occurs ),
matnr like maraBmatnr,
werks like marcBwerks,
minbe like marcBminbe.
data: end of tAmarc.
* I:./6:-5 .-<5/ .2 @253 .@/ 7-58/; F629 9-0. .-<5/.
data : begin of tAmakt occurs ),
matnr like maraBmatnr,
maktx like maktBmaktx,
spras like maktBspras,
end of tAmakt.
* I:./6:-5 .-<5/ D@I4@ -4.8-55* 9/6=/; -55 .@/ 2.@/6 I:./6:-5 .-<5/;.
data: begin of itab occurs ),
matnr like maraBmatnr,
meins like maraBmeins,
maktx like maktBmaktx,
spras like maktBspras,
werks like marcBwerks,
minbe like marcBminbe,
end of itab.
* .@/ F2552DI:= 3/45-6-.I2: I; 8;/3 F26 3/FI:I:= .@/ FI/534-.
* -:3 .@/ 5-*28. F26 .@/ -57.
* @/6/ -; slisAtAfieldcatAal+ I; - I:./6:-5 .-<5/ DI.@28. - @/-3/6 5I:/
* D/ /I15I4I./5* 3/FI:/ -: I:./6:-5 .-<5/ 2F .@/ ;-9/ ;.684.86/ -; .@-.
!(
* 2F slisAtAfieldcatAal+ <8. DI.@ - @/-3/6 5I:/ I: .@/ 3/FI:I.I2:.
* .@I; I; 32:/ .2 9-0/ .@/ 423/ ;I915/6.
* 2.@/6DI;/ D/ 9-* @-7/ .2 3/FI:/ .@/ ;.684.86/ -; I: .@/ :269-5 ;-1
* 162=6-9;.
* I: .@/ FI/534-.-52= .-<5/ D/ -4.8-55* 1-;; .@/ FI/53; F629 2:/ 26
* 926/ .-<5/; -:3 46/-./ - ;.684.86/
* I: .@/ 5-*28. ;.684.86/ D/ <-;I4-55* 3/FI:/ .@/ F269-..I:= 21.I2:;
* 5I0/ 3I;15-* I: .@/ H/<6- 1-../6: ,.@/ @2.;12. 21.I2:; /.4.
data: fieldcatalog type slisAtAfieldcatAal+ with header line,
fieldlayout type slisAlayoutAal+.
* 3/45-6I:= .@/ /7/:..-<5/ I:./6:5 .-<5/ F26 8;I:= /7/:.; 5I0/
* .21B2FB1-=/ /.4.
data : e+entstab type slisAtAe+ent with header line.
* 3/45-6I:= -: I:./6:-5 .-<5/ .2 @253 .@/ 3-.- F26 .@/ .21B2FB1-=/
data : heading type slisAtAlistheader with header line.
data : heading type slisAtAlistheader with header line.
data : heading! type slisAtAlistheader with header line.
data : heading" type slisAtAlistheader with header line.
data : heading# type slisAtAlistheader with header line.
data : heading$ type slisAtAlistheader with header line.
data : heading% type slisAtAlistheader with header line.
data : heading& type slisAtAlistheader with header line.
data : heading' type slisAtAlistheader with header line.
* ;.684.86/ .2 1-;; .@/ 42526 -..6I<8./; F26 3I;15-*.
data : colorstruct type slisAcoltypes.
************************************************************************
* I:I.I-5IH-.I2:. *
************************************************************************
initialiKation.
syrepid = syBrepid.
sypagno = syBpagno.
clear fieldcatalog.
************************************************************************
* ;.-6.B2FB;/5/4.I2:. *
************************************************************************
startBofBselection.
* ;8<628.I:/ .2 12185-./ .@/ 42526;.684.
perform fillAcolorstruct using colorstruct.
* ;8<628.I:/ .2 12185-./ .@/ FI/53; 2F .@/ FI/53 4-.-52=8/
perform populateAfieldcatalog.
* ;8<628.I:/ .2 ;/5/4. 3-.- F629 7-6I28; .-<5/; -:3 12185-./ I. I: .@/
* I:./6:-5 .-<5/.
perform selectdataAandAsort.
* ;8<628.I:/ .2 12185-./ .@/ 5-*28. ;.684.86/.
perform populateAlayout using fieldlayout.
* ;8<628.I:/ .2 4-55 .@/ F8:4.I2: 9/6=/ .2 /:;86/ 1621/6 3I;15-*.
")
perform mergeAfieldcatalog.
* ;8<628.I:/ .2 12185-./ .@/ /7/:.;.-<.
perform fillAe+entstab tables e+entstab.
* ;8<628.I:/ .2 12185-./ .@/ @/-3I:= .-<5/;.
perform fillAheadingtable tables heading using '@/-3I:='.
perform fillAheadingtable tables heading using '@/-3I:='.
perform fillAheadingtable tables heading! using '@/-3I:=!'.
perform fillAheadingtable tables heading" using '@/-3I:="'.
perform fillAheadingtable tables heading# using '@/-3I:=#'.
perform fillAheadingtable tables heading$ using '@/-3I:=$'.
perform fillAheadingtable tables heading% using '@/-3I:=%'.
perform fillAheadingtable tables heading& using '@/-3I:=&'.
perform fillAheadingtable tables heading' using '@/-3I:=''.
* ;8<628.I:/ .2 3I;15-* .@/ 5I;..
perform displayAal+Alist.
************************************************************************
* F269;
************************************************************************
* I: .@I; ;8<628.I:/ D/ 12185-./ .@/ FI/534-.-52= .-<5/ DI.@ .@/ :-9/;
* 2F .@/ .-<5/,FI/53:-9/,D@/.@/6 I. I; 0/* FI/53 26 :2.,@/-3I:= -:3
* 42589: J8;.IFI4-.I2:.
form populateAfieldcatalog.
perform fillAfieldsAofAfieldcatalog tables fieldcatalog
using 'I.-<' '9-.:6' 'I' .
perform fillAfieldsAofAfieldcatalog tables fieldcatalog
using 'I.-<' '9/I:;' ' '.
perform fillAfieldsAofAfieldcatalog tables fieldcatalog
using 'I.-<' '9-0.I' ' ' .
perform fillAfieldsAofAfieldcatalog tables fieldcatalog
using 'I.-<' '9.-6.' ' ' .
perform fillAfieldsAofAfieldcatalog tables fieldcatalog
using 'I.-<' '9-.05' ' ' .
perform fillAfieldsAofAfieldcatalog tables fieldcatalog
using 'I.-<' ';16-;' ' ' .
perform fillAfieldsAofAfieldcatalog tables fieldcatalog
using 'I.-<' 'D/60;' ' ' .
perform fillAfieldsAofAfieldcatalog tables fieldcatalog
using 'I.-<' '9I:</' ' ' .
endform. O 12185-./AFI/534-.-52=
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* F269 FI55AFI/53;A2FAFI/534-.-52= *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* ........ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* BBG FI/534-.-52= *
* BBG 1A.-<:-9/ *
* BBG 1AFI/53:-9/ *
"
* BBG 1A0/* *
* BBG 1A0/* *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
form fillAfieldsAofAfieldcatalog tables fieldcatalog
structure fieldcatalog
using pAtabname
pAfieldname
pAkey.
* pAnoAout.
fieldcatalogBtabname = pAtabname.
fieldcatalogBfieldname = pAfieldname.
fieldcatalogBkey = pAkey.
fieldcatalogBemphasiKe = '!"#'.
*fieldcatalogBnoAout = pAnoAout.
append fieldcatalog.
endform. O FI55AFI/53;2FFI/534-.-52=
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* F269 12185-./A5-*28. *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* ........ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* BBG FI/535-*28. *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
form populateAlayout using fieldlayout type slisAlayoutAal+.
fieldlayoutBf!code = 'R/.-' .
fieldlayoutBKebra = 'I'.
* F26 .@/ DI:32D .I.5/.
fieldlayoutBwindowAtitlebar = '-57 with /+ents'.
fieldlayoutBcolwidthAoptimiKe = 'I'.
fieldlayoutBnoA+line = ' '.
*fieldlayoutBnoAinput = 'I'.
fieldlayoutBconfirmationAprompt = ''.
fieldlayoutBkeyAhotspot = 'I'.
* .his remo+es the column headings if the flag is set to 'I'
fieldlayoutBnoAcolhead = ' '.
*fieldlayoutBhotspotAfieldname = '9-0.I'.
fieldlayoutBdetailApopup = 'I'.
* fieldlayoutBcoltabAfieldname = 'I'.
endform. O 12185-./A5-*28.
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* F269 ;/5/4.3-.-A-:3A;26. *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* ........ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
form selectdataAandAsort.
select matnr meins mtart matkl from mara
into corresponding fields of tAmara
up to $)) rows .
"!
select matnr maktx spras from makt
into corresponding fields of tAmakt
where matnr = tAmaraBmatnr and
spras = syBlangu.
select matnr werks minbe from marc
into corresponding fields of tAmarc
where matnr = tAmaraBmatnr.
append tAmarc.
endselect.
append tAmakt.
endselect.
append tAmara.
endselect.
perform populateAitab.
sort itab by matnr.
endform. O ;/5/4.3-.-A-:3A;26.
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* F269 9/6=/AFI/534-.-52= *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* ........ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
form mergeAfieldcatalog.
call function '6/8;/A-57AFI/534-.-52=A9/6=/'
exporting
iAprogramAname = syrepid
iAinternalAtabname = 'I.-<'
* iAstructureAname = '42526;.684.'
* IA45I/:.A:/7/6A3I;15-* = 'I'
iAinclname = syrepid
changing
ctAfieldcat = fieldcatalogWX
exceptions
inconsistentAinterface =
programAerror = !
others = ".
endform. O 9/6=/AFI/534-.-52=
* I: .@I; F8:4.I2: .@/ 9I:I989 1-6-9/./6; .@-. D/ ://3 .2 1-;; I; -;
* F2552D;:B
* iAcallbackAprogram BBG 4-55I:= 162=6-9 :-9/
* iAstructureAname BBG ;.684.86/ :-9/.
* isAlayout BBG 5-*28. :-9/.
* itAfieldcat BBBG <23* 2F .@/ FI/53 4-.-52=8/ I:./6:-5 .-<5/
form displayAal+Alist.
call function '6/8;/A-57A5I;.A3I;15-*'
exporting
* IAI:./6F-4/A4@/40 = ' '
iAcallbackAprogram = syrepid
* IA4-55<-40A1FA;.-.8;A;/. = ' '
* IA4-55<-40A8;/6A4299-:3 = ' '
""
iAstructureAname = 'I.-<'
isAlayout = fieldlayout
itAfieldcat = fieldcatalogWX
* I.A/I4583I:= =
* I.A;1/4I-5A=6281; =
* I.A;26. =
* I.AFI5./6 =
* I;A;/5A@I3/ =
* IA3/F-85. = 'I'
* .@/ F2552DI:= 1-6-9/./6 I; ;/. -; '-' I:263/6 .2 3I;15-* .@/ ;.-:3-63
* .225 <-6
iAsa+e = '-'
* I;A7-6I-:. = ' '
itAe+ents = e+entstabWX
* I.A/7/:.A/II. =
* I;A16I:. =
* IA;46//:A;.-6.A42589: = )
* IA;46//:A;.-6.A5I:/ = )
* IA;46//:A/:3A42589: = )
* IA;46//:A/:3A5I:/ = )
* I9126.I:=
* /A/II.A4-8;/3A<*A4-55/6 =
* /;A/II.A4-8;/3A<*A8;/6 =
tables
tAouttab = itab
exceptions
programAerror =
others = !.
endform. O 3I;15-*A-57A5I;.
*RBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
*R Form 12185-./AI.-<
*RBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* text
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* BBG p text
* FBB p! text
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
form populateAitab.
loop at tAmara.
loop at tAmakt where matnr = tAmaraBmatnr.
loop at tAmarc where matnr = tAmaraBmatnr.
mo+eBcorresponding tAmara to itab.
mo+eBcorresponding tAmakt to itab.
mo+eBcorresponding tAmarc to itab.
append itab.
endloop.
endloop.
endloop.
endform. O 12185-./AI.-<
*RBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
*R Form FI55A/7/:.;.-<
*RBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
"#
* text
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* BBG1A/7/:.;.-< text *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
form fillAe+entstab tables pAe+entstab structure e+entstab.
* D@/: .@/ F2552DI:= F8:4.I2: I; 4-55/3 .@/ ;*;./9 12185-./; .@/
* I:./6:-5 .-<5/ /7/:.;.-< DI.@ - 5I;. 2F /7/:.; :-9/.
* -; ;@2D: </52D D@/: 8;I:= IA5I;.A.*1/ = ) .@/ F8:4.I2: 6/.86:; #
* /7/:.; :-9/.
call function '6/8;/A-57A/7/:.;A=/.'
exporting
iAlistAtype = )
importing
etAe+ents = pAe+entstabWX
exceptions
listAtypeAwrong =
others = !.
* <* 4-55I:= .@/ -<27/ F8:4.I2: D/ FI6;. 12185-./ .@/ /7/:.;.-< DI.@
* .@/ 16/3/FI:/3 /7/:.; -:3 .@/: D/ 927/ .@/ F269 :-9/ -; ;@2D: </52D.
* D/ -;;I=: - F269 :-9/ .2 .@/ /7/:. -; 6/N8I6/3 <* .@/ 8;/6.
* F269 :-9/ 4-: </ -:*.@I:=..@/ 1/6F269 ;.-./9/:. F26 .@I; F269
* I; 3*:-9I4-5* 4-55/3.
read table pAe+entstab with key name = slisAe+AtopAofApage.
if syBsubrc = ) .
mo+e '.21A2FA1-=/' to pAe+entstabBform.
append pAe+entstab.
endif.
read table pAe+entstab with key name = slisAe+AtopAofAco+erpage.
if syBsubrc = ) .
mo+e '.21A2FA427/61-=/' to pAe+entstabBform.
append pAe+entstab.
endif.
read table pAe+entstab with key name = slisAe+AendAofAco+erpage .
if syBsubrc = ) .
mo+e '/:3A2FA427/61-=/' to pAe+entstabBform.
append pAe+entstab.
endif.
read table pAe+entstab with key name = slisAe+AforeignAtopAofApage.
if syBsubrc = ) .
mo+e 'F26/I=:A.21A2FA1-=/' to pAe+entstabBform.
append pAe+entstab.
endif.
read table pAe+entstab with key name = slisAe+AforeignAendAofApage.
if syBsubrc = ) .
mo+e 'F26/I=:A/:3A2FA1-=/' to pAe+entstabBform.
append pAe+entstab.
endif.
"$
read table pAe+entstab with key name = slisAe+AlistAmodify.
if syBsubrc = ) .
mo+e '5I;.A923IF*' to pAe+entstabBform.
append pAe+entstab.
endif.
read table pAe+entstab with key name = slisAe+AtopAofAlist.
if syBsubrc = ) .
mo+e '.21A2FA5I;.' to pAe+entstabBform.
append pAe+entstab.
endif.
read table pAe+entstab with key name = slisAe+AendAofApage.
if syBsubrc = ) .
mo+e '/:3A2FA1-=/' to pAe+entstabBform.
append pAe+entstab.
endif.
read table pAe+entstab with key name = slisAe+AendAofAlist .
if syBsubrc = ) .
mo+e '/:3A2FA5I;.' to pAe+entstabBform.
append pAe+entstab.
endif.
endform. O FI55A/7/:.;.-<
*RBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
*R Form FI55A@/-3I:=.-<5/
*RBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* text
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* BBG1A@/-3I:= text *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
form fillAheadingtable tables pAheading structure heading
using tablename.
case tablename.
when '@/-3I:='.
pAheadingBtyp = '@'.
concatenate
' 6/126. :-9/:B' syrepid
' -<< Industry 1te 5td' into pAheadingBinfo.
append pAheading.
write syBdatum using edit mask 'AAEAAEAAAA' to sydatum.
concatenate
' 3-./:B' sydatum ' 8;/6: ' syBuname '1-=/ :2:' sypagno
into pAheadingBinfo.
append pAheading.
when '@/-3I:='.
pAheadingBtyp = '@'.
pAheadingBinfo = '.21B2FB427/6B1-=/'.
append pAheading.
when '@/-3I:=!'.
pAheadingBtyp = '@'.
pAheadingBinfo = '/:3B2FB427/6B1-=/'.
"%
append pAheading.
when '@/-3I:="'.
pAheadingBtyp = '@'.
pAheadingBinfo = 'F26/I=:B.21B2FB1-=/'.
append pAheading.
when '@/-3I:=#'.
pAheadingBtyp = '@'.
pAheadingBinfo = 'F26/I=:B/:3B2FB1-=/'.
append pAheading.
* D@/: '@/-3I:=$'.
* 1A@/-3I:=B.*1 = '@'.
* 1A@/-3I:=BI:F2 = '5I;.B923IF*'.
* -11/:3 1A@/-3I:=.
when '@/-3I:=%'.
pAheadingBtyp = '@'.
pAheadingBinfo = '/:3B2FB1-=/'.
append pAheading.
when '@/-3I:=&'.
pAheadingBtyp = '@'.
pAheadingBinfo = '/:3B2FB5I;.'.
append pAheading.
when '@/-3I:=''.
pAheadingBtyp = '@'.
pAheadingBinfo = '.21B2FB5I;.'.
append pAheading.
endcase.
endform. O FI55A@/-3I:=.-<5/
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* F269 .21A2FA1-=/ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* ........ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
form topAofApage.
call function '6/8;/A-57A4299/:.-6*AD6I./'
exporting
itAlistAcommentary = headingWX
exceptions
others = .
endform.
*RBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
*R Form FI55A42526;.684.
*RBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* text
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* BBG1A42526;.684. text *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
form fillAcolorstruct using pAcolorstruct type slisAcoltypes .
pAcolorstructBheacolfirBcol = %.
pAcolorstructBheacolfirBint = .
pAcolorstructBheacolfirBin+ = .
endform. O FI55A42526;.684.
"&
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* F269 .21A2FA427/61-=/ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* ........ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
form topAofAco+erpage.
call function '6/8;/A-57A4299/:.-6*AD6I./'
exporting
itAlistAcommentary = headingWX
exceptions
others = .
endform.
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* F269 /:3A2FA427/61-=/ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* ........ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
form endAofAco+erpage.
call function '6/8;/A-57A4299/:.-6*AD6I./'
exporting
itAlistAcommentary = heading!WX
exceptions
others = .
endform.
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* F269 F26/I=:A.21A2FA1-=/ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* ........ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
form foreignAtopAofApage.
call function '6/8;/A-57A4299/:.-6*AD6I./'
exporting
itAlistAcommentary = heading"WX
exceptions
others = .
endform.
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* F269 F26/I=:A/:3A2FA1-=/ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* ........ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
form foreignAendAofApage.
call function '6/8;/A-57A4299/:.-6*AD6I./'
exporting
itAlistAcommentary = heading#WX
exceptions
others = .
endform.
"'
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* F269 5I;.A923IF* *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* ........ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
*F269 5I;.A923IF*.
* 4-55 F8:4.I2: '6/8;/A-57A4299/:.-6*AD6I./'
* /I126.I:=
* I.A5I;.A4299/:.-6* = @/-3I:=$WX
* /I4/1.I2:;
* 2.@/6; = .
*/:3F269.
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* F269 /:3A2FA1-=/ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* ........ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
form endAofApage.
call function '6/8;/A-57A4299/:.-6*AD6I./'
exporting
itAlistAcommentary = heading%WX
exceptions
others = .
endform.
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* F269 /:3A2FA5I;. *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* ........ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
form endAofAlist.
call function '6/8;/A-57A4299/:.-6*AD6I./'
exporting
itAlistAcommentary = heading&WX
exceptions
others = .
endform.
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* F269 .21A2FA5I;. *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
* ........ *
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*
form topAofAlist.
call function '6/8;/A-57A4299/:.-6*AD6I./'
exporting
itAlistAcommentary = heading'WX
exceptions
others = .
endform.
*BBB /nd of 1rogram
"(
!(,S(BA$CB/!DBDSP$A: Functions ("ample
6/126. H-57A=6I3.
.-<5/; :+bap.
typeBpools : slis.
data iAe+ents .*1/ slisAtAe+ent.
3-.- : myAal+ .*1/ 6/F .2 clAguiAal+Agrid.
.*1/; : </=I: 2F itab,
+beln 5I0/ +bapB+beln,
arktx 5I0/ +bapBarktx,
/:3 2F itab.
.*1/; : itab .*1/ .-<5/ 2F itab.
3-.- : display .*1/ itab.
3-.- : fcat .*1/ ;5I;A.AFI/534-.A-57.
3-.- : wa 5I0/ 5I:/ 2F F4-..
3-.- D- 5I0/ 7<-1.
3-.-: container .*1/ 6/F .2 clAguiAcustomAcontainer.
data reportAid like syBrepid.
;/5/4.B21.I2:; sA+beln F26 +bapB+beln.
reportAid = syBrepid.
;/5/4. * F629 +bap I:.2 4266/;12:3I:= FI/53; 2F .-<5/ display D@/6/
+beln I: sA+beln.
waBfieldname = '7</5:'.
waBtabname = '7<-1'.
waBkey = 'I'.
D-B@2.;12. = 'I'.
waBtextAfieldname = '3oc no.'.
-11/:3 wa .2 fcat.
45/-6 wa.
waBfieldname = '-60.I'.
waBtabname = '7<-1'.
waBtextAfieldname = 'Item .ext'.
-11/:3 wa .2 fcat.
1/6F269 f)%$)AbuildAe+ent 8;I:= '8;/6A4299-:3'
'F)&$)A8;/6A4299-:3'.
4-55 F8:4.I2: '6/8;/A-57A=6I3A3I;15-* '
/I126.I:=
IA4-55<-40A162=6-9 = reportAid
I.AFI/534-. = F4-.
I.A/7/:.; = iAe+ents
.-<5/;
tAouttab = 3I;15-*
#)
.
F269 f)%$)AbuildAe+ent 8;I:= +alue>wAcAe+entAname?
+alue>wAcAe+entAform?.
3-.-: f)%$)AwaAe+ent .*1/ slisAal+Ae+ent.
45/-6 f)%$)AwaAe+ent.
f)%$)AwaAe+entBname = wAcAe+entAname.
f)%$)AwaAe+entBform = wAcAe+entAform.
-11/:3 f)%$)AwaAe+ent .2 iAe+ents.
/:3F269.
F269 f)&$)AuserAcommand 8;I:= wAucomm .*1/ syBucomm
wAselfield .*1/ slisAselfield.
4-;/ wAucomm.
D@/: 'RI4'.
6/-3 .-<5/ 3I;15-* I:.2 D- I:3/I wAselfieldBtabindex.
* 9/;;-=/ /))) DI.@
* ' *ou ha+e no authoriKation to +iew the report'.
call transaction ';/'.
/:34-;/.
/:3F269.
*** /nd of 1rogram
Download a report to e"cel wit% format -border4 color cell4 etc0
Try )5is pr*3r./...i) /.y 5e>p y*6 )* +5.43e )5e 1*4) ..e)+.
C*de:
REPORT ?SIRI NO STANDARD PAGE !EADING.
* )5is rep*r) de/*4s)r.)es 5*- )* se4d s*/e ABAP d.). )* .4
* E%CEL s5ee) 6si43 OLE .6)*/.)i*4.
INCL#DE OLE=INCL.
* 5.4d>es 1*r OLE *8@e+)s
DATA: !_E%CEL TYPE OLE=_OBAECT2 7 E9+e> *8@e+)
!_MAPL TYPE OLE=_OBAECT2 7 >is) *1 -*r,8**,s
!_MAP TYPE OLE=_OBAECT2 7 -*r,8**,
!_?L TYPE OLE=_OBAECT2 7 +e>>
!_F TYPE OLE=_OBAECT. 7 1*4)
TABLES: SPFLI.
DATA ! TYPE I.
* ).8>e *1 1>i35)s
DATA: IT_SPFLI LIKE SPFLI OCC#RS :$ IT! !EADER LINE.
*B---------------------------------------------------------------------*
*B E0e4) START-OF-SELECTION
*B---------------------------------------------------------------------*
START-OF-SELECTION.
* re.d 1>i35)s
#
SELECT * FROM SPFLI INTO TABLE IT_SPFLI #P TO :$ ROS.
* disp>.y 5e.der
#LINE CD:E.
RITE: ( SY-'LINE NO-GAP2
CFE &F>3&C$$:E COLOR COL_!EADING NO-GAP2 SY-'LINE NO-GAP2
CGE &Nr&C$$=E COLOR COL_!EADING NO-GAP2 SY-'LINE NO-GAP2
C=$E &'*4&C$$FE COLOR COL_!EADING NO-GAP2 SY-'LINE NO-GAP2
C=$E &N.+5&C$$GE COLOR COL_!EADING NO-GAP2 SY-'LINE NO-GAP2
CHE &?ei)&C$$IE COLOR COL_!EADING NO-GAP2 SY-'LINE NO-GAP.
#LINE (CD:E.
* disp>.y 1>i35)s
LOOP AT IT_SPFLI.
RITE: ( SY-'LINE NO-GAP2
IT_SPFLI-CARRID COLOR COL_KEY NO-GAP2 SY-'LINE NO-GAP2
IT_SPFLI-CONNID COLOR COL_NORMAL NO-GAP2 SY-'LINE NO-GAP2
IT_SPFLI-CITYFROM COLOR COL_NORMAL NO-GAP2 SY-'LINE NO-GAP2
IT_SPFLI-CITYTO COLOR COL_NORMAL NO-GAP2 SY-'LINE NO-GAP2
IT_SPFLI-DEPTIME COLOR COL_NORMAL NO-GAP2 SY-'LINE NO-GAP.
ENDLOOP.
#LINE (CD:E.
* )e>> 6ser -5.) is 3*i43 *4
CALL F#NCTION &SAPG#I_PROGRESS_INDICATOR&
E%PORTING
* PERCENTAGE " $
TE%T " TE%T-$$J
E%CEPTIONS
OT!ERS " :.
* s).r) E9+e>
CREATE OBAECT !_E%CEL &E%CEL.APPLICATION&.
* PERFORM ERR_!DL.
SET PROPERTY OF !_E%CEL &'isi8>e& " :.
* CALL MET!OD OF !_E%CEL &FILESA'EAS& E%PORTING K: " &+:L,is_e9+e>.9>s&
.
* PERFORM ERR_!DL.
* )e>> 6ser -5.) is 3*i43 *4
CALL F#NCTION &SAPG#I_PROGRESS_INDICATOR&
E%PORTING
* PERCENTAGE " $
TE%T " TE%T-$$H
E%CEPTIONS
OT!ERS " :.
* 3e) >is) *1 -*r,8**,s2 i4i)i.>>y e/p)y
CALL MET!OD OF !_E%CEL &*r,8**,s& " !_MAPL.
PERFORM ERR_!DL.
* .dd . 4e- -*r,8**,
CALL MET!OD OF !_MAPL &Add& " !_MAP.
PERFORM ERR_!DL.
* )e>> 6ser -5.) is 3*i43 *4
CALL F#NCTION &SAPG#I_PROGRESS_INDICATOR&
E%PORTING
* PERCENTAGE " $
TE%T " TE%T-$$M
E%CEPTIONS
OT!ERS " :.
* *6)p6) +*>6/4 5e.di43s )* .+)i0e E9+e> s5ee)
PERFORM FILL_CELL #SING : : : &F>63&C$$:E.
PERFORM FILL_CELL #SING : = $ &Nr&C$$=E.
PERFORM FILL_CELL #SING : F : &'*4&C$$FE.
PERFORM FILL_CELL #SING : G : &N.+5&C$$GE.
PERFORM FILL_CELL #SING : I : &?ei)&C$$IE.
LOOP AT IT_SPFLI.
#!
* +*py 1>i35)s )* .+)i0e E%CEL s5ee)
! " SY-TABI% < :.
PERFORM FILL_CELL #SING ! : $ IT_SPFLI-CARRID.
PERFORM FILL_CELL #SING ! = $ IT_SPFLI-CONNID.
PERFORM FILL_CELL #SING ! F $ IT_SPFLI-CITYFROM.
PERFORM FILL_CELL #SING ! G $ IT_SPFLI-CITYTO.
PERFORM FILL_CELL #SING ! I $ IT_SPFLI-DEPTIME.
ENDLOOP.
* +5.43es 8y Kis5*re - s).r)
* CALL MET!OD OF !_E%CEL &*r,8**,s& " !_MAPL.
CALL MET!OD OF !_E%CEL &*r,s5ee)s& " !_MAPL.7 E%PORTING K: " =.
PERFORM ERR_!DL.
* .dd . 4e- -*r,8**,
CALL MET!OD OF !_MAPL &Add& " !_MAP E%PORTING K: " =.
PERFORM ERR_!DL.
* )e>> 6ser -5.) is 3*i43 *4
SET PROPERTY OF !_MAP &NAME& " ©&.
CALL F#NCTION &SAPG#I_PROGRESS_INDICATOR&
E%PORTING
* PERCENTAGE " $
TE%T " TE%T-$$M
E%CEPTIONS
OT!ERS " :.
* *6)p6) +*>6/4 5e.di43s )* .+)i0e E9+e> s5ee)
PERFORM FILL_CELL #SING : : : &F>63&C$$:E.
PERFORM FILL_CELL #SING : = $ &Nr&C$$=E.
PERFORM FILL_CELL #SING : F : &'*4&C$$FE.
PERFORM FILL_CELL #SING : G : &N.+5&C$$GE.
PERFORM FILL_CELL #SING : I : &?ei)&C$$IE.
LOOP AT IT_SPFLI.
* +*py 1>i35)s )* .+)i0e E%CEL s5ee)
! " SY-TABI% < :.
PERFORM FILL_CELL #SING ! : $ IT_SPFLI-CARRID.
PERFORM FILL_CELL #SING ! = $ IT_SPFLI-CONNID.
PERFORM FILL_CELL #SING ! F $ IT_SPFLI-CITYFROM.
PERFORM FILL_CELL #SING ! G $ IT_SPFLI-CITYTO.
PERFORM FILL_CELL #SING ! I $ IT_SPFLI-DEPTIME.
ENDLOOP.
* +5.43es 8y Kis5*re - e4d
* dis+*44e+) 1r*/ E9+e>
* CALL MET!OD OF !_E%CEL &FILESA'EAS& E%PORTING K: " &C:LSK'.%LS&.
FREE OBAECT !_E%CEL.
PERFORM ERR_!DL.
*---------------------------------------------------------------------*
* FORM FILL_CELL *
*---------------------------------------------------------------------*
* se)s +e>> .) +**rdi4.)es i2@ )* 0.>6e 0.> 8*>d)ype 8*>d *
*---------------------------------------------------------------------*
FORM FILL_CELL #SING I A BOLD 'AL.
CALL MET!OD OF !_E%CEL &Ce>>s& " !_?L E%PORTING K: " I K= " A.
PERFORM ERR_!DL.
SET PROPERTY OF !_?L &'.>6e& " 'AL .
PERFORM ERR_!DL.
GET PROPERTY OF !_?L &F*4)& " !_F.
PERFORM ERR_!DL.
SET PROPERTY OF !_F &B*>d& " BOLD .
PERFORM ERR_!DL.
ENDFORM.
*B---------------------------------------------------------------------*
*B F*r/ ERR_!DL
#"
*B---------------------------------------------------------------------*
* *6)p6)s OLE err*r i1 .4y *
*----------------------------------------------------------------------*
* --N p: )e9)
* O-- p= )e9)
*----------------------------------------------------------------------*
FORM ERR_!DL.
IF SY-S#BRC ON $.
RITE: ( &Fe5>er 8ei OLE-A6)*/.)i*4:&C$:$E2 SY-S#BRC.
STOP.
ENDIF.
ENDFORM. 7 ERR_!DL
P>e.se 4*)e )5.) )5is e9./p>e /.y8e s>*- .) 1i>>i43 )5e e9+e> ).8>e
Cper5.ps 1*6r 1ie>ds per se+*4d *4 . M$$ M!P /.+5i4e - .>/*s) F$ se+*4ds
1*r . s5*r) e9./p>eE.
T* 3e) )5e d.). *4 pr*per)ies .4d /e)5*ds - )5ere is . 8i) *1 s/*,e .4d /irr*rs
3*i43 *4 5ereQ )5ey .re E%CEL pr*per)ies .4d /e)5*ds2 4*) s.p *4es - s* y*6 4eed
)* >**, .) e9+e> 5e>p )* de)er/i4e 5*- . p.r)i+6>.r 164+)i*4 is s)r6+)6red. )5e4
86i>d )5e 8>*+, i4 s.p2 .s s5*-4 i4 )5e e9./p>e.
I1 y*6 *4>y -.4) )* )r.4s1er )5e d.). )* E9+e> >i,e -5e4 y*6 )r.4s1er )5e d.). 1r*/
AL' )* E9+e> si/p>y 6se )5e F64+)i*4 M*d6>es:
%%L_SIMPLE_API
I1 y*6 -.4) /*re /*di1i+.)i*4s -5e4 y*6 )r.4s1er i) )* E9+e> 6se:
%%L_F#LL_API
A sample Tree Programming
6/126. H77986! .
.-<5/;: 0:7@.
.*1/;: </=I: 2F D260.*1/,
5/7/5>!?,
@08::6 5I0/ 0:7@B08::6,
08::6 5I0/ 0:7@B@08::6,
/:3 2F D260.*1/.
3-.-: I.A0:7@ .*1/ .-<5/ 2F D260.*1/,
D-A0:7@ 5I0/ 5I:/ 2F I.A0:7@,
I.A./91 .*1/ .-<5/ 2F D260.*1/,
D-A./91 5I0/ 5I:/ 2F I.A./91,
I.AD260 .*1/ .-<5/ 2F D260.*1/,
D-AD260 5I0/ 5I:/ 2F I.AD260.
3-.- : </=I: 2F I.A:23/; 24486; ).
I:4583/ ;.684.86/ ;:23/./I..
3-.- : /:3 2F I.A:23/;.
42:;.-:.;: :89</6A2FA5/7/5; .*1/ I 7-58/ %.
1-6-9/./6: 1A@08::6 5I0/ 0:7@B@08::6.
;.-6.B2FB;/5/4.I2:.
##
* 1arent = . hierarchy node
D-A./91B08::6 = 1A@08::6.
-11/:3 D-A./91 .2 I.A./91.
D-AD260B08::6 = D-A./91B08::6.
D-AD260B5/7/5 = .
-11/:3 D-AD260 .2 I.AD260.
* 6eading customer hierarchy >max. % le+el?
32 :89</6A2FA5/7/5; .I9/;.
4@/40 :2. I.A./91 I; I:I.I-5.
;/5/4. 08::6 @08::6
F629 0:7@
I:.2 4266/;12:3I:= FI/53; 2F .-<5/ I.A0:7@
F26 -55 /:.6I/; I: I.A./91
D@/6/ @08::6 = I.A./91B08::6.
5221 -. I.A0:7@ I:.2 D-A0:7@.
D-A0:7@B5/7/5 = ;*BI:3/I C .
-11/:3 D-A0:7@ .2 I.AD260.
/:35221.
I.A./91WX = I.A0:7@WX.
/:332.
* @ierarchy nodes BG tree control
5221 -. I.AD260 I:.2 D-AD260 D@/6/ 5/7/5 = .
1/6F269 9-0/A:23/.
5221 -. I.AD260 I:.2 D-AD260 D@/6/ 5/7/5 = ! -:3
@08::6 = D-AD260B08::6.
1/6F269 9-0/A:23/.
5221 -. I.AD260 I:.2 D-AD260 D@/6/ 5/7/5 = " -:3
@08::6 = D-AD260B08::6.
1/6F269 9-0/A:23/.
5221 -. I.AD260 I:.2 D-AD260 D@/6/ 5/7/5 = # -:3
@08::6 = D-AD260B08::6.
1/6F269 9-0/A:23/.
5221 -. I.AD260 I:.2 D-AD260 D@/6/ 5/7/5 = $ -:3
@08::6 = D-AD260B08::6.
1/6F269 9-0/A:23/.
5221 -. I.AD260 I:.2 D-AD260 D@/6/ 5/7/5 = % -:3
@08::6 = D-AD260B08::6.
1/6F269 9-0/A:23/.
/:35221.
/:35221.
/:35221.
/:35221.
/:35221.
/:35221.
* 9aking the tree control
4-55 F8:4.I2: '6;A.6//A42:;.684.'
#$
.-<5/;
:23/.-< = I.A:23/;
/I4/1.I2:;
.6//AF-I586/ = .
* 3isplay the tree control
3-.- : F$ .*1/ 4.
4-55 F8:4.I2: '6;A.6//A5I;.A3I;15-*'
/I126.I:=
4-55<-40A162=6-9 = ;*B6/1I3
I9126.I:=
F$ = F$ .
F269 9-0/A:23/.
I.A:23/;B:-9/ = D-AD260B08::6.
I.A:23/;B42526 = .
I.A:23/;BI:./:;I7 = .
I.A:23/;B./I. = D-AD260B08::6.
I.A:23/;B.5/:=.@ = %.
I.A:23/;B.5/7/5 = D-AD260B5/7/5.
I.A:23/;B.42526 = .
I.A:23/;B.I:./:;I7 = .
-11/:3 I.A:23/;.
/:3F269.
Sending mail wit% attac%ment
* .his program will allowed you to send email with attachment.
* First, specify the attachment file from your local hardisk and execute.
* :ext, specify the sender email address and click the send button.
*
* Dritten by : ;-1 <asis, -<-1 1rogramming and 2ther I9= ;tuff
* http:EEwww.sapBimg.com
*
report yAcr&Amail.
data method like syBucomm.
data gAuser like soudnamei.
data gAuserAdata like soudatai.
data gAowner like soudBusrnam.
data gAreceipients like soos occurs ) with header line.
data gAdocument like sood# .
data gAheader like sood!.
data gAfolmam like sofm!.
data gAobjcnt like soli occurs ) with header line.
data gAobjhead like soli occurs ) with header line.
data gAobjpara like selc occurs ) with header line.
data gAobjparb like soop occurs ) with header line.
data gAattachments like sood$ occurs ) with header line.
data gAreferences like soxrl occurs ) with header line.
data gAauthority like sofaBusracc.
data gArefAdocument like sood#.
#%
data gAnewAparent like soodk.
data: begin of gAfiles occurs ) ,
text>#)(%? type c,
end of gAfiles.
data : foldAnumber>!? type c,
foldAyr>!? type c,
foldAtype>"? type c.
parameters wsAfile>#)(%? type c default 'c:Vdebugger.txt'.
* 4an me any file fromyour pc ....either xls or word or ppt etc ...
gAuserBsapname = syBuname.
call function ';2A8;/6A6/-3A-1I'
exporting
user = gAuser
* 16/1-6/AF26AF253/6A-44/;; = ' '
importing
userAdata = gAuserAdata
* /I4/1.I2:;
* 8;/6A:2.A/II;. =
* 1-6-9/./6A/6626 = !
* IA/6626 = "
* 2.@/6; = #
.
if syBsubrc FG ).
* 9/;;-=/ I3 ;*B9;=I3 .*1/ ;*B9;=.* :89</6 ;*B9;=:2
* DI.@ ;*B9;=7 ;*B9;=7! ;*B9;=7" ;*B9;=7#.
endif.
foldAtype = gAuserAdataBoutboxfolC)>"?.
foldAyr = gAuserAdataBoutboxfolC">!?.
foldAnumber = gAuserAdataBoutboxfolC$>!?.
clear gAfiles.
refresh : gAobjcnt,
gAobjhead,
gAobjpara,
gAobjparb,
gAreceipients,
gAattachments,
gAreferences,
gAfiles.
method = ';-7/'.
gAdocumentBfoltp = foldAtype.
gAdocumentBfolyr = foldAyr.
gAdocumentBfolno = foldAnumber.
gAdocumentBobjtp = gAuserAdataBobjectAtyp.
*gAdocumentB2<J*6 = '!&'.
*gAdocumentB2<J:2 = '))))))))!"%$'.
*gAdocumentB2<J:-9 = '9/;;-=/'.
gAdocumentBobjdes = 'sapBimg.com testing by program'.
gAdocumentBfolrg = '2'.
#&
*gAdocumentBokcode = '4@:='.
gAdocumentBobjlen = ')'.
gAdocumentBfileAext = '.I.'.
gAheaderBobjdes = 'sapBimg.com testing by program'.
gAheaderBfileAext = '.I.'.
call function ';2A32489/:.A6/12;I.26*A9-:-=/6'
exporting
method = method
officeAuser = syBuname
refAdocument = gArefAdocument
newAparent = gAnewAparent
importing
authority = gAauthority
tables
objcont = gAobjcnt
objhead = gAobjhead
objpara = gAobjpara
objparb = gAobjparb
recipients = gAreceipients
attachments = gAattachments
references = gAreferences
files = gAfiles
changing
document = gAdocument
headerAdata = gAheader
* F259/9A3-.- =
* 6/4/I7/A3-.- =
.
* File from the pc to send...
method = '-..46/-./F62914'.
gAfilesBtext = wsAfile.
append gAfiles.
call function ';2A32489/:.A6/12;I.26*A9-:-=/6'
exporting
method = method
officeAuser = gAowner
refAdocument = gArefAdocument
newAparent = gAnewAparent
importing
authority = gAauthority
tables
objcont = gAobjcnt
objhead = gAobjhead
objpara = gAobjpara
objparb = gAobjparb
recipients = gAreceipients
attachments = gAattachments
references = gAreferences
#'
files = gAfiles
changing
document = gAdocument
headerAdata = gAheader
.
method = ';/:3'.
gAreceipientsBrecnam = '90)'$'.
gAreceipientsBrecesc = '<'.
gAreceipientsBsndex = 'I'.
append gAreceipients.
call function ';2A32489/:.A6/12;I.26*A9-:-=/6'
exporting
method = method
officeAuser = gAowner
refAdocument = gArefAdocument
newAparent = gAnewAparent
importing
authority = gAauthority
tables
objcont = gAobjcnt
objhead = gAobjhead
objpara = gAobjpara
objparb = gAobjparb
recipients = gAreceipients
attachments = gAattachments
references = gAreferences
files = gAfiles
changing
document = gAdocument
headerAdata = gAheader.
*BB /nd of 1rogram
Sending ("ternal email t%roug% SAP
Dhat is the F9 for sending the external email through ;-1 by attaching layout set to itQ
.hese are the F9 for sending external email :B
'OA+O$5!)*#A')*+A"1I6
;-1office: ;end new document with attachments +ia 6F4
'OA*)WA+O$5!)*#A"##A')*+A"1I6
>In #.%4 only, *ou can go to ;/"& and click the documentation on how to use it. - sample program is pro+ided
there.?
;-1office: ;end new document with attachments +ia 6F4
:ote : If you are using F9 'OA*)WA+O$5!)*#A"##A')*+A"1I6 then /xport 1arameter
+O$5!)*#A+"#"-O0GA+)'$ contains the ;ubject.
'OA*)WA+O$5!)*#A')*+A"1I6
;-1office: ;end new document
#(
How to send a report to an e"ternal mail'id?
.ry this sample code :B
6/126. H6/126.A.2A/9-I5 :2 ;.-:3-63 1-=/ @/-3I:= 5I:/B;IH/ !)).
3-.- : </=I: 2F I.-< 24486; ),
1/6:6 5I0/ 1-)))B1/6:6,
/:-9/ 5I0/ 1-)))B/:-9/,
/:3 2F I.-<.
3-.-: messageAcontent 5I0/ soli 24486; ) DI.@ @/-3/6 5I:/,
recei+erAlist 5I0/ soos 24486; $ DI.@ @/-3/6 5I:/,
packingAlist 5I0/ soxpl 24486; ! DI.@ @/-3/6 5I:/,
listobject 5I0/ abaplist 24486; ),
compressedAattachment 5I0/ soli 24486; )) DI.@ @/-3/6 5I:/,
wAobjectAhdAchange 5I0/ sood,
compressedAsiKe 5I0/ syBindex.
;.-6.B2FB;/5/4.I2:.
;/5/4. 1/6:6 /:-9/
I:.2 4266/;12:3I:= FI/53; 2F .-<5/ I.-<
F629 1-)))
D@/6/ 1/6:6 F $).
5221 -. I.-<.
D6I./ :E)! ;*B75I:/ , I.-<B1/6:6, $ ;*B75I:/ , I.-<B/:-9/, $)
;*B75I:/.
/:35221.
* 6ecei+ers
recei+erAlistBrecextnam = ')C#)*"%-!"I%-I+N("HOO.$O!'. OBBG
* /9-I5 -336/;;
6/4/I7/6AlistB6/4/;4 = '/'. OFB
6/4/I7/6AlistB;:3-6. = 'I:.'.OFB
6/4/I7/6AlistB;:316I = ''.OFB
-11/:3 recei+erAlist.
* =eneral data
wAobjectAhdAchangeBobjla = syBlangu.
wAobjectAhdAchangeBobjnam = '2bject name'.
wAobjectAhdAchangeBobjsns = '1'.
* 9ail subject
wAobjectAhdAchangeBobjdes = '9essage subject'.
* 9ail body
-11/:3 '9essage content' .2 messageAcontent.
* -ttachment
4-55 F8:4.I2: ';-7/A5I;.'
$)
/I126.I:=
listAindex = ')'
.-<5/;
listobject = listobject.
4-55 F8:4.I2: '.-<5/A42916/;;'
I9126.I:=
compressedAsiKe = compressedAsiKe
.-<5/;
in = listobject
out = compressedAattachment.
3/;46I</ .-<5/ compressedAattachment.
45/-6 packingAlist.
packingAlistBtransfAbin = 'I'.
packingAlistBheadAstart = ).
packingAlistBheadAnum = ).
packingAlistBbodyAstart = .
packingAlistBbodyAnum = syBtfill.
packingAlistBobjtp = '-5I'.
packingAlistBobjnam = '2bject name'.
packingAlistBobjdes = '-ttachment description'.
packingAlistBobjlen = compressedAsiKe.
-11/:3 packingAlist.
4-55 F8:4.I2: ';2A2<J/4.A;/:3'
/I126.I:=
objectAhdAchange = wAobjectAhdAchange
objectAtype = '6-D'
owner = syBuname
.-<5/;
objcont = messageAcontent
recei+ers = recei+erAlist
packingAlist = packingAlist
attAcont = compressedAattachment.
Creating C%art in ABAP
6/126. HHAA=6-1@ .
3-.-: </=I: 2F I.-<A3-.- 24486; ),
3-.-:-9/>$?,
N8-:.I.* .*1/ I,
N8-:.I.*! .*1/ I,
N8-:.I.*" .*1/ I,
/:3 2F I.-<A3-.-,
</=I: 2F I.-<A21.I2:; 24486; ),
21.I2:>!)?,
/:3 2F I.-<A21.I2:;.
$
I.-<A3-.-B3-.-:-9/ = '/lectricity'.
I.-<A3-.-BN8-:.I.* = $$.
I.-<A3-.-BN8-:.I.*! = %!.
I.-<A3-.-BN8-:.I.*" = $(.
-11/:3 I.-<A3-.-.
I.-<A3-.-B3-.-:-9/ = '=as'.
I.-<A3-.-BN8-:.I.* = "$.
I.-<A3-.-BN8-:.I.*! = $!.
I.-<A3-.-BN8-:.I.*" = ##.
-11/:3 I.-<A3-.-.
I.-<A3-.-B3-.-:-9/ = 'Dater'.
I.-<A3-.-BN8-:.I.* = '.
I.-<A3-.-BN8-:.I.*! = !!.
I.-<A3-.-BN8-:.I.*" = (.
-11/:3 I.-<A3-.-.
4-55 F8:4.I2: '[email protected]"3'
/I126.I:=
425 = 'Jan'
425! = 'Feb'
425" = '9ar'
.I.5 = '8tility /xpenses in 8;Y.'
.-<5/;
3-.- = I.-<A3-.-
21.; = I.-<A21.I2:;
/I4/1.I2:;
2.@/6; = .
ABAP function to con2ert *umber to Dords
*
* C*40er)i43 N6/8er )* *rds
*
* T5is 164+)i*4 +*/es 5.4dy /*s)>y 1*r )5e Fi4.4+e /*d6>e .s )5ey 4eed )* pri4) *6) +5e+,
* 1*r )5e 0e4d*rs. T5e 164+)i*4 .>>*-s y*6 )* +*0er) e.si>y 1r*/ 46/8ers )* -*rds.
*
* ri))e4 8y : SAP B.sis ABAP Pr*3r.//i43 .4d O)5er IMG S)611
* 5))p:((---.s.p-i/3.+*/
$!
*
REPORT ?SPELL.
TABLES SPELL.
DATA : T_SPELL LIKE SPELL OCC#RS $ IT! !EADER LINE.
DATA : PAMO#NT LIKE SPELL-N#MBER 'AL#E &:=FGI:$&.
SY-TITLE " &SPELLING N#MBER&.
PERFORM SPELL_AMO#NT #SING PAMO#NT &#SD&.
RITE: &N#MBERS&2 T_SPELL-ORD2 &DECIMALS &2 T_SPELL-DECORD.
FORM SPELL_AMO#NT #SING PRBTR PAERS.
CALL F#NCTION &SPELL_AMO#NT&
E%PORTING
AMO#NT " PAMO#NT
C#RRENCY " PAERS
FILLER " SPACE
LANG#AGE " &E&
IMPORTING
IN_ORDS " T_SPELL
E%CEPTIONS
NOT_FO#ND " :
TOO_LARGE " =
OT!ERS " F.
ENDFORM. 7 SPELL_AMO#NT
Con2ert .ont% to Dord in ABAP
REPORT ?MONT!.
DATA %_MONT!C::E.
CALL F#NCTION &CON'ERSION_E%IT_LDATE_O#TP#T&
E%PORTING
INP#T " SY-DAT#M
IMPORTING
O#TP#T " %_MONT!.
RITE:( &M*4)5 i4 -*rds&2 %_MONT!<FCHE.
*-- E4d *1 Pr*3r./
ABAP P+P',P Dindow
*ou had button in the application toolbar of the selection screen, when you click that button, a popBup window
should be displayed containing " fields. the data to be displayed depends on the +alues entered by the user.
? @ow to get the popBup windowQ Is there any func. module is thereQ
!? and how to get the fields in the popBup windowQ if any func. module is there , what are the parameters to be
passedQ
8;/ .@I; fm 12181A.2A3/4I3/AI:F2 .
1arameters reMuired for this F9 is the .ext you reMuire to display on the popup window.
.wo buttons automatically comes on this window a .ick and a x sign if you click tick the output +araible -:;D/6
is J else it is - .
or
$"
;ee the below /xample:
-. ;/5/4.I2:B;46//: 2: 7-58/B6/N8/;. F26 ;/5A:<-B52D.
1/6F269 H:/DA7-58/A@/51A:<-.
F269 H:/DA7-58/A@/51A:<-.
;/5/4. 3I;.I:4. H<-6/- F629 H3I7:<-<8 I:.2 .-<5/ I.-<A:<-.
4-55 F8:4.I2: '[email protected]<5/A3I;15-*'
/I126.I:=
/:312;A425 = ")
/:312;A62D = #)
;.-6.12;A425 = !)
;.-6.12;A62D = ")
.I.5/./I. = '1lease 4hoose *our /ntry'
I9126.I:=
4@2I;/ = 428:.;
.-<5/;
7-58/.-< = I.-<A:<-
/I4/1.I2:;
<6/-0A2FF =
2.@/6; = !.
IF 428:.; :/ ).
6/-3 .-<5/ I.-<A:<- I:3/I 428:.;.
;/5A:<-B52D = I.-<A:<-BH<-6/-.
/:3IF.
45/-6 :I.-<A:<-,428:.;.6/F6/;@:I.-<A:<-.
/:3F269. O H:/DA7-58/A@/51A:<-
ABAP Pop'out bo" for user confirmation
* T* p*p-*6) . 8*9 1*r )5e 6ser )* +*41ir/
REPORT ?POP#PCONFIRM.
DATA: %_ANSC:E TYPE C.
+.>> 164+)i*4 &POP#P_TO_CONFIRM_STEP&
e9p*r)i43
* DEFA#LTOPTION " &Y&
)e9)>i4e: " &D* y*6 -.4) )* +*4)i46e&
* TE%TLINE= " & &
)i)e> " &P>e.se C*41ir/&
* START_COL#MN " =I
* START_RO " D
* CANCEL_DISPLAY " &%&
IMPORTING
ANSER " %_ANS.
RITE: ( %_ANS.
*-- E4d *1 Pr*3r./
Pop a .essage to specific SAP users
Is there an.wa. to popup a window on particular users screens though abap program?
*
* P*p . Mess.3e )* spe+i1i+ SAP 6sers
*
* !*- )* 3e) . >is) *1 .>> )5e +6rre4)>y >*33ed *4 6sersR
$#
* !*- )* p*p6p .4 i4s).4) /ess.3e *4 . 6ser&s /*4i)*rR
* !*- )* 3e) . spe+i1i+ 6ser&s de).i>sR
* #s.3e *1 &POP#P_GET_'AL#ES& 164+)i*4 /*d6>e )* 3e) d.). 1r*/ 6ser
* -i)5*6) 5.0i43 )* -ri)e G#I +*de
*
* S68/i))ed 8y : SAP B.sis2 ABAP Pr*3r.//i43 .4d O)5er IMG S)611
* 5))p:((---.s.p-i/3.+*/
*
REPORT ?POP#P NO STANDARD PAGE !EADING.
INCL#DE OICONN.
DATA: BEGIN OF #SR_TABL OCC#RS $.
INCL#DE STR#CT#RE #INFO.
DATA: END OF #SR_TABL.
DATA: L_LENGT! TYPE I2
T_ABAPLIST LIKE ABAPLIST OCC#RS $ IT! !EADER LINE2
BEGIN OF T_#SER OCC#RS $2
CO#NTER TYPE I2
SELECTION TYPE C2
MANDT LIKE SY-MANDT2
BNAME LIKE SY-#NAME2
NAME_FIRST LIKE '_ADRP_CP-NAME_FIRST2
NAME_LAST LIKE '_ADRP_CP-NAME_LAST2
DEPARTMENT LIKE '_ADRP_CP-DEPARTMENT2
TEL_N#MBER LIKE '_ADRP_CP-TEL_N#MBER2
END OF T_#SER2
L_CLIENT LIKE SY-MANDT2
L_#SERID LIKE #INFO-BNAME2
L_OPCODE TYPE %2
L_F#NCT_CODEC:E TYPE C2
L_TESTC=$$E TYPE C.
L_OPCODE " =.
CALL &T5#srI41*& ID &OPCODE& FIELD L_OPCODE
ID &TAB& FIELD #SR_TABL-*SYS*.
CLEAR T_#SER. REFRES! T_#SER.
LOOP AT #SR_TABL.
T_#SER-MANDT " #SR_TABL-MANDT.
T_#SER-BNAME " #SR_TABL-BNAME.
APPEND T_#SER.
ENDLOOP.
SORT T_#SER.
DELETE ADAACENT D#PLICATES FROM T_#SER.
LOOP AT T_#SER.
T_#SER-CO#NTER " SY-TABI%.
SELECT 'SNAME_FIRST
'SNAME_LAST
'SDEPARTMENT
'STEL_N#MBER
INTO CT_#SER-NAME_FIRST2
T_#SER-NAME_LAST2
T_#SER-DEPARTMENT2
T_#SER-TEL_N#MBERE
FROM #SR=: AS #
AOIN '_ADRP_CP AS '
ON #SPERSN#MBER " 'SPERSN#MBER AND
#SADDRN#MBER " 'SADDRN#MBER
!ERE #SBNAME " T_#SER-BNAME.
ENDSELECT.
$$
MODIFY T_#SER.
ENDLOOP.
SORT T_#SER BY NAME_LAST NAME_FIRST.
PERFORM DISPLAY_LIST.
TOP-OF-PAGE.
PERFORM DISPLAY_MEN#.
* E4d *1 )*p-*1-p.3e
TOP-OF-PAGE D#RING LINE-SELECTION.
PERFORM DISPLAY_MEN#.
* E4d *1 )*p-*1-p.3e d6ri43 >i4e-se>e+)i*4
AT LINE-SELECTION.
IF SY-C#RO " =.
IF SY-C#COL O :M.
T_#SER-SELECTION " &%&.
MODIFY T_#SER TRANSPORTING SELECTION !ERE SELECTION " &&.
PERFORM DISPLAY_LIST.
ELSEIF SY-C#COL O FD.
CLEAR T_#SER-SELECTION.
MODIFY T_#SER TRANSPORTING SELECTION !ERE SELECTION " &%&.
PERFORM DISPLAY_LIST.
ELSEIF SY-C#COL O I$.
PERFORM TRANSFER_SELECTION.
PERFORM POP#P_MSG.
ELSEIF SY-C#COL O DJ.
PERFORM TRANSFER_SELECTION.
SORT T_#SER BY NAME_LAST.
PERFORM DISPLAY_LIST.
ELSEIF SY-C#COL O H:.
PERFORM TRANSFER_SELECTION.
SORT T_#SER BY NAME_FIRST.
PERFORM DISPLAY_LIST.
ELSEIF SY-C#COL O MF.
PERFORM TRANSFER_SELECTION.
SORT T_#SER BY MANDT.
PERFORM DISPLAY_LIST.
ENDIF.
ENDIF.
* E4d *1 >i4e-se>e+)i*4
*B---------------------------------------------------------------------*
*B F*r/ DISPLAY_LIST
*B---------------------------------------------------------------------*
FORM DISPLAY_LIST.
SY-LSIND " $.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
LOOP AT T_#SER.
RITE: ( SY-'LINE2 T_#SER-SELECTION AS C!ECKBO%2
SY-'LINE2 T_#SER-MANDT2
SY-'LINE2 T_#SER-BNAME2
SY-'LINE2 T_#SER-NAME_FIRSTC:IE2
SY-'LINE2 T_#SER-NAME_LASTC:IE2
SY-'LINE2 T_#SER-DEPARTMENTC=$E2
SY-'LINE2 T_#SER-TEL_N#MBERC=$E2 SY-'LINE.
!IDE: T_#SER-CO#NTER2 T_#SER-SELECTION.
ENDLOOP.
FORMAT COLOR OFF.
RITE: (C:$HE SY-#LINE.
ENDFORM. 7 DISPLAY_LIST
$%
*B---------------------------------------------------------------------*
*B F*r/ DISPLAY_MEN#
*B---------------------------------------------------------------------*
FORM DISPLAY_MEN#.
FORMAT COLOR COL_!EADING !OTSPOT.
RITE: CM:E SY-#LINE2
( SY-'LINE NO-GAP2 CGE ICON_SELECT_ALL NO-GAP2 &Se>e+) A>>&2
SY-'LINE NO-GAP2 CGE ICON_DESELECT_ALL NO-GAP2 &Dese>e+) A>>&2
SY-'LINE NO-GAP2 CGE ICON_S!ORT_MESSAGE NO-GAP2 &Se4d P*p6p&2
SY-'LINE NO-GAP2 CGE ICON_SORT_#P NO-GAP2 &L.s) N./e& NO-GAP2
SY-'LINE NO-GAP2 CGE ICON_SORT_#P NO-GAP2 &Firs) N./e& NO-GAP2
SY-'LINE NO-GAP2 CGE ICON_SORT_#P NO-GAP2 &C>ie4)& NO-GAP2
SY-'LINE2
(CM:E SY-#LINE2
(C:$HE SY-#LINE.
FORMAT !OTSPOT OFF.
RITE: ( SY-'LINE2 & &2
SY-'LINE2 &C>i&2
SY-'LINE2 &#ser &2
SY-'LINE2 &Firs) N./e &2
SY-'LINE2 &L.s) N./e &2
SY-'LINE2 &Dep.r)/e4) &2
SY-'LINE2 &Te>ep5*4e &2
SY-'LINE2
(C:$HE SY-#LINE.
FORMAT COLOR OFF.
ENDFORM. 7 DISPLAY_MEN#
*B---------------------------------------------------------------------*
*B F*r/ TRANSFER_SELECTION
*B---------------------------------------------------------------------*
FORM TRANSFER_SELECTION.
DO.
READ LINE SY-INDE% FIELD 'AL#E T_#SER-SELECTION.
IF SY-S#BRC ON $.
E%IT.
ENDIF.
MODIFY T_#SER TRANSPORTING SELECTION
!ERE CO#NTER " T_#SER-CO#NTER.
ENDDO.
CLEAR T_#SER.
ENDFORM. 7 TRANSFER_SELECTION
*B---------------------------------------------------------------------*
*B F*r/ POP#P_MSG
*B---------------------------------------------------------------------*
FORM POP#P_MSG.
DATA: L_MSG LIKE SM$GDIC-POP#PMSG 'AL#E &E9peri/e4).> Mess.3e&2
L_LEN TYPE I2
L_RET TYPE C.
LOOP AT T_#SER !ERE SELECTION " &%&.
PERFORM GET_MESSAGE C!ANGING L_MSG L_RET.
E%IT.
ENDLOOP.
IF L_RET " &A&. 7#ser +.4+e>>ed )5e /ess.3e
E%IT.
ENDIF.
* Ge) )5e /ess.3e )e9)
L_LEN " STRLENC L_MSG E.
LOOP AT T_#SER !ERE SELECTION " &%&.
CALL F#NCTION &T!_POP#P&
$&
E%PORTING
CLIENT " T_#SER-MANDT
#SER " T_#SER-BNAME
MESSAGE " L_MSG
MESSAGE_LEN " L_LENGT!
* C#T_BLANKS " & &
E%CEPTIONS
#SER_NOT_FO#ND " :
OT!ERS " =.
IF SY-S#BRC ON $.
RITE: &#ser &2 T_#SER-BNAME2 &4*) 1*64d.&.
ENDIF.
ENDLOOP.
IF SY-S#BRC ON $.
* Bi3 err*rT N* 6ser 5.s 8ee4 se>e+)ed.
MESSAGE ID &AT& TYPE &E& N#MBER &F:I& IT!
&N* 6ser se>e+)edT&.
E%IT.
ENDIF.
ENDFORM. 7 POP#P_MSG
*B---------------------------------------------------------------------*
*B F*r/ GET_MESSAGE
*B---------------------------------------------------------------------*
FORM GET_MESSAGE C!ANGING P_L_MSG LIKE SM$GDIC-POP#PMSG
P_RET#RNCODE TYPE C.
DATA: BEGIN OF FIELDS OCC#RS :.
INCL#DE STR#CT#RE S'AL.
DATA: END OF FIELDS2
RET#RNCODE TYPE C.
FIELDS-TABNAME " &SM$GDIC&.
FIELDS-FIELDNAME " &POP#PMSG&.
FIELDS-FIELDTE%T " &Mess.3e :&.
CONCATENATE & - Ms3 1r*/& SY-#NAME &.& INTO FIELDS-'AL#E SEPARATED
BY & &.
APPEND FIELDS.
CALL F#NCTION &POP#P_GET_'AL#ES&
E%PORTING POP#P_TITLE " &S6pp>y )5e p*p6p /ess.3e&
IMPORTING RET#RNCODE " P_RET#RNCODE
TABLES FIELDS " FIELDS.
IF P_RET#RNCODE " &A&.
E%IT.
ELSE.
READ TABLE FIELDS INDE% :.
P_L_MSG " FIELDS-'AL#E.
ENDIF.
ENDFORM. 7 GET_MESSAGE
*-- E4d *1 Pr*3r./
Calue re6uest for parameter
* If you ha+e two parameters, you want to display +alues>f#? in parameter !
* depending on the +alues entered in parameter .
6/126. HA;6IA@/51A7-58/AF26A.-<5/; .
tables tcurt.
3-.- 3*FI/53; 5I0/ 3*:16/-3 24486; DI.@ @/-3/6 5I:/.
1-6-9/./6;: 1AD-/6; 5I0/ .486.BD-/6;, O4urrency
1A5./I. 5I0/ .486.B5./I., O5ong .ext
$'
1A0./I. 5I0/ .486.B0./I.. O;hort .ext
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
*BBB /xample of updating +alue of another field on the screen BBBBBBBBBB
-. ;/5/4.I2:B;46//: 2: 7-58/B6/N8/;. F26 1AD-/6;.
45/-6: 3*FI/53;WX, 3*FI/53;.
*BBB select currency
4-55 F8:4.I2: '@/51A7-58/;A=/.'
/I126.I:=
fieldname = 'D-/6;'
tabname = '.486.'
I9126.I:=
;/5/4.A7-58/ = 1AD-/6;.
*BBB get long text for the selected currency
;/5/4. ;I:=5/ 5./I. F629 .486.
I:.2 3*FI/53;BFI/537-58/
D@/6/ ;16-; = ;*B5-:=8
-:3 D-/6; = 1AD-/6;.
IF ;*B;8<64 FG ).
45/-6 3*FI/53;BFI/537-58/.
/:3IF.
*BBB update another field
3*FI/53;BFI/53:-9/ = '1A5./I.'.
-11/:3 3*FI/53;.
4-55 F8:4.I2: '3*:1A7-58/;A813-./'
/I126.I:=
3*:-9/ = ;*B4162=
3*:89< = ;*B3*::6
tables
dynpfields = 3*FI/53; .
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
*BBB /xample of reading +alue of another field BBBBBBBBBBBBBBBBBBBBBBBBB
-. ;/5/4.I2:B;46//: 2: 7-58/B6/N8/;. F26 1A0./I..
*BBB read another field
45/-6: 3*FI/53;WX, 3*FI/53;.
3*FI/53;BFI/53:-9/ = '1AD-/6;'.
-11/:3 3*FI/53;.
4-55 F8:4.I2: '3*:1A7-58/;A6/-3'
/I126.I:=
3*:-9/ = ;*B4162=
3*:89< = ;*B3*::6
.-<5/;
3*:1FI/53; = 3*FI/53; .
6/-3 .-<5/ 3*FI/53; I:3/I .
*BBB get short text and update current field
;/5/4. ;I:=5/ 0./I. F629 .486.
I:.2 1A0./I.
D@/6/ ;16-; /N ;*B5-:=8
-:3 D-/6; /N 3*FI/53;BFI/537-58/.
*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
.ake your SAP/, Disappear and Appear Again
3uring data processing, you can make your ;-1=8I in+isible and then +isible again once the process is completed.
$(
*B---------------------------------------------------------------------
REPORT ?TEST_IN'ISIBLE_TRICK .
*************************************************************
START-OF-SELECTION.
*SAPG#I s+ree4 0.4is5es 1r*/ 6ser s+ree4 >is)
CALL F#NCTION &SAPG#I_SET_PROPERTY&
DESTINATION &SAPG#I&
E%PORTING pr*per)y " &'ISIBLE&
0.>6e " & &
E%CEPTIONS sys)e/_1.i>6re " :
+*//64i+.)i*4_1.i>6re " =
OT!ERS " F.
***********************************************************************
DO :$$$ TIMES.
*d*i43 s*/e -*r, -5i+5 ).,es >*) *1 )i/e
DO :$$$ TIMES.
ENDDO.
*Rese))i43 )i/e +*64)er *1 di.>*3 pr*+ess s* )5.) )i/e-*6) d*es 4*)
*5.ppe4. #se )5is 1/ -i)5i4 y*6r pr*3r./s .) .ppr*pri.)e >*+.)i*4s )*
*rese) )i/e +*64)er.
CALL F#NCTION &T!_REDISPATC!&.
ENDDO.
*************************************************************
**r, is +*/p>e)e .4d 4*- -.,e 6p )5e SAPG#I s+ree4
CALL F#NCTION &SAPG#I_SET_PROPERTY&
DESTINATION &SAPG#I&
E%PORTING pr*per)y " &'ISIBLE&
0.>6e " &%&
E%CEPTIONS sys)e/_1.i>6re " :
+*//64i+.)i*4_1.i>6re " =
OT!ERS " F.
*** E4d *1 Pr*3r./
To e"ecute a dos command from ABAP
*
* ri))e4 8y : SAP B.sis2 ABAP Pr*3r.//i43 .4d O)5er IMG S)611
* 5))p:((---.s.p-i/3.+*/
*
* T* e9e+6)e . d*s +*//.4d 1r*/ ABAP2 y*6 4eed )* +re.)e . 8.) 1i>e.
*
* #se )5e -i4d*-s 4*)ep.d )* +re.)e )5is 8.) 1i>e i4 +:L :-
*
* )es).8.)
* +:L
* +dL)e/p
* dir (p
*
REPORT ?DOSCOMMAND NO STANDARD PAGE !EADING.
PARAMETERS: DOSCMDCF$E DEFA#LT &+:L)es).8.)& LOER CASE.
+.>> 164+)i*4 &G#I_E%EC&
e9p*r)i43
%)
+*//.4d " DOSCMD.
*-- E4d *1 pr*3r./.
!FC call to get Ser2er $ist
@ow to get the 6F4 call to get the list of ;-1 ;er+ers >3ifferent machines?Q
3oes such a thing exist >From ;-16F4.I:I may beQ? but the I:I file is not a good option as I would need to check
the connection a+ailability.
- list of application ser+ers within an 6E" system can be obtained by calling function module
'#HA+I'1%"(A')O)A%I'#'
For example:
6/126. H;/67/65I;..
call function '.@A3I;15-*A;/67/6A5I;.'.
*** /nd of 1rogram
"at are )*)P /b8ects6
-<-1 2bjects is a new concept in 6E" 6elease #.). .he term has two meanings. 2n the one hand, it stands for the
entire -<-1 runtime en+ironment. 2n the other hand, it represents the objectBoriented extension of the -<-1
language.
.he following is a simple example shows the objectBoriented aspect of function groups in the simple case of a
counter.
;uppose we ha+e a function group called 428:./6:
4reate an abap program with this code :B
F8:4.I2:B1225 428:./6.
3-.- 428:. .*1/ I.
F8:4.I2: ;/.A428:./6.
* 5ocal Interface I9126.I:= 7-58/>;/.A7-58/?
428:. = ;/.A7-58/.
/:3F8:4.I2:.
F8:4.I2: I:46/9/:.A428:./6.
-33 .2 428:..
/:3F8:4.I2:.
F8:4.I2: =/.A428:./6.
* 5ocal Interface: /I126.I:= 7-58/>=/.A7-58/?
=/.A7-58/ = 428:..
/:3F8:4.I2:.
* /nd of program code
.he function group has a global integer field 428:., and three function modules,
B ;/.A428:./6,
B I:46/9/:.A428:./6, and
B =/.A428:./6, that work with the field.
%
.wo of the function modules ha+e input and output parameters. .hese form the data interface of the function group.
-ny -<-1 program can then work with this function group. For example:
6/126. H-<-122.
3-.- :89</6 .*1/ I 7-58/ $.
4-55 F8:4.I2: ';/.A428:./6' /I126.I:= ;/.A7-58/ = :89</6.
32 " .I9/;.
4-55 F8:4.I2: 'I:46/9/:.A428:./6'.
/:332.
4-55 F8:4.I2: '=/.A428:./6' I9126.I:= =/.A7-58/ = :89</6.
D6I./: E '-fter processing :89</6 is :B ', :89</6.
* /nd of program code
-fter this section of the program has been processed, the program +ariable :89</6 will ha+e the +alue '.
.he program itself cannot access the 428:. field in the function group. 2perations on this field are fully encapsulated in the
function module. .he program can only communicate with the function group by calling its function modules.
%ist of "0"1 Functions
ABAPBD+C,BD+D*$+AD Download )*)P documentation in HT(+
format.
APP$B$+/BD($(T( it" t"is function module &ou delete logs in
t"e database according to specified selection
conditions
APP$B$+/BDSP$A: it" t"is function module &ou can anal&9e
logs in t"e database.
APP$B$+/BDSP$A:B*T(!* it" t"is function module &ou can anal&9e
logs in local memor&% e.g. w"en &ou "a:e onl&
collected log records at runtime and do not
want to write to t"e database.
APP$B$+/B*T T"is function module c"ec#s w"et"er t"e
specified ob8ect or sub-ob8ect e5ists and
deletes all e5isting associated data in local
memor&.
APP$B$+/B!(ADBDB it" t"is function module &ou read t"e log
data in t"e database for an ob8ect or sub-
ob8ect according to specified selection
conditions.
APP$B$+/B!(ADB*T(!* it" t"is function module &ou read all log data
w"ose log class "as at least t"e specified
:alue% from local memor&% for t"e specified
ob8ect or sub-ob8ect.
APP$B$+/BS(TB+BE(CT it" t"is function module% &ou create a new
ob8ect or sub-ob8ect for writing in local
memor&. it" a flag &ou can control w"et"er
t"e )PP+;+/7;.-T,;... messages are
written in local memor& or are output on t"e
screen.
%!
APP$B$+/BD!T(BDB it" t"is function module &ou write all data for
t"e specified ob8ect or sub-ob8ect in local
memor& to t"e database. -f t"e log for t"e
ob8ect or sub-ob8ect in <uestion is new% t"e log
number is returned to t"e calling program.
APP$B$+/BD!T(BH(AD(! it" t"is function module% &ou write t"e log
"eader data in local memor&.
APP$B$+/BD!T(B$+/BPA!A.(T(!S it" t"is function module% &ou write t"e name
of t"e log parameters and t"e associated
:alues for t"e specified ob8ect or sub-ob8ect in
local memor&. -f t"is function module is called
repeatedl& for t"e same ob8ect or sub-ob8ect%
t"e e5isting parameters are updated
accordingl&. -f &ou do not specif& an ob8ect or
sub-ob8ect wit" t"e call% t"e most recentl&
used is assumed.
APP$B$+/BD!T(B.(SSA/(BPA!A.S it" t"is function module &ou write a single
message% wit" parameters% in local memor&.
/t"erwise t"e function module wor#s li#e
)PP+;+/7;.-T,;S-07+,;(,SS)7,.
APP$B$+/BD!T(B.(SSA/(S it" t"is function module &ou write one or
more messages% wit"out parameters% in local
memor&.
APP$B$+/BD!T(BS*/$(B.(SSA/( it" t"is function module &ou write a single
message% wit"out parameters% in local
memor&. -f no "eader entr& "as &et been
written for t"e ob8ect or sub-ob8ect% it is
created. -f &ou do not specif& an ob8ect or sub-
ob8ect wit" t"e call% t"e most recentl& used is
assumed.
A!FCB/(TBTD will return t"e -P address of t"e terminal in
"e5.
BA$BC*T$BC!(AT( Create Control for log displa&
BA$BC*T$BF!(( .elease Control
BA$BC*T$B!(F!(SH Put new data in log displa&
BA$BDBBD($(T( Delete logs from t"e database
BA$BDBBD(@,(,( =nloc# log
BA$BDBB(*@,(,( +oc# log
BA$BDBB$+AD +oad logs from t"e database
BA$BDBB$+AD +oad log!s$
BA$BDBBSAC( Sa:e logs in t"e database
BA$BDBBSAC( Sa:e log!s$
BA$BDBBSAC(BP!(PA!( Prepare sa:e
%"
BA$BDBBS(A!CH Find logs in t"e database
BA$BDSPB$+/BDSP$A: Displa& messages in memor&
BA$BDSPB$+/BDSP$A: Displa& +og
BA$BDSPB$+/BPA!A.(T(!S ,it"er output e5tended long te5t or call a
callbac# routine !based on t"e data in
*)+;S;+/7-P).)(S$
BA$BDSPB$+/BT(CH*CA$BDATA /utput all log "eader data
BA$BDSPB.S/B$+*/T(5T Displa& message long te5t
BA$BDSPB.S/BPA!A.(T(!S ,it"er output e5tended long te5t or call a
callbac# routine !based on t"e data in
*)+;S;(S7-P).)(S$
BA$BDSPB.S/BT(CH*CA$BDATA /utput tec"nical data of a message suc" as
wor# area% error number% etc.
BA$BDSPB+,TP,TBF!(( ,nd output
BA$BDSPB+,TP,TB*T -nitiali9e output
BA$BDSPB+,TP,TBS(TBDATA Set dataset to be displa&ed
BA$BDSPBP!+F$(BD(T$(C($B/(T (essage "ierarc"& in D,T+,3,+
BA$BDSPBP!+F$(B*+BT!((B/(T Displa& wit"out tree !fullscreen$
BA$BDSPBP!+F$(BP+P,PB/(T Displa& wit"out tree !popup$
BA$BDSPBP!+F$(BS*/$(B$+/B/(T Standard profile !S+7'$ for one log
BA$BDSPBP!+F$(BSTA*DA!DB/(T Standard profile !S+7'$ for a lot of logs
BA$B/$BBA,TH+!7AT+*B/(T )ssign aut"ori9ation
BA$B/$BBA,TH+!7AT+*B!(S(T .eset aut"ori9ation
BA$B/$BBC+*F/B/(T .ead configuration
BA$B/$BBC+*F/BS(T Set configuration
BA$B/$BB.(.+!:B(5P+!T Put function group memor& in )*)P-(,(/.4
BA$B/$BB.(.+!:B.P+!T 7et function group memor& from )*)P-
(,(/.4
BA$B/$BB.(.+!:B!(F!(SH !Partiall&$ reset global memor&
BA$B/$BB.(.+!:B!(F!(SH !Partiall&$ initiali9e memor&
BA$B/$BB.S/BC,!!(*TBHA*D$(B/(T 7et current message "andle
BA$B/$BB.S/BD(FA,$TSB/(T 7et message defaults
BA$B/$BBS(A!CHB$+/ Find logs in memor&
BA$B/$BBS(A!CHB.S/ Find messages in memor&
%#
BA$B$+/BC!(AT( Create log wit" "eader data
BA$B$+/BC!(AT( Create log wit" "eader data
BA$B$+/BD($(T( Delete log !from database also at Sa:e$
BA$B$+/B(5ST C"ec# e5istence of a log in memor&
BA$B$+/BHD!BCHA*/( C"ange log "eader
BA$B$+/BHD!BCH(CF C"ec# log "eader data for consistenc&
BA$B$+/BHD!B!(AD .ead log "eader and ot"er data
BA$B$+/B.S/BADD Put message in log
BA$B$+/B.S/BADD Put message in log
BA$B$+/B.S/BCHA*/( C"ange message
BA$B$+/B.S/BCHA*/( C"ange message
BA$B$+/B.S/BCH(CF C"ec# message data for consistenc&
BA$B$+/B.S/BC,.,$AT( )dd message cumulated
BA$B$+/B.S/BD($(T( Delete message
BA$B$+/B.S/BD($(T( Delete message
BA$B$+/B.S/B(5ST C"ec# e5istence of a message in memor&
BA$B$+/B.S/B!(AD .ead message and ot"er data
BA$B$+/B.S/B!(P$AC( .eplace last message
BA$B$+/B!(F!(SH Delete log from memor&
BA$B$+/B!(F!(SH Delete log from memor&
BA$B.S/BDSP$A:BABAP /utput message as )*)P-(,SS)7,
BA$B+BE(CTBS($(CT .ead )pplication +og ob8ects table record
BA$B+BE(CTBS,B+BE(CT C"ec# w"et"er ob8ect and subob8ect e5ist and
t"e combination is allowed
BA$BS,B+BE(CTBS($(CT .ead subob8ect table record
BPB(C(*TB!AS( Trigger an e:ent from )*)P>? program
BPBE+B$+/B!(AD Fetc" 8ob log e5ecutions
CHA*/(D+C,.(*TB!(ADBH(AD(!S 7et t"e c"ange document "eader for a sales
document% and put t"e results in an internal
table.
("ample)
CALL F#NCTION &C!ANGEDOC#MENT_READ_!EADERS&
E%PORTING
*8@e+)+>.ss " &EINKBELEG&
*8@e+)id " >_*8@e+)id
%$
6ser4./e " sp.+e
TABLES
i_+d5dr " >)_+d5dr.
LOOP AT >)_+d5dr !ERE 6d.)e IN s_.ed.).
CALL F#NCTION &C!ANGEDOC#MENT_READ_POSITIONS&
E%PORTING
+5.43e46/8er " >)_+d5dr-+5.43e4r
TABLES
edi)p*s " >)_edi)p*s.
LOOP AT >)_edi)p*s !ERE 14./e " &LOEK?&
AND 1_4e- " &L&.
p_des+ " )e9)-r$:. 7 C.4+e> C*4)r.+)
ENDLOOP.
ENDLOOP.
CHA*/(D+C,.(*TB!(ADBP+ST+*S 7et t"e details of a c"ange document% and
store t"em in an internal table. T"is will tell
&ou w"et"er a field was c"anged% deleted% or
updated.
("ample)
CALL F#NCTION &C!ANGEDOC#MENT_READ_!EADERS&
E%PORTING
*8@e+)+>.ss " &EINKBELEG&
*8@e+)id " >_*8@e+)id
6ser4./e " sp.+e
TABLES
i_+d5dr " >)_+d5dr.
LOOP AT >)_+d5dr !ERE 6d.)e IN s_.ed.).
CALL F#NCTION &C!ANGEDOC#MENT_READ_POSITIONS&
E%PORTING
+5.43e46/8er " >)_+d5dr-+5.43e4r
TABLES
edi)p*s " >)_edi)p*s.
LOOP AT >)_edi)p*s !ERE 14./e " &LOEK?&
AND 1_4e- " &L&.
p_des+ " )e9)-r$:. 7 C.4+e> C*4)r.+)
ENDLOOP.
ENDLOOP.
C$AFBC$ASSFCAT+*B+FB+BE(CTS .eturn all of t"e c"aracteristics for a material
C$+BP,TBS/*B*BF!+*T (o:e t"e negati:e sign from t"e left "and side
of a number% to t"e rig"t "and side of t"e
number. 0ote t"at T"e result will be left
8ustified !li#e all c"aracter fields$% not rig"t
8ustifed as numbers normall& are.
C$PBB(5P+!T ,5port a te5t table to t"e clipboard !on
presentation ser:er$
C$PBB.P+!T -mport a Te5t Table from t"e Clipboard !on
presentation ser:er$
C+..TBT(5T To load long te5t into S)P
C+*C(!S+*B(5TBA$PHAB*P,T con:erts an& number into a string fill wit"
9eroes% wit" t"e number at t"e e5treme rig"t
%%
("ample)
i4p6) " :=F
*6)p6) " $$$$$$$$$$$$$...$$$$$$$$$$$$:=F
C+*C(!S+*B(5TBA$PHAB+,TP,T con:erts an& number wit" 9eroes rig"t into a
simple integer
("ample)
i4p6) " $$$$$$$$$$$:=F
*6)p6) " :=F
C+*C(!TBABAPSP++$E+BB>BPDF con:ert abap spool output to PDF
C+*C(!TB+TF Con:ert S)P documents !S)PScript$ to ot"er
t&pes.
("ample)
CALL F#NCTION 7CON'ERT_OTF7
E%PORTING FORMAT " 7PDF7
IMPORTING BIN_FILESI?E " FILE_LEN
TABLES OTF " OTFDATA
LINES " PDFDATA
E%CEPTIONS ERR_MA%_LINEIDT! " :
ERR_FORMAT " =
ERR_CON'_NOT_POSSIBLE " F
OT!ERS " G.
C+*C(!TB+TFSP++$E+BB>BPDF con:erts a /TF spool to PDF !i.e. Sapscript
document$
C+*C(!TBT+BF+!(/*BC,!!(*C: Con:ert local currenc& to foreign currenc&.
C+*C(!TBT+B$+CA$BC,!!(*C: Con:ert from foreign currenc& to local
currenc&
DAT(BCH(CFBP$A,SB$T: C"ec# to see if a date is in a :alid format for
S)P. or#s well w"en :alidating dates being
passed in from ot"er s&stems.
DAT(BC+.P,T(BDA: .eturns a number indicating w"at da& of t"e
wee# t"e date falls on. (onda& is returned as a
'% Tuesda& as 2% etc.
DAT(B/(TBD((F will return t"e wee# t"at a date is in.
DAT(B*BF,T,!( Calculate a date 0 da&s in t"e future.
DA:BATT!B,T(SB/(T .eturn useful information about a da&. ill tell
&ou t"e da& of t"e wee# as a word !Tuesda&$%
t"e da& of t"e wee# !2 would be Tuedsa&$%
w"et"er t"e da& is a "olida&% and more.
!pro:ided b& Francois Henrotte$
D+D*$+AD download a file to t"e presentation ser:er !PC$
D:*PBCA$,(SB!(AD .ead t"e :alues from a d&npro. T"is function
can be used to read t"e :alues from a report@s
selection screen too !)not"er e5ample$.
D:*PBCA$,(SB,PDAT( Similar to D40P;3)+=,S;.,)D% t"is function
will allow t"e updating of fields on a d&npro.
3er& useful w"en &ou want to c"ange a field
%&
based on t"e :alue entered for anot"er field.
(*@,(BS$((P ait a specified period of time before
continuing processing.
(*@,(,(B(SF,*CT+* +oc# an abap program so t"at it cannot be
e5ecuted.
("ample)
Se) )5e p.r./e)ers .s 1*>>*-s:
RELID " &??&
SRTF= " $
SRTF " Cy*6r rep*r) 4./eE
Please note t"at &ou s"ould not use S4-.,P-D to pass &our report name to t"e function. T"e :alue of S4-
.,P-D will c"ange as it is being passed to t"e function module% and will no longer "old t"e :alue of t"e
calling report.
(PSB/(TBD!(CT+!:B$ST*/ return a list of filenames from a local or
networ# dri:e
(PSB/(TBF$(BATT!B,T(S Pass in a filename and a pat"% and will return
attributes for t"e file
F;BDAT( displa&s a calendar in a popup window and
allows user to c"oose a date% or it can be
displa&ed read onl&.
F;BFBF($DBCA$,(B!(@,(ST =se :alues from a DD-C table to pro:ide a list
of possible :alues. T)*0)(, and F-,+D0)(,
are re<uired fields% and w"en
(=+T-P+,;CH/-C, is selected% more t"an one
:alue can be returned.
F;FB*TBTAB$(BCA$,(B!(@,(ST F? "elp t"at returns t"e :alues selected in an
internal table. 3er& "and& w"en programming
&our :er& own F? "elp for a field.
("ample)
d.).:
8e3i4 *1 )_0.>6es *++6rs =2
0.>6e >i,e ,4.:-8e3r62
e4d *1 )_0.>6es2
)_re)6r4 >i,e dds5re)0.> *++6rs $ -i)5 5e.der >i4e.
)_0.>6es " &PAR*&.
.ppe4d )_0.>6es.
)_0.>6es " &#GG&.
.ppe4d )_0.>6es.
+.>> 164+)i*4 &FGIF_INT_TABLE_'AL#E_REU#EST&
e9p*r)i43
re)1ie>d " &BEGR#&
0.>6e_*r3 " &S&
).8>es
0.>6e_).8 " )_0.>6es
re)6r4_).8 " )_re)6r4
e9+ep)i*4s
p.r./e)er_err*r " :
4*_0.>6es_1*64d " =
*)5ers " F.
%'
i1 sy-s68r+ " $.
re.d ).8>e )_re)6r4 i4de9 :.
*_8e3r6->*- " )_re)6r4-1ie>d0.>.
i1 *_8e3r6->*- " &PAR*&.
*_8e3r6-*p)i*4 " &CP&.
e>se.
*_8e3r6-*p)i*4 " &EU&.
e4di1.
*_8e3r6-si34 " &I&.
.ppe4d *_8e3r6 )* s_8e3r6.
e>se.
*_8e3r6 " i_8e3r6.
e4di1.
F;FBSH$PB(5TB(5A.P$( documents t"e different reasons to
use a searc" "elp e5it% and s"ows "ow
it is done.
F;PB*TBTAB$(BCA$,(B!(@,(ST T"is function does not e5ist in ?.A and
abo:e. =se
F?-F;-0T;T)*+,;3)+=,;.,Q=,ST
instead.
F$(*A.(B/(T popup to get a filename from a user%
returns blan# filename if user selects
cancel
F+!.ATB.(SSA/( Ta#es a message id and number% and
puts it into a :ariable. or#s better
t"an .-T,;(,SS)7,% since some
messages use B as a place "older% and
.-T,;(,SS)7, does not
accommadate t"at% it onl& replaces t"e
ampersands !C$ in t"e message.
FTPBC+..A*D ,5ecute a command on t"e FTP ser:er
FTPBC+**(CT /pen a connection !and log in$ to an
FTP ser:er
FTPBDSC+**(CT Close t"e connection !and log off$ t"e
FTP ser:er
F, CSAPB.ATBB+.B!(AD 4ou can use t"is function module to
displa& simple material */(s. 4ou
cannot displa& */( groups !for
e5ample% all :ariants of a :ariant */($.
as in transaction CSD1. Current
restrictions2 4ou cannot displa& long
te5ts. 4ou cannot displa& sub-items.
4ou cannot displa& classification data
of */( items for batc"es. 4ou can
onl& displa& one alternati:e or :ariant.
4ou cannot enter an alternati:e for
%(
module CS)P;()T;*/(;.,)D% so
&ou alwa&s see alternati:e D'. T"e
following e5ample came from a
posting on t"e S)P-.1-+ mailing list.
("ample)
d.).: 8e3i4 *1 )s),= *++6rs $.
i4+>6de s)r6+)6re s),*_.pi$=.
d.).: e4d *1 )s),=.
d.).: 8e3i4 *1 )s)p= *++6rs $.
i4+>6de s)r6+)6re s)p*_.pi$=.
d.).: e4d *1 )s)p=.
d.).: 8e3i4 *1 )dep_d.). *++6rs $.
i4+>6de s)r6+)6re +sdep_d.)..
d.).: e4d *1 )dep_d.)..
d.).: 8e3i4 *1 )dep_des+r *++6rs $.
i4+>6de s)r6+)6re +sdep_des+r.
d.).: e4d *1 )dep_des+r.
d.).: 8e3i4 *1 )dep_s*6r+e *++6rs $.
i4+>6de s)r6+)6re +sdep_s*6r+e.
d.).: e4d *1 )dep_s*6r+e.
d.).: 8e3i4 *1 )dep_*rder *++6rs $.
i4+>6de s)r6+)6re +sdep_*rder.
d.).: e4d *1 )dep_*rder.
d.).: 8e3i4 *1 )dep_d*+ *++6rs $.
i4+>6de s)r6+)6re +sdep_d*+.
d.).: e4d *1 )dep_d*+.
d.).: 1>3_-.r4i43 >i,e +.pi1>.3-1>-.r4i43.
+.>> 164+)i*4 &CSAP_MAT_BOM_READ&
e9p*r)i43
/.)eri.> " &MAT:$$&
p>.4) " &$$$:&
8*/_6s.3e " &:&
0.>id_1r*/ " &=$.:=.:MMD&
* 0.>id_)*
i/p*r)i43
1>_-.r4i43 " 1>3_-.r4i43
).8>es
)_s),* " )s),=
)_s)p* " )s)p=
)_dep_d.). " )dep_d.).
)_dep_des+r " )dep_des+r
)_dep_s*6r+e " )dep_s*6r+e
)_dep_*rder " )dep_*rder
)_dep_d*+ " )dep_d*+
e9+ep)i*4s
err*r " :.
Function /roup /!AP is now obsolete3 S)P recommends using functions in
function group SF,S instead. *elow is
an o:er:iew of t"e c"anges.
&)
/BS(TB/(TBA$$BCA$,(S Fetc" :alues from a set.
/(TBC,!!(*TB:(A! 7et t"e current fiscal &ear.
("ample)
CALL F#NCTION &GET_C#RRENT_YEAR&
E%PORTING
B#KRS " &:$$$& 7 C*/p.4y C*de
DATE " SY-DAT#M 7 D.)e )* 1i4d 1is+.> ye.r 1*r
IMPORTING
C#RRM " -_+6rr/ 7 C6rre4) Fis+.> M*4)5
C#RRY " -_+6rry 7 C6rre4) Fis+.> Ye.r
PRE'M " -_pre0/ 7 Pre0i*6s Fis+.> M*4)5
PRE'Y " -_pre0y. 7 Pre0i*6s Fis+.> Ye.r
/(TB/$+BA$BS:.B+$S .eturns a list of all tables% select
options% te5ts% etc for a program. ,:en
includes t"e te5t definitions for t"e
selection screen
/(TB*C$,D(TAB .eturns a list of all -0C+=D,S in a
program
/(TBE+BB!,*T.(B*F+ 7et t"e current 8ob number from a
program. )lso returns ot"er useful info
about t"e current 8ob.
/,BC!(AT(BD!(CT+!: Create a director& on t"e presentation
ser:er
/,BD($(T(BF$( .eplaces S;F-+,;D,+,T,. Delete a
file on t"e presentation ser:er
/,BD+D*$+AD .eplaces S;D/0+/)D. Download
table from t"e app ser:er to
presentation ser:er
/,B(5(C .eplaces S;,E,C=T,. Start a File or
Program )s&nc"ronousl& wit"
in,5ec
/,B/(TBD(SFT+PB*F+ .eplaces S;Q=,.4. Deli:ers
-nformation )bout t"e Des#top !client$
/,B!(.+C(BD!(CT+!: Delete a director& on t"e presentation
ser:er
/,B!,* Start a File or Program
)s&nc"ronousl& wit" S"ell,5ecute
/,B,P$+AD .eplaces S;=P+/)D. =poad file
from presentation ser:er to t"e app
ser:er
&
H($PBSTA!T Displa& "elp for a field. =seful for
doing )T S,+,CT-/0 SC.,,0 /0
3)+=, .,Q=,ST for t"ose fields t"at
do not pro:ide F? "elp at t"e DD-C
le:el.
H($PBCA$,(SB/(TBDTHBTAB$( S"ow a list of possible :alues for F?
popup "elp on selection screens. T"is
function module pops up a screen t"at
is 8ust li#e all t"e ot"er F? "elps% so it
loo#s li#e t"e rest of t"e S)P s&stem.
3er& useful for pro:iding dropdowns
on fields t"at do not "a:e t"em
predefined.
("ample)
).8>es: )$$:-.
DATA: >+_-er,s LIKE )$$:---er,s2
>).8_1ie>ds LIKE 5e>p_0.>6e OCC#RS $ -i)5 5e.der >i4e2
BEGIN OF >).8_0.>6es OCC#RS $2
1e>dCG$E TYPE +2
END OF >).8_0.>6es.
*-- Se) 6p 1ie>ds )* re)rie0e d.).
>).8_1ie>ds-).84./e " &T$$:&.
>).8_1ie>ds-1ie>d4./e " &ERKS&.
>).8_1ie>ds-se>e+)1>.3 " &%&.
APPEND >).8_1ie>ds.
>).8_1ie>ds-).84./e " &T$$:&.
>).8_1ie>ds-1ie>d4./e " &NAME:&.
>).8_1ie>ds-se>e+)1>.3 " sp.+e.
APPEND >).8_1ie>ds.
*-- Fi>> 0.>6es
se>e+) * 1r*/ )$$:-.
>).8_0.>6es-1e>d " )$$:---er,s.
.ppe4d >).8_0.>6es.
>).8_0.>6es-1e>d " )$$:--4./e:.
.ppe4d >).8_0.>6es.
e4dse>e+).
CALL F#NCTION &!ELP_'AL#ES_GET_IT!_TABLE&
E%PORTING
1ie>d4./e " &ERKS&
).84./e " &T$$:&
)i)>e_i4_0.>6es_>is) " &Se>e+) . 0.>6e&
IMPORTING
se>e+)_0.>6e " >+_-er,s
TABLES
1ie>ds " >).8_1ie>ds
0.>6e).8 " >).8_0.>6es
E%CEPTIONS
1ie>d_4*)_i4_ddi+ " $:
/*re_)5e4_*4e_se>e+)1ie>d " $=
4*_se>e+)1ie>d " $F.
H+$DA:BCH(CFBA*DB/(TB*F+ =seful for determining w"et"er or not
&!
a date is a "olida&. 7i:e t"e function a
date% and a "olida& calendar% and &ou
can determine if t"e date is a "olida&
b& c"ec#ing t"e parameter
H/+-D)4;F/=0D.
("ample)
d.).: >d_d.)e >i,e s+.>-d.)6/ de1.6>) sy-d.)6/2
>+_5*>id.y_+.>_id >i,e s+.>-5+.>id de1.6>) &CA&2
>).8_5*>id.y_.))ri86)es >i,e )5*> *++6rs $ -i)5 5e.der >i4e2
>+_5*>id.y_1*64d >i,e s+.>-i4di+.)*r.
CALL F#NCTION &!OLIDAY_C!ECK_AND_GET_INFO&
E%PORTING
d.)e " >d_d.)e
5*>id.y_+.>e4d.r_id " >+_5*>id.y_+.>_id
IT!_!OLIDAY_ATTRIB#TES " &%&
IMPORTING
!OLIDAY_FO#ND " >+_5*>id.y_1*64d
).8>es
5*>id.y_.))ri86)es " >).8_5*>id.y_.))ri86)es
E%CEPTIONS
CALENDAR_B#FFER_NOT_LOADABLE " :
DATE_AFTER_RANGE " =
DATE_BEFORE_RANGE " F
DATE_IN'ALID " G
!OLIDAY_CALENDAR_ID_MISSING " I
!OLIDAY_CALENDAR_NOT_FO#ND " D
OT!ERS " J.
i1 sy-s68r+ " $ .4d
>+_5*>id.y_1*64d " &%&.
-ri)e: ( >d_d.)e2 &is . 5*>id.y&.
e>se.
-ri)e: ( >d_d.)e2 &is 4*) . 5*>id.y2 *r )5ere -.s .4 err*r +.>>i43 )5e 164+)i*4&.
e4di1.
H+$DA:B/(T Pro:ides a table of all t"e "olida&s
based upon a Factor& Calendar C>
Holida& Calendar.
H!BDSP$A:BBASCB$ST is an H. function% but can be used for
an& data. 4ou pass it data% and column
"eaders% and it pro:ides a table control
wit" t"e abilit& to manipulate t"e data%
and send it to ord or ,5cel. )lso see
t"e additional documentation "ere.
H!B/(TB$(AC(BDATA 7et all lea:e information !includes
lea:e entitlement% used "olida&s>paid
out "olida&s$
H!B(B*,.BP!SBD((FS .eturn t"e number of wee#s between
two dates.
H!BPA:!+$$BP(!+DSB/(T 7et t"e pa&roll period for a particular
date. !pro:ided b& Francois Henrotte$
&"
("ample)
DATA: IT_TIGMU TYPE TIGMU OCC#RS $ IT! !EADER LINE2
IT_?L TYPE PC=BF OCC#RS $ IT! !EADER LINE.
_BEGDA " &=$$:$:$:&.
_PERNR " &$$$$$$$:&.
CALL F#NCTION &!R_PAYROLL_PERIODS_GET&
E%PORTING
3e)_8e3d. " -_8e3d.
TABLES
3e)_peri*ds " i)_)IGMV
E%CEPTIONS
4*_peri*d_1*64d " :
4*_0.>id_per/* " =.
C!ECK sy-s68r+ " $.
CALL F#NCTION &!R_TIME_RES#LTS_GET&
E%PORTING
3e)_per4r " -_per4r
3e)_p.8r@ " i)_)IGMV-p.8r@
3e)_p.8rp " i)_)IGMV-p.8rp
TABLES
3e)_P> " i)_P>
E%CEPTIONS
4*_peri*d_spe+i1ied " :
-r*43_+>6s)er_0ersi*4 " =
4*_re.d_.6)5*ri)y " F
+>6s)er_.r+5i0ed " G
)e+54i+.>_err*r " I.
NOTE: i)_P>-i1)yp " &A& .8se4+e
i)_P>-i1)yp " &S& .) -*r,
H!BT.(B!(S,$TSB/(T 7et t"e time results for a pa&roll
period. !pro:ided b& Francois
Henrotte$
("ample)
DATA: IT_TIGMU TYPE TIGMU OCC#RS $ IT! !EADER LINE2
IT_?L TYPE PC=BF OCC#RS $ IT! !EADER LINE.
_BEGDA " &=$$:$:$:&.
_PERNR " &$$$$$$$:&.
CALL F#NCTION &!R_PAYROLL_PERIODS_GET&
E%PORTING
3e)_8e3d. " -_8e3d.
TABLES
3e)_peri*ds " i)_)IGMV
E%CEPTIONS
4*_peri*d_1*64d " :
4*_0.>id_per/* " =.
C!ECK sy-s68r+ " $.
CALL F#NCTION &!R_TIME_RES#LTS_GET&
E%PORTING
3e)_per4r " -_per4r
3e)_p.8r@ " i)_)IGMV-p.8r@
3e)_p.8rp " i)_)IGMV-p.8rp
&#
TABLES
3e)_P> " i)_P>
E%CEPTIONS
4*_peri*d_spe+i1ied " :
-r*43_+>6s)er_0ersi*4 " =
4*_re.d_.6)5*ri)y " F
+>6s)er_.r+5i0ed " G
)e+54i+.>_err*r " I.
NOTE: i)_P>-i1)yp " &A& .8se4+e
i)_P>-i1)yp " &S& .) -*r,
*TBT(5T To load long te5t into S)P
FBD(!FSB+FBB,F!SBF*D .eturn a list of all plants for a gi:en
compan& code.
$STBF!+.B.(.+!: .etrie:es t"e output of a report from
memor& w"en t"e report was e5ecuted
using S=*(-T... ,EP/.T-07 +-ST T/
(,(/.4. See also .-T,;+-ST.
$STBT+BASC con:ert an )*)P report !displa&ed on
screen$ from /TF to )SC-- format
.B(DB(5T(*D 7et t"e stoc# position for t"e pre:ious
mont". T"is displa&s t"e same info
t"at &ou see in ((D1.
.+*THB*A.(SB/(T -t returns all t"e mont" and names in
repecti:e language.
.+*THBP$,SBD(T(!.*( )dd or subtract mont"s from a date.
To subtract a mont"% enter a negati:e
:alue for t"e @mont"s@ parameter.
("ample)
d.).: 4e-_d.)e )ype d.
CALL F#NCTION &MONT!_PL#S_DETERMINE&
E%PORTING
/*4)5s " -I 7 Ne3.)i0e )* s68)r.+) 1r*/ *>d d.)e2 p*si)i0e )* .dd
*>dd.)e " sy-d.)6/
IMPORTING
NEDATE " 4e-_d.)e.
-ri)e: ( 4e-_d.)e.
.SB(5C($B+$(BSTA*DA!DB+$( will build a file% and automaticall& start
,5cel
+TFBC+*C(!T wraps se:eral ot"er function modules.
ill con:ert /TF to )SC-- or PDF
P+P,PBT+BC+*F!.B$+SSB+FBDATA Create a dialog bo5 in w"ic" &ou ma#e
a <uestion w"et"er t"e user wis"es to
perform a processing step wit" loss of
&$
data.
P+P,PBT+BC+*F!.BST(P Create a dialog bo5 in w"ic" &ou ma#e
a <uestion w"et"er t"e user wis"es to
perform t"e step.
P+P,PBT+BC+*F!.BDTHB.(SSA/( Create a dialog bo5 in w"ic" &ou
inform t"e user about a specific
decision point during an action.
P+P,PBT+BC+*F!.BDTHBCA$,( Create a dialog bo5 in w"ic" &ou ma#e
a <uestion w"et"er t"e user wis"es to
perform a processing step wit" a
particular ob8ect.
P+P,PBT+BD(CD( Pro:ide user wit" se:eral c"oices as
radio buttons
P+P,PBT+BD(CD(BDTHB.(SSA/( Create a dialog bo5 in w"ic" &ou
inform t"e user about a specific
decision point :ia a diagnosis te5t.
P+P,PBT+BDSP$A:BT(5T Create a dialog bo5 in w"ic" &ou
displa& a two line message
P+P,PBT+BS($(CTB.+*TH Popup to c"oose a mont"
P+P,PBDTHBTAB$(BDSP$A: Pro:ide a displa& of a table for user to
select one% wit" t"e :alue of t"e table
line returned w"en selected.
P!C*/ .eturn pricing conditions in an
internal table. =se structure TC/(F
for parameter C/((;H,)D;'% and
structure TC/(P for parameter
C/((;-T,(;'% and set
C)+C=+)T-/0;T4P, to *. T"e pricing
conditions will be returned in E/(3.
4ou must fill TC/(P% and TC/(F wit"
t"e appropriate :alues before callling
t"e function in order for it to wor#.
P!+F$(B/(T .ead an ,ntr& in an -0- File on t"e
frontend
P!+F$(BS(T rite an ,ntr& in an -0- File on t"e
frontend
!(ADBT(5T To load long te5t into S)P
!(/ST!:B/(T .ead an ,ntr& from t"e .egistr&
!(/ST!:BS(T Set an entr& in t"e .egistr&
&%
!FCBABAPB*STA$$BA*DB!,* .uns an )*)P program t"at is stored
in t"e table P./7.)( w"en t"e
(/D, G @F@. Table .-T,S contains
t"e ouput of t"e program. )llows &ou
to run a program wit"out "a:ing t"e
source code in t"e target s&stem.
!HB/(TBACTC(BDFBP$CA! .eturn t"e acti:e H. Plan
!HB/(TBDAT(BDA:*A.( return t"e da& based on t"e date
pro:ied
!HBSTA!TB(5C($BDTHBDATA starts ,5cel wit" t"e contents of an
internal table. T"is function finds ,5cel
in t"e des#top registr&. -t also uses a
local PC wor#ing director& to sa:e t"e
file !t"at@s w"at t"e @@ :alue for data
pat" flag does$. 3er& transparent to
userH
!HBST!,CB/(T .eturns all related org info
!HP<BP+P,PBF;BS(A!F is a matc"code for an& t&pe of H.
Planning ob8ect% including t"e
possibilit& to fill t"e field t"at &ou want
("ample)
E9./p>es: se.r+5 1*r .4y *r3.4iP.)i*4.> s)r6+)6re
FG " &%&
PL'AR " &$:&
OTYPE " &O &
se.r+5 1*r .4y pers*4s
FG " &%&
PL'AR " &$:&
OTYPE " &P &
M#LTI_SELECT " &%& )* .>>*- /6>)ip>e se>e+)i*4
EASY " &%& 1*r 6ser-depe4de4) /.)+5+*de
#41*r)64.)e>y2 )5e 6se *1 ).8>e BASE_OBAIDS is dis.8>ed2 s* y*6 +.4&) spe+i1y
. r**) 1*r )5e 5ier.r+5y y*6 disp>.y
!FDBD+!DBD!AP Con:ert a long string or p"rase into
se:eral lines.
!PBCA$CBDAT(B*B*T(!CA$ )dd>subtract &ears>mont"s>da&s from
a date
!PB$ASTBDA:B+FB.+*THS Determine last da& of mont"
!P:BD:*P!+B!(AD .ead d&npro% including screen flow
!P:BT!A*SACT+*B!(AD 7i:en a transaction% return t"e
&&
program and screen or gi:en a
program and screen% return t"e
transactions t"at use t"e program and
screen.
!SBC+C(!PA/(BS($(CT+*S .eturns an internal table t"at contains
a formatted list of all t"e selection
parameters entered for a report. Table
is read& to print out.
!SB!(F!(SHBF!+.BS($(CT+PT+*S 7et t"e current contents of selection
screen
!SBS(*DB.A$BF+!BSP++$$ST Send message from )*)P>? program
to S)Poffice.
!SBCA!A*TBC+*T(*TS .eturns t"e contents of t"e specified
:ariant in a table.
!SP+BD+D*$+ADBSP++$E+B Download t"e spool from a program to
a file. .e<uires spool number.
!SP+B!(T,!*BABAPBSP++$E+B Fetc" printer spool according to t"e
spool number informed.
!7$B!(ADBD! -f t"e ser:er name is left blan#% it reads
a director& from local presentation
ser:er% ot"erwise it reads t"e director&
of t"e remote ser:er
!7$B!(ADBD!B$+CA$ .ead a director& on t"e )pplication
Ser:er
!7$B!(ADBF$( .ead a file from t"e presentation
ser:er if no ser:er name is gi:en% or
read file from remote ser:er. 3er&
useful to a:oid aut"orit& c"ec#s t"at
occur doing an /P,0 D)T)S,T. T"is
function using a S)P C program to
read t"e data.
!7$BS$((P Hang t"e current application from ' to
I seconds.
!7$BS,B.T Submit a remote report.
!7$BD!T(BF$(B$+CA$ Sa:es table to t"e presentation ser:er
!not PC$. Does not use /P,0
D)T)S,T% so it does not suffer from
aut"orit& c"ec#sH
SAPBC+*C(!TBT+B5$SBF+!.AT Con:ert data to (icrosoft ,5cel
format.
&'
SAP/,BP!+/!(SSB*DCAT+! Displa& a progress bar on t"e S)P
7=-% and gi:e t"e user some idea of
w"at is "appening
SAC(BT(5T To load long te5t into S)P
SC!+$$*/B*BTAB$( -f &ou are coding a module pool and
using a table control% &ou can use t"is
function SC./++-07;-0;T)*+, to
"andle an& scrolling. !pro:ided b& Paul
F8aer$
SDBDAT(T.(BDFF(!(*C( 7i:e t"e difference in Da&s and Time
for 2 dates
S+B*(DBD+C,.(*TBATTBS(*DBAP= Send a document as part of an email.
T"e documentation is better t"an
normal for t"is function% so please
read it.
S+BSP$TBF$(BA*DBPATH Split a full& pat"ed filename into a
filename and a pat".
S+BSP++$B!(AD Fetc" printer spool according to t"e
spool number informed. See also
.SP/;.,T=.0;)*)P;SP//+J/*
S+BD*DBSP++$B$ST *rowse printer spool numbers
according to user informed.
SDDBH($PBF;B+!/B+BE(CTS H. (atc"code tailored for
organi9ational units. -ncludes a button
so t"at &ou can browse t"e "ierarc"&
too.
S5B+BE(CTBC+*C(!TB+TFBPDF Con:ersion From /TF to PDF
!S)PScript con:ersion$
S5B+BE(CTBC+*C(!TB+TFBP!T Con:ersion From /TF to Printer
Format !S)PScript con:ersion$
S5B+BE(CTBC+*C(!TB+TFB!AD Con:ersion From /TF to )SC--
!S)PScript con:ersion$
S5P/BCA$$BS:ST(. &ou can c"ec# t"e user@s aut"ori9ation
for t"e specified command and run t"e
command. T"e command runs on t"e
"ost s&stem on w"ic" t"e function
module is e5ecuted. T"e function
module is .FC capable. -t can
t"erefore be run on t"e "ost s&stem at
w"ic" a user "appens to be acti:e or
on anot"er designated "ost s&stem at
w"ic" an .>1 ser:er is acti:e.
&(
S5P/BC+..A*DBCH(CF C"ec# w"et"er t"e user is aut"ori9ed
to e5ecute t"e specified command on
t"e target "ost s&stem wit" t"e
specified arguments.
S5P/BC+..A*DBD(F*T+*B/(T .ead t"e definition of a single e5ternal
/S command from t"e .>1 S&stem@s
database.
S5P/BC+..A*DB(5(C,T( C"ec# a user@s aut"ori9ation to use a
command% as in
SEP7;C/(()0D;CH,CF. -f t"e
aut"ori9ation c"ec# is successful% t"en
e5ecute t"e command on t"e target
"ost s&stem.
S5P/BC+..A*DB$STB/(T Select a list of e5ternal /S command
definitions.
T(!.*A$BDB/(T .eturn t"e terminal id
THBD($(T(B,S(! +ogoff a user. Similar results to using
S(D?.
THB(*C!+*.(*T 7et t"e =0-E en:ironment
THBP+P,P Displa& a popup s&stem message on a
specific users screen.
THB!(.+T(BT!A*SACT+* .un a transaction on a remote ser:er.
/ptionall& pro:ide *DC data to be
used in t"e transaction
THB,S(!B*F+ 7i:e information about t"e current
user !sessions% wor#station logged in
from% etc$
THB,S(!B$ST S"ow w"ic" users are logged into an
app ser:er
T.PB/,BD!(CT+!:B$STBF$(S .etrie:e all of t"e files and
subdirectories on t"e Presentation
Ser:er !PC$ for a gi:en director&.
"en a :alue ot"er t"an K or K.K is used for t"e filter% &ou will not get an& directories%
unless t"e& matc" &our wildcard filter. For e5ample% if &ou entered K.png% t"en onl& files
and directories t"at end in png will be returned b& t"e function.
("ample)
d.).: >+_dire+)*ry >i,e 8ds+5,*:D-).r3e)_dir 0.>6e &C:LTEMPL&2
>+_1i>)erC=$E )ype + de1.6>) &*.*&.
>i_1i>e_+*64) )ype i2
>i_dir_+*64) )ype i2
>).8_dir_).8>e >i,e sd*,p.)5 *++6rs $ -i)5 5e.der >i4e2
')
>).8_1i>e_1i>e_).8>e >i,e sd*,p.)5 *++6rs $ -i)5 5e.der >i4e.
+.>> 164+)i*4 &TMP_G#I_DIRECTORY_LIST_FILES&
e9p*r)i43
dire+)*ry " >+_dire+)*ry
1i>)er " >+_1i>)er i/p*r)i43
1i>e_+*64) " >i_1i>e_+*64)
dir_+*64) " >i_dir_+*64)
).8>es
1i>e_).8>e " >).8_1i>e_).8>e
dir_).8>e " >).8_dir_).8>e
e9+ep)i*4s
+4)>_err*r " :
*)5ers " =.
,*TBC+*C(!S+*BS.P$( con:ert weig"ts from one =/( to
anot"er.
,P$+AD upload a file to t"e presentation ser:er
!PC$
,P$+ADBF$(S ill load one or more files from app or
presentation ser:er
D((FB/(TBF!STBDA: For a gi:en wee# !4444(( format$%
t"is function returns t"e date of t"e
(onda& of t"at wee#.
D!T(B$ST =seful for writing out t"e list contents
t"at result from t"e function
+-ST;F./(;(,(/.4.
DSBD+D*$+AD Sa:e -nternal Table as File on t"e
Presentation Ser:er
DSB(5C($ Start ,EC,+ on t"e PC
DSB(5(C,T( e5ecute a program on a windows PC
DSBF$(BD($(T( Delete File at t"e Frontend
DSBF$(*A.(B/(T Call File Selector
DSB.S/ Create a dialog bo5 in w"ic" &ou
displa& an one line message
DSB,P$+AD +oad Files from t"e Presentation
Ser:er to -nternal )*)P Tables
DSBC+$,.(B/(T 7et t"e label from a frontend de:ice.
DDDB$STBT+BHT.$ )fter running a report% call t"is
function to con:ert t"e list output to
HT(+.
'
-<-1 E # I:./67I/D N8/;.I2:; DI.@ -:;D/6;
'$ "at is S)P .>16
)ns S)P .>1 refers to S&stems )pplication and Product for data processing .eal-time "a:ing a
1 tier arc"itecture i.e. Presentation la&er% )pplication la&er and Database la&er.
2$ "at are t"e programming standards followed6
)ns
1$ "at are t"e contents in tec"nical specifications6
Ans T%ere are fi2e contents in Tec%nical Settings) Data Class4 SiGe Category4 Buffering Permission4
Buffering Type and $ogging3
?$ "at is an instance6
Ans D%en you call a function module4 an instance of its function group plus its data4 is loaded into t%e
memory area of t%e internal session3 An ABAP program can load se2eral instances by calling
function modules from different function groups3
I$ How to ta#e care of performance in )*)P De:elopment6
)ns
A$ "at is Function group6 Difference between function group and function module6
Ans Function /roups act as containers for Function .odules t%at logically belong toget%er3
Function /roups
=0 T%ese cannot be defined in a Function .odule3
>0 t cannot be called3
A0 T%ey are containers for Function .odule3
Function .odules
=0 T%ese must be defined in a Function /roup3
>0 t can be called from any program3
A0 T%ey are not containers for Function /roup3
L$ "at is t"e difference between @Select single K @ and @Select upto ' rows@6
Ans HSelect single &I J T%e result of t%e selection s%ould be a single entry3 f it is not possible to identify
a uni6ue entry4 t%e system uses t%e first line of t%e selection3 For e3g3
DATA ) TAB T:P( 7!(FHAB(.P3
S($(CT S*/$( & F!+. 7!(FHAB(.P *T+ TAB
'!
DH(!( (.P*+ K H<<=<=I A*D D(PT*+ K H<<=<I3
D!T( ) # TAB'(.P*+4 TAB'(.P*A.(4TAB'D(PT*+3
Select upto = rows '
M$ "at Function does data dictionar& perform6
Ans Central information repository for application and system data3 T%e ABAP Dictionary contains data
definitions -metadata0 t%at allow you to describe all of t%e data structures in t%e system -like
tables4 2iews4 and data types0 in one place3 T%is eliminates redundancy3
N$ Difference between domain and data element6 "at are aggregate ob8ect6
Ans Domain ' Specifies t%e tec%nical attributes of a data element ' its data type4 lengt%4 possible
2alues4 and appearance on t%e screen3 (ac% data element %as an underlying domain3 A single
domain can be t%e basis for se2eral data elements3 Domains are obLects in t%e ABAP Dictionary3
3ata /lement B 3escribes the business function of a table field. Its technical attributes are based on a
domain, and its business function is described by its field labels and documentation.
-ggregate 2bject B
'D$ "at is :iew6 Different t&pes of :iew. ,5plain6
Ans Ciew ' A 2iew is a 2irtual table containing fields from one or more tables3 A 2irtual table t%at does
not contain any data4 but instead pro2ides an application'oriented 2iew of one or more ABAP
Dictionary tables3
Different Types of Ciew)
=0 .aintenance
>0 Database J t is on more t%an two tables3
A0 ProLection J t is only on one table3
;0 Help
''$ Can u print decimals in t&pe 06 "at is difference between float and pac#ed data t&pe6
Ans *o4 we cannot print decimals in type * because decimal places are not permitted wit% *
data type3
Float Data Type) D%en used gi2es error MData type F is not allowedN3
Packed *umber) t is used to display numbers in decimals3 For e3g3
PA!A.(T(!S ) A-;0 T:P( P D(C.A$S >4
B-;0 T:P( P D(C.A$S >3
DATA ) C-;0 T:P( P D(C.A$S >3
C K A O B3
D!T( ) # HTH( S,. SI 4 C3
'"
'2$ "at is step-loop6 ,5plain all t"e steps6
Ans A step loop is a repeated series of field'blocks in a screen3 (ac% block can contain one or more
fields4 and can e"tend o2er more t%an one line on t%e screen3
;tep loops as structures in a screen do not ha+e indi+idual names. .he screen can contain more than one
stepBloop, but if so, you must program the 5221.../:35221s in the flow logic accordingly. .he ordering
of the 5221.../:35221s must exactly parallel the order of the step loops in the screen. .he ordering tells
the system which loop processing to apply to which loop. ;tep loops in a screen are ordered primarily by
screen row, and secondarily by screen column.
.ransaction .H% >de+elopment class ;3D-? implements a step loop +ersion of the table you saw in
transaction .H%).
;tatic and 3ynamic ;tep 5oops
;tep loops fall into two classes: static and dynamic. ;tatic step loops ha+e a fixed siKe that cannot be
changed at runtime. 3ynamic step loops are +ariable in siKe. If the user reBsiKes the window, the system
automatically increases or decreases the number of step loop blocks displayed. In any gi+en screen, you can
define any number of static step loops, but only a single dynamic one.
*ou specify the class for a step loop in the ;creen 1ainter. /ach loop in a screen has the attributes 5ooptype
>fixed=static, +ariable=dynamic? and 5oopcount. If a loop is fixed, the 5oopcount tells the number of loopB
blocks displayed for the loop. .his number can ne+er change.
1rogramming with static and dynamic step loops is essentially the same. *ou can use both the 5221 and
5221 -. statements for both types.
5ooping in a ;tep 5oop
Dhen you use 5221 -. FinternalBtableG with a step loop, the system automatically displays the step loop
with +ertical scroll bars. .he scroll bars, and the updated >scrolled? table display, are managed by the
system.
8se the following additional parameters if desired:
F!+. Pline=8 and T+ Pline>8
C,!S+! Pscroll'2ar8
'1$ "at is t"e initial :alue and ma5imum lengt" of all data t&pe6
Ans
Data Type nitial field lengt% Calid field lengt% nitial 2alue .eaning
*umeric types
; ; < nteger -w%ole number0
F Q Q < Floating point number
P Q = J =R < Packed number
'#
C%aracter types
C = = J RSSAS 1 T 1 Te"t field -alp%anumeric c%aracters0
D Q Q 1<<<<<<<<1 Date field -Format) ::::..DD0
* = = J RSSAS 1< T <1 *umeric te"t field -numeric c%aracters0
T R R 1<<<<<<1 Time field -format) HH..SS0
He"adecimal type
5 = = J RSSAS 51< T <1 He"adecimal field
'?$ "at are t"e wa&s to find out t"e tables used in t"e program6
)ns
'I$ Can &ou "a:e two detail lists from t"e basic list at t"e same time6
-f &es "ow and if no w"&6
)ns
'A$ "at are t"e different functions used in sap script6 "at are t"e parameters used in eac"
Function6
Ans T%ere are t%ree different functions used in SAP Script)
=0 +P(*BF+!.
>0 D!T(BF+!.
A0 C$+S(BF+!.
Parameters in (ac% Function)
=0 +P(*BF+!. J
("porting
Form
$anguage
>0 D!T(BF+!. J
("porting
(lement
Dindow
A0 C$+S(BF+!.
'L$ "at is se<uence of e:ent triggered in report6
Ans T%ere are R e2ents in report)
=0 nitialiGation
>0 At Selection'Screen
A0 Start'of'Selection
;0 (nd'of'Selection
S0 Top'of'Page
R0 Bottom'of'Page
'M$ "at are standard la&outs sets in t"e S)P Script6
Ans T%ere are four standard layouts in t%e SAP Script)
=0 Header
>0 $ogo
A0 .ain Dindow
'$
;0 Footer
'N$ "at function module upload data from application ser:er6
)ns
2D$ "at are t"e :arious t&pes of selection screen e:ent6
Ans S($(CT+*'SC!((* B(/* +F B$+CF ABC DTH F!A.( TT$( T<=3
S($(CT+*'SC!((* B(/* +F SC!((* S<< AS D*D+D3
CA$$ S($(CT+*'SC!((* S<< STA!T*/ AT =< =<3
2'$ "at do &ou #now about a client6
)ns
22$ "at are t"e s&stem fields6 ,5plain6
Ans T%e ABAP system fields are acti2e in all ABAP programs3 T%ey are filled by t%e runtime
en2ironment4 and you can 6uery t%eir 2alues in a program to find out particular states of t%e
system3 Alt%oug% t%ey are 2ariables4 you s%ould not assign your own 2alues to t%em4 since t%is
may o2erwrite information t%at is important for t%e normal running of t%e program3 Howe2er4 t%ere
are some isolated cases in w%ic% you may need to o2erwrite a system 2ariable3 For e"ample4 by
assigning a new 2alue to t%e field S:'$S*D4 you can control na2igation wit%in details lists3
21$ "at is S)P Script6 "at is t"e purpose of S)P Script6 Difference between
SAP Script and !eport?
Ans SAP Script J t is t%e integrated te"t management system of t%e SAP !#A System3 Two types J PC
(ditor 9 $ine (ditor3
!eports ' t is t%e way to display data fetc%ed from database table onto screen or directly output it
to a printer3 Two types J Classical and nteracti2e3
2?$ "at is t"e use of occurs in internal table6 Can u c"ange occurs :alue in program6
Ans ,se of +ccurs ' f you use t%e +CC,!S parameter4 t%e 2alue of t%e *TA$ S7( of t%e table is
returned to t%e 2ariable Pn8
Data ) Begin of TAB occurs <4
(nd of TAB3
+ccurs or nitial SiGe J to specify t%e initial amount of memory t%at s%ould be assigned to t%e
table3
:es4 we can c%ange t%e occurs 2alue in program but output remains t%e same3
2I$ Difference between S4-T)*-E and S4--0D,E6 "ere it is used6
Can u c"ec# S4-S=*.C after perform6
-ns ;*B.-<II B 4urrent line of an internal table. ;*B.-<II is set by the statements below, but only for index
tables. .he field is either not set or is set to ) for hashed tables.
APP(*D sets S:'TAB5 to t%e inde" of t%e last line of t%e table4 t%at is4 it contains t%e o2erall
number of entries in t%e table3
'%
C+$$(CT sets S:'TAB5 to t%e inde" of t%e e"isting or inserted line in t%e table3 f t%e table %as
t%e type HASH(D TAB$(4 S:'TAB5 is set to <3
$++P AT sets S:'TAB5 to t%e inde" of t%e current line at t%e beginning of eac% loop lass3 At t%e
end of t%e loop4 S:'TAB5 is reset to t%e 2alue t%at it %ad before entering t%e loop3 t is set to < if
t%e table %as t%e type HASH(D TAB$(3
!(AD TAB$( sets S:'TAB5 to t%e inde" of t%e table line read3 f you use a binary searc%4 and
t%e system does not find a line4 S:'TAB5 contains t%e total number of lines4 or one more t%an t%e
total number of lines3 S:'*D(5 is undefined if a linear searc% fails to return an entry3
S(A!CH Pitab8 F+! sets S:'TAB5 to t%e inde" of t%e table line in w%ic% t%e searc% string is
found3
;*AI:3/I B In a 32 or D@I5/ loop, ;*BI:3/I contains the number of loop passes including the current
pass.
2A$ Difference between =P+/)D and S;=P+/)D6
Ans ,P$+AD ' File transfer wit% dialog from presentation ser2er file to internal table3 Data w%ic% is
a2ailable in a file on t%e presentation ser2er is transferred in an internal table3 ASC 9 Binary files
can be transferred3
DSB,P$+AD ' To read data from t%e presentation ser2er into an internal table wit%out a user
dialog4 use t%e function module DSB,P$+AD3 T%e most important parameters are listed below3
Parameters Function
C+D(PA/( +nly for upload under D+S) Calue B.
F$(*A.( Filename
F$(T:P( File type
2L$ "& did u switc" to S)P6
)ns
2M$ "at is a +ogical Database6
Ans $ogical Databases are special ABAP programs t%at retrie2e data and make it a2ailable to
application programs3
,se of $DB J is used to read data from database tables by linking t%em to e"ecutable ABAP
programs3
2N$ "at are t"e e:ents used for +ogical Database6
Ans Two (2ents J
=0 /(T ' T%is is t%e most important e2ent for e"ecutable programs t%at use a logical
database3 t occurs w%en t%e logical database %as read a line from t%e node Ptable8 and
made it a2ailable to t%e program in t%e work area declared using t%e statement *+D(S
Ptable83 T%e dept% to w%ic% t%e logical database is read is determined by t%e /(T
statements
'&
>0 P,T ' T%e P,T statement directs t%e program flow according to t%e structure of
the logical database.
1D$ "at is t"e difference between 7et and 7et +ate6
Ans /(T ' After t%e logical database %as read an entry from t%e node Ptable83
/(T $AT( ' After all of t%e nodes of t%e logical database %a2e been processed t%at are below
Ptable8 in t%e database %ierarc%y3
1'$ "at are t"e t&pes of -nternal Tables6
Ans T%ere are t%ree types)
=0 $ine
>0 Fey
A0 Table
12$ "at are t"e e:ents used in )*)P in t"e order of e5ecution6
Ans
11$ "at are -nteracti:e .eports6
Ans An output list w%ic% displays Lust t%e basic details 9 allow user to interact4 so t%at a new list is
populated based on user'selection3 Dit% interacti2e list4 t%e user can acti2ely control data retrie2al
and display during t%e session3
1?$ "at are t"e commands used for interacti:e reports6
Ans Top'of'Page during line'selection
1I$ "at are t"e s&stem fields u "a:e wor#ed wit"6 ,5plain6
Ans %ad worked wit% t%e following -A<0 system fields)
? ;*B3<;*; B 4entral 3atabase
!? ;*B@2;. B ;er+er
"? ;*B21;*; B 2perating ;ystem
#? ;*B;-165 B ;-1 6elease
$? ;*B;*;I3 B ;ystem :ame
%? ;*B5-:=8 B 8ser 5ogon 5anguage
&? ;*B9-:3. B 4lient
'? ;*B8:-9/ B 5ogon 8ser :ame
(? ;*B3-.52 B 5ocal 3ate
)? ;*B3-.89 B ;er+er 3ate
? ;*B.I952 B 5ocal .ime
!? ;*B8H/I. B ;er+er .ime
"? ;*B3*::6 B ;creen :umber
#? ;*B6/1I3 B 4urrent -<-1 program
$? ;*B.423/ B .ransaction 4ode
%? ;*B85I:/ B @oriKontal 5ine
&? ;*B75I:/ B 7ertical 5ine
'? ;*BI:3/I B :umber of current loop 1ass
(? ;*B.-<II B 4urrent line of internal table
!)? ;*B3<4:. B :umber of table entries processed
!? ;*B;8<64 B 6eturn 4ode
!!? ;*B84299B Function 4ode
!"? ;*B5I:4. B 1age 5ength of list
!#? ;*B5I::2 B 4urrent 5ine
!$? ;*B1-=:2 B 4urrent 1age :umber
!%? ;*B5;I:3 B Index of 5ist
!&? ;*B9;=I3 B 9essage 4lass
!'? ;*B9;=:2 B 9essage :umber
''
!(? ;*B9;=.* B 9essage .ype
")? ;*B;12:2 B ;pool number during printing
1A$ "at is t"e difference between Primar& #e& and =ni<ue Fe&6
Ans Primary Fey J t can accepts < 2alue and cannot be *,$$3
,ni6ue Fey J t can be *,$$3
1L$ "at is t"e transaction code for Table maintenance6
Ans S.A<
1M$ -f u are using +ogical Databases "ow will u modif& t"e selection-screen elements6
Ans Select'options ) dname for deptt'dname3
1N$ "at is an .FC6
Ans !emote Function Call
?D$ -f u are using .FC and passing :alues to a remote s&stem "ow does it wor#6
Ans
?'$ "at are t"e e:ents in Screen Programming6
Ans T%ere are two e2ents in Screen Programming)
=0 PB+ -Process Before +utput0 J Before t%e screen is displayed4 t%e PB+ e2ent is processed3
>0 PA -Process After nput0 J D%en t%e user interacts wit% t%e screen4 t%e PA e2ent is
processed3
?2$ "at is t"e significance of H-D,6
Ans ts stores t%e click 2alue and display t%e related record in t%e secondary list3
?1$ "ere do u code t"e H-D, statement6
Ans n a $++P statement
??$ T&pes of *DC@s6
Ans T%ere are two types of BDCIs)
=0 Transaction .et%od
>0 Session .et%od
?I$ )d:antages C Disad:antages of different t&pes of *DC@s6
Ans Transaction .et%od)
=0 t is faster t%an session met%od3
>0 D%ile e"ecuting4 it starts from starting3
Session .et%od)
=0 t is slower t%an transaction met%od3
>0 D%ile e"ecuting4 it does not start from starting3
?A$ "at are t"e e:ents used in -nteracti:e .eports.
Ans T%ere are t%ree e2ents of nteracti2e !eports)
'(
3 At PF-nn0
3 At line'selection
3 At user'command
?L$ "at is an .D*(S6
Ans !DB.S J !elational Database .anagement System3 t %elps to create relations%ip between two
or more table3
?M$ "at standards u use to follow w"ile coding )*)P programs6
Ans
?N$ "at will &ou code in ST).T-/F-S,+,CT-/0 C ,0D-/F-S,+,CT/0 C w"&6
Ans STA!T'+F'S($(CT+*
S($(CT & F!+. D(PTT *T+ C+!!(SP+*D*/ F($DS +F TAB
DH(!( D(PT*+ * D(PT*+3
APP(*D TAB3
(*DS($(CT3
$++P AT TAB3
D!T( ) # =< TAB'D(PT*+3
HD( ) TAB'D(PT*+3
(*D$++P3
(*D'+F'S($(CT+*
ID$ "at are 8oins and different t&pes 8oins6
Ans T%ere are four types of Eoins)
=0 Self Eoin
>0 nner Eoin
A0 +uter Eoin
;0 (6ui Eoin
I'$ "ic" is t"e default 8oin6
Ans
I2$ How do u displa& a data in a Detail +ist6
)ns *& using two statements2
'$ Top-of-page during line-selection
2$ )t line-selection
I1$ "at are t"e t&pes of windows in S)P Script6
)ns T"ere are fi:e Standard +a&outs in S)P Script2
'$ Page
2$ indow
1$ Page indow
?$ Paragrap" Format
I$ C"aracter Format
I?$ "at are t"e function modules used in a S)P Script dri:er program6
()
)ns T"ere are t"ree functions used in S)P Script2
'$ /P,0;F/.(
2$ .-T,;F/.(
1$ C+/S,;F/.(
II$ "at are ,5tracts6
)ns ,5tracts are d&namic se<uential datasets in w"ic" different lines can "a:e different
structures. e can access t"e indi:idual records in an e5tract dataset using a +//P.
IA$ How would u go about impro:ing t"e performance of a Program% w"ic" selects data from
(S,7 C (FPF6
)ns
IL$ How does S&stem wor# in case of an -nteracti:e .eport6
)ns
IM$ "at is +=6
-ns 5ogical 8nit of Dork
IN$ Different t&pes of +=s. "at r t"e&6
)ns Two t&pes of += are2
? 3< 58D B - database 58D is the mechanism used by the database to ensure that its data is
always consistent. - database 58D is an inseparable seMuence of database operations that ends
with a database commit. .he database 58D is either fully executed by the database system or
not at all. 2nce a database 58D has been successfully executed, the database will be in a
consistent state. If an error occurs within a database 58D, all of the database changes since the
beginning of the database 58D are re+ersed. .his lea+es the database in the state it had before
the transaction started.
>0 SAP $,D ' A logical unit consisting of dialog steps4 w%ose c%anges are written to t%e
database in a single database $,D is called an SAP $,D3 ,nlike a database $,D4 an
SAP $,D can span se2eral dialog steps4 and be e"ecuted using a series of different
work processes3
AD$ "at is First e:ent triggered in program6
)ns
A'$ "at are :arious Joins6 "at is rig"t outer 8oin6
)ns
A2$ How do u find out w"et"er a file e5its on t"e presentation ser:er6
)ns eps;get;director&;listing for director&
A1$ S&stems fields used for -nteracti:e +ists )0D +ists
)ns -nteracti:e S&stem Fields2 S4-+S-0D% S4-CP)7,% S4-+-++-% S4-+-S,+% S4-+-ST-%
S4-+ST)T% S4-ST)C/% S4-ST)./
+ists2 S4-C/+0/% S4-+-0CT% S4-+-00/% S4-+-0SO% S4-P)70/%
S4-T3).DP..S4-T3).N% S4-T-T+
(
A?$ +ogo in S)P Script6
)ns Steps for ma#ing and inserting +ogo in S)P Script2
First Procedure2
'$ Draw t"e picture
2$ Sa:e it
1$ >nS,LM
?$ rite name C C"oose Color
I$ Clic# on -mport
A$ *rowse picture
L$ ,nter
Second Procedure
'$ >nS,L'
2$ -nsert
1$ 7rap"ics
?$ Clic# on stored on document ser:er
I$ ,5ecute
A$ C"oose name of *()P
AI$ "at are t"e difference between call screen and lea:e screen6
)ns Call Screen2 Calling a single screen is a special case of embedding a screen se<uence. -f
&ou want to pre:ent t"e called screen from co:ering t"e current screen completel&% &ou
can use t"e C)++ SC.,,0 statement wit" t"e ST).T-07 )T and ,0D-07 )T
C)++ SC.,,0 'DDD.
C)++ SC.,,0 'DDD ST).T-07 )T 'D 'D ,0D-07 )T 2D 2D.
+,)3, SC.,,0 statement ends t"e current screen and calls t"e subse<uent screen.
5/-7/ ;46//:.
5/-7/ .2 ;46//: !))).
AA$ -f internal table used in for all entries in empt& t"en w"at "appens
)ns 0o% records will be displa&ed.
AL$ -f - forgot some command in S)P Script e.g.2 suppress 9ero displa& - How to do find it6
)ns
AM$ How to write a *DC - "ow do u go about it6
)ns Steps for writing *DC
'$ >nS,1M
2$ Declare Tables% Data !for -T)*$ and Data !for *DC-T)*$
1$ Call function Q=ploadR.
?$ rite code for t"e First Screen% .adio *utton% Filename% C"ange *utton% Second
Screen% =tilities !Create ,ntries$% T"ird Screen and Sa:e.
I$ Call transaction QS,''R using *DC-T)* mode Q)R.
A$ Sa:e% C"ec# ,rrors% )cti:ate and ,5ecute.
AN$ "at is Performance tuning6
(!
)ns
LD$ Define Documentation.
)ns
L'$ *rief about Testing of programs.
)ns
L2$ How do u mo:e on to t"e ne5t screen in interacti:e reporting6
)ns rite code of t"e following2
'$ Top-of-Page during line-selection
2$ )t line-selection
L1$ Create an& functions6 How to go about it6
)ns Steps for creating t"e Functions2
First Procedure2
'$ >nS,1L
2$ 7oto
1$ Function 7roup !F7$
?$ Create 7roup
I$ 0ame of F7 !O.,FH);F7$
A$ S"ort Te5t
L$ Sa:e
M$ +ocal /b8ect
Second Procedure
'$ ,n:ironment
2$ -nacti:e /b8ect
1$ Function 7roup !O.,FH);F7$
?$ )cti:ate
I$ *ac#
T"ird Procedure
'$ 0ame of Function (odule !O.,FH);F($
2$ Create
1$ rite F7 0ame !O.,FH);F7$
?$ S"ort Te5t
I$ Sa:e
Fourt" Step2
Call function QO.,FH);F(R.
L?$ )d:anced topics6
)ns
LI$ Function modules used in F? "elp.
("
)ns T"ere are two t&pes of function modules used in F? "elp2
'$ F?-F;F-,+D;3)+=,;.,Q=,ST
2$ F?-F;-0T;T)*+,;3)+=,;.,Q=,ST
LA$ or# most on w"ic" module2 0ame a few tables.
)ns Sales C Distribution (odule
'$ Sales Document2 -tem Data S 3*)P
2$ Sales Document2 Partner S 3*P)
1$ Sales Document2 Header Data S 3*)F
?$ Sales Document Flow S 3*F)
I$ Sales Document2 Deli:er& -tem Data - +-PS
A$ Customer (aster S F0)'
L$ (aterial Data S ().)
M$ Conditions !Transaction Data$ - F/03
LL$ S&stem Table used
)ns
'$ Sales Document2 -tem Data S 3*)P
2$ Sales Document2 Partner S 3*P)
1$ Sales Document2 Header Data S 3*)F
?$ Sales Document Flow S 3*F)
I$ Sales Document2 Deli:er& -tem Data - +-PS
A$ Customer (aster S F0)'
L$ (aterial Data S ().)
M$ Conditions !Transaction Data$ - F/03
LM$ From a table "ow do u find w"et"er a material is used in anot"er material */(6
)ns
LN$ "at is read line6
)ns .,)D +-0, and .,)D C=..,0T +-0, S T"ese statements are used to read data from t"e
lines of e5isting list le:els. T"ese statements are closel& connected to t"e H-D, tec"ni<ue.
MD$ How u used logical database6 How is data transferred to program6 Corresponding
statement in +D*.
)ns
M'$ How do u suppress fields on selection screen generated b& +D*6
)ns
M2$ Can t"ere be more t"an ' main window in S)P Script6
)ns 0o% t"ere cannot be more t"an ' main window in S)P Script because in .-T,;F/.(% it
as#s for t"e parameter indow t"at will create t"e problem.
.-T,;F/.( S
,5porting
,lement
indow
(#
M1$ 7lobal and local data in function modules.
)ns
M?$ "at are t"e differences between S)P memor& and )*)P memor&6
)ns )*)P (emor& is a memor& area in t"e internal session !roll area$ of an )*)P program.
Data wit"in t"is area is retained wit"in a se<uence of program calls% allowing &ou to pass
data between programs t"at call one anot"er. -t is also possible to pass data between
sessions using S)P (emor&.
;-1 9emory is a memory area to which all sessions within a ;-1gui ha+e access. *ou can use ;-1
memory either to pass data from one program to another within a session >as with -<-1 memory? or to pass
data from one session to another.
MI$ "at are differences between )t selection-screen and )t selection-screen output6
)ns )T S,+,CT-/0-SC.,,0 e:ent is triggered in t"e P)- of t"e selection screen once t"e
)*)P runtime en:ironment "as passed all of t"e input data from t"e selection screen to
t"e )*)P program.
-. ;/5/4.I2:B;46//: 28.18. B .his e+ent block allows you to modify the selection screen directly
before it is displayed.
MA$ "at are t"e e:ents6
)ns
ML$ "at is get cursor field6
)ns 7,T C=.S/. statement transfers t"e name of t"e screen element on w"ic" t"e cursor is
positioned during a user action into t"e :ariable Tf>.
=/. 486;26 FI/53 FfG W2FF;/. FoffGX W5I:/ FlinGX W7-58/ F+alGX 5/:=.@ FlenGX.
MM$ "at is t"e inside concept in select-options6
)ns Select-options specif& are displa&ed on t"e selection screen for t"e user to enter :alues.
Different Properties of Select-options2
'$ 3isible +engt"
2$ (atc"code /b8ect
1$ (emor& -D
?$ +owercase
I$ /bligator&
A$ 0o Displa&
L$ (odif& -D
MN$ "at is t"e difference between occurs ' and occurs 26
)ns
ND$ "at is t"e difference between Free and .efres"6
)ns Free - 4ou can use F.,, to initiali9e an internal table and release its memor& space wit"out
first using t"e .,F.,SH or C+,). statement. +i#e .,F.,SH% F.,, wor#s on t"e table
bod&% not on t"e table wor# area. )fter a F.,, statement% &ou can address t"e internal
table again. -t still occupies t"e amount of memor& re<uired for its "eader !currentl& 2IA
b&tes$. "en &ou refill t"e table% t"e s&stem "as to allocate new memor& space to t"e lines.
.efres" - T"is alwa&s applies to t"e bod& of t"e table. )s wit" t"e C+,). statement% t"e
memor& used b& t"e table before &ou initiali9ed it remains allocated. To release t"e
memor& space% use t"e statement
($
N'$ "at are elements6
)ns
N2$ Can we "a:e more t"an one selection-screen and "ow6
)ns 4es% we can "a:e more t"an one selection screen.
Selection-screen begin of bloc# "one& wit" frame title te5t-'D'.
Select-options 2 deptno for 9re#"a;deptt-deptno.
Selection-screen end of bloc# "one&.
Selection-screen begin of bloc# "one&' wit" frame title te5t-'D2.
Select-options 2 dname for 9re#"a;deptt-dname.
Selection-screen end of bloc# "one&'.
N1$ How to declare select-option as a parameter6
)ns S,+,CT-/PT-/0S2 specif& are displa&ed on t"e selection screen for t"e user to enter
:alues.
Parameters2 dname li#e dept-dname.
Select-options2 dname for dept-dname.
(#? @ow can u write programmatically +alue help to a field without using search help and
matc" codes6
)ns *& using two t&pes of function modules to be called in S)P Script2
'$ H,+P;/*J,CT;SH/;F/.;F-,+D
2$ H,+P;/*J,CT;SH/
NI$ "at are t"e differences between S,D'% S,DN and S,'D6
)ns S,DN - Transport /rgani9er !,5tended 3iew$
S,DN - Transport /rgani9er
S,'D - Transport /rgani9er
NA$ How to set destination6
)ns
NL$ "at are t"e function module t&pes6
)ns
NM$ "at are tables6
)ns Tables 2 O.,FH);,(P.
-t creates a structure S t"e table wor# area in a program for t"e database tables% :iews or
structure O.,FH);,(P. T"e table wor# area "as t"e same name as t"e ob8ect for w"ic" we
created it. O.,FH);,(P must be declared in t"e )*)P dictionar&. T"e name and
se<uence of fields in t"e table wor# area O.,FH);,(P corresponds e5actl& to t"e
se<uence of fields in t"e database table% :iew definition in t"e )*)P dictionar&.
NN$ "at are client-dependant tables and independent tables6
)ns
(%
'DD$ How to distinguis" client-dependant tables from independent tables6
)ns
'D'$ "at is t"e use of Table maintenance allowed6
)ns (ar# t"e Table maintenance allowed flag if users wit" t"e corresponding aut"ori9ation ma&
c"ange t"e data in t"e table using t"e Data *rowser !Transaction S,'A$. -f t"e data in t"e
table s"ould onl& be maintained wit" programs or wit" t"e table :iew maintenance
transaction !Transaction S(1D$% &ou s"ould not set t"e flag.
'D2$ How to define Selection Screen6
)ns Parameters% Select-options C Selection-Screen
'D1$ "at are t"e c"ec# tables and :alue tables6
)ns C"ec# Table2 T"e )*)P Dictionar& allows &ou to define relations"ips between tables using
foreign #e&s . ) dependent table is called a foreign #e& table% and t"e referenced table is
called t"e c"ec# table. ,ac" #e& field of t"e c"ec# table corresponds to a field in t"e
foreign #e& table. T"ese fields are called foreign #e& fields. /ne of t"e foreign #e& fields is
designated as t"e c"ec# field for c"ec#ing t"e :alidit& of :alues. T"e #e& fields of t"e
c"ec# table can ser:e as input "elp for t"e c"ec# field.
7alue .able: 1rior to 6elease #.), it was possible to use the +alue table of a domain to pro+ide input help.
.his is no longer possible, primarily because unexpected results could occur if the +alue table had more than
one key field. It was not possible to restrict the other key fields, which meant that the en+ironment of the
field was not considered, as is normal with check tables.
In cases where this kind of +alue help was appropriate, you can reconstruct it by creating a search help for
the data elements that use the domain in Muestion, and using the +alue table as the selection method.
4heck table will be at field le+el checking.
7alue table will be at domain le+el checking ex: scarr table is check table for carrid.
'D?$ "at is t"e difference between tables and structures6
)ns Tables2
'$ Data is permanentl& stored in tables in t"e database.
2$ Database tables are generated from t"em.
Structure2
'$ -t contains data temporaril& during program run-time.
2$ 0o Database tables are generated from it.
'DI$ How to declare one internal table wit"out "eader line wit"out using structures6
)ns 0o% we cannot declare internal table wit"out "eader line and wit"out structure because it
gi:es error U-T)* cannot be a table% a reference% a string or contain an& of t"ese ob8ectV.
Code wit" Header wit"out Structure
T)*+,S 2 O.,FH);,(P.
D)T) 2 -T)* +-F, O.,FH);,(P /CC=.S D -TH H,)D,. +-0,.
S,+,CT K F./( O.,FH);,(P -0T/ C/..,SP/0D-07 F-,+DS /F -T)*.
)PP,0D -T)*.
,0DS,+,CT.
(&
+//P )T -T)*.
.-T, 2 > -T)*-,(P0/% -T)*-,(P0)(,%-T)*-D,PT0/.
,0D+//P.
Code wit"out Header wit" Structure
T)*+,S 2 O.,FH);,(P.
D)T) 2 *,7-0 /F -T)* /CC=.S D%
,(P0/ +-F, E.,FH);,(P-,(P0/%
,(P0)(, +-F, E.,FH);,(P-,(P0)(,%
D,PT0/ +-F, E.,FH);,(P-D,PT0/%
,0D /F -T)*.
S,+,CT K F./( O.,FH);,(P -0T/ C/..,SP/0D-07 F-,+DS /F -T)*.
)PP,0D -T)*.
,0DS,+,CT.
+//P )T -T)*.
.-T, 2 > -T)*-,(P0/% -T)*-,(P0)(,%-T)*-D,PT0/.
,0D+//P.
'DA$ "at are loc# ob8ects6
)ns .eason for Setting +oc#2 Suppose a tra:el agent want to boo# a flig"t. T"e customer wants
to fl& to a particular cit& wit" a certain airline on a certain da&. T"e boo#ing must onl& be
possible if t"ere are still free places on t"e flig"t. To a:oid t"e possibilit& of o:erboo#ing%
t"e database entr& corresponding to t"e flig"t must be loc#ed against access from ot"er
transactions. T"is ensures t"at one user can find out t"e number of free places% ma#e t"e
boo#ing% and c"ange t"e number of free places wit"out t"e data being c"anged in t"e
meantime b& anot"er transaction.
.he 6E" ;ystem synchroniKes simultaneous access of se+eral users to the same data records with a lock
mechanism. Dhen interacti+e transactions are programmed, locks are set and released by calling function
modules >see Function 9odules for 5ock 6eMuests?. .hese function modules are automatically generated
from the definition of lock objects in the -<-1 3ictionary.
Two t&pes of +oc#2 S"ared and ,5clusi:e
'DL$ "at are datasets6 "at are t"e different s&nta5es6
)ns T"e se<uential files !/0 )PP+-C)T-/0 S,.3,.$ are called datasets. T"e& are used for file
"andling in S)P.
'DM$ "at are t"e e:ents we use in dialog programming and e5plain t"em6
)ns T"ere are two e:ents in Dialog Programming i.e. screen2
'. P*/ !Process *efore /utput$ S *efore t"e screen is displa&ed% t"e P*/ e:ent is
processed.
2. P)- !Process )fter -nput$ S "en t"e user interacts wit" t"e screen% t"e P)- e:ent is
processed.
'DN$ "at is t"e difference between /P,0;F/.( and C+/S,;F/.(6
)ns /P,0;F/.( S T"is module opens la&out set printing. T"is function must be called up
before we can wor# wit" ot"er la&out set function li#e .-T,;F/.(.
('
.-T,;F/.( S /utput te5t element in form window. T"e specified element of t"e la&out
set window entered is output. T"e element must be defined in t"e la&out set.
C+/S,;F/.( S ,nd la&out set printing. Form printing started wit" /P,0;F/.( is
completed. Possible closing operations on t"e form last opened are carried out. Form
printing must be completed b& t"is function module. -f t"is is not carried out% not"ing is
printed or displa&ed on t"e screen.
''D$ "at are t"e page windows6 How man& main windows will be t"ere in a page window6
)ns Page indow2 -n t"is window% we define t"e margins for left% widt"% upper and "eig"t for
t"e la&out of Header% +ogo% (ain% C Footer.
'''$ "at are control e:ents in a loop6
-ns 4ontrol le+el processing is allowed within a 5221 o+er an internal table. .his means that we can di+ide
seMuences of entries into groups based on the contents of certain fields.
-. Fle+elG.
Fstatement blockG
/:3-..
*ou can react to the following control le+el changes:
Fle+elG 9eaning
FI6;. First line of the internal table
5-;. 5ast line of the internal table
:/D FfG <eginning of a group of lines with the same contents in the field FfG and in the
fields left of FfG
/:3 2f FfG /nd of a group of lines with the same contents in the field FfG and in the fields left
of FfG
''2$ How to debugg a script6
)ns 7o to S,L'% gi:e la&out set name% go to utilities select debugger mode on.
''1$ How man& ma5imum sessions can be open in S)Pgui6
)ns T"ere are ma5imum A sessions open in S)Pgui.
''?$ S)P Scripts and )*)P programs are client dependent or not6 "&6
)ns
''I$ "at are S&stem 3ariable6
-ns ;ystem +ariables ha+e been predefined by ;-1. De can use these +ariables in formulas or, for example, to
pass on certain pieces of information to a function module. @ow the function called by the function module
beha+es depends on the type of information passed on.
-t present, we can use the following system +ariables:
;ystem 7ariable 8se 9eaning
((
;*A923/ In function modules 4urrent mode of the 1I sheet
;*A./;. In function modules ;tatus of the 1I sheet >test or acti+e?
;*A62D In function modules 4urrent table line
;*A7-58/ or I =enerally 6efers to the immediately preceding input +alue
''A$ -s it compulsor& to use all t"e e:ents in .eports6
)ns
''L$ "at is t"e difference between sum and collect6
)ns Sum2 4ou can onl& use t"is statement wit"in a +//P. -f &ou use S=( in an )T - ,0D)T
bloc#% t"e s&stem calculates totals for t"e numeric fields of all lines in t"e current line
group and writes t"em to t"e corresponding fields in t"e wor# area. -f &ou use t"e S=(
statement outside an )T - ,0D)T bloc# !single entr& processing$% t"e s&stem calculates
totals for t"e numeric fields of all lines of t"e internal table in eac" loop pass and writes
t"em to t"e corresponding fields of t"e wor# area. -t t"erefore onl& ma#es sense to use t"e
S=( statement in )T...,0D)T bloc#s.
If the table contains a nested table, you cannot use the ;89 statement. :either can you use it if you are
using a field symbol instead of a work area in the 5221 statement.
Collect2
''M$ "at are session met"od and call transaction met"od and e5plain about t"em6
)ns Session met"od S =se t"e *DC;/P,0;7./=P to create a session. /nce we "a:e created
a session% t"en we can insert t"e batc" input data into it wit" *DC;-0S,.T. =se t"e
*DC;-0S,.T to add a transaction to a batc" input session. e specif& t"e transaction t"at
is to be started in t"e call to *DC;-0S,.T. e must pro:ide a *DCD)T) structure t"at
contains all t"e data re<uired to process t"e transaction completel&. =se t"e
*DC;C+/S,;7./=P to close a session after we "a:e inserted all of our batc" input data
into it. /nce a session is closed% it can be processed.
Call Transaction -
-n t"is met"od% we use C)++ T.)0S)CT-/0 =S-07 to run an S)P transaction. ,5ternal
data does not "a:e to be deposited in a session for later processing. -nstead% t"e entire
batc" input process ta#es place inline in our program.
''N$ -f &ou "a:e 'DDDD records in &our file% w"ic" met"od &ou use in *DC6
)ns - will use Session (et"od because in t"is met"od - do not "a:e to e5ecute t"e program
from t"e starting w"ereas Call Transaction met"od e5ecutes t"e program from t"e starting.
'2D$ "at are different modes of Call Transaction met"od and e5plain t"em6
)ns T"ere are t"ree modes of Call Transaction met"od2
'$ ) S Displa& )ll Screens
2$ , S Displa& ,rrors
1$ 0 S *ac#ground Processing
--------------------------------------------------------------------------------------------------------------------
))
'2'$ "at is t"e t&pical structure of an )*)P program6
)ns H,)D,.% */D4% F//T,..
'22$ "at are field s&mbols and field groups6 Ha:e &ou used Wcomponent id5 of structureW
clause wit" field groups6
)ns Field S&mbols S T"e& are place"older or s&mbolic names for t"e ot"er fields. T"e& do not
p"&sicall& reser:e space for a field% but point to its contents. -t can point to an& data
ob8ects.
Field-s&mbols Tfs>
Field 7roups S Field groups does not reser:e storage space but contains pointers to
e5isting fields.
)n e5tract dataset consists of a se<uence of records. T"ese records ma& "a:e different
structures. )ll records wit" t"e same structure form a record t&pe. 4ou must define eac"
record t&pe of an e5tract dataset as a field group% using t"e F-,+D-7./=PS statement.
Field-groups Tfg>
'21$ "at s"ould be t"e approac" for writing a *DC program6
)ns ST,P '2 C/03,.T-07 TH, +,7)C4 S4ST,( D)T) T/ ) F+)T F-+,
to internal table C)++,D WC/03,.S-/0W.
ST,P 22 T.)0SF,.-07 TH, F+)T F-+, -0T/ S)P S4ST,( C)++,D
WS)P D)T) T.)0SF,.W.
ST,P 12 D,P,0D-07 =P/0 TH, *DC T4P,
i$ Call transaction !rite t"e program e5plicitl&$
ii$ Create sessions !sessions are created and processed. -f success% data will transfer$.
'2?$ "at is a batc" input session6
)ns *)TCH -0P=T S,SS-/0 is an intermediate step between internal table and database table.
Data along wit" t"e action is stored in session i.e. data for screen fields% to w"ic" screen it
is passed% program name be"ind it% and "ow ne5t screen is processed.
Create session S *DC;/P,0;7./=P
-nsert batc" input S *DC;-0S,.T
Close session S *DC;C+/S,;7./=P
'2I$ "at is t"e alternati:e to batc" input session6
)ns Call Transaction (et"od
'2A$ ) situation2 )n )*)P program creates a batc" input session. e need to submit t"e
program and t"e batc" session in bac#ground. How to do it6
)ns 7o to S(1A and create bac#ground 8ob b& gi:ing 8ob name% 8ob class and 8ob steps
!J/* SCH,D=+-07$
'2L$ "at is t"e difference between a pool table and a transparent table and "ow t"e& are
stored at t"e database le:el6
)ns Pool Table -
)
.ransparent .able B /xists with the same structure both in dictionary as well as in database exactly with the
same data and fields. <oth 2pen ;N5 and :ati+e ;N5 can be used.
'2M$ "at are t"e problems in processing batc" input sessions6 How is batc" input process
different from processing on line6
)ns Two Problems2 -
'$ -f t"e user forgets to opt for #eep session t"en t"e session will be automaticall& remo:ed
from t"e session <ueue !log remains$. Howe:er% if session is processed we ma& delete it
manuall&.
2$ -f session processing fails% data will not be transferred to S)P database table.
'2N$ -s Session (et"od% )s&nc"ronous or S&nc"ronous6
)ns
'1D$ "at are t"e different t&pes of data dictionar& ob8ects6
)ns Different t&pes of data dictionar& ob8ects2
'$ Tables
2$ 3iews
1$ Data elements
?$ Structure
I$ Domains
A$ Searc" Helps
L$ +ocal /b8ects
M$ (atc"code
'1'$ How man& t&pes of tables e5ist and w"at are t"e& in data dictionar&6
)ns ? T&pes of Tables2
'. Transparent tables - ,5ists wit" t"e same structure bot" in dictionar& as well as in
database e5actl& wit" t"e same data and fields. *ot" /pen SQ+ and 0ati:e SQ+ can be
used.
2. Pool tables
1. Cluster tables - T"ese are logical tables t"at are arranged as records of transparent tables.
/ne cannot use 0ati:e SQ+ on t"ese tables !onl& /pen SQ+$. T"e& are not manageable
directl& using database s&stem tools.
?. -nternal tables
'12$ "at is t"e step-b&-step process to create a table in data dictionar&6
)ns Steps to create a table2
Step '2 creating domains !data t&pe% field lengt"% .ange$.
Step 22 creating data elements !properties and t&pe for a table field$.
Step 12 creating tables !S,''$.
'11$ Can a transparent table e5ist in data dictionar& but not in t"e database p"&sicall&6
)ns 0o% Transparent table do e5ist wit" t"e same structure bot" in t"e dictionar& as well as in
t"e database% e5actl& wit" t"e same data and fields.
'1?$ -n S)P Scripts% "ow will u lin# F/.( wit" t"e ,:ent Dri:en6
)!
)ns
'1I$ Can &ou create a table wit" fields not referring to data elements6
)ns 4,S. e.g.2- -T)* +-F, SPF+-.
Here we are refering to a data ob8ect !SPF+-$ not data element.
'1A$ "at is t"e ad:antage of structures6 How do &ou use t"em in t"e )*)P programs6
-ns =52<-5 /II;.-:4/ >these could be used by any other program without creating it again?.
'1L$ "at does an e5tract statement do in t"e )*)P program6
)ns /nce &ou "a:e declared t"e possible record t&pes as field groups and defined t"eir
structure% &ou can fill t"e e5tract dataset using t"e following statements2
,ET.)CT TF7>.
"en t"e first ,ET.)CT statement occurs in a program% t"e s&stem creates t"e e5tract
dataset and adds t"e first e5tract record to it. -n eac" subse<uent ,ET.)CT statement% t"e
new e5tract record is added to t"e dataset
,ET.)CT H,)D,..
"en &ou e5tract t"e data% t"e record is filled wit" t"e current :alues of t"e corresponding
fields.
)s soon as t"e s&stem "as processed t"e first ,ET.)CT statement for a field group TF7>%
t"e structure of t"e corresponding e5tract record in t"e e5tract dataset is fi5ed. 4ou can no
longer insert new fields into t"e field groups TF7> and H,)D,.. -f &ou tr& to modif& one of
t"e field groups afterwards and use it in anot"er ,ET.)CT statement% a runtime error
occurs.
*& processing ,ET.)CT statements se:eral times using different field groups% &ou fill t"e
e5tract dataset wit" records of different lengt" and structure. Since &ou can modif& field
groups d&namicall& up to t"eir first usage in an ,ET.)CT statement% e5tract datasets
pro:ide t"e ad:antage t"at &ou need not determine t"e structure at t"e beginning of t"e
program.
'1M$ "at is a collect statement6 How is it different from append6
)ns Collect 2 -f an entr& wit" t"e same #e& alread& e5ists% t"e C/++,CT statement does not
append a new line% but adds t"e contents of t"e numeric fields in t"e wor# area to t"e
contents of t"e numeric fields in t"e e5isting entr&.
)ppend S Duplicate entries occurs.
'1N$ "at is /P,0 SQ+ :s 0)T-3, SQ+6
)ns /pen SQ+ S T"ese statements are a subset of standard SQ+. -t consists of D(+ command
!Select% -nsert% =pdate% Delete$. -t can simplif& and speed up database access. *uffering is
partl& stored in t"e wor#ing memor& and s"ared memor&. Data in buffer is not alwa&s up-
to-date.
)"
0ati:e SQ+ S T"e& are loosel& integrated into )*)P. -t allows access to all functions
containing programming interface. T"e& are not c"ec#ed and con:erted. T"e& are sent
directl& to t"e database s&stem. Programs t"at use 0ati:e SQ+ are specific to t"e database
s&stem for w"ic" t"e& were written. For e.g. to create or c"ange table definition in t"e
)*)P.
'?D$ "at does an ,E,C SQ+ stmt do in )*)P6 "at is t"e disad:antage of using it6
-ns .o use a :ati+e ;N5 statement, you must precede it with the /I/4 ;N5 statement, and follow it with the
/:3/I/4 statement as follows:
/I/4 ;N5 W1/6F269I:= FformGX.
F:ati+e ;N5 statementG
/:3/I/4.
.here is no period after :ati+e ;N5 statements. Furthermore, using in+erted commas >O? or an asterisk >*? at
the beginning of a line in a nati+e ;N5 statement does not introduce a comment as it would in normal -<-1
syntax. *ou need to know whether table and field names are caseBsensiti+e in your chosen database.
'?'$ "at is t"e meaning of )*)P editor integrated wit" )*)P data dictionar&6
-ns -<-1 /ditor: .ool in the -<-1 Dorkbench in which you enter the source code of -<-1 programs and
check their syntax. *ou can also na+igate from the -<-1 /ditor to the other tools in the -<-1 Dorkbench.
'?2$ "at are t"e e:ents in )*)P language6
)ns T"e e:ents are as follows2
'. -nitiali9ation
2. )t selection-screen
1. Start-of-selection
?. ,nd-of-selection
I. Top-of-page
A. ,nd-of-page
L. )t line-selection
M. )t user-command
N. )t PF
'D. 7et
''. )t 0ew
'2. )t +)ST
'1. )T ,0D
'?. )T F-.ST
'?1$ "at is an interacti:e report6 "at is t"e ob:ious difference of suc" report compared
wit" classical t&pe reports6
)ns )n -nteracti:e report is a d&namic drill down report t"at produces t"e list on users c"oice.
Difference2 -
a$ T"e list produced b& classical report doesn@t allow user to interact wit" t"e s&stem
w"ere as t"e list produced b& interacti:e report allows t"e user to interact wit" t"e s&stem.
*$ /nce a classical report% e5ecuted user looses control w"ere as -nteracti:e% user "as
control.
C$ -n classical report% drilling is not possible w"ere as in interacti:e% drilling is possible.
'??$ "at is a drill down report6
)ns -ts an -nteracti:e report w"ere in t"e user can get more rele:ant data b& selecting e5plicitl&.
)#
'?I$ How do &ou write a function module in S)P6 Describe.
)ns
'. Called program - S,1L - Creating function group% function module b& assigning
attributes% importing% e5porting% tables% and e5ceptions.
2. Calling program - S,1M - -n program% clic# pattern and write function name- pro:ide
e5port% import% tables% e5ception :alues.
'?A$ "at are t"e e5ceptions in function module6
)ns ,5ceptions2 /ur function module needs an e5ception t"at it can trigger if t"ere are no
entries in table SPF+- t"at meet t"e selection criterion. T"e e5ception 0/T;F/=0D ser:es
t"is function.
C/((=0-C)T-/0;F)-+=., C S4ST,(;F)-+=.,
'?M$ How are t"e date and time field :alues stored in S)P6
)ns DD.((.4444. HH2((2SS
'?N$ "at are t"e fields in a *DC;Tab and *DCD)T) Table6
)ns Fields of *DC;Tab C *DCD)T) Table2
Sr.0o Fields - Description
'$ Program - *DC (odule pool
2$ D&npro - *DC Screen 0umber
1$ D&nbegin - *DC Screen Start
?$ Fname - Field 0ame
I$ F:al - *DC field :alue
'ID$ 0ame a few data dictionar& ob8ects6
)ns Different t&pes of data dictionar& ob8ects2
'$ Tables
2$ 3iews
1$ Data elements
?$ Structure
I$ (atc"code
A$ Domains
L$ Searc" Helps
M$ +ocal /b8ects
'I'$ "at "appens w"en a table is acti:ated in DD6
)ns "en t"e table is acti:ated% a p"&sical table definition is created in t"e database for t"e
table definition stored in t"e )*)P dictionar&. T"e table definition is translated from t"e
)*)P dictionar& of t"e particular database.
-t is a:ailable for an& insertion% modification and updation of records b& an& user.
'I1$ "at are matc"codes6 Describe6
)ns -t is similar to table inde5 t"at gi:es list of possible :alues for eit"er primar& #e&s or non-
primar& #e&s.
'I?$ "at transactions do &ou use for data anal&sis6
)ns
)$
'II$ "at are t"e elements of selection screen6
)ns T"ere are I elements of selection screen2
Selection-screen include bloc#s T*>
Selection-screen include parameters TP>
Selection-screen include select-options TS>
Selection-screen include comment TC>
Selection-screen include pus"-button Tpus">
'IA$ "at are ranges6 "at are number ranges6
)ns (ain function of ranges to pass data to t"e actual selection tables wit"out displa&ing t"e
selection screen.
(in% (a5 :alues pro:ided in selection screens.
'IL$ "at are select options and w"at is t"e diff from parameters6
)ns Parameters 2 e can enter a single :alue.
1-6-9/./6;: 1-6-9>)?.
Select-options2 e can enter low and "ig" :alue i.e. range "as to be specif&. *& using 0/-
-0T,.3)+ user can process onl& single fields.
;/5/4.B21.I2:;: 3:2 F26 3/1.B3:2.
;/5/4.B21.I2:;: 3:2 F26 3/1.B3:2 :2BI:./67-5.
;/5/4.B21.I2:; declares an internal table, which is automatically filled with +alues or ranges of +alues
entered by the end user. For each ;/5/4.B21.I2:;, the system creates a selection table.
;/5/4.B21.I2:; F;/5G F26 FfieldG.
- selection table is an internal table with fields ;I=:, 21.I2:, 52D and @I=@.
.he type of 52D and @I=@ is the same as that of FfieldG.
.he ;I=: field can take the following +alues: I Inclusi+e >should apply? / /xclusi+e >should not apply?
.he 21.I2: field can take the following +alues: /N /Mual =. =reater than :/ :ot eMual <. <etween 5/
5ess than or eMual :< :ot between 5. 5ess than 41 4ontains pattern =/ =reater than or eMual :1 :o
pattern.
3ifferencesB
1-6-9/./6; allow users to enter a single +alue into an internal field within a report.
;/5/4.B21.I2:; allows users to fill an internal table with a range of +alues.
;electBoptions pro+ide ranges where as parameters do not.
For each 1-6-9/./6; or ;/5/4.B21.I2:; statement you should define text elements by choosing
=oto B .ext elements B ;election texts B 4hange.
)%
/g:B 1arameters name>")?.
Dhen the user executes the -<-1E# program, an input field for 'name' will appear on the selection screen.
*ou can change the comments on the left side of the input fields by using text elements as described in
;election .exts.
'IM$ How do &ou :alidate t"e selection criteria of a report6 )nd "ow do &ou displa& initial
:alues in a selection screen6
)ns 3alidate2 - b& using matc" code ob8ects.
Displa& 2- Parameters Tname> default @555@.
Select-options Tname> for spfli-carrid.
-nitial :alues in a selection screen2
-0-T-)+-O)T-/0.
D0/-+/ G 'D.
D0/-H-7H G 1D
S-70 -.
/PT-/0 0*.
)PP,0D D0/.
'IN$ "at are selection te5ts6
)ns
'AD$ "at is CTS and w"at do &ou #now about it6
)ns CTS stands for C"ange and Transport S&stem. T"e CTS pro:ides a range of functions t"at
"elp &ou to c"oose a transport strateg& optimall& suited to &our re<uirements. e
recommend t"at &ou follow t"e transport strateg& w"ile &ou plan and set up &our s&stem
landscape.
C"ange and Transport S&stem !CTS$ is a tool t"at "elps &ou to organi9e de:elopment
pro8ects in t"e )*)P or#benc" and in Customi9ing% and t"en transport t"e c"anges
between t"e S)P S&stems and clients in &our s&stem landscape. T"is documentation
pro:ides &ou wit" an o:er:iew of "ow to manage c"anges wit" t"e CTS and essential
information on setting up &our s&stem and client landscape and deciding on a transport
strateg&. .ead and follow t"is documentation w"en planning &our de:elopment pro8ect. For
practical information on wor#ing wit" t"e C"ange and Transport S&stem% see C"ange and
Transport /rgani9er and Transport (anagement S&stem.
'A'$ "en a program is created and need to be transported to prodn does selection te5ts
alwa&s go wit" it6 -f not "ow do &ou ma#e sure6 Can &ou c"ange t"e CTS entries6 How do
&ou do it6
)ns
'A2$ "at is t"e client concept in S)P6 "at is t"e meaning of client independent6
)ns
'A1$ )re programs client dependent6
)ns 4es% group of users can access t"ese programs wit" a client number.
)&
'A?$ 0ame a few s&stem global :ariables &ou can use in )*)P programs6
)ns S4-S=*.C% S4-D*C0T% S4-+-++-% S4-D)T=(% S4-=O,-T% S4-=C/((%
S4-T)*-E.....
;*B5I55I is absolute number of lines from which the e+ent was triggered.
'AI$ "at are internal tables6 How do &ou get t"e number of lines in an internal table6 How to
use a specific number occurs statement6
)ns
'$ -t is a standard data t&pe ob8ect% w"ic" e5ists onl& during t"e runtime of t"e program.
T"e& are used to perform table calculations on subsets of database tables and for re-
organi9ing t"e contents of database tables according to users need.
2$ =sing S4-D*C0T.
1$ T"e number of memor& allocations t"e s&stem need to allocate for t"e ne5t record
population.
'AA$ How do &ou ta#e care of performance issues in &our )*)P programs6
)ns Performance of )*)P programs can be impro:ed b& minimi9ing t"e amount of data to be
transferred. T"e data set must be transferred t"roug" t"e networ# to t"e applications% so
reducing t"e amount of time and also reduces t"e networ# traffic.
Some measures t"at can be ta#en are2
- =se :iews defined in t"e )*)P>? DD-C !also "as t"e ad:antage of better reusabilit&$.
- =se field list !S,+,CT clause$ rat"er t"an S,+,CT K.
- .ange tables s"ould be a:oided !-0 operator$
- ):oid nested S,+,CTS.
'AL$ "at are datasets6
)ns T"e se<uential files !/0 )PP+-C)T-/0 S,.3,.$ are called datasets. T"e& are used for file
"andling in S)P.
'AM$ How to find t"e return code of an stmt in )*)P programs6
)ns /pen SQ+ "as 2 s&stem fields wit" return codes2
'$ S4-S=*.C
2$ S4-D*C0T
=sing function modules
'AN$ "at are Con:ersion C -nterface programs in S)P6
)ns C/03,.S-/02 +egac& s&stem to flat file.
-0T,.F)C,2 Flat file to S)P s&stem.
'LD$ Ha:e &ou used S)P supplied programs to load master data6
)ns
'L'$ "at are t"e tec"ni<ues in:ol:ed in using S)P supplied programs6 Do &ou prefer to
write &our own programs to load master data6 "&6
)ns
'L2$ "at are logical databases6 "at are t"e ad:antages>disad:antages of logical databases6
)'
)ns To read data from a database tables we use logical database.
) logical database pro:ides read-onl& access to a group of related tables to an )*)P>?
program.
-d+antages: B .he programmer need not worry about the primary key for each table. <ecause 5ogical
database knows how the different tables relate to each other, and can issue the ;/5/4. command with
proper where clause to retrie+e the data.
'$ )n eas&-to-use standard user interface.
2$ C"ec# functions% w"ic" c"ec# t"at user input is complete% correct% and plausible.
1$ (eaningful data selection.
?$ Central aut"ori9ation c"ec#s for database accesses.
I$ 7ood read access performance w"ile retaining t"e "ierarc"ical data :iew determined b&
t"e application logic.
Disad:antages2 -
'$ -f &ou do not specif& a logical database in t"e program attributes% t"e 7,T e:ents ne:er
occur.
2$ T"ere is no ,0D7,T command% so t"e code bloc# associated wit" an e:ent ends wit"
t"e ne5t e:ent statement !suc" as anot"er 7,T or an ,0D-/F-S,+,CT-/0$.
'L1$ "at specific statements do &ou using w"en writing a drill down report6
)ns )T +-0,-S,+,CT-/0
)T =S,.-C/(()0D
)T PF.
'L?$ "at are different tools to report data in S)P6 "at all "a:e &ou used6
)ns
'LI$ "at are t"e ad:antages and disad:antages of )*)P <uer& tool6
)ns )d:antages2 0o programming #nowledge is re<uired.
Disad:antages2 Depending on t"e comple5it& of t"e database tables% it ma& not be eas& for
t"e user to select t"e necessar& data correctl&.
'LA$ "at are t"e functional areas6 =ser groups6 How does )*)P <uer& wor# in relation to
t"ese6
)ns Functional )reas - *& creating functional areas% we can initiall& select t"is data. T"is
ensures t"at t"e data is presented to t"e )*)P Quer& user in a meaningful wa& to
accomplis" t"e tas#% and t"at onl& t"e data t"at t"e user ma& use is presented.
=ser 7roups S ) user group is a collection of users t"at wor# wit" about t"e same data and
carr& out similar tas#s. T"e members of a user group can use all programs !<ueries$
created b& an& user of t"e group. C"anges to suc" a program are at once :isible to all
users. T"is ensures t"at all members of a user group use t"e same e:aluation programs.
)*)P Quer&2 -t consists of t"ree components S <ueries% functional areas and user groups.
T"e functional areas pro:ide t"e user wit" an initial set of data in accordance wit" t"e tas#
to be accomplis"ed. )ll users must be members of at least one user group. )ll members of
one user group can access t"e same data as well as t"e same program !<ueries$ to create
lists.
)(
'LL$ -s a logical database a re<uirement>must to write an )*)P <uer&6
)ns 0o% it is not must to use +D*. )part from it% we "a:e ot"er options2
'$ Table 8oin b& *asis Table
2$ Direct .ead of table
1$ Data .etrie:al b& Program
'LM$ "at is t"e structure of a *DC sessions.
)ns *DCD)T)
'LN$ "at are C"ange "eader and detail tables6 Ha:e &ou used t"em6
)ns
'MD$ "at do &ou do w"en t"e s&stem cras"es in t"e middle of a *DC batc" session6
)ns e will loo# into t"e error log file !S(1I$.
'M'$ "at do &ou do wit" errors in *DC batc" sessions6
)ns e loo# into t"e list of incorrect session and process it again. To correct incorrect session%
we anal&9e t"e session to determine w"ic" screen and :alue produced t"e error. For small
errors in data we correct t"em interacti:el& ot"erwise modif& batc" input program t"at "as
generated t"e session or man& times e:en t"e data file.
'M2$ How do &ou set up bac#ground 8obs in S)P6 "at are t"e steps6 "at are t"e e:ents
dri:en batc" 8obs6
)ns 7o to S(1A and create bac#ground 8ob b& gi:ing 8ob name% 8ob class and 8ob steps
!J/* SCH,D=+-07$
'M1$ -s it possible to run "ost command from S)P en:ironment6 How do &ou run6
)ns
'M?$ "at #ind of financial periods e5ist in S)P6 "at is t"e rele:ant table for t"at6
)ns
'MI$ Does S)P "andle multiple currencies6 (ultiple languages6
)ns 4es.
'MA$ "at is a currenc& factoring tec"ni<ue6
)ns
'ML$ How do &ou document )*)P programs6 Do &ou use program documentation menu
option6
)ns
'MM$ "at is S)P Script and la&out set6
)ns T"e tool% w"ic" is used to create la&out set is called S)P Script. +a&out set is a design
document.
'MN$ "at are t"e )*)P commands t"at lin# to a la&out set6
)ns Control Commands% S&stem Commands
'ND$ "at is output determination6
)
)ns
'N'$ "at is t"e field lengt" of Pac#ed 0umber6 "at is t"e default decimal of pac#ed
number6
)ns
'N2$ "at are t"e different t&pes of data t&pes6
)ns T"ere are t"ree t&pes of data t&pes2
Data T&pes
,lementar& Comple5 .eferences
Fi5ed 3ariable Structure Table Data /b8ect
3ariable
'N1$ "at is t"e s&nta5 of Pac#ed 0umber6
)ns Data 2 0=( t&pe P decimals 2.
'N?$ "at are different t&pes of attributes of Function (odule6
)ns T"ere are A attributes of F(2
'. -mport
2. ,5port
1. Table
?. C"anging
I. Source
A. ,5ception
'NI$ +ist of Screen elements.
)ns T"ere are '1 screen elements2
i. -nput > output fields
ii. Te5t fields
iii. C"ec#bo5
i:. .adio button
:. Pus" *utton
:i. Drop down list
:ii. Subscreen
:iii. Table control
i5. Tabstrip control
5. Custom control
5i. *o5
5ii. Status icons
5iii. /F;C/D, fields
'NA$ How man& default Tab Strips are t"ere6 How to insert more Tabs in it6
)ns T"ere 2 default Tab strips. Screen painter attributes contain Tab Title% w"ic" is used to
insert more tabs in tab strip.