You are on page 1of 176

SAP NOTEBOOK - ABAP

INTERVIEW QUESTIONS
ANSWERS TIPS
Hybris and SAP
Hybris is a e-commerce product which is now a part of SAP after SAP's acquisition.
Hybris' strong suit is supporting business-to-business (B2B) commerce, but it also supports
business-to-consumer (B2C) commerce, product content management and order
management. B2B customers include the likes of industrial products supplier Granger
while coffee equipment maker Nespresso and camera manufacturer Nikon use Hybris for
both B2B and B2C commerce.
Hybris' core architecture provides a master data-management layer said to ensure
consistent inventory, pricing, order-status and other information across channels, whether
that's Web, mobile, call center or retail stores. There's also a process-management layer
that applies the same business rules across channels, so prices and promotions
encountered online are consistent with those encountered in stores or on mobile devices.
With the Hybris acquisition completed, Sheldon says the enterprise commerce technology
landscape is now "dominated by four large software companies: SAP, IBM, Oracle and
eBay."
IBM and Oracle are clearly SAP's chief rivals, and they've both spent billions on
acquisitions in the commerce and customer experience arena. The most directly
competitive products to Hybris at IBM are Unica and Sterling Commerce, while Oracle has
ATG and commerce-oriented bits and pieces of BEA, E-Business Suite, FatWire, Stellent
and Eloqua.
Looking for Unlimited very long input text entry field in SAP ABAP
programming?
Method1: Simple: Function module for Popup
Use the function module CATSXT_SIMPLE_TEXT_EDITOR.
Just give a title for the funtion !o"ule an" e#eute to give a POP $P an" free te#t fiel".
The resulting ITA% &ill give 'ou the te#t lines.
Method2: Medium : OOPS method for Free text editor
DATA editor_container TYPE REF TO cl_gui_custom_container.
create object editor_container
exporting
container_name = !ontainer"##
exceptions
cntl_error = "
cntl_s$stem_error = %
create_error = &
li'etime_error = (
li'etime_d$npro_d$npro_lin) = *.
() Create" a referene to 'our Te#t E"it Control an" reate it*s o(+et ,
DATA text_editor TYPE REF TO cl_gui_textedit.
create object text_editor
exporting
parent = editor_container
+ord+rap_mode = cl_gui_textedit=,+ord+rap_at_'ixed_position
+ord+rap_position = line_lengt-
+ord+rap_to_linebrea)_mode = cl_gui_textedit=,true. .or simpl$ = 'alse
)-i"e tool(ar an" status(ar
call met-od text_editor /,set_toolbar_mode
exporting
toolbar_mode = cl_gui_textedit=,'alse.
call met-od text_editor/,set_statusbar_mode
exporting
statusbar_mode = cl_gui_textedit=,'alse.
") Ans&ering 'our .uestion Te#t E"it Control //0 Data(ase Ta(le
call met-od text_editor/,get_text_as_stream
exporting
onl$_+-en_modi'ied = cl_gui_textedit=,'alse
importing
text = +r)_text
exceptions
ot-ers = ".
Save &r1_te#t to Ta(le
e) Te#t E"it Control 2// "ata(ase344 ta(le344 u3440
The reverse 5roess of Ste5 6
7ith !etho" ,
!A00 1ET2OD text_editor/,set_text_as_stream
......
How to Clear the OOPS Free text:
This is ho& I get ri" of the e#isting te#t,
3 Delete t-e Text
me/,o_editor/,delete_text4 5.
3 6et t-e ne+ text
me/,o_editor/,set_textstream4 E7PORT89: text = i;_text 5.
Set the Free text object editable and Disabled mode by using the below method.
8F condition.....

!A00 1ET2OD :_FREETE7T_"/,6ET_READO90Y_1ODE
E7PORT89:
READO90Y_1ODE = "
E7!EPT8O96
ERROR_!9T0_!A00_1ET2OD = "
89<A08D_PARA1ETER = %
OT2ER6 = &.
8F 6Y/6=>R! #.
3 1E66A:E 8D 6Y/16:8D TYPE 6Y/16:TY 9=1>ER 6Y/16:9O
3 ?8T2 6Y/16:<" 6Y/16:<% 6Y/16:<& 6Y/16:<(.
E9D8F.
else.
!A00 1ET2OD :_FREETE7T_"/,6ET_READO90Y_1ODE
E7PORT89:
READO90Y_1ODE = !0_:=8_TE7TED8T=,FA06E
E7!EPT8O96
ERROR_!9T0_!A00_1ET2OD = "
89<A08D_PARA1ETER = %
OT2ER6 = &.
8F 6Y/6=>R! #.
3 1E66A:E 8D 6Y/16:8D TYPE 6Y/16:TY 9=1>ER 6Y/16:9O
3 ?8T2 6Y/16:<" 6Y/16:<% 6Y/16:<& 6Y/16:<(.
E9D8F.
endi'.
Editable ALV event trigger without pressing enter key
Ma1ing AL8 to reat to Change "ata auto!atiall'
LI9:, htt5,;;&i1i.sn.sa5.o!;&i1i;"is5la';A%AP;Ma1ing<AL8<to<reat<to<Change<"ata<auto!atiall'
Scenario:
To !a1e AL8 to reat to "ata hange auto!atiall' &ithout an' nee" for the user to li1 on E9TER or an'
other (utton;!enu ite!.
Procedure:
In or"er to !a1e the s'ste! reat to an e"it event= &e nee" to first register the edit event.
To register the e"it event= all the !etho" REGISTER_EDIT_EVENT
CALL METHOD cont_editalvgd -> register_edit_event
Exporting
{}I_event_id = cl_gi_alv_grid => !c_evt_!odi"ied#
7hen user 5ress *E9TER* the event MC_E8T_E9TER is triggere" &hih auto!atiall' sets the varia(le
M_ell_e"it to *X*.
%ut if the user ('5asses the enter 1e' then the varia(le M_CELL_EDIT has to (e set e#5liitl' &hih is "one ('
5assing mc_evt_modified to the e#5orting 5ara!eter I_E8E9T_ID instea" ofmc_evt_enter.
In the PAI event= all the !etho" CEC!_C"NGED_D"T". This !etho" auto!atiall' triggers
the data_changed event.
%' "efault= SAP reogni>es *E9TER* event. 7hen onl' the C-EC:_C-A9?ED_DATA is alle" in PAI event=
then the *E9TER* event is not reogni>e" (' the s'ste!. In or"er to have (oth the events reogni>e" (' the
s'ste!= &e nee" to register the e"it event.
Sam#$e code:
REPORT @_A0<_ED8T_E<E9T.
3.Table declarations...................................................
TA>0E6A
6PF08. . Flig-t 6c-edule Details
3. Data declarations...................................................
3.////////////////////////////////////////////////////////////////////3
3 ?or) ;ariables 3
3.////////////////////////////////////////////////////////////////////3
DATAA
?_:R8D TYPE REF TO !0_:=8_A0<_:R8DB . Re'erence object 'or al; grid
?_!O9TA89ER TYPE REF TO !0_:=8_!=6TO1_!O9TA89ER.
. Re'erence object 'or container
3.////////////////////////////////////////////////////////////////////3
3 6tructure to -old Flig-t 6c-edule details 3
3.////////////////////////////////////////////////////////////////////3
DATAA
F6_6PF08 TYPE 6PF08.
3.////////////////////////////////////////////////////////////////////3
3 6tructure to -old Field !atalog details 3
3.////////////////////////////////////////////////////////////////////3
DATAA
?A_F8E0D_!ATA0O: TYPE 0<!_6_F!AT.
3.////////////////////////////////////////////////////////////////////3
3 6tructure to -old 0a$out o' t-e A0< Report 3
3.////////////////////////////////////////////////////////////////////3
DATAA
?A_0AYO=T TYPE 0<!_6_0AYO.
3.////////////////////////////////////////////////////////////////////3
3 8nternal table to -old Flig-t 6c-edule details 'rom table 6PF08 3
3.////////////////////////////////////////////////////////////////////3
DATAA
T_6PF08 08CE
6TA9DARD TA>0E
OF F6_6PF08.
3.////////////////////////////////////////////////////////////////////3
3 8nternal table to -old Field !atalog Details 3
3.////////////////////////////////////////////////////////////////////3
DATAA
T_F8E0D_!ATA0O: TYPE 0<!_T_F!AT.
3.////////////////////////////////////////////////////////////////////3
3 6TART/OF/6E0E!T8O9 E<E9T 3
3.////////////////////////////////////////////////////////////////////3
6TART/OF/6E0E!T8O9.
3 Data retrie;al 'rom t-e database table
6E0E!T 3 FRO1 6PF08 89TO TA>0E T_6PF08.
!A00 6!REE9 "##.
3DampE/////////////////////////////////////////////////////////////////////3
3DampE 1odule set_la$out O=TP=T
3DampE/////////////////////////////////////////////////////////////////////3
3 T-is module is used to set t-e la$out 'or t-e al; grid displa$ 3
3//////////////////////////////////////////////////////////////////////3
1OD=0E 6ET_0AYO=T O=TP=T.
?A_0AYO=T/:R8D_T8T0E = 6PF08 TA>0E DETA806.
?A_0AYO=T/@E>RA = 7.
?A_0AYO=T/ED8T = 7.
E9D1OD=0E. . set_la$out O=TP=T
3DampE/////////////////////////////////////////////////////////////////////3
3DampE 1odule 'ield_catalog O=TP=T
3DampE/////////////////////////////////////////////////////////////////////3
3 T-is module is used to populate t-e 'ield catalog 3
3//////////////////////////////////////////////////////////////////////3
1OD=0E F8E0D_!ATA0O: O=TP=T.
!0EAR ?A_F8E0D_!ATA0O:.
?A_F8E0D_!ATA0O:/F8E0D9A1E = !ARR8D.
?A_F8E0D_!ATA0O:/REF_F8E0D = !ARR8D6.
?A_F8E0D_!ATA0O:/REF_TA>0E = 6PF08.
?A_F8E0D_!ATA0O:/!O0_PO6 = ".
APPE9D ?A_F8E0D_!ATA0O: TO T_F8E0D_!ATA0O:.
!0EAR ?A_F8E0D_!ATA0O:.
?A_F8E0D_!ATA0O:/F8E0D9A1E = !O998D.
?A_F8E0D_!ATA0O:/REF_F8E0D = !O998D.
?A_F8E0D_!ATA0O:/REF_TA>0E = 6PF08.
?A_F8E0D_!ATA0O:/!O0_PO6 = %.
APPE9D ?A_F8E0D_!ATA0O: TO T_F8E0D_!ATA0O:.
!0EAR ?A_F8E0D_!ATA0O:.
?A_F8E0D_!ATA0O:/F8E0D9A1E = !8TYFRO1.
?A_F8E0D_!ATA0O:/REF_F8E0D = !8TYFRO1.
?A_F8E0D_!ATA0O:/REF_TA>0E = 6PF08.
?A_F8E0D_!ATA0O:/!O0_PO6 = &.
APPE9D ?A_F8E0D_!ATA0O: TO T_F8E0D_!ATA0O:.
!0EAR ?A_F8E0D_!ATA0O:.
?A_F8E0D_!ATA0O:/F8E0D9A1E = !8TYTO.
?A_F8E0D_!ATA0O:/REF_F8E0D = !8TYTO.
?A_F8E0D_!ATA0O:/REF_TA>0E = 6PF08.
?A_F8E0D_!ATA0O:/!O0_PO6 = (.
APPE9D ?A_F8E0D_!ATA0O: TO T_F8E0D_!ATA0O:.
E9D1OD=0E. . 'ield_catalog O=TP=T
3D/////////////////////////////////////////////////////////////////////3
3D 1odule =6ER_!O11A9D_#"## 89P=T
3D/////////////////////////////////////////////////////////////////////3
T-is module is used to -andle t-e PA8 e;ents
3//////////////////////////////////////////////////////////////////////3
1OD=0E =6ER_!O11A9D_#"## 89P=T.
!A6E 6Y/=!O11.
?2E9 OC.
3 !alling t-e c-ec)_c-anged_data met-od to trigger t-e data_c-anged
3 e;ent
!A00 1ET2OD ?_:R8D/,!2E!C_!2A9:ED_DATA
81PORT89:
E_<A08D =
!2A9:89:
!_REFRE62 = 7
.
=PDATE 6PF08 FRO1 TA>0E T_6PF08.
?2E9 >A!C OR E78T OR !A9!E0.
0EA<E TO 6!REE9 #.
E9D!A6E. . !A6E 6Y/=!O11
E9D1OD=0E. . =6ER_!O11A9D_#"## 89P=T
3D/////////////////////////////////////////////////////////////////////3
3D 1odule manage_al;_grid O=TP=T
3D/////////////////////////////////////////////////////////////////////3
T-is module is used to manage t-e :rid displa$
3//////////////////////////////////////////////////////////////////////3
1OD=0E 1A9A:E_A0<_:R8D O=TP=T.
8F ?_:R8D 86 898T8A0.
!REATE O>FE!T ?_!O9TA89ER
E7PORT89:
!O9TA89ER_9A1E = !O9TA89ER"
E7!EPT8O96
!9T0_ERROR = "
!9T0_6Y6TE1_ERROR = %
!REATE_ERROR = &
08FET81E_ERROR = (
08FET81E_DY9PRO_DY9PRO_089C = *
OT2ER6 = G
.
8F 6Y/6=>R! H, #.
1E66A:E 8D 6Y/16:8D TYPE 6Y/16:TY 9=1>ER 6Y/16:9O
?8T2 6Y/16:<" 6Y/16:<% 6Y/16:<& 6Y/16:<(.
E9D8F. . 8F 6Y/6=>R! 9E #
!REATE O>FE!T ?_:R8D
E7PORT89:
8_PARE9T = ?_!O9TA89ER
E7!EPT8O96
ERROR_!9T0_!REATE = "
ERROR_!9T0_898T = %
ERROR_!9T0_089C = &
ERROR_DP_!REATE = (
OT2ER6 = *.
8F 6Y/6=>R! H, #.
1E66A:E 8D 6Y/16:8D TYPE 6Y/16:TY 9=1>ER 6Y/16:9O
?8T2 6Y/16:<" 6Y/16:<% 6Y/16:<& 6Y/16:<(.
E9D8F. . 8F 6Y/6=>R! 9E #
!A00 1ET2OD ?_:R8D/,6ET_TA>0E_FOR_F8R6T_D86P0AY
E7PORT89:
8_6TR=!T=RE_9A1E = 6PF08
86_0AYO=T = ?A_0AYO=T
!2A9:89:
8T_O=TTA> = T_6PF08IJ
8T_F8E0D!ATA0O: = T_F8E0D_!ATA0O:
E7!EPT8O96
89<A08D_PARA1ETER_!O1>89AT8O9 = "
PRO:RA1_ERROR = %
TOO_1A9Y_089E6 = &
OT2ER6 = (.
8F 6Y/6=>R! H, #.
1E66A:E 8D 6Y/16:8D TYPE 6Y/16:TY 9=1>ER 6Y/16:9O
?8T2 6Y/16:<" 6Y/16:<% 6Y/16:<& 6Y/16:<(.
E9D8F. . 8F 6Y/6=>R! 9E #
E9D8F. . 8F ?_:R8D 86 898T8A0
Registering t-e ED8T E;ent
!A00 1ET2OD ?_:R8D/,RE:86TER_ED8T_E<E9T
E7PORT89:
8_E<E9T_8D = !0_:=8_A0<_:R8D=,1!_E<T_1OD8F8ED
E7!EPT8O96
ERROR = "
OT2ER6 = %.
8F 6Y/6=>R! H, #.
3 1E66A:E 8D 6Y/16:8D TYPE 6Y/16:TY 9=1>ER 6Y/16:9O
?8T2 6Y/16:<" 6Y/16:<% 6Y/16:<& 6Y/16:<(.
E9D8F. . 8F 6Y/6=>R! 9E #
E9D1OD=0E. . manage_al;_grid O=TP=T
3D/////////////////////////////////////////////////////////////////////3
3D 1odule 6TAT=6_#"## O=TP=T
3D/////////////////////////////////////////////////////////////////////3
T-is module is used to set t-e PF/6tatus and title bar 3
3//////////////////////////////////////////////////////////////////////3
1OD=0E 6TAT=6_#"## O=TP=T.
6ET PF/6TAT=6 A0<6_:=8.
6ET T8T0E>AR A0<_T8T0E.
E9D1OD=0E. . 6TAT=6_#"## O=TP=T
Parallel Cursor - Simple
Improving performance in Nested loop scenario's:
How ? Instead of sequential search in each loops, we will use Read table of ITAB2 and get
the SY-TABIX of that second ITAB.
Now if sy-Subrc = 0 then proceed the loop into second ITAB and use the syntax
0OOP AT 8TA>% 89TO ?A FRO1 +_TA>87.
%se if conditions inside the $oo# to chec& the &e's thereafter(
sortA lt_;bpa b$ )unnrB .6orting b$ )e$ is ;er$ important
lt_)na" b$ )unnr. .6ame )e$ +-ic- is used 'or +-ere condition is used -ere
loop at lt_;bpa into +a_;bpa.
read lt_)na" into +a_)na" . T-is sets t-e s$/tabix
+it- )e$ )unnr = +a_;bpa/)unnr
binar$ searc-.
i' s$/subrc = #. .Does not enter t-e inner loop
;_)na"_index = s$/tabix.
loop at lt_)na" into +a_)na" 'rom ;_)na"_index. .A;oiding ?-ere clause
i' +a_)na"/)unnr H, +a_;bpa/)unnr. .T-is c-ec)s +-et-er to exit out o' loop
exit.
endi'.
333333 Your Actual logic +it-in inner loop 333333
endloop. .C9A" 0oop
endi'.
endloop. . <>PA 0oop
Background Job scheduling - Interview Question
SM36 -DEFINE BACKGROUND JOB - Create background Jobs
SM37 : SIMPLE JOB SELECTION - To check status ( maintenance )
Great interview preparation and knowledge making
http://saplab.blogspot.com/2007/09/difference-with-smartforms-vs.html
http://learnabap.blogspot.com/2007/05/performance-tuning-using-parallel.html
Smartform Interview questions
Found in this site:
http://saplab.blogspot.com/2007/09/smart-forms-frequently-asked-questions.html
Smart forms Frequently Asked Questions
Forcing a page break within table loop
Create a loop around the table. Put a Command node before the table in the loop that
forces a NEWPAGE on whatever condition you want. Then only loop through a subset of
the internal table (based on the conditions in the Command node) of the elements in the
Table node.
Font style and Font size
Goto Transaction SMARTSTYLES.
There you can create Paragraph formats etc just like in sapscript.
Then in your window under OUTPUT OPTIONS you include this SMARTSTYLE and use
the Paragraph and character formats.
Line in Smartform
Either you can use a window that takes up the width of your page and only has a height of
1 mm.
Then you put a frame around it (in window output options).
Thus you have drawn a box but it looks like a line.
Or you can just draw "__" accross the page and play with the fonts so that it joins each
UNDER_SCORE.
Difference between 'form interface' and 'global definitions' in global settings of
smart forms
The Difference is as follows.
To put it very 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).
Global 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.
Smartforms function module name
Once you have activated the smartform, go to the environment -> function module name.
There you can get the name of funtion module name.
The key thing is the program that calls it. for instance, the invoice SMARTFORM
LB_BIL_INVOICE is ran by the program RLB_INVOICE.
This program uses another FM to determine the name of the FM to use itself. The key
thing is that when it calls this FM (using a variable to store the actual name), that the
parameters match the paramters in your smartform.
Another thing to note is that the FM name will change wherever the SF is transported to.
So you need to use the FM to determine the name of the SF.
Here is the code that can be use to determine the internal name of the function module:
Code:
if sf_label(1) <> '/'. " need to resolve by name
move sf_label to externalname.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = externalname
importing
fm_name = internalname
exceptions
no_form = 1
no_function_module = 2
others = 3.
if sy-subrc <> 0.
message 'e427'.
endif.
move internalname to sf_label.
endif.
It checks to see if the sf_label starts with a '/', which is how the internal names start. if it
does, the name has already been converted. If not, it calls the FM and converts the name.
You would then CALL FUNCTION sf_label.
Smartforms FAQ Part Two
Smartforms output difference
Problem with Smartforms: in a certain form for two differently configured printers,
there seem to be a difference in the output of characters per inch (the distance
between characters which gives a layout problem - text in two lines instead of one.
It happens when the two printers having different Printer Controls' if you go to SPAD Menu
(Spool Administrator Menu) you can see the difference in the Printer Control and if you
make the Printer control setting for both the printers as same. then it will be ok. and also u
have to check what is the device type used for both the output devices.
SmartForms Output to PDF
There is a way to download smartform in PDF format.
Please do the following:
1. Print the smartform to the spool.
2. Note the spool number.
3. Download a PDF file (Acrobat Reader) version of the spool by running Program
RSTXPDFT4 and entering the
noted spool number.
SmartForm Double sided printing question
Your customer wants your PO Smart Form to be able to print "Terms and
Conditions" on the back side of each page. They don't want to purchase pre-printed
forms with the company's logo on the front and terms & conditions on the back.
Now this presents an interesting problem.
Has anyone else ever had a request like this? If for example there was a 3 page PO
to be printed, they want 3 pieces of paper, the front side of each to containe the PO
information (page 1, 2, and 3) and the back side of each piece of paper to containg
the static "Terms & Conditions" information.
Anyone have a clue how to force this out?
Easy - page FRONT lists page CONTACTS as next page and CONTACTS lists FRONT as
next page. Since CONTACTS does not contain a MAIN window, it will print the contacts
info and then continue on to FRONT for the rest of the main items. Additionally, set print
mode on FRONT to D (duplex) and set CONTACTS to 'blank' (for both resource name and
print mode - this is the only way to get to the back of the page).
Transport Smart Forms
How does one transport SMARTFORM? SE01?
How do you make sure that both, the SMARTFORM & it's function module gets
transported? Or does the FM with same name gets generated automatically in the
transported client?
A smartform is transported no differently than any other object. if it is assigned to a
development class that is atteched to a transport layer, it will be transported.
The definition is transported, and when called, the function module is regenerated.
This leads to an interetsing situation. On the new machine, it is very likely the function
module name will be different than the name on the source system. Make sure, before you
call the function module, you resolve the external name to the internal name using the
'SSF_FUNCTION_MODULE_NAME' function module.
Typically, generate the SF, then use the pattern to being in the interface. Then change the
call function to use the name you get back from the above function module.
Smartforms: protect lines in main window.
How to protect lines in the main window from splitting between pages?
It was easy with SAPscript, but how to do it with SF's. For 4.7 version if you are using
tables, there are two options for protection against line break:
- You can protect a line type against page break.
- You can protect several table lines against page break for output in the main area.
Protection against page break for line types
- Double-click on your table node and choose the Table tab page.
- Switch to the detail view by choosing the Details pushbutton.
- Set the Protection against page break checkbox in the table for the relevant line type.
Table lines that use this line type are output on one page.
Protection against page break for several table lines
- Expand the main area of your table node in the navigation tree.
- Insert a file node for the table lines to be protected in the main area.
- If you have 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 Drag&Drop. Otherwise, create the
table lines as subnodes of the file.
- Choose the Output Options tab page of the file node and set the Page Protection option.
All table lines that are in the file with the Page Protection option set are output on one
page.
In 4.6, Alternatively in a paragraph format use the Page protection attribute to determine
whether or not to display a paragraph completely on one page. Mark it if you want to avoid
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.
Error handling: Conversion of Char to number exception
If you get this error
Unable to interpret "1,300 " as a number.
Runtime error : CONVT_NO_NUMBER
then use the below solution

data: i type i.
data: c(10) type c.
data: p(10) type p decimals 2.
c = '3.520,00'.
catch system-exceptions convt_no_number = 1.
p = c.
endcatch.
if sy-subrc = 1.
clear sy-subrc.
while sy-subrc = 0.
replace ',' with space into c.
endwhile.
clear sy-subrc.
while sy-subrc = 0.
replace '.' with space into c.
endwhile.
condense c no-gaps.
endif.
p = c / 100.
write:/ p.
Create Tcode for Table maintenance - Parameter transaction
Create a parameter transaction as shown below
Message class Object Locked
This happens when someone saves a single message inside their own development TR
and not an independent exclusive Message class TR.
To solve it, goto SE03 -> give MESS -> Give the class name and star as shown in the
screenshot and dont forget to select the modifiable status and remove released status.
Now execute. It will give you the requests holding the single messages. Remove them
from the development request and create/ use the exclusive message class request.

Real time issues
1. How to change the package of a program.
Goto -> Object Directory Entry.
Real Time Standard Reports Used in SAP
The following is the list of Standard reports used in sap.
2. VA05 - List of Sales Orders
3. VA25 - List of Quotations
4. VA15 - List of Inquiries
5. VF04 - Billing Due List
6. V.14 - Sales Orders / Contracts Blocked for delivery
7. V.15 - Backorders
8. VL04 - Sales Order / Purchase orders worklist
9. VF05 - General Delivery List - Outbound deliveries
10. VL06O -
11. VL06F -
BAPI's Used
BAPI_GOODSMVT_CREATE:
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = gwa_goodsmvt_header
goodsmvt_code = gwa_goodsmvt_code
testrun = g_testrun
importing
materialdocument = g_mblnr
tables
goodsmvt_item = git_goodsmvt
return = git_return.
BAPI_BATCH_CREATE:
call function 'BAPI_BATCH_CREATE'
exporting
material = gwa_pourcast-matnr
batch = gwa_pourcast-charg
plant = mchb-werks
batchattributes = lwa_batchatt
batchcontrolfields = lwa_batchattr
tables
return = git_rettab.
BAPI_TRANSACTION_COMMIT:
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
BAPI_TRANSACTION_ROLLBACK:
call function 'BAPI_TRANSACTION_ROLLBACK'.
BAPI_ROUTING_CREATE:
call function 'BAPI_ROUTING_CREATE'
exporting
testrun = g_testrun
bomusage = '1'
application = 'PP01'
importing
group = g_group
groupcounter = g_groupcounter
tables
task = git_task
"HEADER - TASK_LIST_GROUP, GROUP_COUNTER, "VALID_FROM ,TAS, PLAN,
TAS, TAS, TAS(EMPTY), "LOT_SIZE_FROM, LOT SIZE TO, DESCR
materialtaskallocation = git_materialtaskallocation
"HEADER -MATERIAL, PLAN, "VALID_FROM
operation = git_operation
"ITEMS - VALID_FROM, ACTI, CONTROL KEY, "WORK_CNT, PLANT, DESCRIPTION,
DENOMI, NOMINA, "BASE_QUANTITY, STDUNIT(KG), STD_VALUE-->UPTO 6 "MAX
* componentallocation = git_componentallocation
"VALID_FROM, ACTIVITY, "BOM_TYPE, BOM_NO, ALTERNATIVE_BOM, ITEM_ID,
ITEM_NO, PLANT, MATERIAL,
productionresource = git_productionresource
"VALID_FROM, ACTIVITY, ITEM_NO_OF_PROD, CTRL_KEY,
PRT_USAGE_VALUE_UNIT, STD_USAGE_VALUE_FOR_PRT,
"FORMULA_TOT_USAGE, PRT_CATEGORY, PRT_PLANT, EQUIPMENT
inspcharacteristic = git_inspcharacteristic
"ACTIVITY, VALID_FROM, MSTR_CHAR, PMSTR_CHAR,
CHA_MASTER_IMPORT_MODUS, TARGET_VAL, UP_TOL_MLT, "LW_TOL_LMT,
* TEXTALLOCATION =
* TEXT =
return = git_return.
UP TO 1 ROWS Example
SQL Query examples:
SELECT A~ERNAM A~EBELN A~SUBMI A~AEDAT A~ANGDT A~KDATB A~LIFNR
B~TXZ01 C~TFACTOR1 C~TFACTOR2 C~TFACTOR3 C~AMOUNT D~NAME1
INTO CORRESPONDING FIELDS OF ITAB
FROM EKKO AS A
INNER JOIN EKPO AS B
ON B~EBELN = A~EBELN
AND B~EBELP = A~LPONR
INNER JOIN ZMMTENDER AS C
ON C~TENDERNUMBER = B~EBELN
INNER JOIN LFA1 AS D
ON D~LIFNR = A~LIFNR
UP TO 1 ROWS
WHERE A~EBELN = P_RFQ_NO.
ENDSELECT.
HOW TO USE SAP GET SET PARAMETERS - GLOBAL VARIABLE
While working with SAP, many times you would have noticed screen fields getting
populated with values on its own. Want to know how? Its all by the virtue of SET/GET
parameters (also known as SPA/GPA parameters). In this post, we will make ourselves
knowledgible enough to work with these.
What are SET/GET parameters or SPA/GPA Parameters?
SET/GET Parameters or SPA/GPA parameters are the means through which you can
make use of SAP memory to pass data between different main ( external ) sessions of a
teminal ( user ) session. To elaborate a little on the terms used above, when you logon to
SAP system, you basically create a terminal or user session. This terminal session can
have multiple main or external sessions within it, which you can relate to multiple screens
opened withing one user logon. SAP Application server allocates a memory area dedicated
to each user or terminal session which can then be shared between all the main sessions
within this user session. This user-specific memory dedicated to a user session is
calledSAP memory. SET/GET parameters basically enable the exchange of data
between these external sessions within the same user session through SAP memory.
How to create SET/ GET parameters?
Before you can make use of SET/GET parameter, you will have to create one, failing which
you would get error while performing Extended Check of your program. However, you
wont get any compile time error or runtime error. SET/GET Parameters are also treated as
repository objects and have normal Object directory entry (TADIR) similar to other
repository objects. You can create SET/GET parameter using Object navigator
(transaction SE80). Just select the package under which you want to create the SET/GET
create parameter and follow the following path in the context menu obtained by right-
clicking on the package. -> Create -> Other(1) -> SET/GET Parameter ID
Create SET/GET Parameter ID
The definition of SET/GET parameters can be found in the transparent table TPARA.
How to transfer data from one external session to other using Parameter
IDs?
How to read / set values for the Parameter IDs in program?
After creating the parameter, the next step is setting the values to the created parameter
ids. You can do this using the below mentioned ABAP command.
SET PARAMETER ID parameterid FIELD dobj.
Here, parameterid is the SET/GET Parameter ID whose name should not be of more than
20 characters. dobj is a flat character type data object whose value needs to be set to the
parameter id mentioned earlier. You can read the value of any parameter id in the same or
different main/external session of the same user/terminal session using a similar ABAP
statement.
GET PARAMETER ID parameterid FIELD dobj.
Same as above, parameterid is the name of parameter id whose value needs to be
fetched and dobj is the flat character type data object to which the fetched value will be
assigned. A small example to illustrate the above statements:
REPORT ZAS04.
DATA: lv_cocd TYPE bukrs.
SET PARAMETER ID BUK FIELD 0001 .
GET PARAMETER ID BUK FIELD lv_cocd.
WRITE: Value fetched from Parameter ID BUK : , lv_cocd.
On executing this small program, you will get the following output:
Example of ABAP Statement 'SET PARAMETER ID' & 'GET PARAMETER ID'
HOW TO FIND USER EXIT
Find the User Exit Subroutines
Double click on any of these Includes that contains User-Exits. You can see
various subroutines with prefix USEREI!.
"usto#ers can insert their standard code inside these for# routines.
"usto#ers can create their own for# routines but should be$in with %&&'.
( #ore faster way to search is to search the strin$ %)ER*+R, USEREI!'
inside the pro$ra#.
USER EXIT IN DETAIL
1. What is a User Exit?
o User exits allow you to add additional functions to the S() standard.
o )ro$ra#s with user exits contain Subroutine -*or# Routines. calls at
certain points in their syntax that are identified by the prefix USEREI!.
o !he actual User Exits *or# Routines are located in an Include )ro$ra#
that has been assi$ned to a ,odule )ool )ro$ra#.. !he followin$
dia$ra# explains this/

o In the User Exits *or# Routines custo#ers can include any chan$es
-enhance#ents. that they want to #ake to the syste#. !hese includes
are always processed durin$ pro$ra# flow
o So the S() developer creates a special include in a #odule pool. !hese
includes contain one or #ore subroutines routines that satisfy the
na#in$ convention USEREI!0. !he calls for these subroutines have
already been i#ple#ented in the R12 pro$ra#.
o ( user exit is considered a modification3 since technically ob4ects in the
S() na#espace are bein$ #odified.
o (fter deliverin$ the#3 S() never alters includes created in this #anner5
if new user exits #ust be delivered in a new release3 they are placed in a
new include pro$ra#.
2. In which SAP component User Exits are primari! used?
User exits are pri#arily used in the Saes and "istribution co#ponent.
#. What are the ad$anta%es and disad$anta%es of User Exit?
Ad$anta%e/ In principle3 custo#ers can #odify anythin$ they want that is found
in the include -tables3 structures3 and so forth..
"isad$anta%e/ S() cannot check the individual enhance#ents the#selves
which often leads to errors in the enhance#ent process. (lso after up$rade3 the
inserted Userexit #odifications are usually $one. !herefore its not
reco##ended.
&. 'ow can we find o$er$iew of User Exits as we as a description of
those user exits that exist in S"?
6e can find overview of User Exits as well as a description of those user exits
that exist in SD in the S() Reference I,7 under Sales and Distribution -8
Syste# ,odification -8 User exits.
Steps/
o 7o to transaction / SP()
o 7o to Sales and Distribution -8 Syste# ,odification -8 User exits

*. 'ow do !ou find User Exit in an! transaction sa! +A,1 - .reate Saes
)rder?
Step 1/ Find the 0odue Poo Pro%ram
7o to the transaction 9 :(;< 9 "reate Sales +rder.
!hen 7o to SYS!E, in the ,enu bar and then to S!(!US fro# where we can
find the %)ro$ra# -screen.'.
Step 2/ Find the Incudes Pro%ram that contains User1Exits
Double click that %)ro$ra# -screen.'. 7enerally user-exits are always at the
start of the standard S() pro$ra#
Step #/ Find the User Exit Subroutines
Double click on any of these Includes that contains User-Exits. You can see
various subroutines with prefix USEREI!.
"usto#ers can insert their standard code inside these for# routines.
"usto#ers can create their own for# routines but should be$in with %&&'.
( #ore faster way to search is to search the strin$ %)ER*+R, USEREI!'
inside the pro$ra#.
HOW TO FIND A CUSTOMER EXIT ?
O5en 'our 5rogra! in SE@A.
Searh glo(all' for 4C%ST)*ER+,%NCTI)N4 or 4C-_E.IT4.
If there are hits, you have exits of the second generation (handled with CMOD) or a BADI
(handled with SE18/SE19).
HOW TO FIND A BADI
,IND " /"DI
These ste5s shoul" ena(le 'ou to fin" an' %ADI relate" to an' transation in a !atter of !inutes.
1) Go to the transaction SE37 to find your function module.
2) Locate the function SXV_GET_CLIF_BY_NAME.
3) Put a breakpoint there.
4) Now open a new session.
5) Go to your transaction.
6) At that time, it will stop this function.
7) Double click on the function field EXIT_NAME.
8) That will give you name of the BADI that is provided in your transaction.
OR
GOTO SE24 - CLASS BUILDER
Go the class CL_EXITHANDLER
goto its method GET_INSTANCE
and put a breakpoint in this line calling the method
CALL METHOD CL_EXITHANDLER = > GET_CLASS_NAME_BY_INTERFACE
Run any tcode and in the debugger if you enter the fieldname EXIT_NAME it will give all
the exits for this tcode.
Difference between SMOD AND CMOD ?
What is the difference between SMOD and CMOD?
CMOD is the Project Management of SAP Enhancements
(i.e., SMOD Enhancements). SMOD contains the actual enhancements and CMOD is the
grouping of those SMOD enhancements.
Enhancements are exits developed by SAP. The exit is implementerd as a call to a
function module. The code for the function module is written by the developer. You are not
writing the code directly in the function module, but in the include that is implemented in
the function module.
The naming standard of function modules for function module exits is:
EXIT_ [programname] [3 digit suffix]
The call to a functionmodule exit is implemented as:
CALL CUSTOMER.-FUNCTION [3 digit suffix ]
For Example:
The program for transaction VA01 Create salesorder is SAPMV45A
1. If you search for CALL CUSTOMER-FUNCTION program SAPMV45A you will find
( Among other user exits):
CALL CUSTOMER-FUNCTION '003'
exporting
xvbak = vbak
xvbuk = vbuk
xkomk = tkomk
importing
lvf_subrc = lvf_subrc
tables
xvbfa = xvbfa
xvbap = xvbap
xvbup = xvbup.
The exit calls function module EXIT_SAPMV45A_003
2. How to find exits
Display the program where you are searching for and exit and search for CALL
CUSTOMER-EXIT
If you know the Exit name, go to transaction CMOD. Choose menu Utillities = >SAP
Enhancements.
Enter the exit name and press enter.
You will now come to a screen that shows the function module exits for the exit.
or use this ABAP program to search for exits :-
Finding the exits of a SAP transaction code
3. Using Project management of SAP Enhancements
You want to create a project to enhance transaction VA01
- Go to transaction CMOD
- Create a project called ZVA01
- Choose the Enhancement assign radio button and press the Change button
In the first column enter V45A0002 Predefine sold-to party in sales document . Note that
an enhancement can only be used for 1 project. If the enhancement is allready in use, and
error message will be displayed
- Press Save
- Press Components. You can now see that enhancement uses user exit
EXIT_SAPMV45A_002.
- Double Click on the exit.
Now the function module is displayed. Double click on include ZXVVAU04 in the function
module
Insert the following code into the include: E_KUNNR = '2155'.
Activate the include program. Go back to CMOD and activate the project.
Goto transaction VA01 and create a salesorder. Note that Sold-to-party now automatically
is "2155"
SAP FORMS
0 Conce#ts
1.1 Modifying SAP Forms
If you want to modify SAP forms, set up your development environment as follows:
1. Make sure that no SAP-standard forms are stored as client-specific copies in your
development client. Such forms should be held only in client 000, the SAP development
and installation client. If you access an SAP-standard form from another client, then the
central copy in client 000 is used.
If you need to remove SAP-standard objects from your development client, see Notes
10388 and 3355 in the SAP Online Service System (OSS). These notes explain the
procedure for saving modified forms and then deleting all forms.
2. To modify SAP standard forms,
Copy the forms you need from client 000 to your development client.
Rename the forms using a name from the customer name reserve (names
starting with Y or Z).
Copy the forms to one of your own Y or Z development classes.
Renaming the SAP standard object makes it possible to manage and transport your
changes with the SAP workbench organizer. The organizer is not activated for SAP-
standard objects that are modified in clients other than 000.
3. To put your modifications into effect, you must also modify the ABAP print program used
to print documents that use this form. You should rename such print programs and store
them in your own Y or Z development classes.
You can use the SAP Customizing System to replace the SAP print program with your
modified print program in the affected applications
1.2 Forms: Concepts
Forms are used to control the page layout and also the text formatting in your documents.
Before formatting a document for output to the screen or to a printer, you must assign a
form to it. If you do not specify a form for a document, then the SYSTEM form is assigned
to the document by default.
Application-specific forms are used in SAP applications to specify the page layout for such
special documents as invoice or checks. These forms specify the structure of the
information on the page(s) of such a document. They define, for example, the address
header, item lines, the footer, and so on. There are two ways to format texts with forms:
In the standard !"script te#t processing ($ools tandard te#t)% you can select a
form for a document. You can then type te#t into the main window of the form and
output the document in the format defined in the form. &ord processing
'or e#ample% you can select a form for a letter. You can then type the (ody te#t of the
letter in the main window. &hen you print the letter% the default te#t elements in the
other windows of the form (heading% footer% and so on) are printed with the (ody te#t.
! document can (e generated (y a print program in one of the !"
applications. $he print program uses a form to generate the document. )ost
correspondence and document generation in the !" ystem are handled (y way of
print programs.
A print program selects the text elements that are to be printed in the windows of a form. It
may also collect information from the user or ask the user to input text directly, as in some
correspondence functions. The print program may also provide data for variables defined
in the form.
Finally, the print program uses the form to format the document for display or printing.
1.3 Client and Language Versioning: Concepts
Forms and styles are client-specific. That is, a form or style other than the SAP standard in
client 000 is available only in the client in which it was created.
Forms and styles are also language-specific. That is, the definitions and texts in a form or
style are defined for a particular language. Forms and styles can be translated using the
standard SAP translation tools.
Client 000 Defaulting: SAPscript accords forms and styles in client 000 a special status.
If a form or style that is used in a document is not available in the client in which the
document is being printed, then SAPscript checks for the form or style in client 000. If it is
found there, then the client 000 version is used to print the document.
SAP standard forms and styles are always held in client 000. You can take advantage of
the client 000 defaulting as well by storing your Yxxx and Zxxx forms and styles there. That
way, if a local version of a form or style is not present in a client, the client 000 version is
used instead.
Language rules: SAPscript uses the following rules to manage versions of forms and styles
in different languages:
$he language in which a form or style is created is its *original language.* You
can translate a form or style into other languages using !"+s translation tools.
If a form or style is needed only in its original language and need not (e
translated% then you can indicate this in the language attri(utes in the header data. $he
form or style then does not appear in wor, lists in the translation tools.
In versions other than the original language version% changes to a form or style
are limited only to translation of te#ts. -o changes to definitions and attri(utes are
permitted.
1 Com#onentes
2.1 eader !ata
You can find header data in both form and style maintenance. In style maintenance, it is
used primarily to present important information information designed to make it easier for
the end user to select a style. The header data in form maintenance, on the other hand, is
used for information and control purposes. For this reason, the header data of a form will
be described in more detail.
Below, the header data is described as it appears in the alphanumeric Form Painter.
Like the header data of a style, the header data of a form comprises two parts: the data set
by the system and the data you are expected to enter. The latter is dealt with separately.
.evice/independent entries.
.escription
! short e#planatory description of the form (also applies to the style)% designed to
ma,e selection easier for the end user.
'orm class
You can assign a form to a class to help you organi0e and search for forms. $he
default set of classes is the set of program classes in your system.
tart page
$ells the print program which page format in a form to use first for printing.
.efault paragraph
"aragraph set to 1 in standard te#t maintenance.
$a( stop
! grid set at specified intervals in all windows defined in the form. 2owever% you
should note that the ta( stops are only valid in paragraphs where you have not defined
your own ta(s.
3anguage% 4riginal language% $ranslation applic
5se these fields to record the master language and language of the current version of a
form. )ar,ing $ranslation applic ma,es the form accessi(le for translation from the
!" ystem+s translation tools (transaction 678).
.evice/dependent entries.
You can only enter values here that are supported in the R98 printer definition. If you
ma,e other entries% this leads to errors in the chec, routine.
"age format
.etermined from the spool administration ta(le with transaction "!.. )a,e sure
there is a printer assignment : there must (e an additional spool format for the printer
with the same page format.
4rientation
.epends on the page format selected. $his can also (e determined from the spool
administration ta(le. "lease note that the formats landscape and portrait are not
supported (y all printers.
3ines per inch (3"I)
;asis for converting the unit of measurement 3- in style and form maintenance. $he
value 7.00 is set (y the system% as this value is supported (y all printers.
Characters per inch (C"I)
;asis for converting the unit of measurement C2 in style and form maintenance. $he
value <0.00 is set (y the system% as this value is supported (y all printers.
'ont attri(utes
&ith these fields% you can set the default font for a form. $he default font applies if
other o(=ects do not specify a font. !"script suggests a default font% which you can
change.
2.2 Paragrap" Formats and Attri#utes
In SAPscript, paragraphs are formatted using formats and their corresponding attributes.
Text processing is simplified by the use of different paragraph attribute groups:
tandard
'ont
$a(s
4utline
There are naming conventions for paragraph tags:
$he paragraph tag can have one or two characters.
$he first character in the paragraph tag must (e a letter% the second a letter%
num(er% or (lan,> special characters are not valid.
$he paragraph format must (e identified in the .escription field.
1(1(0 Standard Paragra#h "ttri2utes
In the Standard attribute group, you find the general attributes that can be defined in
paragraph formats:
.escription
"recise e#planation of your paragraph tag% so that the user can immediately identify it.
3eft or right margin
!mount of space (etween the paragraph and the left or right (order of the form
window.
Indent first line
Indent of the first line of a paragraph. If the value is positive% it is indented to the
right% if it is negative% it is indented to the left.
If you specify a negative value% then you must place the minus sign after the num(er?
</ .
pace (efore and space after
pace (efore and space after control the amount of space (etween paragraphs. $he
actual space (etween paragraphs results from the space after the preceding paragraph
and the space (efore the following paragraph.
!lignment
!lignment of a paragraph.
o 3eft/aligned
o 36'$
o Right/aligned RI@2$
o Centered C6-$6R
o Austified ;34CB
3ine spacing
pacing (etween the lines. $he default value is < line> the 3"I value (lines per inch) in
the header data is used to calculate the line spacing.
-o (lan, lines
uppression of (lan, lines. You can control whether the (lan, lines of a paragraph
should (e suppressed in the printout or not?
o -o entry
o (lan, lines not suppressed
o C (lan, lines suppressed
"age protection
Cohesion of a paragraph. It is possi(le to determine whether or not a paragraph can (e
divided (y a page (rea,.
o -o entry
o no page protection (default)
o C all lines of the paragraph are on one page
-e#t paragraph same page
Cohesion of two ad=acent paragraphs. 2ere you can define whether the su(seDuent
paragraph should (egin on the same page (that is% at least the first line of the
su(seDuent paragraph must (e on the same page).
o -o entry
o su(seDuent paragraph is output on the same page or the ne#t page%
depending on the amount of space (default)
o C su(seDuent paragraph (egins on the same page
1(1(1 ,ont "ttri2utes for Paragra#hs
You can specify font attributes for paragraph formats. They control the font used in the
text. You can specify these attributes both for the default font in the header and for
particular paragraph formats:
'ont family
6nter a font supported in the !"script font maintenance.
'ont si0e
6nter the si0e of a character font. It is measured in <9<0 point.
;old9Italic
pecify whether to use (old/face printing or italics.
5nderlined
)ar, this attri(ute to underline entire (loc,s of te#t.
When defining a paragraph format, use More to specify these underline attributes:
pacing (etween the (ase line and the underline
$hic,ness
Intensity
Intensity is e#pressed in percent? 0 E is a (lac, underline> <00 E is no underline.
If you defined default underlining in the header, then the fields for underline attributes are
already displayed on the screen.
The following selection criteria apply to the font attributes bold, italics, and underlined:
4ff attri(ute is not set
Retain inherited
4n attri(ute is set
The combination of font family, font size, bold type attribute and italics attribute is referred
to as a system font or SAP font. To use the SAPscript font Font. Word
processing maintenance, choose Tools
1(1(3 Ta2s in Paragra#h ,ormats
You can define as many tab positions as you require for each paragraph format. The text
can be aligned in different ways:
3eft/aligned with 36'$
Right/aligned with RI@2$
Centered with C6-$6R
!t the sign with I@-
!t the comma or decimal point with .6CI)!3
You can control the tab feed in a paragraph with tab positions. The tab stops you define in
the paragraph format replace the tab spacing you defined in the header data of the form.
However, this depends on the extent to which you have defined tab stops in the paragraph
format. If there are fewer tabs in the paragraph formats than in the header data, the tab
stops of the header data are used for the rest of the line. The tab stops are represented as,
, in the text editor.
You can use different units of measurement to define a tab position:
C2 Characters
C) Centimeters
)) )illimeters
"$ "oints
$& $wips (<9F0 point)
The unit of measurement CH is converted to an absolute unit of measurement using the
CPI value (characters per inch) from the header data of the form.
1(1(4 Paragra#h and eading Num2ering
The paragraph numbering and marking attributes are used to structure texts into chapters,
subchapters, and sections. Numbering is carried out automatically by SAPscript.
You can create an outline with the entry options available:
4utline
6nter the name of the highest/level paragraph in an outline hierarchy here. $he outline
hierarchy is created (y assigning this paragraph to all outline paragraphs.
4utline level
6nter the level in the outline hierarchy. $he outline levels of the paragraphs are
num(ered upwards from <> the highest outline level therefore has the outline num(er
<.
-um(er margin
pecify the space (etween num(ering and window (order. -ote that your num(ering
may e#tend into the te#t area of the paragraph if the difference (etween the left
margin and the num(er margin is not great enough to hold the num(ering characters.
3eft9right delimiter
pecify the character that precedes or follows the num(ering.
-um(er chaining
pecify whether you want the paragraph num(ering of the paragraph to (e preceded
(y the num(ering of all higher paragraphs in the hierarchy.
Example for number chaining
&ith &ithout
@. @.
@.B B.
@.C C.
@.C.B B.
Character string
pecify the num(ering format. $he num(ering can (e assigned a different font or
character format to the rest of the paragraph.
-um(ering type
o !R!;IC
!ra(ic numerals? <% F% 8.
o C2!R 'i#ed character? letter or numeral% entered in the field
o 36$$6R 3etters? !/Z
o R4)!- Roman numerals? I% II% III% IG
Depending upon the numbering type that you select, the following attributes may also
apply:
'i#ed character
.efine the fi#ed character to (e used for num(ering. You should only ma,e an entry
in the field 'i#ed character if you have specified C2!R as the num(ering type. 'i#ed
characters include H / and o .
4utput length
6nter the num(er of characters for !ra(ic numerals.
5pper case
pecify for letters or Roman numerals.
2.3 C"aracter Formats and Attri#utes
Character formats, as opposed to paragraph attributes, allow you to format entire blocks of
text within a paragraph.
Character attribute groups can be:
tandard
'ont
When you define character formats, observe the following naming conventions:
$he character format can have one or two characters.
$he first character must (e a letter% the second a letter% num(er% or (lan,> special
characters are not valid.
6nter a simple e#planation in the field .escription. It is intended to help the user
ma,e a selection.
1(3(0 Standard "ttri2utes for Character ,ormats
)ar,er
3in,s a search ,ey to the selected character string when the end user uses this
character format. 6#amples include glossary% hyperte#t% and data element lin,s. 2ere%
selected character strings are assigned the appropriate ,ey.
;ar code
;ar code that is reDuired for certain varia(les and is ,nown to the printer% for e#ample
6!-I. $he character string is printed as a (ar code if the character string concerned is
selected.
($ools &ord processing ;ar code names% such as 6!-I% refer to system (ar
codes. $hese are defined in the !"script font maintenance 'ont).
"rotected
$he character string is not split (y a line (rea,% (ut printed together on the ne#t line.
2idden
$he character string is not printed. $he te#t is only visi(le in the te#t editor.
uperscript9su(script
$he character string is printed half a line higher or lower.
$he following options are availa(le for defining these attri(ute types?
o 4ff
!ttri(ute is not set
o Retain !ttri(ute is inherited
o 4n !ttri(ute is set
1(3(1 ,ont "ttri2utes for Character ,ormats
Font attributes can be specified for character formats as well as for paragraph formats.
You have the same options as for defining font attributes for paragraph formats.
2.$ %indo&s
Windows are defined in form maintenance. They represent areas that are positioned on
pages as page windows and in which at a later time text is printed. You must define at
least one window for each form. Otherwise, SAPscript cannot format the text.
You can assign window names and window types. However, note that you can define only
one main window per form.
Use one of these window types:
)!I-
)ain window in which continuous te#t is printed. $his is the window used (y dialog
users of a print program and form. 'or e#ample% the (ody te#t of a letter would (e
entered in )!I-.
$he te#t in the main window can e#tend over several pages. If the te#t fills one page%
output continues in the window of the ne#t and su(seDuent pages% as long as )!I-
has (een defined for these pages.
G!R
&indow with varia(le contents. $he te#t can vary on each page in which the window
is positioned. Garia(le windows are formatted for each page.
$o every window you can assign te#t% which is printed in the corresponding window
when the form is formatted. $o assign te#t% use te#t elements% which are stored with
the form.
$o create and maintain te#t elements with the !"script 6ditor% choose $e#t
elements. hould the te#t selected for the window e#ceed the window si0e% then the
te#t is cut off.
C4-$
&indow with constant contents that is formatted only once.
Currently% C4-$ windows are processed in the same way as G!R windows. You
should only use windows of type G!R.
1(4(0 Defau$t Paragra#h
For a particular window, you can override the default paragraph format that is set in the
form header. Enter the default format that should apply in the window in the Default
paragraph field in the window definition screen.
2.' Pages
You must define at least one page for every form. And you must designate a "first" page in
the form header. Otherwise text formatting is not possible. In addition, you should inform
the system which page is to be used after reaching the end of the first page. If you do not
specify a next page, the output of your text ends at the end of the current page.
To define a page, give it a name and specify attributes for it:
-ame of the ne#t page
"age counter mode
o I-C Increases the counter (y <
o 243. Counter remains unchanged
o $!R$ ets the counter to <
You can display the contents of the page counter with the system symbol&PAGE&.
-um(ering type of the page counter
o !R!;IC !ra(ic numerals
o 36$$6R 3etters
o R4)!- Roman numerals
Although CHAR is displayed as an entry option for the numbering type of the page counter,
internally CHAR is converted to ARABIC.
4utput length for page num(ering with numerals
5pper or lower case for num(ering with Roman numerals or letters
Resource name
&ith Resource name% you specify that the paper for this page should (e ta,en from a
particular paper tray at the printer.
In Resource name% enter the print control that has (een defined for switching to the
paper tray you want to use. In printer types pre/defined (y !"% these print controls
are generally as follows?
o $RY0< elect first paper tray
o $RY0F elect second paper tray (if availa(le at the printer)
o $RY08 elect third paper tray (if availa(le at the printer)
o $RY6- "rint envelopes (if availa(le at the printer)
o $RY)- witch the printer to manual paper feed (if availa(le at the
printer). $he printer pauses until you feed a sheet of paper into it.
o $RY)6 witch the printer to manual envelope feed (if availa(le at the
printer). $he printer pauses until you feed an envelope into it.
You can use all tray selection print controls except TRY03 with suitably equipped printers
that are defined with the following SAP device types: HPLJSTND, HPLJ_II, HPLJIIID,
HPLJ4, LX4039, and SNI20XX8.
You can use TRY01, TRY02, TRY03, and TRYMN on suitably equipped printers that are
defined with these device types: KYOF1000, KYOF1200, KYOFS1500.
See the spool system (transaction SPAD) to check on how your printers are defined.
"rint mode
&ith "rint mode% you can specify single/ or dou(le/sided printing for a page. You can
choose from the following values?
o J J Currently active printing mode continues unchanged.
o $he page is printed in simple# mode. $hat is% the printer should print
on only one side of the paper. If another mode was previously active% then the
printer is switched to simple# mode with the start of the page.
o . $he page is printed on the first side of a sheet in duple# mode. If
another mode was previously active% then the printer is switched to duple# mode
with the start of the pageand continues in this mode.
o $ $he page is printed on the first side of a sheet in tum(le duple# mode.
$hat is% the printer prints on (oth sides. $he page on the second side is always
inverted% so that the footer of the second page is printed opposite the header of the
first page.
o If another mode was previously active% then the printer is switched to
tum(le duple# mode with the start of the page and continues printing in this mode.
Print modes are currently supported for printers that use the PCL-5 language. These are
printers that are defined with the following SAP device types: HPLJ_II, HPLJIIID, HPLJ4,
LX4039, SNI20XX8.
See the spool system (transaction SPAD) to check on how your printers are defined.
The print controls for these functions are SPMSI (begin simplex printing); SPMDU (begin
duplex printing); SPMTU (begin tumble duplex printing); SPMFS (print on first side of sheet
in duplex or tumble duplex mode); and SPMBS (print on second side of sheet in duplex or
tumble duplex mode).
1(5(0 Defining ,o$$o6+)n Pages in Du#$e7 Print *odes
You switch to duplex or tumble duplex mode with a form page for which one of these
modes is specified. To continue printing in the current mode, for follow-on pages you must
define another page in which the Print mode field is empty. Otherwise, the following pages
after the mode switch will continue to be printed only on the front sides of new sheets of
paper.
The reason: When SAPscript sends a page with Print mode D or T to the printer, it not only
sets the print mode accordingly. To ensure that the first page in the new mode is correctly
output, SAPscript also instructs the printer to output the page on the front side of a sheet. If
SAPscript sends a sequence of D or T pages to the printer, the output is printed only on
the front side of each sheet.
You define a first page named FIRST for a form to be printed in duplex mode. You
therefore set the Print mode in FIRST to D.
To make the duplex printing work correctly, you must define a second page FOLLOWER in
which Print mode is left empty. In the form definition, you specify FOLLOWER as the
follow-on page for FIRST and for itself as well.
Your text is then printed in duplex mode. FIRST switches the printer to duplex mode and
forces printing of the first page on the front side of a new sheet. FOLLOWER accepts the
duplex mode and sends no further mode print controls to the printer. The printer therefore
alternately prints FOLLOWER pages on the fronts and backs of sheets.
1(5(1 Testing Tra' Se$ection and Print *ode Se$ection
SAP provides predefined SAPscript documents with which you can test whether tray
selection and print mode selection are working properly on your printers.
For tray selection, print the SAPscript document SAPSCRIPT-TRAYTEST, ID ST,
Language D or E.
For print mode selection, print the SAPscript document SAPSCRIPT-PRINTMODETEST,
ID ST, Language D or E.
2.( Page %indo&s
When you define page windows, the window names are linked to page names. You must
specify the position and size of the window on the assigned page.
Define the position of a window by specifying the left margin and upper margin and the
size of a window by specifying its width and height.
3eft margin
pace (etween the window and left margin of the page
5pper margin pace (etween the window and upper margin of the page
&indow width &idth of the window depending on the page format selected
&indow height 2eight of the window depending on the page format selected
Note that the width of the main window must be the same on all pages. All other window
types can have different sizes and positions on different pages.
To print multiple columns, define several main windows on a page. As text entry is
continuous, once the first main window has been filled, output continues in the second
main window.
2.) *e+t ,lements
You can define text elements (window texts) for each window. On the Form: Text
elements.Request screen, choose Edit
The print program accesses text elements by name, formats them and prints them in the
respective window. That is, the program can decide which text elements should be printed
in a particular window. It calls these text elements by name to print them. You must
therefore change text element names in the print program if you make any changes to text
element names in a form.
In the layout of a text element, you can use only the paragraph and character formats
defined in the form.
Example of a text element in an order confirmation:
;E ITEM_LI9E
IL D8%DPA/POS9RD==D8%DPA/MAT9RD==D8%DPA/AR:TXD
; D*Custo!erartilenu!(er *8%DPA/ID9:D* *DD*Position
; *8%DPA/POSEXD
This example shows a section of a main window of a form, with an item line of an order
confirmation. The /E in the tag column is used to identify the text as a text element,
ITEM_LINE is the name of the text element.
1(8(0 Defau$t Te7t E$ement
At the start of a window, you can define a text element without the /E command in the
paragraph format column. This text is always printed at the start of the window. It is not
necessary to insert this text explicitly via a print program.
2.- Main %indo&
In the definition of page windows you can define several main windows per page.
However, you must first specify an area for the main windows.
This function allows you to output text either in columns as in newspapers, or next to and
below each other as in label printing.
You can specify the size and position of this area under the group heading Area:
3eft margin
!mount of space from the left (order of the page
Right margin !mount of space from the right (order of the page
!rea width &idth of the area (reDuired entry)
!rea height 2eight of the area (reDuired entry)
To position several main windows in this area, you must assign values to the variables
under the group headings Horizontal and Vertical.
Under the group heading Horizontal, enter
pacing
2ori0ontal spacing of the main windows
-um(er -um(er of main windows (hori0ontal)
Under the group heading Vertical, enter
pacing
Gertical spacing of the main windows
-um(er -um(er of main windows (vertical)
The units of measurement which can be used in the fields Left margin, Upper margin, Area
width, Area height, and Spacing for both horizontal and vertical measurements are:
C2 Characters
C) Centimeters
3- 3ines
)) )illimeters
"$ "oints
$& $wips (<9F0 point)
For the vertical area, CH is calculated using the CPI value in the header data of the form.
LN is converted on the basis of the LPI value in the header data of the form. The field Start
position under the group heading Positions is a counter for the main windows defined in a
page window. You can use this counter to number the columns. Always enter a value
greater than or equal to 1 for the counter Start position.
If you change the counter of the form main window, the form main window can no longer
be distinguished from the main windows of the page window.
3.1 !isplaying Versions of Forms
Versions. The versionTo display the versions of a form, choose Utilities list includes the
following information:
Gersion and status?
-ew
-o active version% not availa(le for use as yet.
!ctive
$he current form is the active version% in effect in the ystem.
Revised
$he current form is (eing changed. $here are active and edit versions of the form.
$ranslated
$he current form must (e translated.
Current language ,ey
4riginal language of the form.
.escription of the form.
To display detailed information on a version of the form, put the cursor on the version and
choose Form info.
3.2 .ncluding /rap"ics
You can include graphics such as diagrams or charts in your SAPscript documents.
Typically, such graphics are included in documents by way of forms.
Graphics are uploaded either in "Baseline TIFF 6.0" format (file extension.tif on PC files) or
as printer macros. A printer macro in this case is the sequence of printer instructions
needed to print out a diagram.
Graphics and printer macros are uploaded with program RSTXLDMC into individual
standard text documents. At upload, the graphics or printer macros are converted to the
format required by the target printer, either PostScript, PCL-5 for newer Hewlett-Packard
and compatible printers, or PRESCRIBE for Kyocera printers. The resulting SAPscript
document can be printed only on the target printer type. Online display is not possible.
In a form, you might include graphics such as a company logo in the header window. You
can accommodate printing on different types of printers with separate includes for each
format in which you have uploaded graphics. If you define the includes as text elements,
then your print program can select the appropriate include depending upon the device type
of the printer that the user selects. You can determine the device type by looking up the
printer name in table TSP03 (field PADEST) and evaluating the device type (field
PATYPE).
For more information, see the report documentation for RSTXLDMC.
Using graphics in forms can greatly increase the size of print requests and therefore
seriously affect the performance of your printers. Graphics are not recommended for
printing time-critical documents.
3(1(0 %sing /o7es9 -ines9 and Shading
SAPscript provides these text commands for using boxes or frames, lines, and shading in
documents:
$he ;4C command for drawing a (o# or a hori0ontal or vertical line.
$he "4I$I4- command for specifying the starting point (the upper left
corner) of a (o# or line.
$he IZ6 command for specifying the width and height of a (o#.
3(1(1 Su##orted Printers
You can print boxes, lines, and shading on any page printer that uses one of these
SAPscript printer drivers in its device-type definition:
2"3F 2ewlett/"ac,ard 3aserAet family and compati(les
"4$ "ostcript/compati(le printers
"R6 Byocera printers ("rescri(e printer language).
3(1(3 /o7es9 -ines9 Shading: /).9 P)SITI)N9 SI:E
Use the BOX, POSITION, and SIZE commands for drawing boxes, lines, and shading to
print particular windows within a form or passages of text within a window in a frame or
with shading.
The SAP printer drivers that are based on page-oriented printers (the HP LaserJet driver
HPL2, the Postscript driver POST, the Kyocera Prescribe driver PRES) employ these
commands when printing. Line printers and page-oriented printers not supported in the
standard ignore these commands. You can view the resulting printer output in the
SAPscript print preview.
Syntax:
;, %OX EXPOSF EGPOSF E7IDT-F E-EI?-TF EHRAMEF EI9TE9SITGF
;, POSITIO9 EXORI?I9F EGORI?I9F E7I9DO7F EPA?EF
;, SIIE E7IDT-F E-EI?-TF E7I9DO7F EPA?EF
3(1(3(0 /). Command
Syntax
;, %OX EXPOSF EGPOSF E7IDT-F E-EI?-TF EHRAMEF EI9TE9SITGF
Effect: draws a box of the specified size at the specified position. Parameters: For each of
XPOS, YPOS, WIDTH, HEIGHT, and FRAME, you must specify both a measurement and
a unit of measurement. Specify the INTENSITY parameter as a percentage between 0 and
100.
C"4% Y"4
Upper left corner of the box, relative to the values of the POSITION command.
Default: Values specified in the POSITION command.
The following calculation is performed internally to determine the absolute output position
of a box on the page:
X(abs) = XORIGIN + XPOS
Y(abs) = YORIGIN + YPOS
&I.$2
Width of the box. Default: WIDTH value of the SIZE command.
26I@2$
Height of the box. Default: HEIGHT value of the SIZE command.
'R!)6
Thickness of frame. Default: 0 (no frame).
I-$6-I$Y
Grayscale of box contents as %.
Default: 100 (full black)
Measurements: You must specify decimal numbers as literal values (like ABAP numeric
constants) by enclosing them in inverted commas. Use the period as the decimal point
character. See also the examples listed below. Units of measurement: The following units
of measurement may be used:
$& (twip)
"$ (point)
I- (inch)
)) (millimeter)
C) (centimeter)
3- (line)
C2 (character).
The following conversion factors apply:
< $& K <9F0 "$
< "$ K <9LF I-
< I- K F.MN C)
< C) K <0 ))
< C2 K height of a character relative to the C"I specification in the form header
< 3- K height of a line relative to the 3"I specification in the form header
;, %OX HRAME BJ T7
Draws a frame around the current window with a frame thickness of 10 TW (= 0.5 PT).
;, %OX I9TE9SITG BJ
Fills the window background with shading having a gray scale of 10 %.
;, %OX -EI?-T J T7 HRAME BJ T7
Draws a horizontal line across the complete top edge of the window.
;, %OX 7IDT- J T7 HRAME BJ T7
Draws a vertical line along the complete height of the left hand edge of the window.
;, %OX 7IDT- *BK.L* CM -EI?-T B CM HRAME BJ T7 I9TE9SITG BL
;, %OX 7IDT- *BK.L* CM -EI?-T *B@.L* CM HRAME BJ T7
;, %OX XPOS *BJ.J* CM 7IDT- J T7 -EI?-T *B@.L* CM HRAME BJ T7
;, %OX XPOS *B@.L* CM 7IDT- J T7 -EI?-T *B@.L* CM HRAME BJ T7
Draws two rectangles and two lines to construct a table of three columns with a highlighted
heading section.
3(1(3(1 P)SITI)N Command
Syntax
;, POSITIO9 EXORI?I9F EGORI?I9F E7I9DO7F EPA?EF
Effect: Sets the origin for the coordinate system used by the XPOS and YPOS parameters
of the BOX command. When a window is first started, the POSITION value is set to refer to
the upper left corner of the window (default setting).
Parameters: If a parameter value does not have a leading sign, then its value is interpreted
as an absolute value, in other words, as a value that specifies an offset from the upper left
corner of the output page. If a parameter value is specified with a leading sign, then the
new value of the parameter is calculated relative to the old value. If one of the parameter
specifications is missing, then no change is made to this parameter.
C4RI@I-% Y4RI@I-
Origin of the coordinate system.
&I-.4&
Sets the values for the left and upper edges to match those of the current window (default
setting).
"!@6
Sets the values for the left and upper edges to match those of the current output page
(XORIGIN = 0 cm, YORIGIN = 0 cm).
;, POSITIO9 7I9DO7
Sets the origin for the coordinate system to the upper left corner of the window.
;, POSITIO9 XORI?I9 C CM GORI?I9 *C.L CM*
Sets the origin for the coordinate system to a point 2 cm from the left edge and 2.5 cm
from the upper edge of the output page.
;, POSITIO9 XORI?I9 */B.L* CM GORI?I9 /B CM
Shifts the origin for the coordinates 1.5 cm to the left and 1 cm up.
3(1(3(3 SI:E Command
Syntax
;, SIIE E7IDT-F E-EI?-TF E7I9DO7F EPA?EF
Effect: Sets the values of the WIDTH and HEIGHT parameters used in the BOX command.
When a window is first started, the SIZE value is set to the same values as the window
itself (default setting).
Parameters: If one of the parameter specifications is missing, then no change is made to
the current value of this parameter. If a parameter value does not have a leading sign, then
its value is interpreted as an absolute value. If a parameter value is specified with a leading
sign, then the new value of the parameter is calculated relative to the old value.
&I.$2% 26I@2$
Dimensions of the rectangle or line.
&I-.4&
Sets the values for the width and height to the values of the current window (default
setting).
"!@6
Sets the values for the width and height to the values of the current output page.
;, SIIE 7I9DO7
Sets WIDTH and HEIGHT to the current window dimensions.
;, SIIE 7IDT- *@.L* CM -EI?-T *K.M* CM
Sets WIDTH to 3.5 cm and HEIGHT to 7.6 cm.
;, POSITIO9 7I9DO7
;, POSITIO9 XORI?I9 /CJ T7 GORI?I9 /CJ T7
;, SIIE 7IDT- <6J T7 -EI?-T <6J T7
;, %OX HRAME BJ T7
A frame is added to the current window. The edges of the frame extend beyond the edges
of the window itself, so as to avoid obscuring the leading and trailing text characters.
3(1(4 Pre+Setting /). Position "rguments
You can use the POSITION and SIZE commands to preset some arguments in the BOX
command. POSITION presets the start point (upper left corner) of a box or line. SIZE
specifies the width and height of a box.
You can use POSITION and SIZE to preset arguments, but you can also set the start point
and size arguments of a box or line directly in the BOX command.
By default, if no positioning is specified, the upper left corner of a box or halftone or the top
of a line is aligned with current SAPscript window. That is, the upper left corner of the box,
halftone, or line starts at the upper left corner of the current window in the active form. By
default, the height and width of a box are set to the height and width of the current window.
Use POSITION and SIZE to preset the arguments in a BOX command in the following
situations:
$he ;4C command e#ceeds the <8F/character (< line in !"script) length
limitation if you specify all arguments directly in the command. You may e#ceed this
length limit if% for e#ample% you use sym(ols in a command.
By pre-setting arguments with POSITION and SIZE, you can work around the limitation on
the length of a command. You do not need to specify the preset arguments in the BOX
command.
You want to use the enhanced capa(ilities of "4I$I4- for ad=usting the
starting point of a (o# or line.
With BOX, you can specify an offset for the starting point only as a whole number (non-
negative integer). This command would print a box starting 1 CM to the right and 1 CM
down from the left upper corner of a window:
;, %OX XPOS *B* CM GPOS *B* CM
With POSITION; you can adjust the position of a line or box relative to a window much
more precisely. In the POSITION command, you can specify positive and negative offsets
and use non-integer numbers.
Example: The commands shown below position a box slightly to the left and slightly above
a window. This leaves a margin between the edge of the box and the text in the window.
;, POSITIO9 XORI?I9 */.C* CM GORI?I9 */.C* CM
;, SIIE 7IDT- *<.C* CM -EI?-T *<.C* CM
;, %OX HRAME BJ T7
(Note that the box must be enlarged to accommodate the shift. If it is not enlarged, then it
will not cover all of the window.)
You can also use POSITION to set the starting point to the upper left corner of the active
page format. Example: POSITION PAGE moves the starting point from the active window
to the active page format.
You want to use the relative si0ing capa(ilities of IZ6 to ad=ust the si0e of a
(o#% line% or halftone.
With BOX, you can make only absolute size specifications. BOX HEIGHT, for example,
overrides the default height setting to the height of the current window.
With SIZE, you can adjust the size of a box or a line with respect to its previously-set
dimensions. The following commands would, for example, draw a frame 1 CM in from the
margins of the paper:
;, POSITIO9 PA?E
;, POSITIO9 XORI?I9 B CM GORI?I9 B CM
;, SIIE PA?E
;, SIIE -EI?-T */C* CM 7IDT- */C* CM
3(1(5 %sing the Commands in Te7ts and ,orms
Since BOX, POSITION, and SIZE are text commands, you can insert them directly in a
text. However, usually you use these commands in forms, where you have better control of
how a box or line and the accompanying text fit together. SAPscript does not automatically
fill text into a box or otherwise orient text with respect to these graphical elements.
Enter the following line as a command in text in a SAPscript document. The command
draws a box of 17.5 CM length, 1 CM high, with 10% shading:
;, %OX 7IDT- *BK.L* CM -EI?-T *B* CM I9TE9SITG BJ
The left upper corner of the box is located at the left upper corner of the main window
defined in the form of the document. The text that you type in is not automatically oriented
in accordance with the box. Whether the text fits in the box or not depends on you. If you
type in three lines of text, then the bottom line of text is likely to appear below the bottom of
the box.
In a form, you can orient both text and graphical elements in the windows that you define.
You therefore have much better control of how graphics and text fit together.
3(1(; Ti#s and Guide$ines
To ensure in forms that boxes, lines, and shading fit correctly with text, follow these
guidelines:
In your form design% match graphical elements and windows to each other. ;y
default% a (o# defined in a window has the dimensions and starting point of the
window.
Defining a window for each graphical element that you want to include facilitates using
boxes, lines, and shading, since the graphical element and the window have the same
dimensions and positioning.
Example: If a window is defined with the dimensions 6 CM high and 8 CM wide, then this
statement in the text element of the window paints a 10 halftone with the same
dimensions. The shading is oriented on the upper left corner of the window.
;, %OX I9TE9SITG BJ
5se the "4I$I4- command to ad=ust the position of a (o# or line relative to a
window.
For example, these commands in a form window would allow more room above the first
line of text in the window. The box would start 0.2 CM above the top of the window.
;, POSITIO9 GORI?I9 */J.C* CM
;, SIIE -EI?-T *<J.C* CM
;, %OX I9TE9SITG L
Make sure to increase the size of the box to accommodate an offset. Otherwise, the box
will not cover all of the window.
In the example above, the SIZE command increases the height of the box by 0.2 CM to
accommodate the positioning of the box above the window.
.raw a hori0ontal line (y setting the 26I@2$ in a ;4C command to 0. .raw a
vertical line (y setting &I.$2 to 0.
;, %OX HRAME BJ T7 7IDT- J T7 -EI?-T *BJ* CM
Vertical line 10 CM long
;, %OX HRAME BJ T7 7IDT- *BJ* CM -EI?-T J T7
Horizontal line 10 CM long
!d=ust the ta(s in a window to match the position of lines and (o#es.
For example, you define a table with the commands shown below. The vertical lines in the
table are drawn in at 10 CM and 13.5 CM from the left edge of the window:
;, %OX 7IDT- *BK.L* CM -EI?-T *B@.L* CM HRAME BJ T7
;, %OX 7IDT- *BK.L* CM -EI?-T B CM HRAME BJ T7 I9TE9SITG BL
;, %OX XPOS *BJ.J* CM 7IDT- J T7 -EI?-T *B@.L* CM HRAME BJ T7
;, %OX XPOS *B@.L* CM 7IDT- J T7 -EI?-T *B@.L* CM HRAME BJ T7
In the paragraph formats that you use to fill the table, you would define tabs at the
positions shown below. With these tabs, your input would start right-justified in the first,
second, and third columns of the table. You must ensure that your input is not too long to
fit in the columns defined with the lines:
Hor!at T% Hill ta(le
Ta(s, B N.L CM RI?-T
C B@.J CM RI?-T
@ BK.J CM RI?-T

4 Design Too$s
Forms are used for the page layout of SAPscript documents. To be able to format a text for
output to the screen or printer, you must assign a form first.
If no form has been assigned to a text, the system automatically assigns the form
SYSTEM, which contains minimal definitions for text formatting.
There are two ways of formatting texts using forms:
5se the standard te#t maintenance to enter and print the te#t. You can assign
any form. You can also enter te#t via the form% for e#ample% a letter header.
5se an !;!" program to format the te#t according to an assigned form. $he
program can either dynamically print individual predefined te#t modules : te#t
elements : or transfer entire te#ts to (e printed using the form.
Observe these naming conventions for form names:
$he name must start with a letter.
$he name may contain only letters.
The characters * , & / as well as blanks are not valid.
$he name can (e up to <7 characters long.
$.1 Form Components
In the alphanumeric Form Painter, a form has the following components:
2eader data
Data related to development (created by, development class, and so on) and form
information (which elements are used) are both stored in the header data.
"aragraph formats
Paragraph formats are required in forms (as in styles) to format texts. However, they are
also used for word processing in forms, for example, to format text elements.
Character formats
You can also use character formats to format texts or paragraphs. Unlike paragraph
formats, however, they are used to format text within a paragraph.
&indows
Windows are output areas you position on the individual pages of the form. The system
then prints the contents of the windows, the text elements, into these output areas.
"ages
Most forms comprise different pages, for example, one page with the customer address,
the subsequent page containing the corresponding customer records. This implies that you
must define different output areas (windows) on different pages.
"age windows
A page window is the combination of a window and a page. You specify the dimensions of
a window and its position on a page.
$.2 Processing in 01er1ie&
Form maintenance offers three processing options:
Create9change
Change a form that already e#ists or create a new one.
.isplay
.isplay a specific form.
Catalog
.isplay all availa(le forms.
To create a form,
1. Enter the form name and fill in the header information.
2. Define any paragraph formats and character formats that you need for the form.
3. Define page formats for the form.
4. Define the windows you want to position on the pages.
5. Define text elements in windows. These are the default texts and the texts selected by
the program that can be printed in windows.
6. Specify how the windows are to be placed on the pages by defining page windows.
4(1(0 Defining eader Data
The header data of a form consist of Administration data and Basic settings.
The Administration data include Administration information and Language attributes.
In the !dministration information group% enter
'orm name
.escription
.evelopment class
In the 3ang. attri(utes (3anguage attri(utes) group% you find
4riginal language
Current language (language ,ey)
Information on the translation of the form.
tatus information a(out the current form status (active% edited% and so on).
Before entering other header data,
7. Define the paragraph formats of the form.
8. Define the character formats of the form.
9. Return to the header and complete it.
4(1(0(0 Com#$eting the eader Data "fter Defining the "ttri2utes
Header.1. Choose Goto
The Change Form Header screen appears.
The Basic data include the groups Set up page and Default values for text formatting.
In the group et up page% set defaults such as page format and page orientation.
In the group .efault values for te#t formatting% set a default paragraph% default
font% and so on.
2. Enter values in accordance with the guidelines. The fields Tab stop, Page format,
Orientation, Lines/inch, and Characters/inch are assigned default values by the system.
3. Enter the format of the pages in the header data of the form. This format can be taken
from the spool administration table using the transaction SPAD.
The system always uses these values defined in the form header if no other values are
specified for the paragraph and character format definition.
To activate the form, you must enter the First page and the Default paragraph as Basic
settings.
4(1(0(1 Passing Data to an E7terna$ Program
In the R/3 system, you can flag a form for external printing. If a form is not explicitly flagged
for external printing, the system uses application-dependent settings from Customizing.
To flag a form for external printing
Forms. Word processing 1. Choose Tools
Miscellaneous.2. In the header data, choose Attributes
In the lower part of the screen, you can now set a flag for passing data to an external
program. The flag in the form then determines whether to print via the Raw Data Interface
(RDI) or not. To overrule this setting, use the function module OPEN_FORM (see Raw
Data Interface).
4(1(1 Defining Paragra#h ,ormats
Before entering all header data on the Change Form Header screen, you must create the
form by defining paragraph and character formats. The system sends a warning if, in the
header data, you specify a paragraph or a first page that has not yet been defined.
Paragraphs.1. Choose Goto
This takes you to the input screen for paragraph formats and their standard attributes.
Create element.2. Choose Edit
A dialog box appears.
3. Enter the paragraph tag and a short description.
The paragraph tag is created. The system sets line spacing, alignment, and units of
measurement.
Font to define the font attributes for the paragraph4. Choose Attributes tags.
5. Enter values in the input-enabled fields in accordance with the guidelines.
You can overwrite the default font attributes.
Tabs to specify the tab position.6. Choose Goto
An input screen appears, where you can define the required tab positions as well as the
unit of measurement and the alignment. In the standard version, the alignment is set to
LEFT (left-aligned).
Outline to define the outline.7. Choose Attributes
Additional values are displayed that have been set by the system.
8. Enter values in the input-enabled fields. You can change the values set by the system.
9. Repeat the steps above until all paragraph formats are defined.
4(1(3 Defining Character ,ormats
Character formats in forms determine how text is formatted within paragraphs. They are a
refined form of text layout.
Character strings.1. Choose Goto
This takes you to the request screen for standard attributes of character strings.
Create element.2. Choose Edit
A dialog box appears.
3. Enter a character tag and description.
The character tag is created. The system sets all standard attributes to * . You can
overwrite this setting.
Font to define the font attributes for the character4. Choose Attributes format. Font
attributes provide a more detailed definition.
5. Enter values in the input-enabled fields.
The fields Bold, Italics, and Underlined are automatically displayed with * . You can
overwrite this with your entry.
6. Repeat the definition of character tags and their standard and font attributes until all
required character formats have been defined.
7. Save the character formats.
4(1(4 Defining Pages
You must define at least one logical page for every form. Otherwise it is not possible to
format texts. To define a page, assign a name and specify attributes.
Pages.1. Choose Goto
Create element.2. Choose Edit
3. Enter a page name and a short description in the fields Page and Description.
Input-enabled fields are displayed in the lower screen area.
4. Enter values in accordance with the guidelines for page definition.
You can overwrite the default values set in the fields Mode and Numbering type.
5. Repeat these steps until all pages are defined.
6. Save your entries.
4(1(5 Defining <indo6s
You must define at least one window for every form. Otherwise it is not possible to format
texts. Window definition involves a list of window names and corresponding window types.
Units of measurement are not taken into account here.
Windows.1. Choose Goto
This takes you to the input screen for windows. A main window (MAIN) is displayed
automatically. You can define a default paragraph here.
Create element to add new window names and types to the2. Choose Edit list.
A dialog box appears.
3. Enter a window name and description.
Input-enabled fields are displayed in the lower half of the screen. The field Description
receives the value from the dialog box, the value for the field Window type is set by the
system.
By default, the system sets VAR as the window type for windows with variable contents. If
you prefer another window type, simply overwrite this value.
4. Make your entries or changes.
You can define one standard paragraph per window in the field Default paragraph.
5. Repeat these steps for each of your windows.
6. Save your entries.
4(1(; %sing Te7t E$ements in Page <indo6s
You can define and edit text elements in windows as well as in page windows. In both
cases, the text elements are assigned to the active window. You can create several text
elements in a module.
Text elements.1. On the screen Form: Change Page Windows choose Edit
This takes you to the text editor.
2. Enter the name of the text element in the text entry area by the tag column /E .
3. Define one line in the text element for each line in the main window. A section of a text
element is shown below:
;E SPACE_LI9E
;
;E -EADER_TEXT
;, I9CL$DE *SD_R8ADORJB* O%JECT TEXT ID SD8D PARA?RAP- -T
;, I9CL$DE O%JECT 8%%: ID JJJB PARA?RAP- -T
;E ITEM_-EADER
IL Ite!==Material==Desri5tion
IP ====Ouantit'====Prie==Prie unit======8alue
; D$LI9EPKB)D
;
;E ITEM_LI9E
IL D8%DPA/POS9RD==D8%DPA/MAT9RD==D8%DPA/AR:TXD==D*Custo!erartilenu!(er
*8%DPA/ID9:D* *DD*Ite! *8%DPA/POSEXD
As you can see above, each line is defined individually.
4. Save the window texts (text elements) and return to the Form:Change Page Windows
screen.
4(1(8 Defining Page <indo6s
To define a page window, allocate a logical window to a physical page and specify the
position and size of the window (the window is logical, because you define it only once in
the entire form by specifying name and type, but not its usage). However, the size is
limited by the page format selected in the header data.
Page windows.1. Choose Goto
Create element.2. Choose Edit
A list of defined logical windows appears.
3. Select the desired window from the list.
4. Enter valid values in the fields displayed in the lower half of the screen. The unit of
measurement is set by the system.
5. Specify the position of the selected window on the page and the dimensions of the
window.
6. To define page windows for the next page, you must first select the next Page Pages
and select the next page. Then choose Goto page. Choose Goto windows and repeat
the steps above.
7. Save your form.
Delete.To delete a selected element, choose Edit
4(1(8(0 ,i$$ing Page <indo6s 6ith Te7t
When defining page windows, you can request multiple columns. Define an area on a page
and specify the position of the main windows in this area, as described in Defining Main
Windows in Page Windows.
To fill a page window with text, you can also use text elements as described in Using Text
Elements in Page Windows.
4(1(= %sing Te7t E$ements in Page <indo6s
You can define and edit text elements in windows as well as in page windows. In both
cases, the text elements are assigned to the active window. You can create several text
elements in a module.
Text elements.1. On the screen Form: Change Page Windows choose Edit
This takes you to the text editor.
2. Enter the name of the text element in the text entry area by the tag column /E .
3. Define one line in the text element for each line in the main window. A section of a text
element is shown below:
;E SPACE_LI9E
;
;E -EADER_TEXT
;, I9CL$DE *SD_R8ADORJB* O%JECT TEXT ID SD8D PARA?RAP- -T
;, I9CL$DE O%JECT 8%%: ID JJJB PARA?RAP- -T
;E ITEM_-EADER
IL Ite!==Material==Desri5tion
IP ====Ouantit'====Prie==Prie unit======8alue
; D$LI9EPKB)D
;
;E ITEM_LI9E
IL D8%DPA/POS9RD==D8%DPA/MAT9RD==D8%DPA/AR:TXD ==D*Custo!erartilenu!(er
*8%DPA/ID9:D* *DD*Ite! *8%DPA/POSEXD
As you can see above, each line is defined individually.
4. Save the window texts (text elements) and return to the Form:Change Page Windows
screen.
4(1(> Defining *ain <indo6s in Page <indo6s
Main windows in page windows allow you to format text in multiple columns. Define an
area in the page window, in which to position the main windows.
1. Create a page window and assign it to a page.
Main windows.2. Choose Edit
A dialog box appears.
3. Enter values in the fields Area width and Area height in accordance with the input
guidelines for main windows.
4. Enter values in the fields Spacing and Number in the Horizontal group if you want to use
multiple columns. You can ignore the fields in the Vertical group.
5. Determine how many columns and line areas are required for label printing. Then enter
the corresponding values in the fields in the Horizontal and Vertical groups.
The value in the field Left margin varies from main window to main window if multiple
columns are used. The following applies:
Left margin of current column
+ Window width
+ Horizontal spacing
= Left margin of next column
In label printing, the field Upper margin also varies from main window to main window:
Upper margin of current main window
+ Window height
+ Vertical spacing
= Upper margin of next main window
6. Enter a value in the field Start position.
This is a counter. Enter a starting value which is equal to or greater than 1.
The main windows are added to the list.
7. Save your form.
$.3 *est2Printing a Form
You can test a form without having to call the print program that uses it. Test print.
SAPscript presents the print selection screen soChoose Utilities that you can pick the
printer type for which the test print should be formatted.
The Test print function
.isplays or prints all pages and te#t elements that are defined in the form.
Replaces system% standard% and te#t sym(ols with their current values. "rogram
sym(ols are filled with a test value% the character C.
If you test print from the Form: Request screen, SAPscript uses the active version of a
form for the test print. If you are currently editing a form, then SAPscript uses this edit
version of the form for the test print.
Under certain conditions, texts may not be printed in Test print: This is the case, for
example, when the name of a text in an INCLUDE statement is defined with a program
symbol.
5 Re$easing ,orms
Forms must be released for the end user. Otherwise, they are not displayed to the user.
CheckChoose Form
To ensure that forms do not contain any errors, check whether all the entries have been
made and whether all entries correspond to the input conventions. The status of the check
is displayed in the line; the system informs you whether the check routine found any errors.
If the check routine was completed without any errors, you only need to activate your form.
ActivateChoose Form
The system sends a message stating whether activation was successful.
If you attempt to activate your form despite the fact that an error was found during the
check or a check was not run, the activation run is terminated. The form is not accessible
to the end user.
Forms can be processed after activation, whether this involves changes, translations, or
the deletion of an unnecessary form.
Delete. The system asks you whether youTo delete a form, choose Form really want to
delete your form in all languages. After deletion, you return to the request screen. Your
processing status is displayed in the OK line.
; S"Pscri#t Contro$ Commands
The functionality of the SAPscript editor is made available through a set of commands.
These commands give you full editing control over your text. They are executed
immediately when called.
There is, however, another kind of SAPscript command, namely the control commands.
The purpose of these is to allow control of the output formatting. These commands are not
interpreted by the SAPscript editor, but are passed through to the SAPscript Composer for
processing. The Composer is the program that converts text from the form displayed in the
editor to the form used for printing. This includes, for example, line and page formatting,
the replacement of symbols with their current values and the formatting of text according to
the paragraph and character formats specified.
(.1 Synta+ of Control Commands
SAPscript control commands are entered and edited in the text editor in the same way as a
normal line of text. They do, however, differ from normal lines of text:
6nter the paragraph format 9? in the format column to identify a control
command.
6nter the command itself in the te#t line. You will notice that all ,ey words and
other parts of the specification not given as literal values enclosed in inverted commas
are automatically converted to capital letters.
)a,e sure that a control command% together with any parameters it reDuires%
does not occupy more than a single line.
6nter only one control command in each line.
-ote that the editor formatting has no effect on lines containing control
commands.
If a control command is unknown or it contains syntax errors, the line containing it is
treated as a comment line. It is neither interpreted nor printed.
(.2 ,+plicit Page 3rea4: 5,%2PA/,
SAPscript automatically inserts a page break when the main window of a page (MAIN) is
full. You can use the NEW-PAGE command to force a page break in the text at any point
you want one. The text following this command then appears on a new page. The page
break is always performed (it is an unconditional page break).
The NEW-PAGE command completes the current page. This means that all the windows
that are still on the page are printed immediately. If you use the NEW-PAGE command
without parameters, the page defined in the current form as the next page will be taken
next. If, however, your form contains a number of different pages, then you can specify any
one of these as the next page to be used.
Syntax:
;, 9E7/PA?E E5age_na!eF
;, 9E7/PA?E
The current page will be completed and the text in the following lines will be written to the
page specified in the form.
;, 9E7/PA?E SB
As above, except that the page S1 will be taken as the next page.
If% in a -6&/"!@6 command% you specify a page not contained in the form%
the specification is ignored.
$a,e care that there are no (lan, lines immediately (efore a -6&/"!@6
command. If an implicit page (rea, occurs within the (lan, lines% an une#pected
(lan, page may (e printed.
(.3 Pre1enting Page 3rea4s: P60*,C*
You can specify, either in the style or in the form, that a particular paragraph should not be
split in two by a page break. If this page protect attribute is set, then the complete
paragraph is always printed on one page. This property applies only to that particular
paragraph.
This attribute is not intended to be used to protect all paragraphs against a page break.
The point is that a page break is by its very nature a dynamic event and the exact point at
which it occurs depends on the current state (length and contents) of the preceding text. It
is also possible that you may want to protect only certain parts of a paragraph against a
page break. One way to achieve this is to use the NEW-PAGE command immediately
before the text concerned starts. Explicitly beginning a new page at this point should
ensure that a further page break does not occur within the text. However, this technique is
not change-friendly. For example, you format your text with the help of the NEW-PAGE
command so that no page breaks occur where they should not. At a later time, you insert
or delete some lines. These changes cause all the subsequent text to be moved relative to
the printed page, and you must check each NEW-PAGE command you previously inserted
to see if it is still in the correct place.
To allow you to define the areas to be protected against a page break on an individual
basis, SAPscript provides the PROTECT.. ENDPROTECT command pair. If you enclose
the text to be protected in these commands, then SAPscript will ensure that each line of
this text is printed together on the same page. If the complete text fits in the space
remaining on the current page, then it is printed on this page just as it would be if no
PROTECT command had been used. If, however, the remaining space is not sufficient for
the text, then the PROTECT command has the same effect as a NEW-PAGE command
and text is printed on a new page.
Thus the PROTECT/ENDPROTECT commands may be regarded as a kind of conditional
NEW-PAGE command, the condition being whether or not the lines enclosed between the
two commands fit in the space remaining in the current main window.
Syntax:
;, PROTECT
,
,
;, E9DPROTECT
The text lines to be protected are enclosed between the two commands.
!n 6-."R4$6C$ command without a preceding "R4$6C$ command has no
effect.
If the terminating 6-."R4$6C$ is missing% !"script assumes it at the end of
the te#t.
"R4$6C$.. 6-."R4$6C$ command pairs cannot (e nested. If a second
"R4$6C$ command occurs (efore the first one has (een terminated (y an
6-."R4$6C$% it is ignored.
If the te#t enclosed (y a "R4$6C$.. 6-."R4$6C$ pair is itself too long for a
single page% then a page (rea, is generated immediately (efore the te#t and the te#t is
printed in the normal way. It is then unavoida(le that a page (rea, will occur at some
point within the te#t.
(.$ 5e+t Main %indo&: 5,%2%.5!0%
Each page can consist of up to 99 main windows. Each main window is assigned a
consecutive identifying number (0..98), and the windows are filled in this order. This
feature enables SAPscript to print labels and to output multi-column text. When one main
window fills up, the next main window on that page is taken, if there is a next one. A page
break is inserted after the last main window.
You can use the NEW-WINDOW command to call the next main window explicitly, even if
the current main window is not yet full. If you are in the last main window of the page, the
command has the same effect as the NEW-PAGE command.
Syntax:
;, 9E7/7I9DO7
(.' Assigning a Value to a *e+t Sym#ol: !,F.5,
Text symbols acquire their values as a result of explicit assignment.
To Symbols interactively assign text symbols, in the text editor choose Include Text.
This method is available for all text symbols belonging to a text module as well as those of
the associated form.
Values defined in this way are lost when the transaction is left. If you want to print the text
module again, then you must enter the symbol values again. The purpose of the DEFINE
command is to provide a means of making this value assignment a permanent part of the
text, so that the values are available again when the text module is called again. This
command can also be used to re-assign a new value to a text symbol half-way through the
text.
Syntax:
;, DEHI9E Ds'!(ol_na!eD 3 *value*
;, DEHI9E Dsu(+etD 3 *Gour letter of K;@;NL*
The value assigned can have a maximal length of 60 characters. It may itself contain other
symbols. A symbol contained within the value assigned to another symbol is not replaced
with its own value at the point at which the DEFINE command is executed. Rather, this
replacement is made when the symbol defined in the DEFINE command is called in the
text.
;, DEHI9E Ds'!(olBD 3 *!ail*
;, DEHI9E Ds'!(olCD 3 *SAPDs'!(olBD*
;, DEHI9E Ds'!(olBD 3 *sri5t*
&symbol2& -> SAPscript If, however, the DEFINE command is written using the ':='
character rather than the '=' character, then any symbol contained within the value being
assigned is replaced immediately with its current value. The assignment to the target
symbol is made only after all symbols in the value string are replaced with their values. The
total length of the value string may not exceed 80 characters. The target symbol must be a
text symbol, as before.
;, DEHI9E Ds'!(olBD 3 *!ail*
;, DEHI9E Ds'!(olCD ,3 *SAPDs'!(olBD*
;, DEHI9E Ds'!(olBD 3 *sri5t*
&symbol2& -> SAPmail
(.( Formatting !ate Fields: S,* !A*, MAS7
To define the formatting of date fields, use the SET DATE MASK control command.
Executing this command causes all subsequent date fields to be printed using the
specified format.
Syntax:
;, SET DATE MAS: 3 *"ate_!as1*
In the date mask, you can use the following codes:
..? day (two digits)
...? day name / a((reviated
....? day name / written out in full
))? month (two digits)
)))? month name / a((reviated
))))? month name / written out in full
YY? year (two digits)
YYYY? year (four digits)
3.? day (formatted as for the 3 option)
3)? month (formatted as for the 3 option)
3Y? year (formatted as for the 3 option)
All other characters found in a date mask are interpreted as simple text and are copied
straight into the output.
Assuming the current system date is March 1st, 1997.
;, SET DATE MAS: 3 *Hoster Cit'= MM;DD;GG*
&DATE& -> Foster City, 03/01/97
;, SET DATE MAS: 3 *MMMM DD= GGGG*
&DATE& -> March 01, 1997 The date mask may be reset to the default setting by using an
empty string:
;, SET DATE MAS: 3 * *
The abbreviated and full forms of the names of the days and months are stored in the
language dependent TTDTG table under the following keys:
EE!"CRI"$O...Odd? a((reviated day name
EE!"CRI"$O....Odd? full form of day name
EE!"CRI"$O)))Omm? a((reviated month name
EE!"CRI"$O))))Omm? full form of month name
dd: day number 01 = Monday,..., 07 = Sunday
mm: month number 01 = January,..., 12 = December
(.) Formatting *ime Fields: S,* *.M, MAS7
To format time fields to your needs, use the SET TIME MASK control command. Executing
this command causes all subsequent time fields to be printed using the specified format.
Syntax:
;, SET TIME MAS: 3 *ti!e_!as1*
In the time mask, you can use the following codes:
22 hours (two digits)
)) minutes (two digits)
seconds (two digits)
All other characters found in a time mask are interpreted as simple text and are copied
straight into the output.
Assuming the current time is 10:08:12,
;, SET TIME MAS: 3 *--,MM*
&TIME& -> 10:08
;, SET TIME MAS: 3 *-- hours MM !inutes*
&TIME& -> 10 hours 08 minutes
The time mask may be reset to the default setting by using an empty string:
;, SET TIME MAS: 3 * *
(.- Country2!ependent Formatting: S,* C085*69
The formatting for certain field types depends on the country settings. These field types
include, for example, date fields and number fields that include either a decimal point or
the thousands separator character. The formatting options defined in the user master
record are usually the ones used here. To choose a formatting option other than the one
specified in the user master record, use the SET COUNTRY control command. The
country-dependent formatting options are stored in the T005X table.
Syntax:
;, SET CO$9TRG ountr'_1e'
You can enter the country key either as a literal value enclosed in quotes or as a symbol.
;, SET CO$9TRG *CA9*
;, SET CO$9TRG Dountr'_1e'D
Use a blank country name to revert to the setting found in the user master record:
;, SET CO$9TRG * *
This SAPscript command actually calls the corresponding ABAP command internally. This
guarantees the effect of the SAPscript command to be identical with that of the ABAP
command.
If the formatting turns out not to be as required, then you should check the settings in table
T005X.
(.: Position of t"e Leading Sign: S,* S./5
The usual convention in business applications is to show the leading sign to the right of the
figure to which it applies. However, it is sometimes necessary to show the leading sign to
the left of the figure. To set the sign explicitly, use the SET SIGN control command.
Executing this command affects the formatting of all subsequent program symbols that
possess a leading sign.
Syntax:
;, SET SI?9 LEHT
The leading sign appears to the left of the number.
;, SET SI?9 RI?-T
The leading sign appears to the right of the number.
(.1; .nitiali<ing 5um#ered Paragrap"s: 6,S,*
To reset the numbering of an outline paragraph to its initial value, use the RESET control
command. If you do not use the RESET command, then the numbering of all outline
paragraphs in a text is continuous. If you specify the name of an outline paragraph in the
RESET command, then its paragraph numbering and that of subordinate paragraphs is
reinitialized.
Syntax:
;, RESET 5aragra5h_for!at
The paragraph format specifies the outline paragraph to be reset.
Assume that the paragraph N1 is defined in the style you are using. This kind of paragraph
is intended for enumerated lists and causes a sequential number to be printed.
Q Proee" as follo&s if 'ou &ant to &or1 &ith the SAP R;@ s'ste!,
9B Ensure that 'ou have a PC
9B S&ith the PC on
9B Cli1 on the SAP ion using the !ouse.
Q Gou &ill then enter the SAP logon sreen. In or"er to log on here= 'ou !ust arr' out the
follo&ing ations,
;, RESET 9B
9B Enter 'our user na!e
9B Enter 'our 5ass&or"
9B Selet the a55liation 'ou &ant to use
This text specification would be output as follows:
Proee" as follo&s if 'ou &ant to &or1 &ith the SAP R;@ s'ste!,
B. Ensure that 'ou have a PC
C. S&ith the PC on
@. Cli1 on the SAP ion using the !ouse.
Gou &ill then enter the SAP logon sreen. In or"er to log on here= 'ou !ust arr' out the
follo&ing ations,
B. Enter 'our user na!e
C. Enter 'our 5ass&or"
@. Selet the a55liation 'ou &ant to use
If there is no RESET command between the two sections, then the two lists would be
numbered in a single sequence:
Proee" as follo&s if 'ou &ant to &or1 &ith the SAP R;@ s'ste!,
B. Ensure that 'ou have a PC
C. S&ith the PC on
@. Cli1 on the SAP ion using the !ouse.
Gou &ill then enter the SAP logon sreen. In or"er to log on here= 'ou !ust arr' out the
follo&ing ations,
6. Enter 'our user na!e
L. Enter 'our 5ass&or"
M. Selet the a55liation 'ou &ant to use
(.11 .ncluding 0t"er *e+ts: .5CL8!,
To include the contents of another text into the current text, use the INCLUDE control
command. SAPscript still treats the text to be included as a separate text. The text is
copied over only at the point at which the output is formatted.
Thus the use of the INCLUDE command always ensures that the most current version of a
text is included into the output, since the text is not read and inserted until the output is
formatted.
Syntax:
;, I9CL$DE na!e EO%JECT oF EID iF ELA9?$A?E lF EPARA?RAP- 5F E9E7/PARA?RAP- n5F
You must specify the name of the text to be inserted. It can be up to 70 characters long. If
the name of the text contains spaces, then you must enclose it in quotes as a literal value.
You can, alternatively, specify the name via a symbol. All remaining parameters in the
INCLUDE command are optional. If an optional parameter is not specified, then SAPscript
uses default values as applicable for the calling environment.
;, I9CL$DE MGTEXT
The text MYTEXT is included in the language of the calling text.
;, I9CL$DE MGTEXT LA9?$A?E *E* PARA?RAP- *AB*
The text with the name MYTEXT and the language E is included, regardless of the
language of the calling text. The paragraph format A1 will be used as the standard
paragraph type for this call.
Optional parameters:
3!-@5!@6
If this parameter is not specified% then the language of the calling te#t or the form
language are used for the te#t to (e included. If the language is specified% then the te#t
will (e fetched in this language% regardless of the language of the calling te#t.
"!R!@R!"2
$he te#t to (e included is formatted using the style allocated. $he "!R!@R!"2
parameter can (e used to redefine the standard paragraph for this style for the current
call. !ll 1/paragraphs in the included te#t will then (e formatted using the paragraph
specified here.
-6&/"!R!@R!"2
$he first line of the te#t to (e included will (e given this format indicator% as long as it
is not a comment or command line. If the optional "!R!@R!"2 parameter (see
a(ove) is not specified% then all 1/paragraphs of the included te#t will also (e
formatted using the paragraph specified in the -6&/"!R!@R!"2 command.
4;A6C$
In order to completely specify a te#t% information a(out the te#t o(=ect is also
reDuired. $here are a num(er of restrictions and other rules that depend on the o(=ect
type of the calling te#t?
!ny ,ind of te#t can (e included in a form. If no o(=ect is specified% then $6C$
will (e used (standard te#ts).
In the case of a document te#t (.4B5 o(=ect)% you can include only document
te#ts. $his o(=ect type is also assumed if no o(=ect is specified in this environment.
4nly hyperte#ts and document te#ts can (e included in a hyperte#t (.Y
o(=ect). If the 4;A6C$ parameter is missing% then .Y is used as the default value.
In the other ,inds of te#t you can include only standard te#ts ($6C$ o(=ect)%
document te#ts or hyperte#ts. If there is no specification% then the default o(=ect is
$6C$.
I.
$he te#t I. is a part of the te#t ,ey% which permits further te#t o(=ects within a given
o(=ect. If no I. is specified% then the default include I. is used from the $$CI. ta(le
for the calling te#t. If there is no entry in this ta(le% then the te#t I. of the calling te#t
is used.
$he following consistency chec, is applied (oth to the I. and the o(=ect?
!ll te#t I.s are allowed in a form.
In document te#ts% only document te#ts may (e included that have te#t I.s $C
(general te#ts) or 54 (authori0ation o(=ects) and also other document te#ts with the
same te#t I. as the calling document te#t.
In .Y te#ts% all .Y te#ts can (e included% whatever I. they have.
.ocument te#ts to (e included must have one of the I.s $C or 54.
Into the other te#ts% standard te#ts with any allowa(le te#t I.% .Y te#ts with
all I.s% and document te#ts with the I.s $C and 54 can (e included.
The INCLUDE command returns a status code in the SAPSCRIPT-SUBRC symbol:
0? the te#t include was successful.
<? the command could not (e e#ecuted (ecause it contained synta# errors.
F? the rules governing the te#t to (e included were not followed (see a(ove).
This value cannot occur if the command is used in a SAPscript form.
N? the specified te#t could not (e found.
(.12 C"anging t"e Style: S*9L,
The STYLE control command allows you to change the style within a text. The new style is
in force until another STYLE command is issued. If you specify * as the name of the style,
then the system reverts to the original style.
Syntax:
;, STGLE st'le EDOMI9A9TF
;, STGLE Q
A style set with this command has no effect in a text included with INCLUDE. The system
takes the paragraph and character formats from the calling text. To use the style set with
STYLE in the INCLUDE text as well, you must add DOMINANT to the command.
If the INCLUDE text has a style assigned to it, in both cases, the system always takes the
paragraph and character formats from the directly assigned style.
(.13 Formatting Addresses: A!!6,SS
The ADDRESS - ENDADDRESS control command formats an address according to the
postal convention of the recipient country defined in the COUNTRY parameter. The
reference fields are described in the structures ADRS1, ADRS2, or ADRS3, depending on
the type of address. Either direct values or symbols may be assigned to the parameters.
Syntax:
;, ADDRESS EDELI8ERGF ETGPE tF EPARA?RAP- aF EPRIORITG 5F ELI9ES lF
;, TITLE title
;, 9AME na!eBE=na!eCE=na!e@E=na!e6FFF
;, PERSO9 na!e of natural 5erson ETITLE for! of a""ressF
;, PERSO99$M%ER nu!(er of the 5ersonen
;, DEPARTME9T "e5art!ent
;, STREET street na!e -O$SE house nu!(er
;, LOCATIO9 a""itional loation infor!ation
;, PO%OX 5o (o# ECODE 5ost o"e ; >i5 o"eF ECITG it'F
;, POSTCODE 5ost o"e ; >i5_o"e
;, CITG it'BE=it'CF
;, 9O_$PPERCASE_HOR_CITG
;, RE?IO9 ount' ; state
;, CO$9TRG rei5ient ountr' ELA9?$A?E language o"eF
;, CO$9TRG_I9_REC_LA9?
;, LA9?_HOR_CO$9TRG language 1e'
;, HROMCO$9TRG sen"er ountr'
;, ADDRESS9$M%ER a""ress nu!(er
;, E9DADDRESS
The parameter values contain both formatting and address information. The address data
are formatted for output according to the data in the following parameters:
$Y"6
'R4)C45-$RY
C45-$RY
3!-@5!@6
"RI4RI$Y
.63IG6RY
3I-6
For more information, see the documentation for the SAP function module
ADDRESS_INTO_PRINTFORM.
If DELIVERY is not specified and if a POBOX is specified, then the POBOX is used in an
address instead of a STREET.
;(03(0 Parameters
.63IG6RY
)eans that the address should (e formatted as a complete delivery address% using the
street name and num(er rather than the ".4. ;o#.
$Y"6
pecifies the type of address.
The following types are possible: 1. Normal address (ADRS1). This is the address of a
company or organization. It corresponds to the address structure that is expected in most
SAP applications. 2. Private or personal address (ADRS2). This is the address of a natural
person, a private or home address. 3. Company addressDienstadresse (ADRS3) with
contact person. This is the address of a colleague or contact within a company or
organization. The company name should be specified in the TITLE and NAME fields; the
ATTN: contact person should be named in PERSON and TITLE.
Should you enter another address type or leave the field blank, then type 1 is used for
formatting.
"!R!@R!"2
pecifies the paragraph format to (e used for outputting the address. If this parameter
is not given% the address will (e output using the default paragraph format.
"RI4RI$Y
pecifies which of the address lines may (e omitted should this (e necessary. !ny
com(ination of the following codes may (e specified. $he order in which you list the
codes determines the order in which address lines are left out.
The codes are as follows: A Title P Mandatory empty line 4 Name4 3 Name3 R Region T
Neighborhood, administrative section of a city (CITY2)l D Department L Country name C
Post code or zip code 2 Name2 B P.O. Box (Japan only) S Street name and number or
P.O. Box, depending upon DELIVERY parameter N Name and form of address of natural
person (PERSON and TITLE) I Location information in LOCATION O City
3I-6
pecifies how many lines may (e used for formatting the address. If there are too few
lines availa(le to allow all the address data to (e formatted% then the data specified in
the "RI4RI$Y parameter are omitted. If there is no 3I-6 parameter and if this
command is in a form window of a type other than )!I-% then the num(er of lines
availa(le for formatting the address are automatically calculated (ased on the current
output position and the si0e of the window.
$I$36
$itle or form of address. 5sed only with addresses of types < and 8.
-!)6
5p to four names may (e given% separated (y commas. 5sed only with addresses of
types < and 8.
"6R4-
-ame of the addressee. 5sed only for addresses of type F (private or personal
address) or type 8 (company contact address). In type 8 addresses% use "6R4- for
the name of your contact person? P!ttn? )r. Aeffries+. $he name fields should (e used
for the company address.
"6R4--5);6R
"ersonal num(er. Can (e used only for address types F or 8 (private or personal
address).
$I$36 (with "6R4-)
$itle of the addressee. Can (e used only for address types F or type 8 (private or
personal address).
.6"!R$)6-$
.epartment of the addressee. Can (e used only for address type 8 (company address).
$R66$
treet name.
2456
2ouse num(er for the corresponding street.
34C!$I4-
!dditional location information% such as the (uilding% *5pstairs !partment* and so
on. !ppears on its own line in the address.
"4;4C
". 4. ;o#
C4.6
$he post code 9 0ip code of the ". 4. ;o# if this differs from the post code 9 0ip code
of the recipient.
CI$Y
$he city in which the destination ".4. ;o# is located if this differs from the city of the
recipient.
"4$C4.6
"ost code 9 0ip code of the recipient.
CI$Y
!ddressee+s city. city< is e#pected to (e the city> cityF is the neigh(orhood or
administrative section% if reDuired.
-4O5""6RC!6O'4ROCI$Y
.efault K -4O5""6RC!6O'4ROCI$Y P P
5sually% the system prints the city and country names of foreign addresses in
uppercase ( -4O5""6RC!6O'4ROCI$Y P P ).
You can use this parameter to force the system to output city and country name
unchanged (uppercase9lowercase).
( -4O5""6RC!6O'4ROCI$Y PC+ )
R6@I4-
$his allows an administrative region% county% province% or state etc. to (e specified.
C45-$RY
pecifies the recipient country% i.e. the country according to whose postal conventions
the address is to (e formatted.
C45-$RYOI-OR6CO3!-@
$his flag tells the system to use the recipient language for the country name.
( C45-$RYOI-OR6CO3!-@ PCP)
Recipient language is not used? C45-$RYOI-OR6CO3!-@ P P )(.efault?
3!-@O'4ROC45-$RY
.efault K pace
5se this parameter to e#plicitly set the language in which to print the country name of
a foreign address. ;y default% the system uses the language of the sending country.
3!-@5!@6
3anguage code of the language of the recipient country% if it differs from that of the
recipient C45-$RY. 6#ample? addresses in wit0erland. tandard !" language
codes are used> you can display these in the initial !"script te#t processing screen or
in ta(le $00F.
'R4)C45-$RY
pecifies the language to (e used for formatting the name of the recipient country. 'or
most 6uropean countries% the recipient country is specified (y placing the
international car registration letters in front of the post code and separating them from
the post code with a hyphen. You must always specify the sender country.
!..R6-5);6R
$he num(er is used to inde# a central address file% from which the desired address is
read instead of using the set of the a(ove fields. You can find more information on
this facility in the documentation for the function module
!..R6OI-$4O"RI-$'4R).
You use this one parameter instead of the set of parameters described before.
;, ADDRESS
;, TITLE *Hir!a*
;, 9AME *Shnei"er D Co*= *Hinan>(eratung*
;, STREET *:a5italgasse @@*
;, PO%OX *BC@6L* CODE *MA6NN*
;, POSTCODE *MA@JN*
;, CITG *Mannhei!*
;, CO$9TRG *DE*
;, HROMCO$9TRG *DE*
;, E9DADDRESS
This produces the following output address:
Hir!a
Shnei"er D Co
Hinan>(eratung
Postfah BC@6L

MA6NN Mannhei!
If the DELIVERY parameter is specified on the ADDRESS command, then the street name
and number will appear in the address in place of the P. O. Box number.
Hir!a
Shnei"er D Co
Hinan>(eratung
:a5italgasse @@

MA@JN Mannhei!
SAPscript makes an internal call to the ADDRESS_INTO_PRINTFORM function module
for formatting the address. If the result is not as expected, you should check the settings
for this function module (see the function module documentation).
Setting a Header Text in the Main Window: TOP You can use the TOP.. ENDTOP control
command to specify lines of text that you want to print always at the top of the main
window. These text lines are also known as header texts. For example, you would use
header texts in the case of a very long table covering several pages of output to ensure
that the table heading information were repeated at the start of each new page of output.
Syntax:
;, TOP
,
,
;, E9DTOP
The lines of text enclosed between the two control commands will be output from now on
at the start of the main window.
An existing header text can be disabled by using the TOP.. ENDTOP command pair
without enclosing any text lines between the two command lines:
;, TOP
;, E9DTOP
Subsequent pages will contain no header text.
If the main window already contains some output then a newly specified header
te#t ta,es effect on the ne#t page only.
$he same applies to the deletion of a header te#t. If a header te#t has already
(een output on the current page then it cannot (e retracted.
2eader te#ts should not (e employed in te#ts that are printed from applications
programs% such as reminder te#ts% order te#ts. $hese applications programs can also
wor, with header te#ts via the form interface% which may lead to une#pected results.
(.1$ Setting a Footer *e+t in t"e Main %indo&: 30**0M
You can specify footer texts for the main window in a similar way to header texts. Footer
texts are always printed at the bottom of the window.
Syntax:
;, %OTTOM
,
,
;, E9D%OTTOM
The lines of text enclosed between the two control commands will be output from now on
at the bottom of the main window.
An existing footer text can be disabled by using the BOTTOM.. ENDBOTTOM command
pair without enclosing any text lines between the two command lines:
;, %OTTOM
;, E9D%OTTOM
This and subsequent pages will contain no footer text.
!ssuming there is still sufficient space in the main window% a newly specified
footer te#t will also (e printed on the current page.
'ooter te#ts should not (e employed in te#ts that are printed from applications
programs% such as reminder te#ts% order te#ts. $hese applications programs can also
wor, with footer te#ts via the form interface% which may lead to une#pected results.
(.1' Conditional *e+t: .F
You can use the IF control command to specify that text lines should be printed only when
certain conditions are met. If the logical expression contained within the IF command is
true, then the text lines enclosed by the IF... ENDIF command pair are printed. Otherwise
they are ignored.
Syntax:
;, IH on"ition
,
,
;, E9DIH
The logical expression can use the following comparison operators:
3 EO e.ual to
20
0 ?T greater than
23 LE less than or e.ual to
03 ?E greater than or e.ual to
20 9E not e.ual to
The follo&ing logial o5erators an (e use" to o!(ine on"itions,
-4$
!-.
4R
Evaluation of (oth the in"ivi"ual logial e#5ressions an" of the o!(inations of e#5ressions is
5erfor!e" stritl' fro! left to right. There are no 5ree"ene rules. %ra1ete" e#5ressions are
not su55orte".
The o!5arison is al&a's 5erfor!e" on literal values= that is= the s'!(ols are for!atte" as
harater strings (efore the' are o!5are". This is 5artiularl' signifiant in the ase of
5rogra! s'!(ols= (eause the for!atting of these !a' "e5en" on various 5ara!eters. Hor
e#a!5le= the for!atte" for! of a urren' fiel" e!5lo's a varia(le nu!(er of "ei!al 5laes
an" a varia(le R"ei!al 5ointS s'!(ol Pa 5erio" or a o!!a) "e5en"ing on the a55lia(le
urren' 1e'.
Gou an e#ten" the IH o!!an" &ith the ELSE o!!an" to allo& te#t lines to (e s5eifie" that
'ou &ant to 5rint in ase the on"ition is false. If the on"ition is true= the te#t lines enlose" ('
the IH an" ELSE o!!an"s are for!atte"T other&ise the te#t lines enlose" (' the ELSE an"
E9DIH o!!an"s are for!atte".
S'nta#,
;, IH on"ition
,
;, ELSE
,
;, E9DIH
The ELSEIH o!!an" allo&s 'ou to s5eif' !ulti5le ases.
S'nta#,
;, IH on"ition
,
;, ELSEIH on"ition
,
;, ELSE
,
;, E9DIH
Gou an use an' nu!(er of ELSEIH o!!an"s &ithin one o!5oun" IH.. E9DIH ontrol
o!!an". The use of an ELSE o!!an" is then o5tional.
You must not e#tend a condition over more than one line. ;oth the I' or 636I'
command and the attached condition must (e completely contained within a single
line.
You can nest I' commands.
You must terminate an I' command with an 6-.I' command. If you forget this%
there will (e no more output following the I' command if the condition is false.
If a synta# error occurs in the interpretation of this command% then the command is
not e#ecuted. $his may have an une#pected effect on the su(seDuent te#t output.
'or e#ample% if the I' statement is incorrect% then all following 636I' and 636
commands will (e ignored% since the opening I' command is Pmissing+. $his will
cause all the te#t lines attached to the 636I' and 636 commands to (e printed.
(.1( Finding a Matc": CAS,
The CASE o!!an" overs a s5eial ase of the !ulti5le ase IH o!!an". Rather than
allo&ing an ar(itrar' on"ition to (e teste" in eah of the in"ivi"ual ases Pas in the general
!ulti5le ase IH o!!an")= the CASE o!!an" allo&s a given s'!(ol to (e teste" against
s5eifi values until a !athing value is foun".
S'nta#,
;, CASE s'!(ol
;, 7-E9 valueB
,
;, 7-E9 valueC
,
;, 7-E9 valuen
,
;, 7-E9 OT-ERS.
,
;, E9DCASE
The s'!(ol in the CASE line is for!atte". If its value is foun" in one of the 7-E9 lines= then
the te#t lines follo&ing this 7-E9 line are 5rinte". If no !athing value is foun" then the te#t
lines enlose" (' the 7-E9 OT-ERS line an" the E9DCASE o!!an" are 5rinte". The
7-E9 OT-ERS setion is o5tional.
As &ith the IH o!!an"= the o!5arison is al&a's 5erfor!e" on literal values.
! C!6 command must (e terminated (y an 6-.C!6 command.
$he &26- 4$26R section is optional.

(.1) Calling A3AP Su#routines: P,6F06M
Gou an use the PERHORM o!!an" to all an A%AP su(routine Pfor!) fro! an' 5rogra!=
su(+et to the nor!al A%AP runti!e authori>ation he1ing. Gou an use suh alls to
su(routines for arr'ing out alulations= for o(taining "ata fro! the "ata(ase that is nee"e" at
"is5la' or 5rint ti!e= for for!atting "ata= an" so on.
PERHORM o!!an"s= li1e all ontrol o!!an"s= are e#eute" &hen a "ou!ent is for!atte"
for "is5la' or 5rinting. Co!!uniation (et&een a su(routine that 'ou all an" the "ou!ent is
(' &a' of s'!(ols &hose values are set in the su(routine.
S'nta# in a for! &in"o&,
;, PERHORM
I9 PRO?RAM
;, $SI9? DI98ARBD
;, $SI9? DI98ARCD
......
;, C-A9?I9? DO$T8ARBD
;, C-A9?I9? DO$T8ARCD
......
;, E9DPERHORM
I98ARB an" I98ARC are varia(le s'!(ols an" !a' (e of an' of the four SAPsri5t s'!(ol
t'5es.
O$T8ARB an" O$T8ARC are loal te#t s'!(ols an" !ust therefore (e harater strings.
The A%AP su(routine alle" via the o!!an" line state" a(ove !ust (e "efine" in the A%AP
re5ort 5rog as follo&s,
HORM TA%LES I9_TA% STR$CT$RE ITCSG
O$T_TA% STR$CT$RE ITCSG.
...
E9DHORM.
The values of the SAPsri5t s'!(ols 5asse" &ith ;, $SI9?... are no& store" in the internal
ta(le I9_TA% . 9ote that the s'ste! 5asses the values as harater string to the su(routine=
sine the fiel" Hel" 8AL$E in struture ITCSG has the "o!ain TDSGM8AL$E PC-AR AJ). See
the e#a!5le (elo& on ho& to aess the varia(les.
The internal ta(le O$T_TA% ontains na!es an" values of the C-A9?I9? 5ara!eters in the
PERHORM state!ent. These 5ara!eters are loal te#t s'!(ols= that is= harater fiel"s. See
the e#a!5le (elo& on ho& to return the varia(les &ithin the su(routine.
Hro! &ithin a SAPsri5t for!= a su(routine ?ET_%ARCODE in the A%AP 5rogra! OCJPERHO
is alle". Then the si!5le (aro"e ontaine" there PRHirst 5ageS= R9e#t 5ageS= RLast 5ageS) is
5rinte" as loal varia(le s'!(ol.
Definition in the SAPsri5t for!,
;, PERHORM ?ET_%ARCODE I9 PRO?RAM OCJPERHO
;, $SI9? DPA?ED
;, $SI9? D9EXTPA?ED
;, C-A9?I9? D%ARCODED
;, E9DPERHORM
;
; D%ARCODED
Co"ing of the alling A%AP 5rogra!,
REPORT OCJPERHO.
HORM ?ET_%ARCODE TA%LES I9_PAR ST$CT$RE ITCSG
O$T_PAR STR$CT$RE ITCSG.
DATA, PA?9$M LI:E SG/TA%IX= 45age nu!(er
9EXTPA?E LI:E SG/TA%IX. 4nu!(er of ne#t 5age
READ TA%LE I9_PAR 7IT- :EG RPA?ES.
C-EC: SG/S$%RC 3 J.
PA?9$M 3 I9_PAR/8AL$E.
READ TA%LE I9_PAR 7IT- :EG R9EXTPA?ES.
C-EC: SG/S$%RC 3 J.
9EXTPA?E 3 I9_PAR/8AL$E.
READ TA%LE I9_PAR 7IT- :EG R%ARCODES.
C-EC: SG/S$%RC 3 J.
IH PA?9$M 3 B.
O$T_PAR/8AL$E 3 RUS. 4Hirst 5age
ELSE.
O$T_PAR/8AL$E 3 RUUS. 49e#t 5age
E9DIH.
IH 9EXTPA?E 3 J.
O$T_PAR/8AL$E<C 3 RLS. 4Hlag, last 5age
E9DIH.
MODIHG O$T_PAR I9DEX SG/TA%IX.
E9DHORM.
(.1- .nserting Print Controls: P6.5*2C05*60L
Gou an use this o!!an" to all ertain 5rinter funtions fro! a SAPsri5t te#t. Although 'ou
annot enter ontrol haraters for the 5rinter "iretl' in 'our te#t= 'ou an "efine a 5rint ontrol
via the s5ool !aintenane transation SPAD that ontains the 5rinter o!!an"s 'ou &ant. Gou
an then all a 5rint ontrol using the PRI9T/CO9TROL SAPsri5t o!!an".
S'nta#,
;, PRI9T/CO9TROL na!e
S5eif' the na!e of the 5rint ontrol either &ith or &ithout inverte" o!!as.
The 5rint ontrol 5rinte" via PRI9T/CO9TROL shoul" al&a's (e a 5rint ontrol reate" in the
usto!er na!e area PI###) for the "evie t'5e use". $se no S### 5rint ontrols= sine their
ontents !a' (e hange" (' SAP at an' ti!e &ith a release or "river !o"ifiation. To !o"if'
SAP "evie t'5es= refer to 9ote @BMM.
The 5rinter o!!an"s in the 5rint ontrol !ust never effet the urrent 5rinter settings= sine
the SAPsri5t 5rinter "river has no infor!ation on an' hanges triggere" (' a 5rint ontrol=
&hih &oul" have to (e un"one (' o!!an"s of the "river itself. The 5rinter "river assu!es
that the 5rint ontrol has no effet on an' te#ts or gra5his 5rinte" after&ar"s.
9ever use PRI9T/CO9TROL to ontrol 5rint attri(utes overe" (' the SAPsri5t "river. To
hange suh 5rint attri(utes= use the usual !etho" of "efining for! an" st'le an" the "evie
t'5e aor"ingl'.
$he contents of the print control called are transparent to !"script. !"script
cannot chec, whether the printer commands contained in the control are correct.
$herefore% if you e#perience pro(lems when printing a te#t containing these
commands% you should first try to print the te#t without the print controls. $hen%
reintroduce the "RI-$/C4-$R43 commands one (y one until the command
causing the pro(lem is identified.
You should ensure that the printer control seDuences you define leave the printer
afterwards in a well/defined state. !"script assumes that after completing each
te#t output certain settings (for e#ample% font% current page) are still valid for
su(seDuent printing. If your printer commands change these settings without
resetting them again afterwards% the results may (e unpredicta(le.
After e#euting a PRI9T/CO9TROL o!!an"= SAPsri5t inserts a s5ae harater at the start
of the ne#t te#t line. If 'ou "o not &ant this= 'ou shoul" give this te#t line the *3* 5aragra5h
for!at.
(.1: 3o+es= Lines= S"ading: 30>= P0S.*.05= S.?,
$se the %OX= POSITIO9= an" SIIE o!!an"s for "ra&ing (o#es= lines= an" sha"ing to 5rint
5artiular &in"o&s &ithin a for! or 5assages of te#t &ithin a &in"o& in a fra!e or &ith sha"ing.
The SAP 5rinter "rivers that are (ase" on 5age/oriente" 5rinters Pthe -P LaserJet "river -PLC=
the Postsri5t "river POST= the :'oera Presri(e "river PRES) e!5lo' these o!!an"s
&hen 5rinting. Line 5rinters an" 5age/oriente" 5rinters not su55orte" in the stan"ar" ignore
these o!!an"s. Gou an vie& the resulting 5rinter out5ut in the SAPsri5t 5rint 5revie&.
S'nta#,
;, %OX EXPOSF EGPOSF E7IDT-F E-EI?-TF EHRAMEF EI9TE9SITGF
;, POSITIO9 EXORI?I9F EGORI?I9F E7I9DO7F EPA?EF
;, SIIE E7IDT-F E-EI?-TF E7I9DO7F EPA?EF
%OX Co!!an"
S'nta#
;, %OX EXPOSF EGPOSF E7IDT-F E-EI?-TF EHRAMEF EI9TE9SITGF
Effet, "ra&s a (o# of the s5eifie" si>e at the s5eifie" 5osition.
Para!eters, Hor eah of XPOS= GPOS= 7IDT-= -EI?-T= an" HRAME= 'ou !ust s5eif' (oth
a !easure!ent an" a unit of !easure!ent. S5eif' the I9TE9SITG 5ara!eter as a
5erentage (et&een J an" BJJ.
XPOS= GPOS
$55er left orner of the (o#= relative to the values of the POSITIO9 o!!an".
Default, 8alues s5eifie" in the POSITIO9 o!!an".
The follo&ing alulation is 5erfor!e" internall' to "eter!ine the a(solute out5ut 5osition of a
(o# on the 5age,
XPa(s) 3 XORI?I9 < XPOS
GPa(s) 3 GORI?I9 < GPOS
7IDT-
7i"th of the (o#. Default, 7IDT- value of the SIIE o!!an".
-EI?-T
-eight of the (o#. Default, -EI?-T value of the SIIE o!!an".
HRAME
Thi1ness of fra!e.
Default, J Pno fra!e).
I9TE9SITG
?ra'sale of (o# ontents as V.
Default, BJJ Pfull (la1)
Measure!ents, Gou !ust s5eif' "ei!al nu!(ers as literal values Pli1e A%AP nu!eri
onstants) (' enlosing the! in inverte" o!!as. $se the 5erio" as the "ei!al 5oint
harater. See also the e#a!5les liste" (elo&.
$nits of !easure!ent, The follo&ing units of !easure!ent !a' (e use",
$& (twip)
"$ (point)
I- (inch)
)) (millimeter)
C) (centimeter)
3- (line)
C2 (character).
The follo&ing onversion fators a55l',
< $& K <9F0 "$
< "$ K <9LF I-
< I- K F.MN C)
< C) K <0 ))
< C2 K height of a character relative to the C"I specification in the form header
< 3- K height of a line relative to the 3"I specification in the form header
;, %OX HRAME BJ T7
Dra&s a fra!e aroun" the urrent &in"o& &ith a fra!e thi1ness of BJ T7 P3 J.L PT).
;, %OX I9TE9SITG BJ
Hills the &in"o& (a1groun" &ith sha"ing having a gra' sale of BJ V.
;, %OX -EI?-T J T7 HRAME BJ T7
Dra&s a hori>ontal line aross the o!5lete to5 e"ge of the &in"o&.
;, %OX 7IDT- J T7 HRAME BJ T7
Dra&s a vertial line along the o!5lete height of the left han" e"ge of the &in"o&.
;, %OX 7IDT- *BK.L* CM -EI?-T B CM HRAME BJ T7 I9TE9SITG BL
;, %OX 7IDT- *BK.L* CM -EI?-T *B@.L* CM HRAME BJ T7
;, %OX XPOS *BJ.J* CM 7IDT- J T7 -EI?-T *B@.L* CM HRAME BJ T7
;, %OX XPOS *B@.L* CM 7IDT- J T7 -EI?-T *B@.L* CM HRAME BJ T7
Dra&s t&o retangles an" t&o lines to onstrut a ta(le of three olu!ns &ith a highlighte"
hea"ing setion.
;(0>(1 P)SITI)N Command
S'nta#
;, POSITIO9 EXORI?I9F EGORI?I9F E7I9DO7F EPA?EF
Effet, Sets the origin for the oor"inate s'ste! use" (' the XPOS an" GPOS 5ara!eters of
the %OX o!!an". 7hen a &in"o& is first starte"= the POSITIO9 value is set to refer to the
u55er left orner of the &in"o& P"efault setting).
Para!eters, If a 5ara!eter value "oes not have a lea"ing sign= then its value is inter5rete" as
an a(solute value= in other &or"s= as a value that s5eifies an offset fro! the u55er left orner
of the out5ut 5age. If a 5ara!eter value is s5eifie" &ith a lea"ing sign= then the ne& value of
the 5ara!eter is alulate" relative to the ol" value. If one of the 5ara!eter s5eifiations is
!issing= then no hange is !a"e to this 5ara!eter.
XORI?I9= GORI?I9
Origin of the oor"inate s'ste!.
7I9DO7
Sets the values for the left an" u55er e"ges to !ath those of the urrent &in"o& P"efault
setting).
PA?E
Sets the values for the left an" u55er e"ges to !ath those of the urrent out5ut 5age
PXORI?I9 3 J != GORI?I9 3 J !).
;, POSITIO9 7I9DO7
Sets the origin for the oor"inate s'ste! to the u55er left orner of the &in"o&.
;, POSITIO9 XORI?I9 C CM GORI?I9 *C.L CM*
Sets the origin for the oor"inate s'ste! to a 5oint C ! fro! the left e"ge an" C.L ! fro! the
u55er e"ge of the out5ut 5age.
;, POSITIO9 XORI?I9 */B.L* CM GORI?I9 /B CM
Shifts the origin for the oor"inates B.L ! to the left an" B ! u5.
;(0>(3 SI:E Command
S'nta#
;, SIIE E7IDT-F E-EI?-TF E7I9DO7F EPA?EF
Effet, Sets the values of the 7IDT- an" -EI?-T 5ara!eters use" in the %OX o!!an".
7hen a &in"o& is first starte"= the SIIE value is set to the sa!e values as the &in"o& itself
P"efault setting).
Para!eters, If one of the 5ara!eter s5eifiations is !issing= then no hange is !a"e to the
urrent value of this 5ara!eter. If a 5ara!eter value "oes not have a lea"ing sign= then its
value is inter5rete" as an a(solute value. If a 5ara!eter value is s5eifie" &ith a lea"ing sign=
then the ne& value of the 5ara!eter is alulate" relative to the ol" value.
7IDT-= -EI?-T
Di!ensions of the retangle or line.
7I9DO7
Sets the values for the &i"th an" height to the values of the urrent &in"o& P"efault setting).
PA?E
Sets the values for the &i"th an" height to the values of the urrent out5ut 5age.
;, SIIE 7I9DO7
Sets 7IDT- an" -EI?-T to the urrent &in"o& "i!ensions.
;, SIIE 7IDT- *@.L* CM -EI?-T *K.M* CM
Sets 7IDT- to @.L ! an" -EI?-T to K.M !.
;, POSITIO9 7I9DO7
;, POSITIO9 XORI?I9 /CJ T7 GORI?I9 /CJ T7
;, SIIE 7IDT- <6J T7 -EI?-T <6J T7
;, %OX HRAME BJ T7
A fra!e is a""e" to the urrent &in"o&. The e"ges of the fra!e e#ten" (e'on" the e"ges of
the &in"o& itself= so as to avoi" o(suring the lea"ing an" trailing te#t haraters.
(.2; e+adecimal !ata: ,>= ,5!,>
$se this o!!an" to sen" 5rinter o!!an"s in a 5rinter language "iretl' to a 5rinter that
su55orts that language. SAPsri5t "oes not inter5ret the "ata enlose" (' the -EX an"
E9D-EX o!!an" 5air= (ut inserts it unhange" into the out5ut strea!. This tehni.ue allo&s
o(+ets &ith a 5i#el/oriente" for!at Pfor e#a!5le= gra5his) to (e 5rinte" as 5art of a SAPsri5t
te#t. The -EX an" E9D-EX o!!an" 5air enlose the 5rinter o!!an"s an" "ata as
he#a"ei!al te#t= so that the 5rinter for!atting routines inter5ret eah suessive 5air of
haraters as a single he#a"ei!al value in the range of J to CLL. The haraters J to N an" A
to H for re5resenting the values BJ to BL are vali" he#a"ei!al haraters. The te#t !a' also
inlu"e o!!ent lines Pthese (egin &ith ;Q in the for!at olu!n)= &hih &ill not (e inter5rete"
as he#a"ei!al "ata (ut are si!5l' 5asse" over (' the for!atting routines.
S'nta#,
;, -EX ETGPE 5rinter_languageF
The -EX o!!an" "enotes the start of the he#a"ei!al "ata. Su(se.uent te#t lines are
inter5rete" as "esri(e" a(ove. If the TGPE 5ara!eter is 5resent= the "ata &ill (e sent to the
5rinter onl' if the 5rinter un"erstan"s the s5eifie" 5rinter language. The follo&ing 5rinter
languages are urrentl' su55orte", POST PPostsri5t)= PRES P:'oera Presri(e) an" PCL
P-P Printer Control Language).
;, -EX ETGPE 5rinter_languageF EXPOS #_5ositionF EGPOS '_5ositionF
The out5ut ursor is set to the a(solute 5osition in"iate" (' the s5eifie" X an" G 5osition
5ara!eters (efore the he#a"ei!al "ata is 5rinte". If either the X or the G 5osition is not
s5eifie"= then J &ill (e assu!e" for this 5ara!eter.
;, -EX ETGPE 5rinter_languageF E-EI?-T heightF ELEHT left_in"entationF
The -EI?-T 5ara!eter "eter!ines the a!ount of s5ae to (e reserve" on the 5age for the
out5ut of the he#a"ei!al "ata. An' te#t follo&ing the E9D-EX o!!an" &ill (e 5rinte" (elo&
this 5oint. If the LEHT 5ara!eter is also s5eifie"= then the out5ut of the he#a"ei!al "ata &ill
is in"ente" fro! the left !argin (' the s5eifie" a!ount.
;, -EX TGPE PCL -EI?-T *K.L* CM LEHT *C.CL* CM
;Q Creator, re5ort IO89TE@J "ate BNN6JKJL ti!e BCLBCN user SAPSCRIPT
;3 B%CAKC@J6MB%CAK6@K@LLCB%CAKC@B6BB%CAMC@J6DB%CAMC@6@JLKHHHHHHHHHHHH
;3 HHB%CAMC@6@JLKHHHHHHHHHHHHCJJJKDJJDHCJHKDJJJJJJJJJJJJJJJJJJJJJJJBK
;, E9D-EX
This "ata is 5rinte" onl' (' an -P PCL 5rinter Pfro e#a!5le= -P LaserJet). K.L ! of s5ae is
alloate" on the 5age for the out5ut of the "ata an" the out5ut ursor is in"ente" C.CL ! to the
right of the for! &in"o& e"ge.
Gou an use the RSTXLDMC 5rogra! to u5loa" orretl' for!atte" 5i#el "ata to the R;@
s'ste! an" to 5re5are it as a -EX/E9D-EX ontrol o!!an". This an then (e save" as
nor!al SAPsri5t te#t.
(.21 Summing a Program Sym#ol: S8MM.5/
The S$MMI9? o!!an" is use" for au!ulating a total value for a 5rogra! s'!(ol. The
o!!an" shoul" (e s5eifie" +ust one. Then= eah ti!e the s5eifie" 5rogra! s'!(ol is
for!atte"= its urrent value is a""e" into the total s'!(ol. Several 5rogra! s'!(ols !a' all (e
a""e" into a single total s'!(ol.
S'nta#,
;, S$MMI9? 5rogra!_s'!(ol I9TO total_s'!(ol
SAPsri5t annot reate the fiel" for the total "'na!iall'. The s'!(ol use" !ust (e "efine" in
a TA%LES struture in the alling 5rogra!.
Hor "etails on su!!ing an" arr'ing for&ar"= see Su!!ing an" Carr'ing Hor&ar" is Inorret.
;(10(0 Summing and Carr'ing ,or6ard is Incorrect
Assu!e that for a !ulti5le/5age invoie= 'ou &ant to 5rint the urrent total as arr' for&ar"
a!ount or su(total on the urrent 5age an" on the su(se.uent 5age. -o&ever= the arr'
for&ar" a!ount is inorret or !issing.
The follo&ing auses are 5ossi(le,
You do not use program sym(ols with .ictionary reference for totalling.
You place the carry forward amount into the ;4$$4) area. !"script processes
the ;4$$4) area at the (eginning of a page> therefore it is not suited for carry
forward amounts.
If you place the carry forwards amount into the $4" area of the main window on
the su(seDuent page% the carry forward amount may (e higher than it should (e?
$his happens if the last part of te#t of the previous page does not fit onto the
page% (ut the te#t is held together% for e#ample% (y a "R4$6C$ command. In this
case% a local te#t sym(ol must receive the carry forward amount.
Gou !ust 5lae the arr' for&ar" a!ount on the urrent 5age into a &in"o& of t'5e 8AR. On
the su(se.uent 5age= use a loal te#t s'!(ol to 5rint the a!ount in the TOP area of the !ain
&in"o&, B. At the (eginning of the for! !ain te#t P(efore 5rinting the first te#t ele!ent)= "efine
the a!ount varia(le an" the total varia(le P(oth !ust (e 5rogra! s'!(ols or Ditionar' a!ount
fiel"s). In the e#a!5le (elo&= &e use the S$MMI9? o!!an" to "eter!ine that for eah
out5ut of DS$MTA%/AMO$9TD the s'ste! auto!atiall' su!s u5 the a!ount in the total
varia(le DS$MTA%/TOTALD. At the en" of the 5age= DS$MTA%/TOTALD ontains the arr'
for&ar" a!ount of the urrent 5age or the gran" total= res5etivel'. In this e#a!5le= &e also
"efine a loal s'!(ol DLASTPA?ED to 5rint the gran" total on the last 5age.
;, S$MMI9? DS$MTA%/AMO$9TD I9TO DS$MTA%/TOTALD
;, DEHI9E DLASTPA?ED 3 R R
C. At the en" of the for! !ain te#t P&hen 5rinting the last te#t ele!ent of the !ain &in"o&)= set
the loal te#ts'!(ol DLASTPA?ED to a "ifferent value= suh as RXS,
;, DEHI9E DLASTPA?ED 3 RXS
@. To 5rint the arr' for&ar" a!ount in the TOP area of the su(se.uent 5age inlu"ing the 5re/
te#t *Carr' for&ar"* an" a ta(= &e use the loal te#t s'!(ol DCARRG. The orres5on"ing te#t
ele!ent is also "efine" in the !ain &in"o&,
;E CARRG
Q DSCarr' for&ar",==SCARRGD

PCALL H$9CTIO9 7RITE_HORM EXPORTI9? ELEME9T 3 RCARRGS TGPE 3 RTOPS)
6. Define the arr' for&ar" &in"o& on the urrent 5age as t'5e 8AR an" 5osition it at the en"
of the !ain &in"o& of the 5age. Print the arr' for&ar" a!ount there an" "efine the loal te#t
s'!(ol DCARRGD to 5rint the a!ount again in the TOP area of the su(se.uent 5age. $se the
loal te#t s'!(ol DLASTPA?ED to 5rint the gran" total on the last 5age. The arr' for&ar"
&in"o& then ontains the follo&ing te#t P"efine it as 5aragra5h TB &ith ta(),
;, IH DLASTPA?ED 3 RXS
TB ?ran" total,==DS$MTA%/TOTALD
;, ELSE
TB Carr' for&ar",==DS$MTA%/TOTALD
;, DEHI9E DCARRGD 3 DS$MTA%/TOTALD
;, E9DIH


8 S"Pscri#t S'm2o$s
Te#t in the SAP s'ste! "oes not usuall' e#ist in"e5en"entl' of other o(+ets= (ut often ontains
a referene to so!e other store" o(+et. Hor e#a!5le= for a letter this oul" (e the a""ress "ata
in the ven"or !aster reor" or infor!ation in the !aterial !aster reor" that is to (e inlu"e" in
a 5urhase or"er te#t. Gou solve this 5ro(le! (' using 5laehol"ers for the "ata rather than
entering the atual values into the te#t. Thus= 'ou an reate fle#i(le te#t !o"ules (' using
these 5laehol"ers at all 5oints &here the te#t nee"s to (e varia(le. Sine !uh of the "ata to
(e inserte" in the te#t reflets the ontents of fiel"s in SAP ta(les= this tehni.ue ensures that
the te#t !o"ules al&a's ontain the urrent values of these fiel"s &hen 5rinte".
In SAPsri5t= these 5laehol"ers are 1no&n as s'!(ols. The' re5resent "ata that &ill not (e
a""e" to the te#t until a later 5oint. This is nor!all' the 5oint at &hih the out5ut is for!atte".
All s'!(ols ourring in the te#t are then re5lae" &ith their urrent values. This re5lae!ent is
5erfor!e" onl' in the out5ut te#t. The original version of the te#t !o"ule is unaffete".
SAPsri5t reogni>es four "ifferent 1in"s of s'!(ols,
ystem sym(ols
tandard sym(ols
"rogram sym(ols
$e#t sym(ols.
The !ain "ifferene (et&een these is the soure of their values. SAPsri5t 5rovi"es values for
the s'ste! s'!(ols. Stan"ar" s'!(ols an" their values are "efine" in the TTDT? ta(le.
Progra! s'!(ols re5resent "ata su55lie" (' the 5rogra! that is urrentl' e#euting. The
values for te#t s'!(ols o!e either fro! ontrol o!!an"s in the te#t itself or are su55lie"
"'na!iall' (' the Inlu"e funtion in the te#t e"itor.
SAPsri5t auto!atiall' reogni>es the t'5e of a s'!(ol. Hirst of all= it he1s &hether the
s'!(ol is a s'ste! s'!(ol. If not= then it he1s &hether the s'!(ol na!e is "efine" in the
"ata area of the alling 5rogra!. In this ase= it is a 5rogra! s'!(ol. Other&ise= SAPsri5t
rea"s ta(le TTDT?. If the s'!(ol is foun" in this ta(le= then it is a stan"ar" s'!(ol. If a s'!(ol
is neither a s'ste! s'!(ol nor a 5rogra! s'!(ol nor a stan"ar" s'!(ol= then it is a te#t
s'!(ol.
).1 Synta+ of Sym#ols
Eah s'!(ol has a na!e that is use" &hen the s'!(ol is alle". A all to a s'!(ol is nor!all'
!a"e in a line of te#t that also inlu"es other 1in"s of te#t. Therefore it is neessar' that
s'!(ols an (e "istinguishe" fro! nor!al te#t= an" that the all is struture" in suh a &a' that
it is 5ossi(le to i"entif' it as a all to a s'!(ol.
5se the delimiter Q (oth immediately (efore and after the sym(ol.
.o not use (lan, characters in the name of a sym(ol. )oreover% since the
characters JH() are used for defining formatting options% you must not use any of
these a sym(ol name either.
)a,e sure that no !"script editor line (rea, occurs (etween the sym(ol
delimiters. If necessary% use a long line to avoid this (paragraph format K or 9K).
6nclose additional formatting options in round (rac,ets and insert them
immediately after the sym(ol name. $he code letters identifying these options
must (e given in capitals.
A string that "oes not satisf' all the a(ove on"itions is not inter5rete" as a s'!(ol (ut is
o5ie" "iretl' into the out5ut te#t.
E#a!5les of vali" s'!(ols,
Ds'!(olD
DMG_s'!(olD
D:9AB/9AMEBD
DDATED
D:9AB/$MSATPI)D
E#a!5les of invali" s'!(ols,
D!'s'!(ol losing "eli!iter !issing
D!' s'!(olD na!e ontains (lan1s
D!'s'!(ol)D na!e ontains an invali" harater
Ds'!(olPID losing (ra1et of for!atting o5tion !issing
D:9AB/$MSATPi)D for!atting o5tion not in a5itals
The s'!(ol na!es the!selves are not ase/sensitive= that is= SAP sri5t "oes not "istinguish
(et&een a5ital an" lo&er ase letters in s'!(ol na!es. These s'!(ol na!es are i"ential,
D!'s'!(olD
DM's'!(olD
DMGSGM%OLD
A s'!(ol na!e an ontain a !a#i!u! of B@J haraters. -o&ever= onl' the first @C
haraters are use" for uni.ue i"entifiation.
).2 System Sym#ols
Gou an use s'ste! s'!(ols in all 1in"s of te#t. SAPsri5t su55lies the values for s'ste!
s'!(ols. The na!es of the s'ste! s'!(ols are fi#e".
8(1(0 Current Date
DDATED
The urrent "ate is "is5la'e". It is for!atte" aor"ing to the s5eifiations foun" in the user
!aster "ata. Gou an a"a5t this for!at to 'our o&n re.uire!ents (' s5eif'ing a "ate !as1
PSET DATE MAS:) or (' using a ountr'/s5eifi for!atting o5tion PSET CO$9TRG).
The urrent value for this s'!(ol is ta1en fro! the SG/DAT$M fiel". This value is not o5ie"
ever' ti!e that the "ate is alle"= (ut onl' at the follo&ing ti!es,
&hen printing starts (4"6-O'4R)% "RI-$O$6C$)
&hen sym(ols are replaced in the te#t editor
&hen a te#t is e#ported in the !CII or R$' format
&hen the $6C$OY);43OR6"3!C6 function module is called (optional)
8(1(1 Current Da' Num2er
DDAGD
The urrent "a' nu!(er is 5rinte". The "is5la' inlu"es lea"ing >eros.
8(1(3 Current *onth Num2er
DMO9T-D
The urrent !onth nu!(er is 5rinte". The "is5la' inlu"es lea"ing >eros.
8(1(4 Current ?ear Num2er
DGEARD
This s'!(ol is use" to 5rint the urrent 'ear as a four "igit nu!(er.
8(1(5 Current Da' Name @-ong ,ormA
D9AME_OH_DAGD
The na!e of the urrent "a' is &ritten out in full. The language use" for the out5ut is
"eter!ine" (' the a55ro5riate te#t language or for! language. The na!es of the "a's are
store" in the TTDT? ta(le un"er the 1e' VVSAPSCRIPT_DDDD_""= &here "" is the "a'
nu!(er PJB3 Mon"a'=..= JK 3 Sun"a').
8(1(; Current *onth Name @-ong ,ormA
D9AME_OH_MO9T-D
The na!e of the urrent !onth is &ritten out in full. The language use" for the out5ut is
"eter!ine" (' the a55ro5riate te#t language or for! language. The na!es of the !onths are
store" in the TTDT? ta(le un"er the 1e' VVSAPSCRIPT_MMMM_!!= &here !! is the
!onth nu!(er PJB=..= BC).
8(1(8 Current Time
DTIMED
The urrent ti!e is 5rinte" in the for! hours,!inutes,seon"s. Eah of the o!5onents for
hours= !inutes= an" seon"s onsists of t&o "igits= using a lea"ing >ero if neessar'. Gou an
a"a5t this for!at to 'our o&n re.uire!ents (' s5eif'ing a ti!e !as1 PSET TIME MAS:).
The value for the ti!e fiel" is ta1en fro! the SG/$IEIT fiel". This value an (e o5ie" over
onl' at 5artiular ti!es P.f. DATE ).

8(1(= ours Com#onent of Current Time
D-O$RSD
The o!5onent of the urrent ti!e referring to hours is 5rinte". The "is5la' inlu"es lea"ing
>eros.
8(1(> *inutes Com#onent of Current Time
DMI9$TESD
The o!5onent of the urrent ti!e referring to !inutes is 5rinte". The "is5la' inlu"es lea"ing
>eros.
8(1(0B Seconds Com#onent of Current Time
DSECO9DSD
The o!5onent of the urrent ti!e referring to seon"s is 5rinte". The "is5la' inlu"es lea"ing
>eros.
8(1(00 Current Page Num2er
DPA?ED
Gou an use this s'!(ol to insert into the te#t the 5age nu!(er that the urrent 5age &ill have
&hen 5rinte". Gou an s5eif' the for!atting o5tion for the 5age nu!(er in the for! for eah
5age t'5e.
8(1(01 Page Num2er of the Ne7t Page
D9EXTPA?ED
This s'!(ol is use" to 5rint the nu!(er of the follo&ing 5age. The out5ut for!at is the sa!e as
&ith DPA?ED .
9ote that on the last 5age of the out5ut= in eah &in"o& that is not of t'5e MAI9=
D9EXTPA?ED has the value J.
8(1(03 Se$ected Device T'#e
DDE8ICED
The DDE8ICED s'!(ol is use" to 5rint the t'5e of the out5ut "evie. This t'5e is 5asse" in the
DE8ICE 5ara!eter &hen the SAPsri5t out5ut POPE9_HORM= PRI9T_TEXT) is starte"= an" it
s5eifies the "evie for &hih the out5ut shoul" (e for!atte".
Possi(le values are,
PRI9TER
SCREE9
TELEX
TELEHAX
A%AP PA%AP list "is5la')
8(1(04 S#aces
DSPACED
Gou an use this s'!(ol to generate a string of s5ae haraters. Gou !ust 5ass the nu!(er
of s5ae haraters re.uire" &ith the s'!(ol. If 'ou leave out the nu!(er= then no s5aes are
5rinte".
8(1(05 %nder$ine
D$LI9ED
Gou an use this s'!(ol to insert a string of un"erline haraters into the out5ut te#t. Gou !ust
5ass the nu!(er of un"erline haraters re.uire" &ith the s'!(ol. If 'ou leave out the nu!(er=
then +ust one un"erline harater is 5rinte".
8(1(0; Vertica$ -ine
D8LI9ED
Gou an use this s'!(ol to insert a string of vertial line haraters into the out5ut te#t. Gou
!ust 5ass the nu!(er of vertial line haraters re.uire" &ith the s'!(ol. If 'ou leave out the
nu!(er= then +ust one vertial line harater is 5rinte".

).3 Program Sym#ols
The integration of SAPsri5t allo&s to lin1 "ata that is store" in various a55liations of the SAP
s'ste! into te#t !o"ulesT for e#a!5le a for! letter to (e sent to several usto!ers. The
a""ress infor!ation of these usto!ers is in the SAP "ata(ase an" !ust (e inor5orate" into
the letter. SAPsri5t annot rea" this "ata out of the SAP "ata(ase itself= (ut has to all another
5rogra! to "o this. The "ata is then o5ie" into &or1 areas "elare" &ith TA%LES.
Starting &ith Release @.B?= 'ou are no longer restrite" to the TA%LES state!ent. Gou an
a""ress an' glo(al varia(le using a 5rogra! s'!(ol. The s'ste! an evaluate the A%AP
Ditionar' infor!ation Pout5ut length= nu!(er of "ei!al 5laes= an" so on) not onl' for
TA%LES fiel"s= (ut also for I9HOTGPES fiel"s an" varia(les &ith a LI:E referene.
E#a!5le,
DATA, MGCO$9TRG LI:E $SRJ@/LA9DB.
The s'ste! onsi"ers all out5ut harateristis that an (e retrieve" using the A%AP state!ent
DESCRI%E.
If SAPsri5t is no& alle" fro! this 5rogra! to for!at a te#t= it an o5' the "ata out of these
&or1 areas.
S'!(ols that o(tain their values fro! this 1in" of "ata area are alle" 5rogra! s'!(ols. The
value of a 5rogra! s'!(ol is li!ite" u5 to a !a#i!u! of CLL haraters. The na!e of a
5rogra! s'!(ol= &hen using TA%LES state!ents= onsists of the ta(le na!e an" the fiel"
na!e= se5arate" (' a h'5hen. E#a!5les of usto!er a""ress fiel"s are, D:9AB/9AMEBD=
D:9AB/ORTJBD= D:9AB/PHAC-D. Other&ise= the s'!(ol is use" in the &a' it is "efine" in
the 5rint 5rogra! Pfor e#a!5le= DMGCO$9TRG). 7hen SAPsri5t enounters a s'!(ol= it first
he1s &hether the s'!(ol is a s'ste! s'!(ol. If it fin"s no orres5on"ing entr'= it tries to fin"
a ta(le or struture in the alling A%AP 5rogra! P"elare" &ith TA%LES). If there is= the s'!(ol
is a 5rogra! s'!(ol an" SAPsri5t ne#t he1s in the Ditionar' to see &hether this ta(le
ontains the s5eifie" fiel".
If there is no ta(le or struture in the alling A%AP 5rogra!= SAPsri5t he1s &hether the
s'!(ol is a stan"ar" s'!(ol. If no entr' is foun" in ta(le TTDT?= the s'ste! he1s the alling
5rogra! for glo(al "efinitions PDATA= CO9STA9TS= I9HOTGPE= PARAMETER). If it fin"s an'
"efinitions= SAPsri5t 5roesses the s'!(ol as 5rogra! s'!(ol.
Onl' if no glo(al "efinitions are foun" either= "oes SAPsri5t 5roess the s'!(ol as te#t
s'!(ol.
%asiall'= a "efine" te#t s'!(ol re!ains a te#t s'!(ol even if in the 5rint 5rogra!= for e#a!5le=
a DATA state!ent &ith the sa!e na!e is use".
Hor re5laing the varia(les= the se.uene of the varia(les in the orres5on"ing te#t is "eisive.
Hor!;te#t,
....
;, DEHI9E D!'s'!(olD 3 Ra(S
Q D!'s'!(olD
....
Print 5rogra!,
....
Data, !'s'!(olPL) value R#'>S.
....
In this e#a!5le= in the for!;te#t instea" of D!'s'!(olD the value of the te#t s'!(ol "efine"
&ith DEHI9E is 5rinte", a(
Hor!;te#t,
....
Q D!'s'!(olD
;, DEHI9E D!'s'!(olD 3 Ra(S
....
Print 5rogra!,
....
Data, !'s'!(olPL) value R#'>S.
....
In this e#a!5le= in the for!;te#t instea" of D!'s'!(olD the value of the 5rogra! s'!(ol
"efine" in the 5rint 5rogra! is 5rinte", #'>
$suall'= SAPsri5t loo1s for the ta(le &or1 areas an" the glo(al varia(les in the !ain 5art of
the A%AP 5rogra! that &as starte". Hor e#a!5le= if 'ou all funtion !o"ules that 'ou &ant to
use the ta(le &or1 areas= enter the na!e of the orres5on"ing 5rogra! in the fiel"
TDPRO?RAM of the struture 'ou an enter in the OPTIO9S 5ara!eter at OPE9_HORM. This
"efinition is then vali" for all 5rogra! s'!(ols u5 to the ne#t CLOSE_HORM. -o&ever= 'ou an
also s5eif' the na!e of the 5rogra! in the PRO?RAM 5ara!eter of the START_HORM
funtion !o"ule. If 'ou "o this= it &ill (e vali" u5 to the ne#t E9D_HORM. If this 5ara!eter is
not set in START_HORM= then the setting in OPE9_HORM a55lies.
Hor for!atting a 5rogra! s'!(ol= SAPsri5t uses the s5eifiations foun" in the Ditionar'
Pout5ut length= for!atting routine= an" so on). Certain "ata t'5es re.uire a""itional infor!ation
out of other fiel"s to for!at a value. Hor e#a!5le= the ontents of a urren' fiel" an (e
for!atte" orretl' onl' &hen the infor!ation fro! the urren' fiel" 1e' is also availa(le.
SAPsri5t itself is res5onsi(le for o(taining the neessar' infor!ation fro! the Ditionar'.
Hor 5rinting the 5rogra! s'!(ols= SAPsri5t uses the 7RITE state!ent of the A%AP
5rogra!!ing language. The effet of this state!ent is ontrolle" e#ternall' via 5ara!eters
Psuh as s5eifiations in the user !aster reor"= ta(le TJJLX)= "e5en"ing on the "ata t'5e. If
a 5rogra! s'!(ol is not 5rinte" in the &a' 'ou e#5ete" it= first he1 &hether the ontrol
5ara!eters state" a(ove are set orretl'.
To fiel"s of the ta(le &or1 areas sho&n (elo&= 'ou an refer in all SAPsri5t te#t !o"ules,

8(3(0 S?ST: S'stem ,ie$ds in the "/"P Programming Environment
Gou an refer to all the fiel"s in this ta(le. Gou shoul"= ho&ever= note that so!e of the fiel"s are
s5eifi to a ertain environ!ent. The' ontain values that "o not o!e fro! 'our a55liation
(ut have (een set (' the SAPsri5t 5rogra!!ing environ!ent Pfor e#a!5le= SGST/REPID).
8(3(1 %SRB3: %ser "ddress Data
This struture ontains infor!ation fro! the user !aster reor" for a given user,
;usiness address
$elecommunication (telephone% telefa#)
4ther data such as user language% department% cost center.
Gou an !aintain the ontents of these fiel"s in the RA""ressS setion of the user !aintenane.
If this ta(le e#ists in the alling 5rogra!= then SAPsri5t o5ies the "ata fro! the &or1 area of
this 5rogra!. Other&ise= SAPsri5t uses the values for the urrentl' ative user.
8(3(3 S"PSCRIPT: Genera$ S"Pscri#t ,ie$ds
Gou an 5rint the follo&ing fiel"s of struture SAPSCRIPT as 5rogra! s'!(ols in SAPsri5t
for!s,
Q!"CRI"$/5;RCQ?
Reeives a value after e#euting an I9CL$DE state!ent. The value sho&s &hether the
I9CL$DE &as foun" Pthat is= the I9CL$DE te#t e#ists) or not. Gou an .uer' this value in an IH
state!ent.
I9CL$DE &as foun", DSAPSCRIPT/S$%RCD 3 J
I9CL$DE &as not foun", DSAPSCRIPT/S$%RCD 3 6.
Q!"CRI"$/.RIG6RQ?
SAPsri5t for!ats a te#t for a s5eifi out5ut "evie. The initial for!atting is in"e5en"ent of the
s5eifi language of this "evie. SAPsri5t then alls a "river to onvert the "evie/in"e5en"ent
for!at to "evie/s5eifi ontrol o!!an"s. This fiel" ontains the na!e of the "river.
"4$ "ostscript driver
2"3F 2" 3aser=et driver for the "C3N9"C3M languages
"R6 .river for output devices using the "R6CRI;6 language
The availa(le "rivers are store" in ta(le TSPJN.
Q!"CRI"$/'4R)"!@6Q? $his field contains a num(er representing the total
num(er of pages of the currently formatted form (any output (etween
$!R$O'4R) and 6-.O'4R)). $he page counter mode ($!R$% I-C%
243.) of the individual pages is ignored. You can use this sym(ol to formulate
information li,e P"age # of y+ for your output.
Q!"CRI"$/A4;"!@6Q? $his field contains a num(er representing the total
num(er of pages of all forms contained in the currently formatted print reDuest% in
other words% of all forms created using the 4"6-O'4R)% $!R$O'4R)..
6-.'4R)% $!R$O'4R).. 6-.O'4R)%...% C346O'4R) function
modules.
7hen using the SAPSCRIPT/HORMPA?ES or SAPSCRIPT/JO%PA?ES s'!(ols= SAPsri5t
lea"s all out5ut 5ages of the urrent for! or urrent 5rint re.uest into !ain !e!or' to re5lae
the s'!(ol (' the a55ro5riate value. Hor large out5ut +o(s= this an !ean a ver' large a!ount
of !e!or'.
Q!"CRI"$/C45-$6RO#Q (# K 0.. R)? $hese fields represent ten counter
varia(les that you can use in your te#t and forms for any counting purposes. You
can use the PH+ and P/+ formatting options to increment or decrement a counter
(efore its value is printed. You can use the .6'I-6 control command to assign
any specific value to a counter.
Q!"CRI"$/$6363!-.Q? $his field contains the country ,ey of the fa#
target address when using fa# output via !"script (field I$C"4/$.$6363!-.
of parameter 4"$I4- of function module 4"6-O'4R)).
Q!"CRI"$/$636-5)Q? $his field contains the local fa# num(er of the fa#
target address when using fa# output via !"script (field I$C"4/$.$636-5)
of parameter 4"$I4- of function module 4"6-O'4R)).
Q!"CRI"$/$636-5)6Q? $his field contains the complete fa# num(er of
the fa# target address when using fa# output via !"script (field I$C"4/
$.$636-5)6 of parameter 4"$I4- of the function module 4"6-O'4R)).
).$ Standard Sym#ols
Stan"ar" s'!(ols are "efine" in ta(le TTDT?. This ta(le ontains (oth the na!e of eah
s'!(ol an" its value. The value= &hih is language/"e5en"ent= an ontain u5 to MJ
haraters. SAP su55lies this ta(le fille" &ith stan"ar" entries. Gou an e#ten" it &ith
usto!er/s5eifi s'!(ols.
Gou an use stan"ar" s'!(ols in all 1in"s of te#t.
).' *e+t Sym#ols
All s'!(ols that "o not orres5on" to one of the three t'5es of s'!(ol "esri(e" a(ove are te#t
s'!(ols. Gou "efine the value of a te#t s'!(ol 'ourself in the te#t !o"ule.
There are t&o &a's of "oing this,
K In ym(ols $e#t. the te#t editor% choose Include
All the te#t s'!(ols ontaine" either in the urrent te#t or in a for! assigne" to the te#t are
"is5la'e". Gou an assign a value of u5 to MJ haraters to a te#t s'!(ol. Enter this value in
the sa!e for! as it is to a55ear in the out5ut.
The effet of assigning a value is te!5orar'= sine the values assigne" are not store" &ith the
te#t (ut are lost as soon as 'ou leave the e"itor. Gou use this 1in" of value assign!ent if 'ou
ha" a rea"'/!a"e te#t ontaining s'!(ols that 'ou &ant to 5rint &ith s5eifi values in 5lae of
the s'!(ols= an" 'ou &ant to "o this onl' one &ithout storing the Rhange"S te#t.
In the te#t% use the control command .6'I-6.
Sine ontrol o!!an"s are store" &ith the te#t !o"ule= an' value 'ou assign in this &a' is
5reserve" &hen 'ou save the te#t. Gou an hange the value assigne" to a s'!(ol in the te#t
at an' ti!e si!5l' (' issuing another DEHI9E o!!an".
Re!e!(er al&a's to use the * Pinverte" o!!a) harater to "eli!it a value. The !a#i!al
length for these values is also MJ haraters.
A te#t in the e"itor ontains the follo&ing DEHI9E o!!an"s,
;, DEHI9E D!'s'!(olD 3 *### ### ##### ####*
D!'s'!(olD
;, DEHI9E D!'s'!(olD 3 *''''' ''' ''''*
; D!'s'!(olD
The 5rinte" te#t a55ears li1e this,
### ### ##### ####
''''' ''' ''''
).( Formatting 0ptions
The value of a s'!(ol is nor!all' 5rinte" using its full length= although trailing s5aes are
re!ove". An e#e5tion are 5rogra! s'!(ols of these "ata t'5es, C$RR= DEC= O$A9= I9TB
I9TC= I9T6= PREC= an" HLTP. These are for!atte" right/+ustifie" &ith an out5ut length as
s5eifie" in the Ditionar'.
Gou an a"a5t the stan"ar" for!atting to 'our o&n re.uire!ents (' using one of the a""itional
for!atting o5tions availa(le. Gou su55l' the 5ara!eters for these o5tions together &ith the
s'!(ol itself. Man' of these o5tions are a((reviate" to a single letter= &hih has to (e given as
a a5ital letter. Gou an o!(ine t&o or !ore o5tions on a single s'!(ol= as long as the result
still !a1es sense.
8(;(0 )ffset
S5eif'ing an offset has the effet that a ertain nu!(er of ('tes of the s'!(ol value= starting
&ith the first ('te on the left= &ill not (e "is5la'e". If the offset s5eifie" is greater than the
length of the value= nothing is 5rinte".
S'nta#
Ds'!(ol<offsetD
If 20 has the value BC@6LMKAN= the follo&ing &ill (e "is5la'e",
Ds'!(olD /0 BC@6LMKAN
Ds'!(ol<@D /0 6LMKAN
Ds'!(ol<KD /0 AN
Ds'!(ol<BCD /0
Ds'!(ol<JD /0 BC@6LMKAN
8(;(1 )ut#ut -ength
If 'ou nee" onl' a 5art of the s'!(ol value= or the out5ut has to fit into a (o# or a fiel" on the
sreen &ithout overla55ing the e"ges of this area= then 'ou an use an out5ut length
s5eifiation to "efine ho& !an' ('tes of the value shoul" (e o5ie".
S'nta#
Ds'!(olPlength)D
If 20 has the value BC@6LMKAN.
Ds'!(olP@)D /0 BC@
Ds'!(olPK)D /0 BC@6LMK
Gou an o!(ine an out5ut length s5eifiation &ith an offset s5eifiation. The s5eifie"
length is then ounte" fro! the s5eifie" offset 5osition.
Ds'!(ol<6P@)D /0 LMK
If a length s5eifie" is greater than the urrent length of the value= then s5aes are a55en"e" to
the s'!(ol value.
Gou an use the harater Q to s5eif' the length of a 5rogra! s'!(ol. The value of the s'!(ol
is then 5rinte" using the out5ut length "efine" in the A%AP Ditionar'.
S'nta#
Ds'!(olPQ)D
The SGST/$9AME fiel" ontains the logon na!e of a user alle" Einstein . The Ditionar'
entr' for this fiel" ontains an out5ut length of BC.
DSGST/$9AMED... /0 Einstein...
DSGST/$9AMEPN)D... /0 Einstein...
DSGST/$9AMEPQ)D... /0 Einstein ...

8(;(3 )mitting the -eading Sign
Progra! s'!(ols &ith nu!eri values an have a lea"ing sign. This sign usuall' a55ears to the
right of the nu!eri value= either as a s5ae for 5ositive nu!(ers= or as a !inus sign for
negative nu!(ers . Gou an use t he S o5tion to ensure that the value is for!atte" &ithout the
sign .
S'nta#
Ds'!(olPS)D
The ITCDP/TD$LPOS fiel" ontains the value /BJJ.JJ. The A%AP Ditionar' "efinition for this
fiel" inlu"es a lea"ing sign.
DITCDP/TD$LPOSD /0 BJJ.JJ/
DITCDP/TD$LPOSPS)D /0 BJJ.JJ
8(;(4 -eading Sign to the -eft
The lea"ing sign is nor!all' "is5la'e" to the right of a nu!eri value= e#e5t in the ase of a
floating 5oint nu!(er. This o5tion ena(les 'ou to s5eif' that the lea"ing sign shoul" (e 5lae"
to the left of the nu!(er.
S'nta#
Ds'!(olP2)D

DITCDP/TD$LPOSD /0 BJJ.JJ/
DITCDP/TD$LPOSP2)D /0 /BJJ.JJ
The SET SI?9 LEHT ontrol o!!an" s5eifies that all su(se.uent s'!(ols &ith a nu!eri
value shoul" have a left/+ustifie" lea"ing sign. If 'ou use this ontrol o!!an"= 'ou !ust no
longer re5eat the 20
8(;(5 -eading Sign to the Right
The "efault setting is to 5rint the lea"ing sign to the right of a nu!eri value. If 'ou use" the
SET SI?9 LEHT ontrol o!!an" to s5eif' that the lea"ing sign shoul" (e 5rinte" in front of
the value= 'ou an overri"e this s5eifiation for in"ivi"ual s'!(ols. The s'!(ols s5eifie" &ith
the 0 o5tion are then 5rinte" &ith the lea"ing sign to the right.
S'nta#,
Ds'!(olP0)D
Gou an use the SET SI?9 RI?-T ontrol o!!an" to s&ith (a1 to the "efault setting for
the out5ut of the lea"ing sign.
8(;(; )mitting -eading :eros
Certain s'!(ol values are 5rinte" &ith lea"ing >eros. If 'ou &ant to su55ress these= use the I
o5tion.
S'nta#
Ds'!(olPI)D
Assu!ing the urrent "ate is B.B.BNN6=
DDAGD /0 JB
DDAGPI)D /0 B
8(;(8 S#ace Com#ression
The s'!(ol value is vie&e" as a se.uene of R&or"sS= eah se5arate" fro! the ne#t (' either
one or a string of s5ae haraters. The C o5tion has the effet of re5laing eah string of
s5ae haraters &ith a single s5ae an" shifting the R&or"sS to the left as neessar' to lose
u5 the ga5s. Lea"ing s5aes are o!5letel' re!ove". The results are the sa!e as those of the
A%AP o!!an" CO9DE9SE. S'nta#,
Ds'!(olPC)D
Assu!ing * Al(ert Einstein * is the s'!(ol value=
Ds'!(olD /0 Al(ert Einstein
Ds'!(olPC)D /0 Al(ert Einstein

8(;(= Num2er of Decima$ P$aces
A 5rogra! s'!(ol of one of the "ata t'5es DEC= O$A9= an" HLTP an ontain "ei!al 5lae
"ata. $se the o5tion (elo& to overri"e the Ditionar' "efinition for the nu!(er of "ei!al 5laes
for the for!atting of this s'!(ol value.
S'nta#
Ds'!(olP.9)D
The E:PO/ME9?E fiel" ontains the value BC@6.LM. The Ditionar' "efinition s5eifies @
"ei!al 5laes an" an out5ut length of BK.
DE:PO/ME9?ED /0 B=C@6.LMJ
DE:PO/ME9?EP.B) /0 B=C@6.M
DE:PO/ME9?EDP.6) /0 B=C@6.LMJJ
DE:PO/ME9?EDP.J) /0 B=C@L
8(;(> )mitting the Se#arator for CThousandsD
S'!(ols of the DEC= C$RR= I9T= an" O$A9 "ata t'5es are nor!all' for!atte" &ith the a
Rthousan"sS se5arator harater. The T o5tion allo&s 'ou to o!it this se5arator harater.
S'nta#,
Ds'!(olPT)D
The E:PO/ME9?E fiel" ontains the value BC@6.LM. The Ditionar' "efinition s5eifies @
"ei!al 5laes an" an out5ut length of BK.
DE:PO/ME9?ED /0 B=C@6.LMJ
DE:PO/ME9?EPT)D /0 BC@6.LMJ
8(;(0B S#ecif'ing an E7#onent for ,$oating Point Num2ers
The &a' a floating 5oint nu!(er is for!atte" "e5en"s on &hether an e#5onent is s5eifie".
The !antissa is a"+uste" (' shifting the "ei!al 5oint an"= if neessar'= intro"uing lea"ing
>eros= aor"ing to the e#5onent hosen. $sing an e#5onent value of J !eans that the
e#5onent re5resentation &ill not (e use" for "is5la'ing the s'!(ol.
S'nta#
Ds'!(olPE9)D
If 'ou s5eif' an e#5onent of J= then the nu!(er is "is5la'e" &ithout using the e#5onent
re5resentation. This has the sa!e effet as o!5letel' o!itting the s5eifiation of an
e#5onent, Ds'!(olPEJ)D has the sa!e effet as Ds'!(olPE)D
In this e#a!5le= the PLM:/SOLL7ERT fiel" is assu!e" to have the value BC@6LM.KA an" to (e
of "ata t'5e HLTP.
DPLM:/SOLL7ERTD /0 <B.C@6LMKAJJJJJJJE<JL
DPLM:/SOLL7ERTPE@)D /0 <BC@.6LMKAJJJJJJJE<J@
DPLM:/SOLL7ERTPEM)D /0 <J.BC@6LMKAJJJJJJE<JM
DPLM:/SOLL7ERTPEJ)D /0 <BC@6LM.KAJJJJJJJ
DPLM:/SOLL7ERTPE)D /0 <BC@6LM.KAJJJJJJJ
8(;(00 Right+Eustified )ut#ut
S'!(ol values other than nu!eri values are nor!all' for!atte" left/+ustifie". To s5eif' right/
+ustifie" for!atting= use the R o5tion. Gou !ust use this o5tion in on+untion &ith an out5ut
length s5eifiation.
S'nta#
Ds'!(olPR)D
If s'!(ol has the value BC@6.
Ds'!(olD /0 BC@6
Ds'!(olPAR) /0 BC@6
Hor 5rogra! s'!(ols= the length s5eifiation ontaine" in the Ditionar' "efinition !a' (e
use" instea" of an e#5liit length.
8(;(01 ,i$$ Characters
Gou an re5lae lea"ing s5aes in a value &ith a fill harater. $se the H o5tion &ith the
harater i!!e"iatel' follo&ing the H in the s5eifiation as the fill harater.
S'nta#
Ds'!(olPH f )D
f 3 fill harater
The figure for usto!er sales in the :9AB/$MSAT fiel" is WKJJ. The Ditionar' "esri5tion of
the fiel" s5eifies an out5ut length A.
D:9AB/$MSATD /0 KJJ.JJ
D:9AB/$MSATPHQ)D /0 QQKJJ.JJ
D:9AB/$MSATPHJ)D /0 JJKJJ.JJ
8(;(03 Su##ressing )ut#ut of Initia$ Va$ues
$se the I o5tion to su55ress the out5ut of s'!(ols that still ontain their initial values.
S'nta#
Ds'!(olPI)D
Assu!ing :9AB/$MSAT ontains the value J an" the urren' is DEM.
D:9AB/$MSATD /0 J=JJ
D:9AB/$MSATPI)D /0
If the fiel" ontains an a!ount other than J= this value is 5rinte" in the nor!al &a'.
D:9AB/$MSATD /0 KJJ=JJ
D:9AB/$MSATPI)D /0 KJJ=JJ
8(;(04 Ignoring Conversion Routines
SAPsri5t onversion routines s5eifie" in the Ditionar' are auto!atiall' reogni>e" an"
use" &hen 5rogra! s'!(ols are for!atte". To su55ress onversion= use the : o5tion.
S'nta#
Ds'!(olP:)D
8(;(05 Changing the Va$ue of a Counter
Gou an inrease or "erease the value of a SAPSCRIPT/CO$9TER_# P#3J.. N) ounter
varia(le (' B= (efore the urrent ounter value is 5rinte".
S'nta#,
DSAPSCRIPT/CO$9TER_#P<)D Inreases (' B the ontents of the ounter varia(le # P#3J.. N)
DSAPSCRIPT/CO$9TER_#P/)D Dereases (' B the ontents of the ounter varia(le # P#3J.. N)
If 'ou &ant to hange the value of a ounter varia(le &ithout atuall' 5rinting the ne& value=
use this for!atting o5tion together &ith an a""itional o5tion to set the out5ut length to J Psee
a(ove). If 'ou &ant to set a ounter varia(le to so!e s5eifi value= use the DEHI9E ontrol
o!!an".
Assu!e that DSAPSCRIPT/CO$9TER_BD initiall' has the value C.
DSAPSCRIPT/CO$9TER_BD /0 C
DSAPSCRIPT/CO$9TER_BP<)D /0 @
DSAPSCRIPT/CO$9TER_BP/)D /0 C
DSAPSCRIPT/CO$9TER_BP/)D /0 B
DSAPSCRIPT/CO$9TER_BP<J)D /0
DSAPSCRIPT/CO$9TER_BP<)D /0 @
8(;(0; Preceding and Su2seFuent Te7ts @Pre+Te7t G Post+Te7tA
In a""ition to using initial values for s'!(ols= 'ou an s5eif' a""itional te#ts that are 5rinte"
onl' &hen the value of the s'!(ol is no longer the initial value. Gou an s5eif' a te#t to (e
5rinte" i!!e"iatel' (efore the s'!(ol value Pthe 5re/te#t)= an" a te#t to (e 5rinte" i!!e"iatel'
after the s'!(ol value Pthe 5ost/te#t). If the s'!(ol ontains its initial value= these te#ts are
su55resse".
S'nta#,
D*5re/te#t*s'!(ol*5ost/te#t*D
Ma1e sure that the s'!(ol= the 5re/te#t= an" the 5ost/te#t all a55ear on a single line of the
e"itor. Gou !a' have to use a long line P5aragra5h attri(ute 3 or ;3) in the e"itor.
The inverte" o!!a * is use" as a "eli!iter for these te#ts. If this harater is also 5art of one
of these te#ts= enter it t&ie at this 5oint= so that it is not inter5rete" as a "eli!iter harater. A
5re/te#t or 5ost/te#t !a' itself ontain s'!(ols in a""ition to nor!al te#t. -o&ever= these
s'!(ols !a' not have a 5re/te#t or a 5ost/te#t.
The :9AB/PHAC- fiel" ontains a usto!er P.O. %o# nu!(er. Sine the te#t 4P.O. %o#4 is not
store" in the fiel" along &ith the value= 'ou &oul" nor!all' &rite the follo&ing for the P.O. %o#
line of an a""ress,
P.O. %o# D:9AB/PHAC-D
-o&ever= if no P.O. %o# has (een s5eifie"= the te#t 4P.O. %o#4 &oul" still a55ear on its o&n in
the a""ress. To 5revent this= use 5re/te#t or 5ost/te#t Pin this ase= 5re/te#t).
P.O. %o# D:9AB/PHAC-D /0 P.O. %o#
D*P.O. %o# *:9AB/PHAC-D /0
If a P.O. %o# has (een s5eifie"= then this &ill (e "is5la'e" together &ith the a55ro5riate te#t in
the nor!al &a'.
D*P.O. %o# *:9AB/PHAC-D /0 P.O. %o# BC@6LM
).) Country2!ependent Formatting
Certain fiel"s are for!atte" s5eifi to a 5artiular ountr'. These inlu"e fiel"s for "is5la'ing a
"ate an" nu!eri fiel"s ontaining either a "ei!al 5oint or a Rthousan"sS se5arator harater.
The for!atting a55lie" is usuall' "eter!ine" (' the "efinitions ontaine" in the user !aster
reor". Gou an use the SET CO$9TRG ontrol o!!an" to hoose a "ifferent for!atting
o5eration. The various ountr'/"e5en"ent for!atting o5tions are store" in ta(le TJJLX.
S'nta#
;, SET CO$9TRG ountr'_1e'
Gou an s5eif' this ountr' 1e' either (' .uoting it "iretl' enlose" in inverte" o!!as or ('
using a s'!(ol.
;, SET CO$9TRG *CA9*
;, SET CO$9TRG D:9AB/LA9DBD
Gou an revert to the settings of the user !aster reor" (' using the SET CO$9TRG ontrol
o!!an" again &ith an e!5t' ountr' na!e.
;, SET CO$9TRG * *
7hen SAPsri5t enounters this o!!an" it alls the orres5on"ing A%AP o!!an"
internall'. The effet of the SAPsri5t o!!an" is thus i"ential &ith that of the A%AP
o!!an".
If the for!atting turns out other than e#5ete"= he1 the settings in ta(le TJJLX.
8(8(0 Date *as&
To for!at "ate fiel"s= use the SAPsri5t SET DATE MAS: o!!an". E#euting this o!!an"
auses all su(se.uent "ate fiel"s to (e 5rinte" &ith the s5eifie" for!atting.
S'nta#
;, SET DATE MAS: 3 *"ate_!as1*
The follo&ing te!5lates !a' (e use" in the "ate !as1,
.. day (two digits)
... name of day (a((reviated)
.... name of day (written out in full)
)) month (two digits)
))) name of month (a((reviated)
)))) name of month (written out in full)
YY year (two digits)
YYYY year (four digits)
3. day (formatted as for the 3 option)
3) month (formatted as for the 3 option)
3Y year (formatted as for the 3 option)
An' other haraters ourring in the !as1 are inter5rete" as si!5le te#t an" are o5ie"
"iretl' to the out5ut.
Assu!ing a urrent s'ste! "ate of Marh Bst= BNNK.
;, SET DATE MAS: 3 *Hoster Cit'= MM.DD.GG*
DDATED /0 Hoster Cit'= J@.JB.NK
DDATEPI)D /0 Hoster Cit'= @.B.NK
;, SET DATE MAS: 3 *MMMM DD= GGGG*
DDATED /0 Marh JB= BNNK
Gou an revert to the stan"ar" setting (' using the SET DATE MAS: o!!an" again &ith an
e!5t' string in 5lae of the "ate !as1,
;, SET DATE MAS: 3 * *
8(8(1 Time *as&
Gou an use the SAPsri5t SET TIME MAS: o!!an" to for!at ti!e fiel"s in a &a' that
"iffers fro! the stan"ar" setting. E#euting this o!!an" auses all su(se.uent ti!e fiel"s to
(e 5rinte" &ith the s5eifie" for!atting.
S'nta#,
;, SET TIME MAS: 3 *ti!e_!as1*
The follo&ing te!5lates !a' (e use" in the ti!e !as1,
22 hours (two digits)
)) minutes (two digits)
seconds (two digits)
An' other haraters ourring in the !as1 are inter5rete" as si!5le te#t an" are o5ie"
"iretl' to the out5ut.
Assu!ing the urrent ti!e is BJ,JA,BC.
DTIMED /0 BJ,JA,BC
;, SET TIME MAS: 3 *--,MM*
DTIMED /0 BJ,JA
;, SET TIME MAS: 3 *-- hours MM !inutes*
DTIMED /0 BJ hours JA !inutes
DTIMEPI)D /0 BJ hours A !inutes
Gou an revert to the stan"ar" setting (' using the SET TIME MAS: o!!an" again &ith an
e!5t' string in 5lae of the ti!e !as1,
;, SET TIME MAS: 3 * *
).- Formatting Con1entions
Man' allo&e" o!(inations of o5tion an" s'!(ol t'5e either !a1e no sense or have no effet
at all. The for!atting 5roess is "ivi"e" into t&o stages, 5ri!ar' for!atting an" en" for!atting.
The 5ur5ose of 5ri!ar' for!atting is to onvert the internal for! of a s'!(ol value to a
harater/(ase" for!. The en" for!atting is then a55lie" to this inter!e"iate for!. The
follo&ing setions "esri(e the for!atting 5roess for eah 1in" of s'!(ol an" in &hih of the
t&o stages of onversion the various o5tions are a55lie".
8(=(0 Primar' ,ormatting of S'stem S'm2o$s
Certain s'ste! s'!(ols !ust first (e onverte" fro! their internal re5resentation into a
harater re5resentation (efore the en" for!atting an (e a55lie" to the!. The follo&ing
s'ste! s'!(ols re.uire a 5ri!ar' onversion,
Q.!YQ% Q)4-$2Q% QY6!RQ% Q245RQ% Q)I-5$6Q%
Q6C4-.Q $he relevant components are e#tracted from the system date or
system time. 3eading 0eros are eliminated if the Z formatting option is specified.
Q.!$6Q $he default (ehavior is that the system date is printed according to the
setting in the user master record or according to the country/dependent formatting
specified in a 6$ C45-$RY command. If a date mas, has (een defined (using
6$ .!$6 )!B)% then the formatting specified there is used for the output.
Q$I)6Q $he default (ehavior is that the current system time is printed in the
form hours?minutes?seconds If an alternative time mas, is specified (using 6$
$I)6 )!B) then this mas, overrides the default setting.
Q"!@6Q% Q-6C$"!@6Q $his sym(ols are initially converted using the
options specified in the form of the page definition.
Q3.!$6Q $his date representation is always formatted using the A".!$
conversion routine.
All re!aining s'ste! s'!(ols are treate" (' the 5ri!ar' onversion as a harater string an"
thus are not onverte". The en" onversion is starte" &hen the 5ri!ar' onversion is o!5lete.
8(=(1 Primar' ,ormatting of Standard S'm2o$s
Stan"ar" s'!(ols are treate" (' the 5ri!ar' for!atting as a harater string an" thus are not
onverte". The en" for!atting is starte" i!!e"iatel'.

8(=(3 Primar' ,ormatting of Program S'm2o$s
Progra! s'!(ols are initiall' onverte" fro! their internal re5resentation into a harater
re5resentation. This is "one using the A%AP 7RITE o!!an" together &ith a""itional
5ara!eters as a55ro5riate for the s5eifie" o5tions. The o5tions to &hih the 5ri!ar'
onversion a55lies "e5en" on the "ata t'5e.
The for!atting is arrie" out in an internal &or1 fiel" (' the A%AP 7RITE o!!an".

This fiel" is hosen aor"ing to the "ata t'5e an" length. The various o5tions are han"le" ('
a55ro5riate e#tensions to the 7RITE o!!an"s,
S
9O/SI?9
I 9O/IERO
. DECIMALS
E EXPO9E9T
I A he1 is !a"e for an initial value (' using an IH state!ent to "o an IS I9ITIAL
o!5arison.
I S I Q : 2 0 E .
Length
C-AR # # #
C$RR # # C # # #
# C
DEC # # C # # #
# C
9$MC # # # #
8AR # # #
8ARC # # #
LA9? # # #
$9IT # # #
DATE # #
DATS # #
TIME # #
TIMS # #
O$A9 # # C # # #
# C
I9TB # # # C # # #
C
I9TC # # # C # # #
C
I9T6 # # # C # # #
C
PREC # # # C # # #
C
C$:G # # #
ACCP # # #
CL9T # # #
HLTP # B C # #
# C
B A%AP 7RITE urrentl' ignores this o5tion for floating 5oint nu!(ers.
C The value is for!atte" using the A%AP 7RITE o!!an" in a &or1 fiel" &ith the s5eifie"
length
If a onversion routine is "efine" in the A%AP Ditionar'= then the 5ri!ar' for!atting is
5erfor!e" using this routine onl'. In this ase= none of the o5tions liste" in this ta(le are
a55lia(le unless 'ou "eativate the onversion routine &ith the : o5tion.
After the 5ri!ar' onversion of a 5rogra! s'!(ol is o!5lete"= the for!atte" value is then
su(+ete" to the en" for!atting.
8(=(4 Primar' ,ormatting of Te7t S'm2o$s
Te#t s'!(ols are treate" (' the 5ri!ar' for!atting as a harater string an" thus are not
onverte". The en" for!atting is starte" i!!e"iatel'.
8(=(5 End ,ormatting
In en" for!atting= the follo&ing for!atting o5tions are a55lie" to the s'!(ol value in the given
or"er. These are the sa!e for all s'!(ol t'5es.
If the C option is used% a space compression is performed.
If the 3 option is used% local date formatting is performed.
If an offset is specified% the offset is interpreted.
If an output length is specified then the length is interpreted.
If a fill character is specified (the ' option)% these are added to the formatted value.
If pre/te#ts and post/te#ts are soecified% they are processed and added to the
formatted value.
Posted 10th May 2010 by Blaster
Labels: SAP FORMS
0
Add a comment
2.
May
10
SAP SQL
Performance tuning for Data Selection Statement
For all entries
$he for all entries creates a where clause% where all the entries in the driver ta(le are
com(ined with 4R. If the num(er of
entries in the driver ta(le is larger than rsd(9ma#O(loc,ingOfactor% several similar S3
statements are e#ecuted to limit the
length of the &26R6 clause.
The plus
3arge amount of data
)i#ing processing and reading of data
'ast internal reprocessing of data
'ast
$he )inus
.ifficult to program9understand
)emory could (e critical (use 'R66 or "!CB!@6 si0e)
ome steps that might ma,e '4R !33 6-$RI6 more efficient?
Removing duplicates from the the driver ta(le
orting the driver ta(le
If possi(le% convert the data in the driver ta(le to ranges so a ;6$&66- statement is
used instead of and 4R statement?
'4R !33 6-$RI6 I- iOta(
&26R6 my,ey TK iOta(/low and
my,ey UK iOta(/high.
Nested selects
$he plus?
mall amount of data
)i#ing processing and reading of data
6asy to code / and understand
$he minus?
3arge amount of data
when mi#ed processing isn+t needed
"erformance ,iller no. <
Select using JOINS
$he plus
Gery large amount of data
imilar to -ested selects / when the accesses are planned (y the programmer
In some cases the fastest
-ot so memory critical
$he minus
Gery difficult to program9understand
)i#ing processing and reading of data not possi(le
Use the selection criteria
6E0E!T 3 FRO1 6>OOC.
!2E!CA 6>OOC/!ARR8D = 02 A9D
6>OOC/!O998D = #(##.
E9D6E0E!T.
SELECT * FROM SBOOK
WHERE CARRID = 'LH' AND
CONNID = '0400'.
ENDSELECT.
Use the aggregated functions
!(A = ###.
6E0E!T 3 FRO1 T"##
?2ERE 6PR60 = D A9D
AR>:> = ##.
!2E!CA T"##/16:9R , !(A.
!(A = T"##/16:9R.
E9D6E0E!T.

SELECT MAX( MSGNR ) FROM T100 INTO C4A
WHERE SPRSL = 'D' AND
ARBGB = '00'.
Select with view
6E0E!T 3 FRO1 DD#"0
?2ERE DO19A1E 08CE !2ARL
A9D A6(0O!A0 = A.
6E0E!T 689:0E 3 FRO1 DD#"T
?2ERE DO19A1E = DD#"0/DO19A1E
A9D A6(0O!A0 = A
A9D A6(<ER6 = DD#"0/A6(<ER6
A9D DD0A9:=A:E = 6Y/0A9:=.
E9D6E0E!T.

SELECT * FROM DD01V
WHERE DOMNAME LIKE 'CHAR'
AND DDLANG!AGE = S"#LANG!.
ENDSELECT.
Select with index support
6E0E!T 3 FRO1 T"##
?2ERE AR>:> = ##
A9D 16:9R = MMM.
E9D6E0E!T.

SELECT * FROM T00$.
SELECT * FROM T100
WHERE SPRSL = T00$#SPRAS
AND ARBGB = '00'
AND MSGNR = '%%%'.
ENDSELECT.
ENDSELECT.

Select Into tale
REFRE62 7##G.
6E0E!T 3 FRO1 T##G 89TO 7##G.
APPE9D 7##G.
E9D6E0E!T

SELECT * FROM T00& INTO TABLE X00&.

Select with selection list
6E0E!T 3 FRO1 DD#"0
?2ERE DO19A1E 08CE !2ARL
A9D A6(0O!A0 = A.
E9D6E0E!T

SELECT DOMNAME FROM DD01L
INTO DD01L#DOMNAME
WHERE DOMNAME LIKE 'CHAR'
AND AS4LOCAL = 'A'.
ENDSELECT
!e" access to multiple lines
0OOP AT TA>.
!2E!C TA>/C = C<A0.
. ...
E9D0OOP.

LOOP AT TAB WHERE K = KVAL.
' ...
ENDLOOP.

#op"ing internal tales
REFRE62 TA>_DE6T.
0OOP AT TA>_6R! 89TO TA>_DE6T.
APPE9D TA>_DE6T.
E9D0OOP.

TAB(DEST)* = TAB(SRC)*.
$odif"ing a set of lines
0OOP AT TA>.
8F TA>/F0A: 86 898T8A0.
TA>/F0A: = 7.
E9D8F.
1OD8FY TA>.
E9D0OOP.

TAB#FLAG = 'X'.
MODIF" TAB TRANSPORTING FLAG
WHERE FLAG IS INITIAL.
Deleting a se%uence of lines
DO "#" T81E6.
DE0ETE TA>_DE6T 89DE7 (*#.
E9DDO.

DELETE TAB(DEST FROM 4+0 TO ++0.

&inear search vs' inar"
READ TA>0E TA> ?8T2 CEY C = 7.

READ TABLE TAB WITH KE" K = 'X' BINAR" SEARCH.
#omparison of internal tales
DE6!R8>E TA>0EA TA>" 089E6 0"B
TA>% 089E6 0%.

8F 0" H, 0%.
TA>_D8FFERE9T = 7.
E06E.
TA>_D8FFERE9T = 6PA!E.
0OOP AT TA>".
READ TA>0E TA>% 89DE7 6Y/TA>87.
8F TA>" H, TA>%.
TA>_D8FFERE9T = 7. E78T.
E9D8F.
E9D0OOP.
E9D8F.

8F TA>_D8FFERE9T = 6PA!E.
. ...
E9D8F.

IF TAB1)* = TAB$)*.
' ...
ENDIF.
$odif" selected components
0OOP AT TA>.
TA>/DATE = 6Y/DAT=1.
1OD8FY TA>.
E9D0OOP.

WA#DATE = S"#DAT!M.
LOOP AT TAB.
MODIF" TAB FROM WA TRANSPORTING DATE.
ENDLOOP.
(ppending two internal tales
0OOP AT TA>_6R!.
APPE9D TA>_6R! TO TA>_DE6T.
E9D0OOP

APPEND LINES OF TAB(SRC TO TAB(DEST.
Deleting a set of lines
0OOP AT TA>_DE6T ?2ERE C = C<A0.
DE0ETE TA>_DE6T.
E9D0OOP

DELETE TAB(DEST WHERE K = KVAL.

)ools availale in S(P to pin*point a performance
prolem
T-e runtime anal$sis 46E&#5
6N0 Trace 46T#*5
Tips and Tric)s tool
T-e per'ormance database
Optimi+ing the load of the dataase
8sing ta#le #uffering
5sing (uffered ta(les improves the performance considera(ly. -ote that in some cases
a stament can not (e used with a (uffered ta(le% so when using these staments the (uffer
will (e (ypassed. $hese staments are?
elect .I$I-C$
4R.6R ;Y 9 @R45" ;Y 9 2!GI-@ clause
!ny &26R6 clasuse that contains a su(Duery or I -533 e#pression
A4I- s
! 636C$... '4R 5".!$6
If you wnat to e#plicitly (ypass the (ufer% use the ;Y"! ;5''6R addition to the
636C$ clause.
8se t"e A3AP S06* Clause .nstead of 06!,6 39
$he 4R.6R ;Y clause is e#ecuted on the data(ase server while the !;!" 4R$
statement is e#ecuted on the application server. $he dat(ase server will usually (e the
(ottlenec,% so sometimes it is (etter to move th=e sort from the dats(ase server to the
application server.
If you are not sorting by the primary key ( E.g. using the ORDER BY PRIMARY key
statement) but are sorting by another key, it could be better to use the ABAP SORT
stament to sort the data in an internal table. Note however that for very large result sets it
might not be a feasible solution and you would want to let the datbase server sort it.
A1oid t"er S,L,C* !.S*.5C* Statement
!s with the 4R.6R ;Y clause it could (e (etter to avoid using 636C$ .I$I-C$%
if some of the fields are not part of an inde#. Instead use !;!" 4R$ H .636$6
!.A!C6-$ .5"3IC!$6 on an internal ta(le% to delete duplciate rows.
From sdn
.ont use nested select statements
F) If possi(le use for all entries in addition
8) In the where addition ma,e sure you give all the primary ,ey
N) 5se Inde# for the selection criteria.
M) You can also use inner =oins
7) You can try to put the data from the first select statement into an Ita( and then in
order to select the data from the second ta(le use for all entries in.
L) 5se the runtime analysis 680 and S3 $race ($0M) to identify the performance
and also to identify where the load is heavy% so that you can change the code
accordingly
!;!" performance depends upon various factors and in devicded in three parts?
<. .ata(ase
F. !;!"
8. ystem
Run !ny program using 680 (performance analys) to improve performance refer to
tips and trics section of 680% !lways remem(er that !;!" perfirmance is improved
when there is least load on .ata(ase.
u can get an interactive grap in 680 regarding this with a file.
also if u find runtime of parts of codes then use ?
witch on R$! .ynamically within !;!" Code
1$o turn runtim analysis on within !;!" code insert the following code
6$ R5- $I)6 !-!3YZ6R 4-.
1$o turn runtim analysis off within !;!" code insert the following code
6$ R5- $I)6 !-!3YZ6R 4''.
!lways chec, the driver internal ta(les is not empty% while using '4R !33 6-$RI6
!void for all entries in A4I-
$ry to avoid =oins and use '4R !33 6-$RI6.
$ry to restrict the =oins to < level only ie only for ta(les
!void using elect 1.
!void having multiple elects from the same ta(le in the same o(=ect.
$ry to minimi0e the num(er of varia(les to save memory.
$he seDuence of fields in Jwhere clauseJ must (e as per primary9secondary inde# ( if
any)
!void creation of inde# as far as possi(le
!void operators li,e UT% T % U Q li,e E in where clause conditions
!void select9select single statements in loops.
$ry to use J(inary searchJ in R6!. internal ta(le. 6nsure ta(le is sorted (efore using
;I-!RY 6!RC2.
!void using aggregate functions (5)% )!C etc) in selects ( @R45" ;Y %
2!GI-@%)
!void using 4R.6R ;Y in selects
!void -ested elects
!void -ested 3oops of Internal $a(les
$ry to use 'I63. Y);43.
$ry to avoid into Corresponding 'ields of
!void using elect .istinct% 5se .636$6 !.A!C6-$
'ollow (elow while coding ?
< !lways chec, the driver internal ta(les is not empty% while using '4R !33
6-$RI6
F !void for all entries in A4I-
8 $ry to avoid =oins and use '4R !33 6-$RI6.
N $ry to restrict the =oins to < level only ie only for F ta(les
M !void using elect 1.
7 !void having multiple elects from the same ta(le in the same o(=ect.
L $ry to minimi0e the num(er of varia(les to save memory.
I $he seDuence of fields in Jwhere clauseJ must (e as per primary9secondary inde# ( if
any)
R !void creation of inde# as far as possi(le
<0 !void operators li,e UT% T % U Q li,e E in where clause conditions
<< !void select9select single statements in loops.
<F $ry to use J(inary searchJ in R6!. internal ta(le. 6nsure ta(le is sorted (efore using
;I-!RY 6!RC2.
<8 !void using aggregate functions (5)% )!C etc) in selects ( @R45" ;Y %
2!GI-@%)
<N !void using 4R.6R ;Y in selects
<M !void -ested elects
<7 !void -ested 3oops of Internal $a(les
<L $ry to use 'I63. Y);43.
<I $ry to avoid into Corresponding 'ields of
<R !void using elect .istinct% 5se .636$6 !.A!C6-$.
You can use the following points in improving the performance..
6valuate reDuirements
Communicate with users to get actual data reDuired so that% default values could (e set
on election creen. $his would avoid e#tracting whole lot of data% which may not (e
really needed.
V)atch the reDuirements.
<. )atch the alternative source of information (in less populated ta(les).
F. Instead of 5sing cluster ta(le% find the alternative transparent ta(les
8. $ry to match the reDuirements with the views.
N. Chec, if the logical seDuence of ta(le access is correct. It is prefera(le to seDuence
the data(ase access to go from a ta(le with lesser values to the more populated ta(les.
VImprove access to $a(les
<. !s far as possi(le try to have direct accesses on records (y providing full ,ey% so that
access would (e faster.
F. !lways specify your conditions in the where/clause instead of chec,ing them
yourself with chec,/statements
8. &henever possi(le access the ta(les through primary ,eys. !lso * select single * can
(e very helpful. Consider the use of the .I$I-C$ option in the case of many
duplicate entries.
N. 6nsure that you utilise internal ta(les wherever possi(le. !void doing a large amount
of processing within a data(ase select loop.
M. imilarly nested data(ase selects are an a(solute no/no.
VReduce )ultiple !ccesses on data(ases
<. !void multiple accesses on data(ases.
F. 5se specific fields for transferring data into the internal ta(les. ( use * into
corresponding fields of ta(le * flavour of the select statement ). $his is especially true if
less than half the availa(le fields have to (e transmitted.
8. If internal ta(les have many entries% a linear search through all entries is very time/
consuming. $ry to ,eep the ta(le ordered and use (inary search ( * Read ta(le *
statement with (inary search ) . e.g. consider an internal ta(le ita( containing values
( F%<0%N%R%7%<F%I%8).
if record with val K 8 is needed the following R6!. statement is used
R6!. $!;36 I$!; &I$2 B6Y G!3 K 8.
$he read operation is done seDuentially here so the reDuired record is accessed in the
Ith step.
! (etter way to do this is ?
orting the ta(le using ?
4R$ I$!;.
R6!. $!;36 I$!; &I$2 B6Y G!3 K 8 ;I-!RY 6!RC2.
orting results in ?
ita( K ( F%8%N%7%I%R%<0%<F )
$he reDiured record is now read in the Fnd step.
-ote that for (est results the ita( must hold large num(er of records.
N.!void doing unnecessary processing within a loop.
M.! nested data(ase select can (e avoided (y using the * for all entries * flavour of the
select statement. ! word of caution / always ensure that the ta(le which is used for
further selections (the * for all entries in ta(le * ta(le contains at least one record). !
failure to do this chec, results in all records (eing pic,ed up (y the select. imilarly%
avoid identical where clauses for different lines of I$!; (y using a sorted internal ta(le
in the 636C$ W '4R !33 6-$RI6 W and using the !;!" language element
.636$6 !.A!C6-$ .5"3IC!$6 prior to e#ecuting the select statement.
)2ow do you ta,e care of performance issues in your !;!" programsX
"erformance of !;!"s can (e improved (y minimi0ing the amount of data to (e
transferred.
$he data set must (e transferred through the networ, to the applications% so reducing
the amount 4' time and also reduces the networ, traffic.
ome measures that can (e ta,en are?
/ 5se views defined in the !;!"9N ..IC (also has the advantage of (etter reusa(ility).
/ 5se field list (636C$ clause) rather than 636C$ 1.
/ Range ta(les should (e avoided (I- operator)
/ !void nested 636C$.
i)system tools
ii)field sym(ols and field groups.
ans?/
'ield ym(ols ? 'ield sym(ols are placeholders for e#isting fields. ! 'ield ym(ol
does not physically reserve space for a field%(ut points to a field which is not ,nown
until runtime of the program.
eg?/ 'I63./Y);43 YZ.
'ield groups ? ! field group com(ines several fields under one name.!t runtime%the
I-6R$ command is used to define which data fields are assigned to which field
group.
$here should always (e a 26!.6R field group that defines how the e#tracted data will
(e sorted%the data is sorted (y the fields grouped under the 26!.6R field group
F)&hat is the difference (etween standard and sorted internal ta(lesX (in performance
wise)
!ns? orted ta(le improve the performance in case of a huge ta(le which has no? of
records
8)&hat are steps you follow to improve the performance of a reportX
!ns? a) 5e select fields statements (not select 1)
() 5se views rather than ta(les
c) .onJt use nested elect.
N)&hat is the role of secondary inde# in performanceX
!ns? sorry i dont ,now
7)&hat is the role of $0M in performance tuningX
!ns? S3 trace
L)&hat is the role of e#tended synta# chec, in performance tuningX
!ns? sorry i dont ,now
I)&ill =oin conditions in sDl Dueries affect perfomanceX howX
!ns ? Yes
R)&ill sorted internal ta(les help in performanceX
!ns? Yes
<0)&ill where conditions in a sDl Duery help improve performanceX
!ns? -o -ot at all
<<).oes select single 1.. 9 select 1 .. affect performanceX howX
!ns? elect single we use for first hit of the record. so o(viously elect single will
improve the performance
For all entries
The for all entries reates a &here lause= &here all the entries in the "river ta(le are
o!(ine" &ith OR. If the nu!(er of entries in the "river ta(le is larger than
rs"(;!a#_(lo1ing_fator= several si!ilar SOL state!ents are e#eute" to li!it the length
of the 7-ERE lause.
The 5lus
X Large a!ount of "ata
X Mi#ing 5roessing an" rea"ing of "ata
X Hast internal re5roessing of "ata
X Hast
The Minus
X Diffiult to 5rogra!;un"erstan"
X Me!or' oul" (e ritial Puse HREE or PAC:A?E si>e)
So!e ste5s that !ight !a1e HOR ALL E9TRIES !ore effiient,
X Re!oving "u5liates fro! the "river ta(le
X Sorting the "river ta(le
If possi(le% convert the data in the driver ta(le to ranges so a ;6$&66-
statement is used instead of and 4R statement?
FOR A00 E9TR8E6 89 i_tab
?2ERE m$)e$ ,= i_tab/lo+ and
m$)e$ H= i_tab/-ig-.
Nested selects
The 5lus,
S!all a!ount of "ata
Mi#ing 5roessing an" rea"ing of "ata
Eas' to o"e / an" un"erstan"
The !inus,
Large a!ount of "ata
&hen !i#e" 5roessing isnSt nee"e"
Perfor!ane 1iller no. B
Select using JOINS
The 5lus
8er' large a!ount of "ata
Si!ilar to 9este" selets / &hen the aesses are 5lanne" (' the 5rogra!!er
In so!e ases the fastest
9ot so !e!or' ritial
The !inus
8er' "iffiult to 5rogra!;un"erstan"
Mi#ing 5roessing an" rea"ing of "ata not 5ossi(le
Use the selection criteria
6E0E!T 3 FRO1 6>OOC.

!2E!CA 6>OOC/!ARR8D = 02 A9D

6>OOC/!O998D = #(##.

E9D6E0E!T.

SELECT * FROM SBOOK

WHERE CARRID = 'LH' AND

CONNID = '0400'.

ENDSELECT.

Use the aggregated functions
!(A = ###.

6E0E!T 3 FRO1 T"##

?2ERE 6PR60 = D A9D

AR>:> = ##.

!2E!CA T"##/16:9R , !(A.

!(A = T"##/16:9R.
E9D6E0E!T.

SELECT MAX( MSGNR ) FROM T100 INTO C4A

WHERE SPRSL = 'D' AND

ARBGB = '00'.

Select with view
6E0E!T 3 FRO1 DD#"0

?2ERE DO19A1E 08CE !2ARL

A9D A6(0O!A0 = A.

6E0E!T 689:0E 3 FRO1 DD#"T

?2ERE DO19A1E = DD#"0/DO19A1E

A9D A6(0O!A0 = A

A9D A6(<ER6 = DD#"0/A6(<ER6

A9D DD0A9:=A:E = 6Y/0A9:=.

E9D6E0E!T.



SELECT * FROM DD01V

WHERE DOMNAME LIKE 'CHAR'

AND DDLANG!AGE = S"#LANG!.

ENDSELECT.

Select with index support
6E0E!T 3 FRO1 T"##

?2ERE AR>:> = ##

A9D 16:9R = MMM.

E9D6E0E!T.



SELECT * FROM T00$.

SELECT * FROM T100

WHERE SPRSL = T00$#SPRAS

AND ARBGB = '00'

AND MSGNR = '%%%'.

ENDSELECT.

ENDSELECT.



Select Into tale
REFRE62 7##G.

6E0E!T 3 FRO1 T##G 89TO 7##G.

APPE9D 7##G.

E9D6E0E!T



SELECT * FROM T00& INTO TABLE X00&.



Select with selection list
6E0E!T 3 FRO1 DD#"0

?2ERE DO19A1E 08CE !2ARL

A9D A6(0O!A0 = A.

E9D6E0E!T



SELECT DOMNAME FROM DD01L

INTO DD01L#DOMNAME

WHERE DOMNAME LIKE 'CHAR'

AND AS4LOCAL = 'A'.

ENDSELECT

!e" access to multiple lines
0OOP AT TA>.

!2E!C TA>/C = C<A0.

. ...

E9D0OOP.



LOOP AT TAB WHERE K = KVAL.

' ...

ENDLOOP.



#op"ing internal tales
REFRE62 TA>_DE6T.

0OOP AT TA>_6R! 89TO TA>_DE6T.

APPE9D TA>_DE6T.

E9D0OOP.



TAB(DEST)* = TAB(SRC)*.

$odif"ing a set of lines
0OOP AT TA>.

8F TA>/F0A: 86 898T8A0.

TA>/F0A: = 7.

E9D8F.

1OD8FY TA>.

E9D0OOP.



TAB#FLAG = 'X'.

MODIF" TAB TRANSPORTING FLAG

WHERE FLAG IS INITIAL.



Deleting a se%uence of lines
DO "#" T81E6.

DE0ETE TA>_DE6T 89DE7 (*#.

E9DDO.



DELETE TAB(DEST FROM 4+0 TO ++0.



&inear search vs' inar"
READ TA>0E TA> ?8T2 CEY C = 7.



READ TABLE TAB WITH KE" K = 'X' BINAR" SEARCH.

#omparison of internal tales
DE6!R8>E TA>0EA TA>" 089E6 0"B

TA>% 089E6 0%.



8F 0" H, 0%.

TA>_D8FFERE9T = 7.

E06E.

TA>_D8FFERE9T = 6PA!E.


0OOP
AT TA>".

READ TA>0E TA>% 89DE7 6Y/TA>87.

8F TA>" H, TA>%.

TA>_D8FFERE9T = 7. E78T.

E9D8F.

E9D0OOP.

E9D8F.



8F TA>_D8FFERE9T = 6PA!E.

. ...

E9D8F.



IF TAB1)* = TAB$)*.

' ...

ENDIF.

$odif" selected components
0OOP AT TA>.

TA>/DATE = 6Y/DAT=1.

1OD8FY TA>.

E9D0OOP.



WA#DATE = S"#DAT!M.

LOOP AT TAB.

MODIF" TAB FROM WA TRANSPORTING DATE.

ENDLOOP.

(ppending two internal tales
0OOP AT TA>_6R!.

APPE9D TA>_6R! TO TA>_DE6T.

E9D0OOP



APPEND LINES OF TAB(SRC TO TAB(DEST.

Deleting a set of lines
0OOP AT TA>_DE6T ?2ERE C = C<A0.

DE0ETE TA>_DE6T.

E9D0OOP



DELETE TAB(DEST WHERE K = KVAL.



)ools availale in S(P to pin*point a performance
prolem
T-e runtime anal$sis 46E&#5

6N0 Trace 46T#*5

Tips and Tric)s tool

T-e per'ormance database


Optimi+ing the load of the dataa se
8sing ta#le #uffering
$sing (uffere" ta(les i!5roves the 5erfor!ane onsi"era(l'. 9ote that in so!e ases a
state!ent an not (e use" &ith a (uffere" ta(le= so &hen using these state!ents the
(uffer &ill (e ('5asse". These state!ents are,
Selet DISTI9CT
ORDER %G ; ?RO$P %G ; -A8I9? lause
An' 7-ERE lause that ontains a su( .uer' or IS 9$LL e#5ression
JOI9 s
A SELECT... HOR $PDATE
If 'ou &an t to e#5liitl' ('5ass the (uffer= use the %GPASS %$HHER a""ition to the SELECT
lause.
8se t"e A3AP S06* Clause .nstead of 06!,6 39
The ORDER %G lause is e#eute" on the "ata(ase server &hile the A%AP SORT state!ent
is e#eute" on the a55liation server. The "ata(ase server &ill usuall' (e the (ottlene1=
so so!eti!es it is (etter to !ove the sort fro! the "ata(ase server to the a55liation
server.
If 'ou are not sorting (' the 5ri!ar' 1e' P E.g. using the ORDER %G PRIMARG 1e' state!ent)
(ut are sorting (' another 1e'= it oul" (e (etter to use the A%AP SORT state!ent to sort
the "ata in an internal ta(le. 9ote ho&ever that for ver' large result sets it !ight not (e a
feasi(le solution an" 'ou &oul" &ant to let the "ata(ase server sort it.
A1oid t"e S,L,C* !.S*.5C* Statement
As &ith the ORDER %G lause it oul" (e (etter to avoi" using SELECT DISTI9CT= if so!e of
the fiel"s are not 5art of an in"e#. Instea" use A%AP SORT < DELETE ADJACE9T
D$PLICATES on an internal ta(le= to "elete "u5liate ro&s.
Difference between Variant Transaction and Parameter Transaction in SE93
NOTES
BASICS: ( tips: TABLE word is necessary for all except collect ) , ( tips2: modify and delete
will only have FROM wa )
Data C$ass: *"STER D"T"9 TR"NS D"T"9
)RG"NI:"TI)N"- D"T"
@"PP-BA9 @"PP-0A9
@"PP-1A(
%se
If 'ou hoose the "ata lass orretl'= 'our ta(le is auto!atiall' assigne" to the orret area
Pta(le s5ae or D% s5ae) of the "ata(ase &hen it is reate". Eah "ata lass orres5on"s to a
5h'sial area in &hih all the ta(les assigne" to this "ata lass are store".
There are the follo&ing "ata lasses,
Y APPL0 P!aster "ata),
Data that is sel"o! hange". An e#a!5le of !aster "ata is the "ata ontaine" in an a""ress
file= suh as the na!e= a""ress an" tele5hone nu!(er.
Y APPL1 Ptransation "ata),
Data that is fre.uentl' hange". An e#a!5le of transation "ata is the goo"s in a &arehouse
&hih hange after eah 5urhase or"er.
Y APPL2 Porgani>ational "ata),
)#erations 6ithout header $ine )#erations 6ith header $ine
O5erations for all Ta(le T'5es P stan"ar" ta(le= sorte" ta(le= hashe" ta(le )
INSERT INTO TABLE . INSERT TABLE ITAB.
COLLECT INTO . COLLECT .
READ TABLE ... INTO . READ TABLE ...
MODIF" TABLE FROM ... MODIF" TABLE ...
########################MODIF" FROM
...WHERE ...
#####################MODIF" ...
WHERE ...
DELETE TABLE FROM . DELETE TABLE .
LOOP AT ITAB INTO ... LOOP AT ITAB ...
)#erations for Inde7 Ta2$es @ standard and sorted on$' A cos ashed ta2$e donDt have inde7
Ti#s: DonDt use T"/-E &e'6ord(
APPEND TO . APPEND .
INSERT INTO ... INSERT ...
MODIF" FROM ... MODIF" ...
Custo!i>ing "ata that is "efine" &hen the s'ste! is installe" an" sel"o! hange". An
e#a!5le is the ta(le &ith ountr' o"es.
T&o further "ata lasses= USR an" USR1= are 5rovi"e" for the usto!er. These are for user
"evelo5!ents. The ta(les assigne" to these "ata lasses are store" in a ta(le s5ae for user
"evelo5!ents. In the follo&ing figure 'ou an see ta(les assigne" to "ifferent "ata lasses. The
figure 5resents the ta(les in the A%AP Ditionar' an" in the "ata(ase.
TA%LE CA9 -A8E A STR$CT$RE I9SIDE A9D T-AT STR$CT$RE CA9 -A8E A9OT-ER
STR$CT$REZ LI:E T-IS $ CA9 -A8E $PTO N INC-%DES
HIELD 9AME I9 A TA%LE CA9 %E MAX BM
HIELD 9AME I9 A STR$CT$RE CA9 %E MAX @J
BUSINESS PARTNERS
For MM -> VENDOR
RAW MATERIAL TYPE = ROH
SEMI FINISHED PRODUCT TYPE = HALB
FINISHED PRODUCT MATERIAL TYPE = FERT
MM
LFA1 VENDOR DETAILS TABLE
( MM )
The one who supplies raw
material to company.
~LIFNR VENDOR ACCOUNT NUMBER
~NAME1 VENDOR NAME
~ORT01 VENDOR ADDRESS
EKKO PURCHASE ORDER TABLE
Buying raw material from
vendor, so purchasing.
~EBELN PURCHASE ORDER NUMBER
~~~LIFNR VENDOR ACCOUNT NUMBER
~AEDAT DATE OF PURCHASE
~NETWR AMOUNT
EKPO
PURCHASE ORDER ITEM
DETAILS
Purchasing a big list of raw
materials from vendor.
~EBELP ITEM NUMBER
~EBELN PURCHASE ORDER NUMBER
~MATNR MATERIAL NUMBER
RBKP INVOICE RECEIPT HEADER
Vendor giving bill to
company.
~BELNR INVOICE NO.
~LIFNR VENDOR A/C NO.
~RMWWR INVOICE AMOUNT
RSEG INVOICE RECEIPT ITEM
Vendor giving list of items
purchased
~BUZEI ITEM NO.
~BELNR INVOICE NO.
~MATNR MATERIAL NO.
EXAMPLE FOR JOIN:
Select LFA1~LIFNR
EKKO~EBELN
EKKO~AEDAT
INTO TABLE itab
FROM LFA1
INNER JOIN EKKO
ON LFA1~LIFNR = EKKO~LIFNR
WHERE LFA1~LIFNR IN SO_VENDOR
------------------------------------------------------------------------------------------------------------------------
-----------------------------------------
RSTXPDFT4
RSTXLDMC are 2 exe programs used in sapscripts to convert a script to pdf
and to upload a TIFF image file for scripts rsptvly
RSTXR3TR: used to allow form to transport across clients ie., from
dev to quality.
------------------------------------------------------------------------------------------------------------------------
-----------------------------------------
PREDEFINED OUTPUT TYPES: (refer table TNAPR for more output
types)
NEU - Purchase order
BA00 - Sales order
LD00 - Delivery application
RD00 - Bill and invoice
------------------------------------------------------------------------------------------------------------------------
-----------------------------------------
Function module creation tcode SE37
------------------------------------------------------------------------------------------------------------------------
-----------------------------------------
Screen 9000 >
Screen 1000 > = < 1010 cannot be used.
-----
Smart Forms Tcode: SMARTFORM
Adobe forms tcode: SFP
WORKFLOW : SWDD
SAP QUERY: SQ02 - An InfoSet describes data sources that are usually defined as joins,
SQ03- USERGROUP, Assign infoset into usergroup, then SQ01-SAP query orSQV1
quick viewer
BAPI : SE37 for function module and sw01 for BOR, tcode : BAPI
Upload Pic to BDS = SE78
BDC : Gui_Upload, GUI_DOWNLOAD , BDC_OPEN_GROUP, BDC_INSERT,
BDC_CLOSE_GROUP are the fn modules.
BADI: SE24, CL_EXITHANDLER -> GET_INSTANCE method, double click, put (rea1
5oint on a funtion !o"ule alle"
C"-- *ET)D C-_E.IT"ND-ERHIGET_C-"SS_N"*E_/?_INTER,"CED
Then run the a##$ication and it 6i$$ sto# in the 2rea&#oint9 no6 get the 2adi name using
E.IT_N"*E in de2ugger9
Go to SE0=9 SE0> for editing the 2adi or creating a ne6 im#$ementation
USEREXIT & EXITS in general:
Open the program and in system-> status, Find the package. Goto SMOD and
Utilities -> Find, search the package and get all exits.
Last 4 characters of program matches with the enhancement name .
Go to CMOD , create a project to register the enhancement. Click COMPONENTS
button and give the enhancement name.
Double click enhancement name and get the exits and the Include prog inside the
fn.modules.
Why we need LUW when Database LUW automatically rollsback ?
The successful conclusion of a transaction is concluded by a
database commit, but an error triggers a database rollback. Since
database updates in one LUW cannot be canceled by a
database rollback in a subsequent LUW, all database updates in
one transaction must be performed in a single LUW.
;undling data(ase updates
In the interests of data integrity, all the database updates for transactions which contain
more than one L!W should be bundled together into one singleL!W. To prevent overload
here, you can delay the execution of FORM routines and functions in ABAP/4 programs.
o PERFORM ,-./ ON COMMIT
By using the addition ON COMMIT, you can delay execution of a subroutine
until the next ABAP/4 command COMMIT WORK occurs. All subroutines
specified in this way are executed together in the L!W concluded by
this COMMIT WORK
o CALL F!NCTION ,01234-1 IN !PDATE TASK
With this statement, the function module ,01234-1 is registered so that it can
be executed by an update process on encountering the next ABAP/4
command COMMIT WORK. In this case (i.e. asynchronous processing), the
dialog process does not wait until the function module has been executed.
However, with COMMIT WORK AND WAIT (i.e. synchronous processing), the
processing does not continue until the function module has finished. All
function modules specified as "Update with immediate start" or "Immediate
start, no restart" (in shortV1) are executed together in one LUW. All function
modules specified as "Update with delayed start (in short V$ are executed in
aseparate LUW. The type V$ is mainly used for less urgent database updates
(e.g. of a statistical nature).
o CALL F!NCTION ,01234-1 IN BACKGRO!ND TASK
With this statement, the function module ,01234-1 is registered so that it can
be executed on encountering the next ABAP/4 commandCOMMIT WORK. In this
case (i.e. asynchronous processing), the dialog process does not wait until
the function module has been executed. All function modules specified in this
way are executed together in one LUW by any dialog process.
By using the addition DESTINATION, you can even run the function module in
a different R/3 System (see Transactional Remote Function Call). In this case,
all function modules specified in this way for one destination executed together
in one LUW.
This technique of bundling database updates allows you to distribute the execution of a
transaction across several work processes and even across different R/3 Systems.
$he !;!"9N commands C4))I$ &4RB and ROLLBACK WORK
When using the bundling technique, you must always signal the conclusion of an update
transaction by calling the ABAP/4 command COMMIT WORK once . In addition to the
database commit, this triggers all the FORM routines and functions registered by this
transaction. While the database commit simply leaves a Logical Unit of Work (L!W) after
successful conclusion, the ABAP/4 command COMMIT WORK only triggers part of the
processing within a transaction. A transaction cannot be considered as successfully
completed until this part has also been successfully executed.
Although it is not obligatory, you should signal the conclusion of an update transaction that
uses the bundling technique by calling the ABAP/4 command COMMIT WORK. This is not
only good programming style, but also relieves you from having to release locked objects
explicitly (see SAP Locking).
If an error is detected during the transaction, you can use the ABAP/4 command ROLLBACK
WORK to roll back the database to its level before the beginning of the transaction.
2andling terminations
If the processing of parts of a transaction is delayed, runtime errors may occur. In this
case, you should be aware of the following:
If a runtime error occurs or if you call the ABAP/4 command MESSAGE with the message
type 'A' in a FORM routine ,-./ registered with PERFORM ,-./ ON COMMIT, the L!W that
contains the ABAP/4 command COMMIT WORK is automatically canceled by a database
rollback (see LUW). Then, no further registeredFORM routines or functions are executed
and the user sees the relevant information about the termination on the screen. The
ABAP/4 command ROLLBACK WORK results in a runtime error.
If a runtime error occurs or if you call the ABAP/4 command ROLLBACK
WORK or MESSAGE with the message type 'A' in a V1 function ,01234-1 registered
withCALL F!NCTION ,01234-1 IN !PDATE TASK , all database updates of already
executed V1 functions are automatically canceled by a database rollback
(seeLUW). V$ functions and functions registered with CALL F!NCTION IN BACKGRO!ND
TASK are not executed. All database updates of the L!W that contain the ABAP/4
command COMMIT WORK and thus all updates of FORM routines registered with PERFORM
ON COMMIT are not canceled.
If a runtime error occurs or if you call the ABAP/4 command ROLLBACK
WORK or MESSAGE with the message type 'A' in a V$ function ,01234-1 registered
withCALL F!NCTION ,01234-1 IN !PDATE TASK, only the database updates of
this V$ function are automatically canceled by a database rollback (see LUW). Any
existing V$ functions and functions registered with CALL F!NCTION IN BACKGRO!ND
TASK are executed.
With V1 and V2 functions, the user sees information about the termination on the screen,
provided his/her R/3 System has been set up accordingly. By choosing Tools ->
Administration -> Monitoring -> Update, he/she can analyze the termination and - after
eliminating the cause of the termination - manually restart all functions of the type 'Update
with immediate start' and 'Update with delayed start' that belong to the transaction.
If a runtime error occurs or if you call the ABAP/4 command ROLLBACK
WORK or MESSAGE with the message type 'A' in a function ,01234-1 registered with CALL
F!NCTION ,01234-1 IN BACKGRO!ND TASK, all the database updates of already
executed functions of the same destination are automatically canceled by a database
rollback (see LUW). The user sees information about the termination on the screen. If an
error is detected during the processing of a function registered in this way, you can decide
in the program whether all the functions with the same destination should be executed
again after the database rollback (see Transactional Remote Function Call).
hort response times in dialog transactions
The acceptance of dialogs by users depends entirely on transaction response times. In this
context, success rests not only on the short response times of a user's "own" transaction.
Since the response times of one transaction affects those of another, you must always
take response times of other transactions into account when programming. By their nature,
database operations contribute most to the increase of response times in dialog
transactions.
.istri(uting a transaction across several wor, processes
By bundling database updates, you can distribute a transaction across several work
processes. Asynchronous execution of the database update in an update or background
process shortens response times in the dialog process.
Schematic flow of a transaction:
5 61 71 5 ,1 8 6$ 5 ,$ 7$ 5 2 31 5 9
: L!W1 : L!W$ : ... : L!W1 : : L!W ...
:#######:#########:#######:########:########:###54;<-8 6.-2=>>##?
5 3$ 5 5 3@ 5
: L!W : ... : L!W :
##########065;3= 6.-2=>>############:#######:#####:#####:#####?
5 34 5
: L!W :
##########54;<-8 6.-2=>>######################:#####:#########?
71, 7$,,Registration of functions for execution in the background
2,,,,ABAP/4 command COMMIT WORK
5,,,,Database commit
,1, ,$,,Registration of V1 functions for execution in update process
8,,,,Registration of V2 functions for execution in update process
61, 6$,,Registration of FORM routines
31,,,,Execution of all registered FORM routines
3$,,,,Execution of all registered V1 functions
3@,,,,Execution of one registered V2 function per LUW
34,,,,Execution of all registered functions in the background
9,,,,Wait until all V1 functions have finished in case of
,,,,COMMIT WORK AND WAIT
HOW CAN YOU DEBUG SMARTFORM ?
How to Debug SmartForms - Debugging SAP SmartForm in ABAP ?
Debugging SmartForms using Function Module
If you want to debug Smartform document in non-modifiable client, then you can try
debugging Smartforms Function Module using soft break point.
First you need to find the function module name of the target SmartForm for debugging.
If you do not know how to get the function module name of the SAP Smart Form, please
read the Smart Form tutorial titled How to Find SAP SmartForms Function Module Name.
Without knowing the function module name, we can not debug SmartForms in non-
modifiable clients.
After you find the function module name, we can now display the ABAP source codes of
the SSF FM (Function Module) using the SAP Transaction SE37.
Within the ABAP codes of Smartform FM you can put a soft break-point any where suitable
for your debugging Smartforms purposes.
It is better to copy the node name or some parts of the ABAP code in the SAP Smartform
and search the text within the SE37 displayed source code of the Smartforms function
module (FM).
You can place a soft break point in the source code using Ctrl+Shift+12 key combination or
using the Stop icon .
Let's assume that you want to debug Smartforms codes within program lines named
'%CODE10' as seen in the followin Smartform screenshot,
First click on the Search button , and not use the Ctrl+F since searc button has far
more powerful functionalities than ordinary Ctrl+F search.
Enter the text you are searching in the Find text area.
You can search for the node name '%CODE10' as well as for a part of your SmartForm
code.
What is important here in this Search is be sure that you selected the option "In main
program".
Otherwise your search will take place only for a limited part of the Smartform function
module codes.
When the place of the target code block is found, you can run the SAP Smart Form and
start to debug Smartform document.
Debug Smart Form using Break-Point
If you are in a modifiable client, or where you can alter the codes of your SAP SmartForms,
then there is an other alternative method that you can debug Smart Forms.
One way of debugging Smartform documents is placing break points within the Smart
Form program lines like shown in below ABAP code :
BREAK SAP!>=.N;/=.
3 +-ere 6AP=ser9ame is $our A>AP De;eloper user
3 OR
BREAK#POINT.
3 +ill stop program execution 'or all 6martForm callers
Smart Form Trace with SFTRACE or SMARTFORM_TRACE
An other SAP tool that might help ABAP developers troubleshoot with Smart Forms and to
debug SmartForm can be the Smart Form Trace.
You can activate Smart Form Trace for tracing Smartform execution process using the
SAP transactionSFTRACE or SMARTFORM_TRACE codes.
Posted 7th May 2010 by Blaster
Labels: Explain
0
Add a comment
%.
May
7
Difference between sy-tabix and sy-index
Sy-tabix: contains the relative row number of the current record/ no of records in itab
Sy-index: index number of record which is currently executed in the loop.
Posted 7th May 2010 by Blaster
Labels: difference between type
0
Add a comment
&.
May
7
Tcodes for interview
SM12 LOCK MANAGEMENT
SM3O VIEW MAINTENANCE
SM31 TABLE MAINTENANCE
SM34 MAINTAIN DATA IN VIEW CLUSTER
SM35 RECORDING BATCH INPUT
SM36 BACKGROUND JOB CREATION
SM37 MONITOR BACKGROUND JOBS
SE03 TRANSPORT ORGANIZER
SE11 ABAP DICTIONARY
SE15/SE84 = REPOSITORY BROWSER
SE16 DATA BROWSER
SE18 BADI DEFINITION
SE19 BADI IMPLEMENTATION
SE24 CLASS BUILDER
SE36 LDB
SE37 FUNCTION BUILDER
SE38 ABAP EDITOR
SE41 MENU PAINTER
SE51 SCREEN PAINTER
SE71 FORM PAINTER
SE80 OBJECT NAVIGATOR
SE81 APPLICATION HIERARCHY
SE91 MESSAGES
SE93 CREATE TCODE
SE95 SAP NOTES
SU20 - AUTHORIZATION FIELDS CREATE
SU21 - AUTHORIZATION OBJECT + CLASS CREATE
SU53 - DISPLAY AUTHORIZATION FOR USERS
ST05 - SQL TRACE
SPRO - CUSTOMIZING
SNRO - NUMBER RANGE OBJECT
SCDO - CHANGE DOCUMENT OBJECT
SHD0 - TRANSACTION VARIANT
SHDB - RECORDING - BDC
CMOD - CUSTOMER ENAHANCEMENTS
SMOD - SAP ENHANCEMENTS
PFTC - FLOW TASK MAINTENANCE IN WORKFLOW
SNOTE - NOTE ASSISTANT
SHMA - SHARED MEMORY AREA
SPAU - WHO CHANGED THE REPOSITORY OBJECTS AND WHO TRANSPORTED
SPDD - MODIFICATION ASSISTANT
SWDD - WORKFLOW
SO10 - STANDARD TEXT - SCRIPTS
SW01 - BOR TO CREATE BAPI
BAPI - BAPI EXPLORER TO VIEW BAPI
SMARTFORMS - CREATE SMARTFORMS
LSMW - LEGACY SYSTEM MIGRATION WORKBENCH
SQ01 - ABAP QUERY / SQL QUERY REPORTING
SQ02 - INFOSET
SQ03 - USERGROUPS
Posted 7th May 2010 by Blaster
Labels: TCODES
0
Add a comment
(.
*.
May
7
sap script important programs
SAPScript Important Programs
Here are some useful programs for SAPSCRIPT development/search ...
RSTXFCAT - Program to find out SAP Scirpt names (Search Program)
RSTXCDM1 - SAPscript: Sample Program for Form Printing
RSTXCNVR - Converting SAPscript standard text to RAW format (ASCII)
RSTXCPDF - Routines for Converting OTF Format to PDF Format
RSTXDBUG - Activate/Deactivate Form Debugger
RSTXFCAT - Find Forms
RSTXFCPY - Copy Forms Between Clients
RSTXFCOM - Comparison of Two Forms
RSTXFCON - SAPscript: Conversion of Page Format for Forms
RSTXFINF - Comprehensive Information about a Specific Form
RSTXHTML - Conversion of SAPscript Texts (ITF) to HTML
RSTXICON - List of SAP icons and their names and SAP numbers
RSTXSYMB - List of SAP symbols and their names as well as SAP number
RSTXR3TR - Transport Program For SAPscript Transport Objects
RSTXSCAT - Find Styles
RSTXSF01 - TrueType font installation for SAPscript/SmartForms
RSTXTCAT - Find Standard Texts
Posted 7th May 2010 by Blaster
SAP ABAP interview question and answers Big Set
What is SAP?
SAP is the name of the company founded in 1972 under the German name (Systems,
Applications, and Products in Data Processing) is the leading ERP (Enterprise Resource
Planning) software package.
SAP Basics feature
* Configuration of the SAP modules
o Transaction SPRO this is the main tree for all the configuration.
* Function Key
o F1 Help
o F3 - Back
o F4 Possible entries or matchcode for the field you are accessing
o F5 Selection screen
o F7 Previous screen
o F8 Next screen
o F9 Technical info
o CTRL+X Cut
o CTRL+C Copy
o CTRL+V Paste
* Navigation
o /n Skip to the next record if you are processing one batch input session
o /bend Cancel a batch input foreground process
o /nend Close all R/3 sessions and logoff
o /nxxx x Call the transaction xxxx in the same session
o /O Generate a session list
o /Oxxx x Call the transaction xxxx in an additional session
o /i Delete the current session
o /h Turn the debug mode on
o /$TAB Reset all buffers (for System Administrators)
o /$SYNC Synchronize instances buffers (for System Administrators)
In 4.x, you can have long SAP transaction code up to a maximum of 20 character
Different types of ERP ?
SAP, BAAN, JD Edwards, Oracle Financials, Siebel, PeopleSoft. Among all the ERPs
most of the companies implemented or trying to implement SAP because of number of
advantages over other ERP packages.
What is ERP?
ERP is a package with the techniques and concepts for the integrated management of
business as a whole, for effective use of management resources, to improve the efficiency
of an enterprise. Initially, ERP was targeted for manufacturing industry mainly for planning
and managing core business like production and financial market. As the growth and
merits of ERP package ERP software is designed for basic process of a company from
manufacturing to small shops with a target of integrating information across the company.
What is IDES?
International Demonstration and Education System. A sample application provided for
faster learning and implementation.
What is WORKFLOW and its importance?
Business Work Flow: Tool for automatic control and execution of cross-application
processes. This involves coordinating the persons involved, the work steps required, the
data, which needs to be processed (business objects). The main advantage is reduction
in throughput times and the costs involved in managing business processes.
Transparency and quality are enhanced by its use.
What is SAP R/3?
A third generation set of highly integrated software modules that performs common
business function based on multinational leading practice. Takes care of any enterprise
however diverse in operation, spread over the world. In R/3 system all the three servers
like presentation, application server and database server are located at different system.
What are presentation, application and database servers in SAP R/3?
The application layer of an R/3 System is made up of the application servers and the
message server. Application programs in an R/3 System are run on application servers.
The application servers communicate with the presentation components, the database,
and also with each other, using the message server. All the data are stored in a centralized
server. This server is called database server.
Name some drawbacks of SAP ?
Interfaces are huge problem, Determine where master data resides, Expensive, very
complex, demands highly trained staff, lengthy implementation time.
What is BEx?
BEx stands for Business Explorer. Bex enables end user to locate reports, view
reports, analyze information and can execute queries. The queries in workbook can
be saved to their respective roles in the Bex browser. Bex has the following
components: Bex Browser, Bex analyzer, Bex Map, Bex Web.
What are variables?
Variables are parameters of a query that are set in the parameter query definition and are
not filled with values until the queries are inserted into workbooks. There are different types
of variables which are used in different application: Characteristics variables, Hierarchies
and hierarchy node, Texts, Formulas, Processing types, User entry/Default
type, Replacement Path.
Can you create a table with fields not referring to data elements?
YES. We can directly give the data type , length and decimals using BUILT-IN TYPE
button.
What are the different types of data dictionary objects?
Tables, Structures, Views, Domains, Data elements, Lock objects, Match code objects,
Search Helps and Type groups.
What should be the approach for writing a BDC program?
STEP 1: CONVERTING THE LEGACY SYSTEM DATA TO A FLAT FILE to internal table
CALLED CONVERSION.
STEP 2: TRANSFERING THE FLAT FILE INTO SAP SYSTEM CALLED SAP DATA
TRANSFER.
STEP 3: DEPENDING UPON THE BDC TYPE
i)call transaction(Write the program explicity)
ii) create sessions (sessions are created and processed.if success data will transfer).
What is the alternative to batch input session?
Call transaction.
How many types of tables exists and what are they in data dictionary?
3 types of tables
i)Transparent tables Exists with the same structure both in dictionary as well as in
database exactly with the same data and fields. Both Opensql and Nativesql can be used.
ii)Pool tables
iii)Cluster tables These are logical tables that are arranged as records of transparent
tables. one cannot use native sql on these tables (only open sql).They are not managable
directly using database system tools.
What is a batch input session?
BATCH INPUT SESSION is an intermediate step between internal table and database
table. Data along with the action is stored in session ie data for screen fields, to which
screen it is passed, program name behind it, and how next screen is processed.
How to upload data using CATT ? Computer Aided Testing Tool
These are the steps to be followed to Upload data through CATT:
Creation of the CATT test case,
recording the sample data input.
Download the source file template.
Modification of the source file.
Upload the data from the source file.
What is Smart Forms?
Smart Forms allows you to create forms using a graphical design tool with robust
functionality, color, and more. Can convert the report to PDF and can be sent through
email or can take a print out also.
How can I make a differentiation between dependent and independent data?
Client dependent or independent transfer requirements include client specific or cross
client objects in the change requests. Workbench objects like SAPscripts are client
specific, some entries in customizing are client independent. If a table has MANDT which
specifies the client then the data related to that table are client dependent.
If you display the object list for one change request, and then for each object the object
attributes, you will find the flag client specific. If one object in the task list has this flag on,
then that transport will be client dependent.
What is the difference between macro and subroutine?
What is the differences between structure and table in data dictionary in ABAP?
Structure and table both are 2/2 matrices but there are many differences between table
and structure.
1. Table can store the data physically but a structure do not store data.
2. Table can have primary key but a structure do not have.
3. Table can have the technical attribute but a structure do not have.
What is an ABAP?
ABAP (Advanced Business Application Programming) is a high level programming
language created by the German software company SAP. It is currently positioned as the
language for programming SAPs Web Application Server, part of its NetWeaver platform
for building business applications.
What is an ABAP data dictionary?
ABAP 4 data dictionary describes the logical structures of the objects used in
application development and shows how they are mapped to the underlying relational
database in tables/views.
What are domains and data element?
Domains:Domain is the central object for describing the technical characteristics of an
attribute of an business objects. It describes the value range of the field. Data Element: It
is used to describe the semantic definition of the table fields like description the field.
Data element describes how a field can be displayed to end-user.
What is foreign key relationship?
A relationship which can be defined between tables and must be explicitly defined at
field level. Foreign keys are used to ensure the consistency of data. Data entered
should be checked against existing data to ensure that there are now contradiction. While
defining foreign key relationship cardinality has to be specified. Cardinality
mentions how many dependent records or how referenced records are possible.
Describe data class ( APPL0, APPL1, APPL2)
Master data: It is the data which is seldom changed.
Transaction data: It is the data which is often changed.
Organization data: It is a customizing data which is entered in the system when the system
is configured and is then rarely changed.
What are indexes?
Indexes are described as a copy of a database table reduced to specific fields. This data
exists in sorted form. This sorting form ease fast access to the field of the tables. In order
that other fields are also read, a pointer to the associated record of the actual table are
included in the index. The indexes are activated along with the table and are created
automatically with it in the database.
Difference between transparent tables and pooled tables.
Transparent tables: Transparent tables in the dictionary has a one-to-one relation with
the table in database.
Table in the database has the same name as in the dictionary.
Its structure corresponds to single database field. Transparent table holds application
data.
Pooled tables. Pooled tables in the dictionary has a many-to-one relation with the table in
database.
Table in the database has the different name as in the dictionary.
Pooled table are stored in table pool at the database level.
What is an ABAP/4 Query or SAP Query reporting?
ABAP/4 Query is a powerful tool to generate simple reports without any coding.
ABAP/4 Query can generate the following 3 simple reports:
Basic List: It is the simple reports.
Statistics: Reports with statistical functions like Average, Percentages.
Ranked Lists: For analytical reports. For creating a ABAP/4 Query, programmer has to
create user group and a functional group. Functional group can be created using with or
without logical database table. Finally, assign user group to functional group. Finally,
create a query on the functional group generated.
What is BDC programming?
Transferring of large/external/legacy data into SAP system using Batch Input
programming. Batch input is a automatic procedure referred to as BDC(Batch Data
Communications). The central component of the transfer is a queue file which receives the
data via a batch input programs and groups associated data into sessions.
What are the functional modules used in sequence in BDC?
These are the 3 functional modules which are used in a sequence to perform a data
transfer successfully using BDC programming: BDC_OPEN_GROUP Parameters like
Name of the client, sessions and user name are specified in this functional modules.
BDC_INSERT It is used to insert the data for one transaction into a session.
BDC_CLOSE_GROUP This is used to close the batch input session.
What are internal tables?
Internal tables are a standard Data Object which exists only during the runtime of the
program. They are used to perform table calculations on subsets of database tables and
for re-organizing the contents of database tables according to users need.
What is the difference between collect and sum?
SUM.
When processing an internal table in a block starting with LOOP and concluded by
ENDLOOP , SUM calculates the control totals of all fields of type I , F and P (see also
ABAP/4 number types ) and places them in the LOOP output area (header line of the
internal table or an explicitly specified work area).
When you use SUM in a LOOP with an explicitly specified output area, this output area
must be compatible with the line type of the internal table.When using LOOP to process a
sorted extract (see SORT ), the control total of F at the end of the group appears in the
field SUM(f) - if f is type I , F or P .
COLLECT.
COLLECT is used to create unique or compressed datasets. The key fields are the
default key fields of the internal table itab . If you use only COLLECT to fill an internal
table, COLLECT makes sure that the internal table does not contain two entries with
the same default key fields.
If, besides its default key fields, the internal table contains number fields,the contents of
these number fields are added together if the internal table already contains an entry with
the same key fields.
If the default key of an internal table processed with COLLECT is blank, all the values are
added up in the first table line.
If you specify wa INTO , the entry to be processed is taken from the explicitly specified
work area wa . If not, it comes from the header line of the internal table itab .
After COLLECT , the system field SY-TABIX contains the index of the existing or new
table entry with default key fields which match those of the entry to be processed.
COLLECT can create unique or compressed datasets and should be used precisely for
this purpose. If uniqueness or compression are unimportant, or two values with identical
default key field values could not possibly occur in your particular task, you should use
APPEND instead. However, for a unique or compressed dataset which is also efficient,
COLLECT is the statement to use.
If you process a table with COLLECT , you should also use COLLECT to fill it. Only by
doing this can you guarantee that the internal table will actually be unique or compressed,
as described above and COLLECT will run very efficiently.
If you use COLLECT with an explicitly specified work area, it must be compatible with the
line type of the internal table.

Q. What is sequence of event triggered in report?
1) Initialization
2) At Selection-Screen
3) Start-of-Selection
4) Get
5) Get Late
6) End-of-Selection
7) Top-of-Page
8) End-of-Page
9) At Line Selection
10) At User Command
11) At PF (nn)
What are events in ABAP reports?
Answer1:
For Classical Reports,
1.Initialization
2. At Selection-Screen
3. Start-of-selection
4. End-of-selection
5. Top-of-page
6. End-of-page
7.At User Command
8.At PF (nn)
For Interactive Reports,
1) Initialization
2) At Selection-Screen
3) Start-of-Selection
4) Get
5) Get Late
6) End-of-Selection
7) Top-of-Page
8) End-of-Page
9) At Line Selection
10) At User Command
11) At PF (nn)
What are Control Break Statements?
1.at first
2.at new
3. at end
4. at last.
What are standard layouts sets in the SAP Script?
There are four standard layouts in the SAP Script:
1) Header
2) Logo
3) Main Window
4) Footer
What are the various types of selection screen event?
SELECTION-SCREEN BEGIN OF BLOCK ABC WITH FRAME TITLE
T01.
SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
CALL SELECTION-SCREEN 500 STARTING AT 10 10.
What is the difference between Table and Template?
Table is a dynamic and template is a static
When do we use End-of-selection?
End-of-selection event are mostly used when we are writing HR-ABAP code. In the HR-
ABAP code, data is retrived in the Start-of-selection event and Printing on the list and all
will be done in End-of-selection event.
In events start-of-selection is default event. When we have to use this event explicitly? and
Why?
The default event in the ABAP is Start-of-selection.We have to call explicitly this event
when you are writing other than ths event that is when you write AT SELECTION-
SCREEN EVENTS OR INITIALIZATION EVENT etc,you have to explicitely mention the
Start-of-selection event while you are writing the logic.
Before these events called, all the code you have written come into this default Start-of-
selection screen event.
What is the differences between ABAP and OOABAP. In which situation we use
OOABAP?
OOABAP is used to develop BSP/PCUI applications and also anthing involved object
oriented like BADIs, SmartForms..etc.where as ABAP is used to develop traditional
programs in R/3.
What is table buffer? Which type of tables used this buffer?
buffer is nothing but a memory area. table is buffered means that table information is
available on application server. when you call data from database table it will come from
application server.
transperent and pooled tables are buffered. cluster tables can not buffered.
What is the use of pretty printer ?
Exactly where can we link the functional module to abap coding.
Pretty Printer is used to format the ABAP Code we write in ABAP Editor ,like KEY WORDS
in Capitals and remaining are in small letters which is also depend on system settings.
-------------------------------------------------------------------------
We can call the function module in the ABAP Code .Press the Pattern button on Appl. tool
bar then u will get box where u write the function module NAME which u want to call in the
code by selecting the radio button CALL FUNCTION. In this way we link function module to
ABAP Code.
What is the difference between SAP memory and ABAP memory?
Answer1:
data sending between main sessions using get parameter and set parameter is sap
memory
data sending between internal sessions using import or export parameters is abap memory
Answer2:
sap memory is a global memory whereas abap memory is local memory.
For example, we have four programs in abap memory and assigned some varibles to a
particular program in abap memory then those varibles cant be used by anyother program
in abap memory i.e., the variables are only for that program and also local to that
memory,whereas sap memory can access all the abap memory or else it can perform any
kind of modifications.
Answer3:
SAP memory is available to the user during the entire terminal session.
ABAP memory is available to the user during life time of external session.
-------------------------------------------------------------------------
What is the difference between Type and Like?
Answer1:
TYPE, you assign datatype directly to the data object while declaring.
LIKE,you assign the datatype of another object to the declaring data object. The datatype
is referenced indirectly.
Answer2:
Type is a keyword used to refer to a data type whereas Like is a keyword used to copy the
existing properties of already existing data object.
Answer3:
type refers the existing data type
like refers the existing data object
-------------------------------------------------------------------------
What is Tcode SE16. For what is it used. Explain briefly?
Answer1:
SE16 is a T-code for Data Browser
Generally used to search the fields of SAP Tables . and respective data.
What are different ABAP/4 editors? What are the differences?
The 2 editors are se38 and se80 both have the abap editor in place. In se38 you can go
create programs and view online reports and basically do all thedevelopmet of objects in
this editor.
In se80 ( object navigator) there are additional features such as creating packages,module
pool , function group ,classes, programs ( where you can create ur programs) and BSP
applications .
-------------------------------------------------------------------------
What is difference between dialog program and a report?
Report is a excecutable program
Dialog is a module pool program.It has to be executed via a transaction only.
Dialog programming is used for customization ofscreens
How do you connect to the remote server if you are working from the office for the
client in remote place.
WAS web application server or ITS are generally used for this purpose. If you are sitting at
your office with a server which is in the system and the other server is at the clients place
you can generate IDOC, intermidiate documents which carry the data you want to transfer
or the documents you want to transfer, these IDOC are interpretted by the system at the
recieving end with the message class with which it is bound with. If you want to logon a
system which is very distant..then remote login can be used this depends on the internet
speed.
Explain about roll area , Dispatcher, ABAP-Processor.
Dispatcher recieves the request from client and assigns the request to one of the work
process.
Roll area: Each workprocess works in a particular memory known as Role Area, which
consists of User context and session data.
ABAP- Processor :is an interpretor which can execute logic
-------------------------------------------------------------------------
Which one is not an exit comand ? (Exit, cancel, stop, back)
STOP.
Effect :The statement STOP is only to be used in executable programs
EXIT.
Effect :If the EXIT statement is executed outside of a loop, it will immediately terminate
the current processing block.
BACK.
Effect : This statement positions the list cursor on the first position of the first line in a
logical unit.
So Cancel is not an exit command
What is Field symbol ?
You can use field symbols to make the program more dynamic. In this example the name
of a table control is substituted by a field symbol. Thus you cal call the form with any
internal table, using the name of the table control as a parameter.
fieldsymbol has the same concept as pointer in c,
fieldsymbol dont point to a data type like char, num instead of that it points to the memory
block. the syntax for fieldsymbol is
-------------------------------------------------------------------------
What is lock object ?
LockObjects used to synchornize access of several users using same data.
-------------------------------------------------------------------------
Why BAPI need then BDC ?
BAPIS provide the standard interface to other applications apart from SAP and within
differnt vesions of SAP too. Also it is OOD bases so dosent depends on screen flow. BDC
gets failed if we make changes for screen changes through IMG customization
What is a collect statement? How is it different from append?
APPEND :
IT IS USED TO GET THE RECORD FROM THE INTERNAL TABLE HEADER TO THE
BODY AREA
IT ALLOWS DUPLICATION
COLLECT:
IT IS USED TO A GET A RECORD FROM HEADER TO THE BODY AREA BUT IT WILL
NOT ALLOW ANY DUPLICATION EXCEPT IF THERE IS ANY NUMERIC FIELS IT ADDS
THAT FIELDS DATA BUT NOT AS A NEW RECORD
On ABAP: Did you set up a workflow? Are you familiar with all steps for setting up a
workflow?
Yes.
Execute the Txn SWDD(Creating a new Workflow).
In the header of the Workflow, define the Business Object and Event you refer to for
triggering the Wf.
Create the Steps required for your workflow(Activity).
Inside the Activity, Create the task and assign the Business Object and the related method
for that business object.
Activate the Workflow.
In the select statement what is group by?
The GRO!P/B" lause allo&s 'ou to su!!ari>e lines that have the sa!e ontent in 5artiular
olu!ns. Aggregate funtions are a55lie" to the other olu!ns.
SELECT 2;..45 MIN( 6.42= ) MAX( 6.42= )
INTO (2;..45A /414/0/A /;B4/0/)
FROM >,<48C3
GRO!P B" 2;..45.
WRITED E 2;..45A /414/0/A /;B4/0/.
ENDSELECT.
From Excel to ABAP Is batch mode possible ?
DATA w_file TYPE string.
* Convert the file path into string
w_file = p_input.
* Internal Table should have same field sequence as EXCEL File.
CLEAR t_upload.
REFRESH t_upload.
* Call function to upload the data into internal table
CALL FUNCTION GUI_UPLOAD
EXPORTING
filename = w_file
filetype = ASC
has_field_separator = X
TABLES
data_tab = t_upload
* Delete the first row of heading from the uploaded table
DELETE t_upload INDEX 1.
ENDIF. IF sy-subrc EQ 0.
What are the advantages and disadvantages of using views in ABAP programming ?
Advantages:
view is used to retrieve the data very fastly from the database tables
*memory wastage is reduced
*faster than joins to retrieve the data from database tables
disadvantages:
view is not a container,it will not hold the data
*view memory is not permanent memory
How data is stored in cluster table?
A cluster table contains data from multiple DDIC tables.
It stores data as a name value pair ( varkey, vardata)
How to create client independent tables?
client independent tables:
the table in which the first field is not mandt is the client independent tables
*mandt is the field with mandt as the data element
*automatically client which we login is populated to mandt
What type of user exits ?
1.function exit
2.menu exit
3.screen exit.
4.field exit.
How can you debug a script form?
SE71 - give the form name then go to utilities = > activate debugger
How do we debug sapscript? Use RstxDBUG or
First put Break point in Print program where ever you want to stop the execution.
After in SE71 give your form name and go to Utilities = > Active De-bugger.
Then go to your transcation like VF03(for Invoice or Credit memo) etc to see the print
preview or print the form execute it.
When you execute it the the form Debugging will get activated and you can see your Form
execution step by step.
What are the different types of data dictionary objects?
Answer1
Data Dictionary Objects
* Tables
* Views
* Domain
* Data Element
* Type Groups
* Search Helps/Matchcode Objects
* Lock objects
* Structure type
* Table Types
A table is buffered. By select statement I dont want to get the data from table buffer. I want
to get the data from database. How?
SELECT FROM * tablename BYPASSING BUFFER. ..
What are user exits? What are customer exits?
User exit is a part of Modification.
Customer Exit is a part of Enhancement. Customer exit has Function exit, menu exit and
screen exit.
User exit -developed for SD (include names will be UserExit_name which has empty
subroutines)A user exit is a three character code that instructs the system to access a
program during system processing.
SXX: S is for standard exits that are delivered by SAP. XX represents the 2-digit exit
number.
UXX: U is for user exits that are defined by the user. XX represents the 2-digit exit number
What is the difference between start_form and open_form in scripts? Why is it
necessary to close a form always once it is opened?
Start_form is used to initialize the layout.
Open_form is used to initialize the spool request.
Gou !ust en" for! 5rinting (' using the funtion !o"ule CLOSE_HORM.
Other&ise= the s'ste! "oes not 5rint or "is5la' an'thing.
--------------------------------------------------------------------
What is difference between At New Field and ON Change?
In case if you want calculate sub total for same values in a field you can use the atnew
statement.ie:
For example in a table sflight, there are 2 fields carrid ( airline id) and seatsmax( seat
available). In case if you want calculate the total number of seats available for each carrrid.
In the same scenario if you use onchange of it will not return the total seats for each carrid,
instead it will return the total seat count for the entire table( ie: for all the carrids in the
table.
Another diffrence is atnew can be used only between loop and end loop whereas on
change of can also be used in select- endselect , do -enddo.
Another diffrence is while using atnew in case if you code any write statements between
atnew and end at the value for the numeric fields will be returned as 0 and that of no
numeric fields will be returned as *(asteriks). But in on change of the orginal values will be
returned.
----------------------------------------------------------------------
Select single * and select upto 1 row diffrence.
The select single * from stmt selects only one row form the database table and puts it in to
the work area(internal table).
The select upto N rows stmt selects all the rows from the database table but writes only the
specified number of rows specified by the n into the internal table. If its given as upto 1
rows only 1 row is written in to the internal table.
-------------------------------------------------------------------
When you create sales report, What you can see in that report ? What are those field
names or data element names?
vbak-auart, ORDER TYPE
vbak-audat, DOCUMENT DATE
vbak-kunnr, CUSTOMER
vbak-bstnk, PURCHASEORDERNO
vbak-submi, collective no
vbrp-posnr, ITEM
vbrp-matnr, MATERIAL NUMBER
vbrp-arktx, DESCRIPTION
vbrp-fkimg, ORDER QTY
vbrp-vkbur, SALESOFFICE
vbrp-aubel, SALES DOCUMENT
vbrk-netwr, NETPRICE
vbrk-vbeln, BILLINGDOCNO
vbrk-knumv, DOC.CONDITION
kna1-name1, CUSTOMERNAME
vbrp-werks, PLANT
vbrk-kunrg, PAYER
kna1-name1, PAYER NAME
vbpa-kunnr, EMPLOYEENO
vbrk-netwr, DISCOUNT
vbrk-netwr,NETAMT
vbrk-netwr,INVAMT
vbrk-fkart, billing type
vbrk-netwr, CST
konv-kbetr, CST PER
vbrk-netwr, LST
konv-kbetr, LST PER
vbrk-netwr, ED
konv-kbetr, ED PER
vbrk-netwr, Ecs
konv-kbetr, Ecs PER
vbrk-netwr, SURCHARGE
vbrk-fkdat, BILLINGDATE
kna1-name1, EMPLOYEENAME
vbak-bstdk, PODATE
likp-bolnr, Bill Of Lading
likp-traty, Means of Transport Type
likp-traid, Means of Transport ID
vbpa-kunnr, Bill To Party
kna1-name1, Bill To Party Name
vbrk-netwr, Net Amount Basic Amount Discount
How to assign multiple transaction codes in a session method to BDC_Insert function
module?
Call function BDC_Insert
exporting
tr. code = enter tr.code1 here
table = give an internal table related totr.code1 here
call function BDC_INSERT
exporting
tr.code = enter 2nd tr code
tables = 2nd internal table
-----------------------------------------------------
Check and Continue. What is the difference?
Check statement, checks the condition with in a loop and if it satisfies the condition, the
control moves to next statement in the loop. Otherwise, it terminates the loop.
Continue statement, acts like goto statement. If the condition is true, it processes the
remaining statements and if the condition is false, then the control moves to the top of
loop.
----------------------------------------------------
At-Line selection, At user-command etc..,
In at line-selection system defined fcode will be generated
In at user-command we need to define the fcode and fkey manually then only it will
triggers.
----------------------------------------------------
Exit and Stop. What is the difference?
exit statments is exits the current loop. and moving to next loop
but stop statement move to end of selection. its not check all other loops.
----------------------------------------------------
What is the reserve command?
RESERVE
If insufficient space is there for listing output reserve statement encounters NEW-
PAGE.But before going to new page it processes END-OF-PAGE.
----------------------------------------------------
How can validate input values in selection screen and which event was fired?
Answer1:
We can Validate Selection Screen With the Help of the Following Events, the Event
Follows the Same hierachy.
AT SELECTION-SCREEN ON
AT SELECTION-SCREEN ON BLOCK
AT SELECTION-SCREEN OUTPUT
AT SELECTION-SCREEN.
Answer2:
At selection-screen on
select stmt where = .
if sy-subrc = 0.
validation success for LOw value in selection screen
At selection-screen on
select stmt where =
if sy-subrc NE 0.
validation failure on high value in the selection field.
else
success.
endif
----------------------------------------------------
BDC Transaction code? = bdc recording
Transaction code for bdc :SHDB
----------------------------------------------------
How to navigate basic list to secondary list?
We can Navigate from basic list to secondary list with the help the event called AT LINE-
SELECTION. for every Secondary List the System Field SY-LSIND increases by 1. So
there will be Totally 21 list possible in SAP.
One Basic List 20 Secondary List.
----------------------------------------------------
Which is the First character of creating LockObject?
LockObjects always starts with character E.
----------------------------------------------------
How many types of standard SAP Internal Tables?
1)standered table
2)index table
3)hashed table
4)sorted table
----------------------------------------------------
What is the Difference Between Tablecontrols and Step Loops?
Table controls have both horizontal and vertical scrollers and cursor control logic is
designed implicitly.
Step loops have only horizontal scrollers and cursor control logic is to be designed by the
user explicitly.
----------------------------------------------------
What are the Events in Dialog Programs?
Events in Dialog Programming are:
PBO-Process Before Output
PAI-Process AFter Input
POH-Process on Help Request
POV-Process on Value Request
----------------------------------------------------
How many ways you can create Table?
two ways.
1.Top-to-bottom approach: first fields are defined and later domain and data element are
defined.
2.Bottom-to-top approach: first domain and data element are defined and later fields are
defined.
----------------------------------------------------
What are the Cluster Tables?
Cluster tables contain continuous text, for example, documentation. Several cluster tables
can be combined to form a table cluster. Several logical lines of different tables are
combined to form a physical record in this table type. This permits object-by-object storage
or object-by-object access. In order to combine tables in clusters, at least parts of the keys
must agree. Several cluster tables are stored in one corresponding table on the database.
----------------------------------------------------
What are function modules in LDB?
Function modules in LDBs are
get
put
get late
----------------------------------------------------
What are Difference Between Classical Batch Input and Call Transaction?
Answer1:
1.In Batch input many transactions can be executed, where as in Call transcation only one
transactioin can be executed.
2.BI is Synchronous process, Ct is both Asynchronous and Synchronous.
3.BI Sessions cannot be runed parallel.
4.Log file is generated automaticly in BI, errors can be found through BDCMSGCOLL.
5.batch input works for multiple applications where as call transactions doent work
6.batch input has sy-subrc check with the database where as call transaction doesnt have
so call transaction is fast.
----------------------------------------------------
How can you call the Sessions?
using transaction code SM35
----------------------------------------------------
Can you call Report in SAP Script?
Yes, we can.
Just write in Line editor:
/:perform f_display_report

SUBMIT REPORT-
-
/:endperform
THIS PERFORM WOULD BE DECLARED IN THE PRINT PROGRAMME IN WHICH YOU
CAN ALWAYS WRITE STATEMENT
---------------------------------------------------------------------
How to Upload Logo to Layout Set and what is Program Name?
You can also upload a Logo in BMP format it has to be saved as %^ Colours if it is a
colour Bitmap.
If you dont save a colour Bitmap as 256 Colours then it will be uploaded in Black.
This can be done in Smart Forms, SAPScript or Transaction SE78
-//-//-
What are the SET Parameter and GET Parameter?
To use parameter IDs, you need to set (store) values in the global memory area and then
get (retrieve) values from this parameter ID memory area. IIn the case of an online
program, you will set values from screen fields and you will get these values for screen
fields. YYou can perform this set/get function two ways: Use the ABAP statements
SET PARAMETER ID and GET PARAMETER ID. Use the field attributes SPA and
GPA . RRemember that parameter IDs can only be used with ABAP Dictionary fields
because parameter IDs are linked to data elements. The appropriate data elements must
have a parameter IDs for this set/get function to work.
What are Text Elements?
Text elements makes program easier to maintain program texts in different languages.
These are used for maintainig list headers,selectiontexts in programs
What is an Interactive Report?
An Interactive report allows the user to participate in retrieving and present data at each
level.while classical report doesnt have access to interact
What are Layout set Elements?
layout set elements are
1.header 2.peragraph formats 3. character formats 4. windows 5. pages 6.page windows
Distinguish between setscreen and call screen?
In the case of setscreen the entire processing of the current screen takes place and then
the system branches out to next screen.if u want to branch out to the next screen without
processing the current screen then LEAVE SCREEN should be used along with SET
SCREEN.
CALL SCREEN is usually used for pop up screens.
What is ABAP Memory and SAP Memory?
Answer1;
SAP memory is a memory area to which all main sessions within a SAPgui have access.
You can use SAP memory either to pass data from one program to another within a
session, or to pass data from one session to another. Application programs that use SAP
memory must do so using SPA/GPA parameters .
ABAP memory is a memory area that all ABAP programs within the same internal session
can access using the EXPORT and IMPORT statements. Data within this area remains
intact during a whole sequence of program calls. To pass data to a program which you are
calling, the data needs to be placed in ABAP memory before the call is made. The internal
session of the called program then replaces that of the calling program. The program
called can then read from the ABAP memory.
Answer2;
1. SAP memory is for cross-transaction Applications and ABAP/4 memory is transaction-
specific.
2. The SAP memory, otherwise known as the global memory, is available to a user during
the entire duration of a terminal session. Its contents are retained across transaction
boundaries as well as external and internal sessions. The contents of the ABAP/4 memory
are retained only during the lifetime of an external session. You can retain or pass data
across internal sessions.
3. The SET PARAMETER and GET PARAMETER statements allow you to write to, or
read from, the SAP memory. The EXPORT TO MEMORY and IMPORT FROM MEMORY
statements allow you to write data to, or read data from, the ABAP memory.
Explain Check Table and Value Table ?
check tabke works at table level and value table works at domain level.
check table is nothing but master table that u will create with valid set of values.
value table it provides the list of values and it will automatically proposed as a check table
while creating foreing key relationship
How many types of Standard Internal Tables?
- STANDARD TABLE:
The key is, by default, set to NON-UNIQUE. You may not use
the UNIQUE addition.
- SORTED TABLE:
Unlike stadard tables, sorted table have no default setting
for the uniqueness attribute. If you do not specify either
UNIQUE or NON-UNIQUE, the system defines a generic table
type, where uniqueness is irrelevant. You can use generic
types to specify the type of generic subroutine parameters.
- HASHED TABLE:
Hashed tables have no default setting. You must use the
UNIQUE addition with hashed tables. You may not use
NON-UNIQUE.
What is Refresh in Internal Table?
Refresh is the keyworld which clears the contents of an internal table body.
What is the Difference Between Collect and Sum?
COLLECT allows you to create unique or summarized datasets. The system first tries to
find a table entry corresponding to the table key. The key values are taken either from the
header line of the internal table itab, or from the explicitly-specified work area.
If the system finds an entry, the numeric fields that are not part of the table key (see ABAP
number types) are added to the sum total of the existing entries. If it does not find an entry,
the system creates a new entry instead.
The way in which the system finds the entries depends on the type of the internal table:
- STANDARD TABLE:
The system creates a temporary hash administration for the table to find the entries. This
means that the runtime required to find them does not depend on the number of table
entries. The administration is temporary, since it is invalidated by operations like DELETE,
INSERT, MODIFY, SORT, ). A subsequent COLLECT is then no longer independent of
the table size, because the system has to use a linear search to find entries. For this
reason, you should only use COLLECT to fill standard tables.
- SORTED TABLE:
The system uses a binary search to find the entries. There is a logarithmic relationship
between the number of table entries and the search time.
What are the ways of creating Tables?
There are two ways to create table
1) top-down approach
2) bottom-up approach
What are Function Modules?
Answer1:
Function modules is a extranal subroutine.we can call it to outside the program.its a mini
program. its used for redues the coding,easy to find error.
Answer2:
Function modules is like a small program (is not a suboutine because sub-routines are not
standalone objects-i.e we cannot execute them alone) which are similar to functions
in C.
We can pass the varible and get the return values even with out knowing what is
happening in its code.
They are standalone programs-i.e.we can debug and execute them alone unlike
subroutines and macros and includes.
What is CAT?
CAT Computer Aided Test Tool. Used to create test cases for application testing
purposes.
What is LDB?
Logical Database is an ABAP program which retrieves data from various tables
Which are interrelated and provides a read only view of the data.
What are the EVENTS in Report Program? What are EVENTS In Interactive Report and
Explain?
Classical Report Events are
LOAD OF PROGRAM.INITIALIZATION.
AT SELECTION-SCREEN.START-OF-SELECTION.
TOP-OF-PAGE.END-OF-PAGE.
END-OF-SELECTION.
Interactive events are
AT LINE-SELECTION.
AT USER-COMMAND.
TOP-OF-PAGE DURING LINE-SELECTION.
AT LINE-SELECTION:Allows the user to interact with the lists.
AT USER-COMMAND:USed for handling Push buttons.
SET PF-STATUS:Provides User Interface.
What are the various techniques of BDC?
call transaction
session method
direct input method
What is SQL Trace?
SQL Tracer is a tool used to measure the performance of ABAP program.
T.code :st05
What is LUW?
It is a span of time during which database records are updated either
commit or rollback.
Have you worked with reading and writing data on to files?
YES, open dataset for output. read dataset from itab. close dataset .
Have you created tables in SAP? What are client dependent and independent tables? How
do you create independent tables?
Tables which are having MANDT field is called as client dependent tables. Tables which
are not having MANDT field is called as client dependent tables.
Have you used SM30 and SM31 transactions?
sm30 is used to view the Call Up View Maintenance and SM31 is to view the Table
maintenance with
How many dictionary objects are there and list all
Available Dictionary Objects are Domains, Viwes, Match Codes, Lock Objects, Structures,
Data Elements, Intenal Types.
What is the difference between transparent and non transparent database tables?
Transparent tables have 1 1 cardinality b/w Data Dictionary and Database, and non
transparent ( Cluster and Pooled) tables have Many 1 cardinality.
Transparent table can access with using OPen & NAtive SQL stmts where as
Nontransparent only OPen Sql.
Transparent trables can store Table relevent data and non transparent tables can store
system data/ application data based on the transparent tables
What is meant by BDC. How many methods of BDC are there?
BDC -> BATCH DATA COMMUNICATION.
METHODS OF BDC-> Direct Input method, Batch Input Session method, Call transaction
method.
What are the difference between table controls and step loops in dialog programming?
1. Function modules use a special screen to define the parameters where as subroutines
use the same ABAP/4 editor to define its parameters.
2. Tables work area can be commonly shared by calling program and subroutine where as
function modules do not share commonly.
3. Calling a function module syntax (Call function.) is different from calling a subroutine
syntax (perform.).
4. With raise statement user can exit from a function module where as exit is used in
subroutines.
What is ALE, IDOC , EDI , RFC. Explain briefly.
ALE: application linking enabling
IDOC: intermediatary documents
EDI: electronic data interchange
RFC: remote function call
What is a binary search?
Binary Search is used in internal table for searching the records. its means record
searched one by one from top & bottom both side.so its a easy nd fast way to find the
record.bt pointer searching is better.
Types of User Exits, what kind of work is done on these exits?
File Exit, Menu Exit, Function Exit.
How will you find out where the user exits are available?
CMOD : This transaction allows you to create a PROJECT by identifying its
ENHANCEMENT(S). After determining all of the ENHANCEMENTS that are part of the
PROJECT, you will have to activate the PROJECT. You will still need to code your user-
exit; therefore, you may want to wait until this step is completed before activating the
PROJECT.
SMOD : This transaction allows you to create an ENHANCEMENT, which you will
include in a PROJECT, by identifying its COMPONENT(S). In the case where SAP has
already created an ENHANCEMENT for its pre-defined user-exits, you will not need to use
transaction SMOD; instead, you should just use transaction CMOD.
Have you created any transactions?
Yes,
We can use TC SE93 for creating our own transaction code.
Difference between Table-Controls and Step-loops?
Table controls are modified / mproved versions of step loops.
in controls we can do,
horizontal scrolling,
vertical scrolling,
scrolling in a perticular field,
resize the table,
can save the settings for future use,
can make selective columns editable,.etc
these things are not possible with step loops.
step loops are controlled by loop-endloop statements.
Import and Export
ABAP memory is a memory area that all ABAP programs within the same internal session
can access using the EXPORT and IMPORT statements. Data within this area remains
intact during a whole sequence of program calls. To pass data to a program which you are
calling, the data needs to be placed in ABAP memory before the call is made. The internal
session of the called program then replaces that of the calling program. The program
called can then read from the ABAP memory. If control is then returned to the program
which made the initial call, the same process operates in reverse.
How many interactive reports did you write?
In an Interactive Report, user can define maximum 20 secondary lists.
What is an Unpack command
UNPACK field1TO field2 .Unpacks the packed field field1 and places it in the field field2
with leading zeros. If field2 is too short, it is truncated on the left.
What is the difference between updated project and end to end project. explain
Answer1:
Some organisations select to implement SAP module by module, thus gets updated as per
their convenience / schedule. This is called as updated project.
Some organisations simply plan all integrated functional modules and decide to go-live
with all functional modules and take their entire operations on SAP. This is called as End to
End SAP implementation project.
Answer2:
Upgrade Project is a project where in SAP is already in place and it is the version upgrade
from a lower end to a higher version.
End to End project is a project where SAP is implemented for the first time.
The other way is to assign that item to the vendor and maintain info records and update it
by using ME11. This can also be done manualy.
Answer2:
This is not possible. Price comaprison session only gives you the idea which supplier has
given the best price for a particular material.you have to raise the po ME21N transaction
only.
Answer3:
The vendor who has got best price will have a unique quotation number. USe ME21N
transaction and create PO with respect RFQ from Overview tab .
What is the difference between internal table and structure?
There are there types of structure:-
1. Flat structure( elementary fields)
2. Nested structure ( type reference to other structure)
3. deep structure ( type reference to database tables)
Explain row type and line type concept
line type refers to the structure of an internal table,whereas row type is the actual part that
contains the data and it refers to the table body.creating internal table using line type and
row type concept is for reusability purpose.Line type and Row type are defined at DDIC
LEVEL.
Can any one give me brief explanation about internal tables, and work area ?
*An internal table is a run time instance. It get created when program starts execution.
*It get destroyed when program terminates. It has two different parts: HeaderLine(optional)
and Body(Compulsory).
*Any value that comes to or goes from interanal table, that travels through headerline.
How to eliminate duplicate entries in internal tables?
Answer1:
SORT itab.DELETE ADJACENT DUPLICATES FROM itab COMPARING ALL FIELDS.
Answer2:
The following syntax:
SORT itab .
delete adjcent duplicates from itab comparing .
Size of the internal tables?
The size of the internal tables are set using the occurs n clause. Here n refers to a integer
number that specifies the size. Usually its given as occurs 0 which creates an itab with the
memmory space of 8kb.
What is the basic difference internal tables and database tables? How can we differentiate
by looking at the tables? Handling of internal tables
The basic difference is database tables are stored in DB server
and the internal tables are virtual tables these are created run time only
Internal tables are created dynamically, the memory of internal tables is not
permant memory, for internal tables the memory will be created in the application server
and it is external memory and terminates after the program termination.
What is the difference between updated project and end to end project. explain
Answer1:
Some organisations select to implement SAP module by module, thus gets updated as per
their convenience / schedule. This is called as updated project.
Some organisations simply plan all integrated functional modules and decide to go-live
with all functional modules and take their entire operations on SAP. This is called as End to
End SAP implementation project.
Answer2:
Upgrade Project is a project where in SAP is already in place and it is the version upgrade
from a lower end to a higher version.
End to End project is a project where SAP is implemented for the first time.
Describe how to setup a printer in SAP or where they would look to research why a
user/users can not print?
SPAD, SP01, SM50, SU01
Have you used performance tuning? What major steps will you use for these?
First of all tuning can be done in three ways:
disk i/o ,sql tunning , memory tunning,
Before tunning u have to get the status of your database using
Oracle utility called statpack , tkprof, then you should go for tunning
Posted 6th May 2010 by Blaster
Labels: Big set ABAP Interview questions
0
Add a comment
G.
May
6
Difference between check table and value table?
Difference between a check table and a value table
Value Table ( wont be used in search help)
This is maintained at Domain Level.
When ever you create a domain , you can entered allowed values. For example you go
to Domain SHKZG - Debit/credit indicator. Here only allowed values is H or S.
When ever you use this Domain, the system will forces you to enter only these values.
This is a sort of master check . To be maintained as a customization object. This mean that
if you want to enter values to this table you have to create a development request &
transport the same.
Check table(used in search help)
For example you have Employee master table & Employee Transaction table.
When ever an employee Transacts we need to check whether that employee exists , so we
can refer to the employee master table.
This is nothing but a Parent & Child relationship . Here data can be maintained at client
level , no development involved.
As per DBMS what we call foregin key table, is called as check table in SAP.
There is 1 more important Difference in Value Table and Check Table is that:
1. The contents of the check will be used as an input help(F4 Help) for a particular field on
which a check table is assigned.
But the contents of Value Table are never used in Input Help.
Posted 6th May 2010 by Blaster
Labels: difference between type
0
Add a comment
O.
P.
May
6
How can you bypass buffer in SAP
Statements /'#assing the /uffer
More o!5le# .ueries get 5asse" onto the "ata(ase server instea" of using the ta(le (uffer.
Suh .ueries are the follo&ing,
An' SELECT &ith a su( .uer' or &ith +oins
An' set funtion PCO$9T= MI9= MAX= S$M= A8?)
?RO$P %G
-A8I9?
SELECT DISTI9CT
ORDER %G Pother than PRIMARG :EG) [ the "ata store" in the (uffer is al&a's or"ere"
(' the 5ri!ar' 1e'. An' other or"ering !ust (e 5erfor!e" (' the "ata(ase.
The SELECT state!ents ('5ass the (uffer,
1 The B"PASSING B!FFER a""ition in the FROM lause
2 The DISTINCT a""ition in the SELECT lause
3 Aggregate e#5ressions in the SELECT lause
4 Joins in the FROM lause
5 The IS N!LLon"ition in the WHERE lause
6 Su(.ueries in the WHERE lause
7 The ORDER B" lause
8 The GRO!P B" lause
9 The FOR !PDATEa""ition
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
Also
Jueries /'#assing the /uffer
SE-ECT GKL S"P /?P"SSING /%,,ER KG Q ,R)* MGTA%
<ERE :EGB 3 \ A9D :EGC 3 \
SE-ECT Q ,R)* MGTA% <ERE :EGB 3 \
SE-ECT Q ,R)* MGTA%
<ERE :EGB 3 \ "ND :EGC 3 \ )R :EGB 3 \
SE-ECT *".PDATA) ,R)* MGTA% <ERE :EGB 3 \ :EGC 3 \
SE-ECT Q ,R)* MGTA%
<ERE :EGB 3 \ "ND :EGC 3 \ "ND DATA 3
PSE-ECT DATA ,R)* MGTA% <ERE :EGB 3 \ "ND :EGC 3 \)
Posted 6th May 2010 by Blaster
Labels: Explain
0
Add a comment
M.
May
6
Difference between Data class and delivery class?
Data C$ass
The "ata lass "eter!ines the #h'sica$ area of the data2ase Pta(les5ae) in &hih the ta(le
is reate".
Gou set the "ata lass in the tehnial settings for the ta(le.
There are L "ata lasses onl' three of &hih are a55ro5riate for a55liation ta(les,
] "PP-B+ *aster data P"ata fre.uentl' aesse" (ut rarel' u5"ate").
] "PP-0+ Transaction data P"ata that is hange" fre.uentl').
] "PP-1+ )rganiMationa$ data Pusto!i>ing "ata that is entere" &hen s'ste! is onfigure"
an" then rarel' hange").
The other t&o t'5es are,
] $SR / Custo!er Data lass
] $SRB [ Custo!er "ata lass / Inten"e" for usto!erSs o&n "evelo5!ents.
De$iver' C$ass
] The "eliver' lass contro$s the degree to 6hich the S"P or the customer is res#onsi2$e
for ta2$e maintenance(
] 7hether SAP 5rovi"es the ta(le &ith or &ithout ontents.
] Determines the ta2$e t'#e(
] Deter!ines ho6 the ta2$e 2ehaves 6hen it is first insta$$ed9 at u#grade9 6hen it is
trans#orted9 an" &hen a lient o5' is 5erfor!e".
There are the follo&ing "evelo5!ent lasses, "9S9C9-
Q ", A55liation ta(le P!aster an" transation "ata).
Q C, Custo!er ta(le= "ata is onl' !aintaine" (' the usto!er.
Q -, Ta(le for storing te!5orar' "ata.
Q ?, Custo!er ta(le= SAP !a' insert ne& "ata reor"s (ut !a' not over&rite or "elete e#isting
ones. The usto!er na!es5ae !ust (e "efine" in ta(le TRESC. To "efine the usto!er
na!es5ae use re5ort RDD:ORL6. Gou an start it "iretl' fro! the ta(le !aintenane ('
hoosing Custo!er na!es5ae "efinition on the Attri(utes ta(.
Q E, S'ste! ta(le &ith its o&n na!es5ae for usto!er entries. The usto!er na!es5ae !ust
(e "efine" in ta(le TRESC. To "efine the usto!er na!es5ae use re5ort RDD:ORL6. Gou
an start it "iretl' fro! the ta(le !aintenane (' hoosing Custo!er na!es5ae "efinition on
the Attri(utes ta(.
Q S: S'ste! ta(le= "ata hanges have the status of 5rogra! hanges.
Q 7, S'ste! ta(le Pe.g. ta(le of the "evelo5!ent environ!ent) &hose "ata is trans5orte" &ith
its o&n trans5ort o(+ets Pe.g. R@TR PRO?= R@TR TA%L= et.)
Posted 6th May 2010 by Blaster
Labels: difference between type
Types of index in SAP
What is meant by Primary Index and Secondary Index
Explain the what is primary and secondary index.
The primary index contains the key fields of the table and a pointer to the non-key fields
of the table. The primary index is created automatically when the table is created in the
database.
You can also create further indexes on a table. These are called secondary indexes. This
is necessary if the table is frequently accessed in a way that does not take advantage of
the sorting of the primary index for the access.
Different indexes on the same table are distinguished with a three-place index identifier.
Lets say you have an ODS and the Primary Key is defined as Document No, Cal_day.
These two fields insure that the records are unqiue, but lets lay you frequently want to run
queries where you selct data based on the Business Area and Document Type. In this
case, we could create a secondary index on Bus Area, Doc Type. Then when the
query runs, instead of having to read every record, it can use the index to select records
that contain just the Bus Area and Doc type values you are looking for.
To request the DB to use the secondary index you created:
SELECT Q HROM SPHLI
V_INTS )R"C-E NINDE.@OSP,-IO OSP,-IPBB0OAN
Basic ABAP interview questions and answers
<. <hat is S"P RG3Q The thir" generation set of highl' integrate" soft&are !o"ules
that 5erfor! (usiness fns. (ase" on !ulti national lea"ing 5raties.
F. Primar' &e' fiel" is the the "ata(ase ta(le olu!n &hih hel5s in i"entif'ing the
reor"s uni.uel' in !aster ta(le(
,oreign &e' fiel" is the "ata(ase ta(le olu!n of a "etails ta(le &hih is "e5en"ent
on the 5ri!ar' 1e' fiel" of a 5arent ta(le (
8. <hat is a re#ort\ Re5ort is Printing "ata as 5er usto!er re.uire!ent.
N. <hat is sa# scri#t\ Is a te#t Te#t 5roessing s'ste! &hih is use" to 5rint the
(usiness "ou!ent suh as sales or"er = 5urhase or"er et.
M. <hat is su2routine #oo$ in sa# scri#tQ <hen it is used\ It ontains the "efinitions
of the su(routines. It is also use" to "eth a""itional "ata to 5rint fro! the la'out
&hen the a""itional "ata has to (e 5rinte" &ithout hanging the stan"ar" "river
5rogra!.
7. <e cannot create a $a'out in S"P sri5t &ithout using Main7in"o&(
L. <e can &ee# *ain6indo6 on the sa!e 5age in a la'out for NN ti!es(
I. T'#es of <indo6s, Main &in"o&= 8aria(le &in"o&= Constant 7in"o&.
R. S"P scri#ts are CLIE9T I9/DEPE9DE9T(
<0. <hich ta2$e has a$$ Print #rogram names and ,orm NamesQ T9APR
<<. -ist the ,n( *odu$es used in Scri#ts: O5en_Hor! = Start_Hor!
<F. Sa# Scri#t Com#onents: Paragra5h for!at= Charater for!ats
<8. <at is #age in sa# scri#tQ Page is a ontainer for &in"o&s(
<N. <hat is 6indo6 in scri#t\ The 5age &hih ontains the &in"o& are alle" 5age
&in"o&s are the &in"o& 5ages(
<M. <hat is Character ,ormat in scri#tQ A line an (e 5rinte" in "ifferent for!at (ut ('
using harater for!at &ithin the sa!e 5aragra5h(
<7. <hat is S'm2o$ and t'#es of s'm2o$s in scri#tQ Printing "ata on La'out is al&a's
"one through S'!(ols. It starts an" en"s &ith D
<L. T'#es of s'm2o$s in scri#tsQ SGSTEM s'!(ols= STA9DARD s'!(ols=
PRO?RAM s'!(ols= TEXT s'!(ols.
<I. S'stem S'm2o$sQ DDATED= DGEARD= DPA?ED
<R. Standard S'm2o$sQ DDSMD an (e foun" in ta(le TTDT?
F0. Program S'm2o$sQ Are varia(les fro! the "river 5rogra!.D&a_1naB/1unnrD
F<. Te7t s'm2o$sQ Are "efine" in the la'out itself(
FF. o6 to de2ug S"P SCRIPTSQ E7ecute the #rogram Rst#D/%G(
F8. Te7t e$ementsQ "re used to identif' the 2$oc& of statements from #age
6indo6s(
FN. Different 6a's of u#$oading $ogos in scri#tsQ Can u#$oad on$' TI,, and /*P
into /usiness Document Server tcode: SE8= )R use transaction RSTX -D*C to
u#$oad the image through #rogram(
CL. Te#t ele!ents in Sri5ts,
F7. S'!(ol DSAPSCRIPT/HROMPA?ESD gives the total nu!(er of 5ages of urrentl'
for!atte" #rint reFuest(
FL. S'!(ol DSAPSCRIPT/S$%RCD gives the value after e#euting the I9CL$DE
state!ent
FI. S'!(ol D SAPSCRIPT/JO%PA?ESD gives the total nu!(er of 5ages of urrentl'
for!atte" form.
FR. -o& Language Translation in sri5t an (e "one \ Create a te#t as Standard Te7t
through S)0B then InsertHIte7tHIstandard(
80. E7#$ain "DDRESS+END"DDRESS contro$ commandQ This contro$ command
formats an address according to the #osta$ convention of the reci#ient countr'
defined in the countr' #arameter(
8<. o6 to read data from standard TE.T in a2a#Q C"-- ,* : RE"D TE.T
8F. o6 'ou u#$oad G do6n$oad scri#ts to #cQ E7ecute RSTXSCRP
88. Tcodes for Scri#ts: SE80 + ,orm #ainter9 SE81: St'$e maintenance9 SE;3:
-anguage trans$ation9 SE8=: Gra#hics management9 S)0B: Create Standard
Te7t modu$e(
8N. Co#' ,orms 2et6een C$ients + Sa#Scri#tsQ RST.,CP?
8M. C)*P"RIS)N ), 1 ,)R*SQ RST.,C)*
87. TRA9SPORT PRO?RAM HOR SAP SCRIPT\ RST.3TR
8L. Trans5ort the stan"ar" te#t \ RSTXTR"N
8I. SAPSCRIPT SPOOL REO$EST TO PDH \ RST.PD,4
8R. -o& to 5rint the footer note onl' on the last 5age\ $se this ;,IHD9EXTPA?EDEO J
N0. 7e annot have C "ifferent orientation for the sa!e la'out.
N<. -o& to "evelo5 Sa5 Si5ts in "ifferent languages\ In SEM@ li1
Translation30Long Te#ts30 Hor!s
NF. 7i"th of the Page &in"o&s of t'5e Main on the sa!e 5age shoul" (e sa!e.
N8. Tcode N"CE : Tra1s the Stan"ar" La'out an" stan"ar" 5rogra! use" for stan"ar"
(usiness "ou!ents an" also the 5lae to onfigure or lin1 the ne& la'out to the
"river 5rogra! if the stan"ar" la'out is o5ie" an" hange".
NN. -o& to onvert Sri5t to s!artfor!s\ $se to"e SMARTHORMS or use
$TILITIES30MI?RATE SCRIPTS TO SMART HORMS
NM. Sha"ing in the sa5 sri5t (o#es \ $se I9TE9SIHG in the %OX o!!an"
N7. C on"itional st!ts &e an use in sri5ts, IH..ELSE..E9DIH= CASE..E9DCASE.
NL. Custo!i>ing I9CL$DE is use" to inlu"e the struture to C$STOM TA%LE= &hereas
APPE9D STR$CT$RES is use" for STA9DARD TA%LE.
NI. A55en" strutures are 9OT RE/$SA%LE.
NR. Rules for Horeign 1e', Do!ain shoul" (e sa!e for (oth Pri!ar' an" seon"ar' 1e'.
An" the Che1 ta(le fiel" shoul" (e 5ri!ar' 1e'.
M0. E#5lain In"e# in DDIC PData Ditionar'), Its use" to searh D% faster. Co5' of D%
&ith less fiel"s in sorte" for!. It has 5ointer to the reor" in atual ta(le.
M<. Ta(le !aintenane generator \ is use" to reate TA%LE MAI9TE9A9CE
PRO?RAM to a"" !o"if' or "elete reor"s in "(. It has C sreens O8ER8IE7
SCREE9= SI9?LE SCREE9
MF. TGPE ?RO$P\ A grou5 to hol"s the T'5e "efinitions instea" of "efining in a(a5
5rogra!.
M8. DATA CLASS\ Deter!ines the ta(les5ae P 5h'sial area) of the ta(le.
MN. SIIE CATE?ORG\ 5ro(a(le s5ae re.uire!ent of the ta(le in "(
MM. DELI8ERG CLASS\ The "eliver' lass ontrols the trans5ort of ta(le "ata for
installation= u5gra"e= lient o5' an" &hen trans5orting (et&een usto!er s'ste!s.
The "eliver' lass is also use" in the e#ten"e" ta(le !aintenane. ", A55liation
ta(le P!aster an" transation "ata).C, Custo!er ta(le= S, S'ste! ta(le
M7. Tehnial Settings= In"e#es an" a55en" strutures are i!5ortant for a ta(le.
ML. Custo!er 9a!es5ae !ust (e "efine" in the ta(le TRESC.
MI. %uffering ta(le, resi"es in A55liation server an" not D%= thus i!5roves
5erfor!ane.Cluster ta(le annot (e (uffere". Hull (uffering= ?eneri (uffering=
Single reor" (uffering
MR. 8ie&\ is a Logial vie& of one or !ore ta(les. The "ata is not 5h'siall' store" in
vie&= instea" "erive" fro! one or !ore ta(les.
70. T'5es of vie&, Data(ase vie&= 5ro+etion vie&= !aintenane vie&= -el5 vie&.
7<. Pro+etion vie&, retreives +ust so!e fiel"s fro! a single ta(le.
7F. -el5 8ie& , Is use" for searh hel5
78. Data(ase vie&, is use" for inner +oin vie& of one or !ore ta(les
7N. Maintenane vie&,-el5s in reating an" !aintaining "ata of the a55liation an" &ill
(e "istri(ute" a!ong several ta(les.
7M. <hat is *odu$e #oo$ ProgramQ Transation in R;@ s'ste! is an o5eration that let
users to !a1e neessar' hanges to the "ata(ase in a onsistent &a'. The entire
R;@ s'ste! is nothing (ut set of (usiness transations. The "ata transfer fro! ol"
s'ste! to R;@ "( or !o"if'ing "ata or "eleting "ata is "one through transation onl'.
77. Different ste#s in the transactionQ / Interative 5hase an" $5"ate 5hase.
7L. Different t'#es of -%< Q Sa5 L$7 an" D% L$7
7I. 7hat is D% L$7 or D( transation.\D%L$7 is a !ehanis! use" (' the "( to
ensure that its "ata are onsistent. The D% L$7 is either full' e#eute" or not at all.
7R. SAP L$7 an have several "ata(ase L$7. So a set of D% is either o!!itte" or
rolle" (a1. The s5eial a(a5 o!!an" C)**IT <)R! !ar1s the en" of SAP
L$7.
L0. 8arious vali"ations\
L<. Client Server tehnolog' (elongs to &hih t'5e of arhiteture\ C tier
LF. In SD !o"ule &ats ATP\ Availa(lit' to 5ro!ise
L8. 7at are the hoies availa(le in SAP "(\ Orale= S'(ase= Info!i#.
LN. 7hat are "ifferent 5eo5le involve" in Sa5 5ro"uts D Peo5le\ DE8ELOPME9T
TEAM= OPERATIO9S STAHH= CO9HI?$RATIO9 TEAM= %$SI9ESS E9D $SERS=
LM. 7hat are the "ifferent interfaes in SAP arhiteture\ $ser interfae= Co!!uniation
interfae= s'ste! interfae.
L7. Different logis availa(le in lient server arhiteture\ Presentation logi= a55liation
logi an" D% logi.
LL. 7hat are the "ifferent ste5s in o5erating 5roess !o"els\ Ca5ital resoures=
Logistis Proess= Material resoures an" a5ait' resoures.
LI. Different stages in !anufaturing; "istri(ution !o"el.\ Hinanial aounting= ost
aounting= fi#e" assets an" hu!an resoure.
LR. In the finanial o5erating !o"el &here the "ata &ill (e store"\ Dou!ent "ata(ase.
I0. 7hat are the "ifferent features of SD\ Real/ti!e Availa(le to 5ro!ise ATP D
she"uling= Co!5rehensive fle#i(le 5riing arhiteture= -ighl' usto!i>ing or"er
5roessing.
I<. Li!itations of SD\ Co!5le#ities of !ulti5le levels of a55roval= li!ite" hannel
5artner "ata availa(le= li!ite" funtionalit' for servie.
IF. 7hat are the 1e' areas in MM\ Purhasing P 5roure!ent)= !aterials re.uire!ent
5lanning MRP= inventor' !anage!ent.
I8. Different t'5e of 5roure!ent\ Stan"ar"= Su(ontrating D onsign!ent= Sto1
transfer D e#ternal servie.
IN. T'5es of 5urhasing "ou!ents\ Purhase re.uisition D re.uest for .uotation=
Ouotation D 5urhase or"er= Outline agree!ent.
IM. -o& an 'ou han"le errors in %DC/ Call transation\ LOOP AT It_"ata
Po5ulate IT_%DCTA% ta(le
CALL TRA9SACTIO9 using IT_%DCDATA MODE A;9;E
$PDATE S;A
MESSA?ES I9TO IT_%DCMS?COLL
I7. Dis5la' !o"es for all transation\ E/ "is5la' onl' errors= 9/%a1groun" 5roessing=
A / Dis5la' all sreen. $5"ate an (e S'nhronous S= As'nhronous A= Loal u5"ate
L.
IL. -o& to run (a1groun" sessions\ She"ule RS%DCS$% $sing SM@M
II. 7hat is the funtion of O: CODE ;9\ Ter!inate urrent (ath in5ut an" !ar1 as
inorret
IR. 7hat is the funtion of O: CODE ;("el\ Delete urrent (ath in5ut fro! session.
R0. 7hat is the funtion of O: CODE ;((eg\ Restart in a transation.
R<. 7hat is the funtion of O: CODE ;(en"\ Ter!inate (ath in5ut 5roessing an" !ar1
session as inorret.
RF. 7hat is the funtion of O: CODE ;("a\ hange "is5la' !o"e to 5roess the on
sreen instea" of "is5la'ing onl'.
R8. 7hat is the funtion of O: CODE ;("e\ Change "is5la' !o"e to "is5la' onl' instea"
of 5roessing the session O9.
RN. 7hat is %DCRECXT\ is a stan"ar" 5rogra! generate" fro! reor"ing &hih
ontains all the re/usa(le "elarations an" also the re/usa(le su(routine "efinitions
for all the %DC 5rogra!s.
RM. -o& to 5rint a session log file\ E#eute RS%DCLO?
R7. -o& to e#5ort the session\ In SM@L 30 utilities 30 e#5ort session
RL. -o& to solve the sreen resolution P Stan"ar" sreen si>e) &hile &or1ing &ith ta(le
ontrol in ("\ It is to onsi"er the "efault sreen resolution 7A_OPT_$PDMODE 3
*S*.
7A_OPT_DESIIE3*X*
7A_OPT_DISMODE 3 *9*.
RI. Ste5s in session !etho"\ reate session= insert to"e= lose session= 5roess or run
the session.
RR. List out the sa5 su55lie" 5rogra!s to loa" !aster "ata\ RMDATI9D P!at !as)=
RH%IDEJJPust !as)= RH%I:RJJ P ven"or !as)= R8I98%JJP sales or"er)=
RMJM%%BJ P 5urhase re.uisition)
<00. SG/S$%RC 3 return o"e
<0<. SG/LA9?$ 3 user log on language
<0F. SG/MA9DT 3 Client AJJ or lient KJJ li1e that.
<08. SG/-OST 3 server
<0N. SG/$9AME 3 logon user na!e
<0M. SG/DALTO 3 Loal "ate
<07. SG/DAT$M 3 server "ate
<0L. SG/TIMLO 3 LOCAL TIME
<0I. SG/$IEIT 3 SER8ER TIME
<0R. SG/DG99R 3 SCREE9 9$M%ER OR DG9PRO 9$M%ER
<<0. SG/REPID 3 Current a(a5 5rogra! na!e
<<<. SG/TCODE 3 Current server o"e
<<F. SG/$LI9E 3 "ra& hori>ontal line
<<8. SG/8LI9E 3 "ra& vertial line
<<N. SG/I9DEX 3 nu!(er of urrent loo5 5ass
<<M. SG/TA%IX 3 urrent line of internal ta(le
<<7. SG/D%C9T 3 nu!(er of ta(le entries 5roess
<<L. SG/$COMM 3 funtion o"e
<<I. SG/LI9CT 3 5age length of the list
<<R. SG/LSI9D 3 LIST I9DEX
<F0. SG/LI99O 3 Current line nu!(er
<F<. SG/D%SGS 3 Central "ata(ase
<FF. SG/OPSGS 3 o5erating s'ste!
<F8. SG/SAPRL 3 Sa5 release
<FN. SG/SID 3 s'ste! ID or s'ste! na!e
<FM. 7hat are the C &a's to restrit the value range for a "o!ain \ S5eif' fi#e"
values= or (' sti5ulating value ta(le.
<F7. -o& to transfer Ita(B "ata into ita(C Psa!e struture)\ ITA%C EO$ALS TO
ITA%B
<FL. Differene (et&een SELECT SI9?LE A9D SELECT $PTO B RO7S\
<FI. ho& !an' se.uene of events triggere" in re5ort\ BC
<FR. -o& !an' ti!es the event I9ITIALIIATIO9 D TOP OH PA?E triggers in CJ
5ages list\ Initiali>ation &ill trigger onl' one= to5 of 5age CJ ti!es.
<80. 7hat is !essage lass\ is to !aintain all the !essages either suess or
failure or error &ith @ "igit nu!(er (et&een JJJ/NNN
<8<. T'5es of !essages\ S=E=X= A= I= 7.
<8F. Te#t ele!ents\ Allo&s 'ou to store te#ts &ithout har"o"ing in 5rogra! an"
an (e !aintaine" outsi"e the 5rogra!.
<88. HOR ALL E9TRIES\ 7e an use HOR ALL E9TRIES to re5lae 9ESTED
SELECT LOOPS (' o5erations on internal ta(les. It &ill i!5rove the 5erfor!ane for
large set of selete" "ata.
<8N. Inner Join 8s Outer +oin \ In a inner +oin= a line for! the left han" "( ta(le or
+oin is onl' inlu"e" in the seletion if there is one or !ore lines in the right han" "(
ta(le that !eet the O9 on"ition. The left Outer +oin +ust rea" lines fro! left han" "(
ta(le or +oin even if there is no orres5on"ing line in the right han" ta(le.
<8M. Interative re5ort\ Su!!ar' in the first list an" after user interation it gives a
"etaile" info.
<87. T'5es of user interation in re5orts\ LI9E SELECTIO9 D $ser o!!an"s
<8L. 7hat s'ste! varia(les 'ou &ill use !ostl' in Interative re5orts\ SG/LSI9D=
SG/$COMM= SG/LISEL Pselete" line ontents)
<8I. 7hen &ill a user trigger S'/uo!! \ 7henever the user interats &ith an' of
the a55liation on the tool(ar. Also the funtion o"e of the selete" (utton &ill (e
save" in the s'ste! varia(le S'/uo!!.
<8R. 7hih !aster "ata to (e use" in Purhasing \ Material !aster "ata= Servie
!aster "ata= 8en"or !aster "ata= 5urhasing !aster "ata.
<N0. 7hat is 5urhase or"er\ It re5resents a for!al re.uest to the ven"or to su55l'
goo"s or servies un"er ertain on"itions
<N<. 7hat are the fators "eter!ine" (' the onsu!5tion (ase" 5lanning\ Ouantit'
re.uire" to or"er.
<NF. 7hat is Horeast / %ase" 5lanne" is (ase" on \ Material onsu!5tion
<N8. 7hat are onversion routines ; e#its\ 9on/stan"ar" onversions fro! "is5la'
for!at to sa5 internal for!at an" vieversa are i!5le!ente" using onversion
routines.
<NN. 7hat t'5e of o(+ets 'ou reate using Ditionar'\ Ta(les= vie&s= "o!ains= "ata
ele!ents= strutures= searh hel5s= lo1 o(+ets= t'5e grou5s.
<NM. Che1 ta(le\ Is an in"e5en"ent ta(le to &hih the relationshi5 is "efine" using
foreign 1e's.
<N7. 8alue ta(le is the ta(le attahe" to a fiel" at "o!ain level &here the entr' to
the fiel" an (e onl' fro! value ta(le. 8alue ta(le is the "efault he1 ta(le.
<NL. 7hat t'5e of vie&s u an use in a(a5 5rogra!\ Onl' PROJECTIO9 8IE7
A9D DATA%ASE 8IE7.
<NI. 7hih ta(le stores the 5rogra!s= 5a1ages= ta(les= "evelo5!ent lass\ TADIR
3 stores the 5rogra!s TA(le DIRetor'= TDE8C 3 Ta(le DE8elo5!ent Class
5a1ages= DDJCB 3 Data(ase ta(les= DDJCT 3 Data(ase ta(les short te#t.
<NR. 7hat is the si>e of internal ta(les\ Intial si>e is A 1( an" an (e e#ten"e" till C
?%.
<M0. Differene (et&een Hiel" grou5 an" internal ta(le\ Hiel" grou5 is also 1no&n
as 7or1 area. It an store onl' single value &hereas internal ta(le stores !ulti5le
values.
<M<. -o& to eli!inate "u5liate entries in Ita(\ Pto o!5are +ust C i"ential 1e'
fiel"s) DELETE ADJACE9T D$PLICATES HROM ITA% or DELETE ADJACE9T
D$PLICATES HROM ITA% COMPARI9? ALL HIELDS.
<MF. COLLECT state!ent\ Is use" to su!!ari>e the nu!erial reor"s of the
olu!n. Pli1e gran" total.)
<M8. -o& to 5rint fro! Lth reor" to BJth reor" in ita(\ LOOP AT ITA% L TO BJ.
7RITE ITA%. E9DLOOP.
<MN. Can 'ou sort the sorte" internal ta(le again \ 9O
<MM. E#5lain OCC$RS 1e'&or".\ It is use" to "elare onl' the stan"ar" ita( (efore
sa56 ver to alloate !e!or' for the internal ta(le.
<M7. T'5es of Ita(\ Stan"ar"= Sorte"= -ashe".
<ML. -o& "o 'ou "eter!ine a ta(le is lient "e5en"ent or in"e5en"ent \ The
MA9DT fiel" "eter!ines this.
<MI. 7hat is TA%LES 1e' &or" in TA%LES :9AB\ Defines a 7or1 Area fiel" &ith
the sa!e na!e.
<MR. -o& an 'ou 5rint @r" reor" fro! ITA% \ READ TA%LE ITA% I9DEX @
<70. Lo1ing o(+et\ Are use" to s'nhroni>e aess to the sa!e "ata (' !ore
than one user.
<7<. Disa"vantage of As'nhronous u5"ate\ Its not reo!!en"e" for Large
a!ount of "ata 5roessing as it reeives no o!5letion !essage fro! the u5"ate
!o"ule. Still 'ou an he1 &ith SMBC for an' 5ro(le!s (ut its not onvinient.
<7F. Ma+or "ifferene in Session an" all transation \ In session !etho" &e an
5roess !ulti5le transations in the sa!e session &hereas in all transation &e an
5roess onl' a single transation.
<78. Reor"ing\ S-D% is the to"e to rea" all ste5s &hile e#euting the session
!etho".
<7N. <hat is an "/"P data dictionar'Q/ A%AP 6 "ata "itionar' describes the
logical strctres o" t$e o%&ects used in application development and shows how
they are mapped to the un"erl'ing relational "ata(ase in ta(les;vie&s.
<7M. <hat are domains Q/ Do!ain is the central object for describin the tec$nical
c$aracteristics of an attri(ute of an (usiness o(+ets. It "esri(es the vale range
of the fiel".
<77. <hat are and data e$ementQ Data Ele!ent, is use" to describe the se!antic
de"inition of the table fields li1e description of the fiel". Data ele!ent "esri(es
ho& a fiel" an (e "is5la'e" to en"/user.
<7L. <hat is foreign &e' re$ationshi#Q/ A relationship which can be defined
between tables an" !ust (e e#5liitl' defined at field level. Horeign 1e's are use" to
ensure the consistenc' of data( Data entere" shoul" (e he1e" against e#isting
"ata to ensure that there are no& ontra"ition. 7hile "efining foreign 1e'
relationshi5 cardina$it' has to 2e s#ecified. Car"inalit' !entions ho& !an'
"e5en"ent reor"s or ho& referene" reor"s are 5ossi(le.
<7I. Descri2e data c$asses(/ *aster data: It is the "ata &hih is sel"o!l'
hange". Transaction data: It is the "ata &hih is often hange". )rganiMation
data: It is a usto!i>ing "ata &hih is entere" in the s'ste! &hen the s'ste! is
onfigure" an" is then rarel' hange". S'stem data:It is the "ata &hih R;@ s'ste!
nee"s for itself.
<7R. <hat are inde7esQ/ In"e#es are "esri(e" as a o5' of a "ata(ase ta(le
re"ue" to s5eifi fiel"s in sorte" for!. This sorting for! ease fast aess to the
fiel" of the ta(les. In or"er that other fiel"s are also rea"= a 5ointer to the assoiate"
reor" of the atual ta(le are inlu"e" in the in"e#. The in"e#es are ativate" along
&ith the ta(le an" are reate" auto!atiall' &ith it in the "ata(ase.
<L0. Difference 2et6een trans#arent ta2$es and #oo$ed ta2$es(/ Trans5arent
ta(les, Trans5arent ta(les in the "itionar' has a one!to!one relation &ith the ta(le in
"ata(ase. Its struture orres5on"s to single "ata(ase fiel". Ta(le in the "ata(ase
has the same name as in the dictionary. Trans5arent ta(le hol"s a55liation "ata.
Poole" ta(les. Poole" ta(les in the "itionar' has a many!to!one relation &ith the
ta(le in "ata(ase. Ta(le in the "ata(ase has the different name as in the dictionary.
Pooled table are stored in table pool at the "ata(ase level.
<L<. <hat is an "/"PG4 Juer'Q/ A%AP;6 Ouer' is a powerful tool to enerate
simple reports without any codin. A%AP;6 Ouer' an generate the follo&ing @
si!5le re5orts, /asic -ist: It is the si!5le re5orts. Statistics: Re5orts &ith statistial
funtions li1e Average= Perentages. Ran&ed -ists: Hor anal'tial re5orts. / Hor
reating a A%AP;6 Ouer'= 5rogra!!er has to reate user roup an" a functional
roup. Huntional grou5 an (e reate" using &ith or &ithout logial "ata(ase ta(le.
Hinall'= assign user grou5 to funtional grou5. Hinall'= reate a .uer' on the
funtional grou5 generate".
<LF. <hat is /DC #rogrammingQ/ Transferring of large;e#ternal;lega' "ata into
SAP s'ste! using "atch #nput prorammin. %ath in5ut is a auto!ati 5roe"ure
referre" to as %DCP%ath Data Co!!uniations).The entral o!5onent of the
transfer is a .ueue file &hih reeives the "ata vie a (ath in5ut 5rogra!s an"
grou5s assoiate" "ata into ^sessions_.
<L8. <hat are the functiona$ modu$es used in seFuence in /DCQ/ These are the
@ funtional !o"ules &hih are use" in a se.uene to 5erfor! a "ata transfer
suessfull' using %DC 5rogra!!ing, %DC_OPE9_?RO$P / Para!eters li1e
9a!e of the lient= sessions an" user na!e are s5eifie" in this funtional !o"ules.
%DC_I9SERT / It is use" to insert the "ata for one transation into a session.
%DC_CLOSE_?RO$P / This is use" to lose the (ath in5ut session.
<LN. <hat are interna$ ta2$esQ/ Internal ta(les are a standard data t'#e o(+et
&hih e#ists onl' "uring the runti!e of the 5rogra!. The' are use" to 5erfor! ta(le
ca$cu$ations on su(sets of "ata(ase ta(les an" for re+organising the ontents of
"ata(ase ta(les.
<LM. <hat is ITSQ <hat are the merits of ITSQ/ ITS is a Internet Transation
Server. ITS for!s an interface 2et6een TTP server and RG3 s'stem= &hih
onverts sreen 5rovi"e" data by the R$% system into &'(L documents and vice!
versa.
Merits of ITS, A o!5lete &e( transation an (e "evelo5e" an" teste" in R;@
s'ste!. All transation o!5onents= inlu"ing those use" (' the ITS outsi"e the R;@
s'ste! at runti!e= an (e store" in the R;@ s'ste!. The a"vantage of auto!ati
language 5roessing in the R;@ s'ste! an (e utili>e" to language/"e5en"ent -TML
"ou!ents at runti!e.
<L7. <hat is D'nProQ/ D'nPro is a D'na!i Progra!!ing &hih is a screen R
associated f$o6 $ogic of Screen(
<LL. <hat are screen #ainter and menu #ainterQ/ Sreen 5ainter, Sreen 5ainter
is a tool to desin and maintain screen and its elements. It allo&s user to reate ?$I
sreens for the transations. Attri(utes= la'out= file" attri(utes an" flo& logi are the
ele!ents of Sreen 5ainter.
Menu 5ainter, Menu 5ainter is a tool to desin the inter"ace co!ponents# Menu
(ars= Tool(ar= !enu lists= H/1e' settings= funtions= Status an" titles are the
o!5onents of Menu 5ainters. Sreen 5ainter an" !enu 5ainter (oth are the
gra5hial interfae of an A%AP;6 a55liations.
<LI. <hat are the com#onents of S"P scri#tsQ/
SAP sri5ts is a &or" 5roessing tool of SAP &hih has the follo&ing o!5onents,
Stan"ar" te#t. It is li1e a stan"ar" nor!al "ou!ents.
La'out sets. / La'out set onsists of the follo&ing o!5onents, 7in"o&s an" 5ages=
Paragra5h for!ats= Charater for!ats. Creating for!s in the R;@ s'ste!.
Ever' la'out set onsists of -ea"er= 5aragra5h= an" harater string. A%AP;6
5rogra!.
<LR. <hat is "-V #rogramming in "/"PQ <hen is this grid used in "/"PQ/
AL8 is A55liation List vie&er. Sa5 5rovi"es a set of AL8 PA%AP LIST 8IE7ER)
funtion !o"ules &hih an (e 5ut into use to e!(ellish the out5ut of a re5ort. This
set of AL8 funtions is use" to enhane the rea"a(ilit' an" funtionalit' of an' re5ort
out5ut. Cases arise in sa5 &hen the out5ut of a re5ort ontains olu!ns e#ten"ing
!ore than CLL haraters in length. In suh ases= this set of AL8 funtions an hel5
hoose selete" olu!ns an" arrange the "ifferent olu!ns fro! a re5ort out5ut an"
also save "ifferent variants for re5ort "is5la'. This is a ver' effiient tool for
"'na!iall' sorting an" arranging the olu!ns fro! a re5ort out5ut. The re5ort
out5ut an ontain u5 to NJ olu!ns in the "is5la' &ith the &i"e arra' of "is5la'
o5tions.
<I0. <hat are the events in "/"PG4 $anguageQ/ Initiali>ation= At seletion/sreen=
Start/of/seletion= en"/of/seletion= to5/of/5age= en"/of/5age= At line/seletion= At
user/o!!an"= At PH= ?et= At 9e&= At LAST= AT E9D= AT HIRST.
<I<. <hat is CTS and 6hat do 'ou &no6 a2out itQ/ The Change an" Trans5ort
S'ste! PCTS) is a tool that hel5s 'ou to organi>e "evelo5!ent 5ro+ets in the A%AP
7or1(enh an" in Custo!i>ing= an" then trans5ort the hanges (et&een the SAP
S'ste!s an" lients in 'our s'ste! lan"sa5e. This "ou!entation 5rovi"es 'ou
&ith an overvie& of ho& to !anage hanges &ith the CTS an" essential infor!ation
on setting u5 'our s'ste! an" lient lan"sa5e an" "ei"ing on a trans5ort strateg'.
Rea" an" follo& this "ou!entation &hen 5lanning 'our "evelo5!ent 5ro+et.
<IF. <hat are $ogica$ data2asesQ <hat are the advantagesG dis+advantages of
$ogica$ data2asesQ/ To rea" "ata fro! a "ata(ase ta(les &e use logial "ata(ase.
A logial "ata(ase 5rovi"es rea"/onl' aess to a grou5 of relate" ta(les to an
A%AP;6 5rogra!. A"vantages, i)he1 funtions &hih he1 that user in5ut is
o!5lete= orret=an" 5lausi(le. ii)Meaningful "ata seletion. iii)entral authori>ation
he1s for "ata(ase aesses. iv)goo" rea" aess 5erfor!ane &hile retaining the
hierarhial "ata vie& "eter!ine" (' the a55liation logi. "is a"vantages, i)If 'ou
"onot s5eif' a logial "ata(ase in the 5rogra! attri(utes=the ?ET events never
our. ii)There is no E9D?ET o!!an"=so the o"e (lo1 assoiate" &ith an event
en"s &ith the ne#t event state!ent Psuh as another ?ET or an E9D/OH/
SELECTIO9).
<I8. <hat is a 2atch in#ut sessionQ/ %ATC- I9P$T SESSIO9 is an inter!e"iate
ste5 (et&een internal ta(le an" "ata(ase ta(le. Data along &ith the ation is store"
in session ie "ata for sreen fiel"s= to &hih sreen it is 5asse"= 5rogra! na!e
(ehin" it= an" ho& ne#t sreen is 5roesse".
<IN. o6 to u#$oad data using C"TT Q/ These are the ste5s to (e follo&e" to
$5loa" "ata through CATT, Creation of the CATT test ase D reor"ing the sa!5le
"ata in5ut. Do&nloa" of the soure file te!5late. Mo"ifiation of the soure file.
$5loa" of the "ata fro! the soure file.
<IM. <hat is Smart ,ormsQ/ S!art Hor!s allo&s 'ou to reate for!s using a
gra5hial "esign tool &ith ro(ust funtionalit'= olor= an" !ore. A""itionall'= all ne&
for!s "evelo5e" at SAP &ill (e reate" &ith the ne& S!art Hor! solution.
<I7. o6 can I ma&e a differentiation 2et6een de#endent and inde#endent
dataQ/ Client "e5en"ent or in"e5en"ent transfer re.uire!ents inlu"e lient s5eifi
or ross lient o(+ets in the hange re.uests. 7or1(enh o(+ets li1e SAPsri5ts
are lient s5eifi= so!e entries in usto!i>ing are lient in"e5en"ent. If 'ou "is5la'
the o(+et list for one hange re.uest= an" then for eah o(+et the o(+et attri(utes=
'ou &ill fin" the flag lient s5eifi. If one o(+et in the tas1 list has this flag on= then
that trans5ort &ill (e lient "e5en"ent.
<IL. <hat is the difference 2et6een macro and su2routineQ/ Maros an onl'
(e use" in the 5rogra! the are "efine" in an" onl' after the "efinition are e#5an"e"
at o!5ilation ; generation. Su(routines PHORM) an (e alle" fro! (oth the
5rogra! the are "efine" in an" other 5rogra!s . A MACRO is !ore or less an
a((reviation for so!e lines of o"e that are use" !ore than one or t&ie. A HORM
is a loal su(routine P&hih an (e alle" e#ternal). A H$9CTIO9 is P!ore or less) a
su(routine that is alle" e#ternal. Sine "e(ugging a MACRO is not reall' 5ossi(le=
5revent the use of the! PISve never use" the!= (ut seen the! in ation). If the
su(routine is use" onl' loal Palle" internal) use a HORM. If the su(routine is alle"
e#ternal Puse" (' !ore than one 5rogra!) use a H$9CTIO9.
SQL Last min tips
What is the differences between select single * and selct up to 1 row?
Select Single * will pickup only one matching record from the database into the buffer, and
returns the same to the internal table.
Select upto 1 rows will pickup all the records matching the condition into the buffer, but
return the top record to the internal table.
For this reason, performance wise select upto 1 row is better than select single.
According to SAP Performance course the SELECT UP TO 1 ROWS is faster than
SELECT SINGLE because you are not using all the primary key fields.
select single is a construct designed to read database records with primary key. In the
absence of the primary key, it might end up doing a sequential search, whereas the select
up to 1 rows may assume that there is no primary key supplied and will try to find most
suitable index.
The 'SELECT SINGLE' statement selects the first row in the database that it finds
that fulfils the 'WHERE' clause If this results in multiple records then only the first
one will be returned and therefore may not be unique.
Mainly: to read data from
The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects
all of the relevant records that are defined by the WHERE clause, applies any
aggregate, ordering or grouping functions to them and then returns the first record
of the result set.
Mainly: to check if entries exist.
Last min refresh TCODES
Transaction Variant = SHD0
Create Transaction Code = SE93
sap script symbols
%sing S"Pscri#t S'm2o$sGou an use SAPsri5t s'!(ols to inlu"e
5rogra! or s'ste! "ata or 5re"efine" te#ts in 'our "ou!ent.To use a s'!(ol= enter the na!e
of the s'!(ol in 'our te#t enlose" in D haraters A
DDATEDGou an insert a s'!(ol an'&here in 'our te#t. 7hen 'ou 5rint or "is5la' 'our
"ou!ent= SAPsri5t su(stitutes the urrent value of the s'!(ol for the s'!(ol na!e in 'our
"ou!ent.If 'ou "o not 1no& the na!e of a s'!(ol= hoose #nclude Symbols to fin" the
s'!(ols availa(le an" selet one. In this ase= 'ou an also s5eif' ho& to 5roess an" for!at
the s'!(ol P5ush(utton OPTIO9S).
Gou an use the DATE s'!(ol to have the urrent "ate inserte" in 'our
"ou!ent &hen the "ou!ent is "is5la'e" or 5rinte". Gou set s'!(ols off fro!
nor!al te#t (' enlosing the s'!(ol na!e in a!5ersan"s PD),Hor e#a!5le=
7all"orf= DDATED is "is5la'e" or 5rinte" as <a$$dorf9 B=(B=(0>>=. The e#at
"ate for!atting "e5en"s on the o5tion set in System User profile )i*ed
values.
If 'ou hoose #nclude Symbol to insert a s'!(ol into 'our te#t= the s'ste!
auto!atiall' su55lies the D haraters.
%sing the ,our T'#es of S'm2o$sSAPsri5t offers four t'5es of s'!(ols that
"ra& their values fro! "ifferent soures. These s'!(ols are s'ste! s'!(ols= 5rogra!
s'!(ols= stan"ar" SAPsri5t s'!(ols= an" loal te#t s'!(ols. Gou aess eah t'5e of s'!(ol
(' &a' of a "ifferent #nclude su(!enu.
-ere is !ore infor!ation on eah t'5e of s'!(ol,
o S'ste! s'!(ols "ra& their values fro! glo(al SAP S'ste! varia(les.
S'stem s'm2o$ Contains
DATE urrent "ate
DAG "a' fro! urrent "ate
DE8ICE out5ut "evie, PRI9TER= SCREE9= TELEX= HAX
-O$RS hours fro! ti!e of "a'
MI9$TES !inutes fro! ti!e of "a'
MO9T- !onth fro! urrent "ate
9AME_OH_MO9T- na!e of the !onth fro! urrent "ate
9EXTPA?E 5age nu!(er of the ne#t 5age
PA?E 5age nu!(er of a SAPsri5t te#t
SECO9DS seon"s fro! ti!e of "a'
SPACE (lan1
TIME ti!e of "a'
$LI9E un"erline
8LI9E vertial line
GEAR 'ear fro! urrent "ate
Sap Script
Sap Script
INTRODUCTION: SAP Script is the SAP System's own text-processing system.Also called as
Word processing tool of SAP. SAP Script is tightly integrated into the SAP System Note:
Entering and formatting text in SAP script is a little bit different than traditional text-processing
programs on a PC. The main difference: the text that you enter is not in its final
format. SAP script applies your formatting to text only when a document is printed, print-
previewed, or displayed on-line in the SAP System
Sap Script
How does a SAP Script work ?
Every Script has a driver / print program attached or calling it. In case you are creating an
entirely new script ,you also need to create the driver program. This program can be executed
directly or attached to attached to certain events viz. Creation of Purchase Order , Sales Order ,
Hiring an Employee. Standard SAP scripts can be modified by copying them in the customer
name space and making the required changes.
Sap Script
Components of a SAP Scripts
1. Standard Text This is like a normal document.You can create letters , articles bascially any
static text. This can be created from transaction SO10.
2. Layout Set This also called as Form created from Transaction SE71. 3. Print Program This
program retrieves desired data from the database , calls the Form, supplies data to the Form
and finally closes the Layout Set ( Form ).
Sap Script
Supplies data Driver Program Layout set Gets printed
Defines
Forms Sap Script
Sap Script
Name House name Postal Code City
WINDOW
Name House name Postal Code City
Page window Particular area in the page where the window is printed out
Page
Standard Text
Transaction SO10
Standard Text
After creating a Standard Text assign it a Style.
Standard Text
If you want text in your standard text to appear as per attributes of character string , you need
to enclose the text TEXT.
Layout Set
OBJECTS OF LAYOUT SET Header Paragraph and Character format Windows and Text
Elements Pages Page Windows
Header
Header data is found both in style and layout set maintenance. In style maintenance, it is used
primarily to present information designed to make it easier for the end user to select a style.
The header data in layout set maintenance, on the other hand, is used for information and
control purposes.
Header
HEADER INFORMATION GLOBAL DATA
Paragraph
In SAP Script, paragraphs are formatted using formats and their corresponding attributes. Word
processing is simplified by the use of different paragraph attribute groups: Standard Font
Tabs Outline
Paragraph
Paragraph Format
Character Format
Character formats Allow you to format entire blocks of text within a paragraph Which will
override the paragraph format Character formats are defined in character strings Eg:
&VBDKA-TDNAME& ,, &VBDKA-TFGEU&
Windows and Text Elements
WINDOWS We can combine information contained in a document into certain groups and
make each group appear on the printed page in an individual area. SAP Scripts calls such a
group a window To refer a window via program each window must have a unique name We
can assign text to each windows via text elements TEXT ELEMENTS Text elements can be
defined in layout set maintenance for each window. The text elements are accessed by name
by a print program, formatted, and output in the respective window. The /E in the tag column is
used to identify the text as a text element
Windows
Windows are defined in layout set maintenance. They represent areas which are positioned on
pages -- as page windows -- and in which text is later output. At least one window must be
defined for each layout set. If not, a text cannot be formatted by SAP Script. The following
window types can be used: main variable constant
Windows
WINDOWS
Windows
MAIN Main window in which continuous text is output. The text in the main window can extend
over several pages. If the text fills one page, output continues in the window of the next and
subsequent pages, as long as MAIN has been defined for these pages. VAR Window with
variable contents. The text can vary on each page in which the window is positioned. Variable
windows are formatted for each page. CONST Window with constant contents which is only
formatted once.
Pages
At least one page must be defined for every layout set. You must also designate a "first" page
in the layout set header. Otherwise text formatting is not possible.
Pages
PAGES
Page Windows
When you define page windows, the window names are linked to page names. To do this, you
need to specify the position and size of the window on the assigned page. Width of the main
window must be the same on all pages.
Page Windows Sap Script
PAGE WINDOWS
Sap Script
COMPONENTS OF SCRIPT Text Elements Style Layout set
Text Elements
The text elements are related to a window . The print program calls the respective text
elements of the window TYPES OF TEXT ELEMENTS TEXT ELEMENTS WITH OUT NAMES
TEXT ELEMENTS WITH NAME
Text Elements
NAMED TEXT ELEMENTS We recognize named text elements by paragraph format /E The
name can be up to 40 characters The different windows can have same named text elements
To out put named text elements we have to call the function module WRITE_FORM
Style
A style defines the set of paragraph and character formats that are available for formatting a
document. If a style is selected, then it provides the character and paragraph formats for your
document. Any formats defined in the layout set selected for a document are then ignored.
Layout Set
Layout sets are used to control the page layout and also the text formatting in your
documents. If a document is formatted for output to the screen or to a printer, then a layout set
must be specified for it. If no other layout set is specified for a document, then the SYSTEM
layout set is assigned to the document by default.
Layout Set
LAYOUT SET CONTROL OPEN_FORM CLOSE_FORM - Initializes the SAP script composer
and opens the specified layout set - Closes the layout set ( if close_form is missing in the
program nothing will be printed)
WRITE_FORM , WRITE_FORM_LINES, CONTROL_FORM - To output data( this can be used
as many times between OPEN_FORM and CLOSE_FORM) PAGE CONTROL IN LAYOUT
SETS STATIC DEFINITION- Specify the starting page in header and for each page specify the
subsequent page DYNAMIC DEFINITION - Specify START PAGE when you call
START_FORM
Symbols
SYMBOLS Symbols are constants that can be inserted in a document. They save the user
unnecessary work when replacing sections of text, phrases, etc. Possible symbol types are:
System symbols Standard symbols Program symbols Text symbols.
Symbols
THE SYNTAX OF SYMBOLS The delimiter & must be used both immediately before and after
the symbol. The name of a symbol may not contain spaces. A SAP Script editor line break
should not occur between the symbol delimiters. If additional formatting options are required,
these should be enclosed in round brackets and inserted immediately after the symbol name.
The code letters identifying these options must be given in capitals.
Symbols
SYSTEM SYMBOLS SAP script provides values for the system symbols Example &date&
&time& &month& &year& &uline& &vline& &page& STANDARD SYMBOLS
Standard symbols are defined in the TTDTG table. This table contains both the name of each
symbol and its value. The value, which is language-dependent, can contain up to 60 chars. This
table is delivered complete with standard entries supplied bySAP. It may be extended with
customer-specific symbols
Symbols
PROGRAM SYMBOL SAP Script cannot read this data out of the SAP database itself, but has
to call on another program to do this. The data are then copied into work areas declared using
TABLES. If SAP Script is now called from this program in order to format a text, it can copy the
data out of these work areas.Symbols which obtain their values from this kind of data area are
called program symbols. Note The value of a program symbol is limited up to a maximum of
255 chars. The name of a program symbol consists of the table name and the field name
separated by a hyphen.
Symbols
TEXT SYMBOLS All symbols which do not correspond to one of the three types of symbol
described above are text symbols. You define the value of a text symbol yourself in the text
module. There are two ways of doing this: Use the menu entries in the text editor Use the
control command DEFINE for e.g /: DEFINE &mysymbol& = XXXX / &mysymbol& /: DEFINE
&mysymbol& = YYYY / &mysymbol&
would print XXXX YYYY
Control Commands
Control Command is a type of SAP script command which are used to control output
formatting. The Syntax of Control Commands The paragraph format /: must be entered in the
format column to identify a control. You enter the command itself in the text line. A control
command, together with any parameters it requires, may not occupy more than a single line A
maximum of one control command may appear in each line
Control Commands
SYNTAX OF CONTROL COMMANDS In tag column, indicate control commands with
paragraph format /: Enter complete control commands and necessary parameters on one line
Enter only one control command per line Editor formatting does not affect lines with control
commands
Control Commands
SOME IMPORTANT CONTROL COMMANDS: /: NEW-PAGE /: PROTECT & /:
ENDPROTECT
/: SET DATE MASK = 'date_mask /: SET TIME MASK = 'time_mask /: RESET
paragraph_format /: INCLUDE name [OBJECT o] [ID i] [LANGUAGE l ] [PARAGRAPH p]
[NEW-PARAGRAPH np]
(Cont..
Next page)
Control Commands
/: TOP : /: ENDTOP /: BOTTOM : /: ENDBOTTOM /: IF condition : /: ENDIF
Control Commands
SET DATE MASK command The formatting for date fields can be defined with the SAPscript
SET DATE MASK command. Executing this command causes all subsequent date fields to be
output using the specified formatting. Syntax /: SET DATE MASK = 'date_mask' The following
templates may be used in the date mask: For day : DD / DDD / DDDD For month : MM / MMM /
MMMM For year : YY / YYYY
Control Commands
SET TIME MASK command You can use the SAPscript SET TIME MASK command to format
time fields in a way that differs from the standard setting. Executing this command causes all
subsequent time fields to be output using the specified formatting. Syntax: /: SET TIME MASK
= 'time_mask' The following templates may be used in the time mask: HH hours (two digits) MM
minutes (two digits) SS seconds (two digits)
Control Commands
BOXES, LINES, SHADING: BOX, POSITION, SIZE The BOX, POSITION and SIZE commands
for drawing boxes, lines and shadowing can be used for specifying that within a layout set
particular windows or passages of text within a window are to be output in a frame or with
shadowing. Syntax 1. /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY] 2. /:
POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE] 3. /: SIZE [WIDTH] [HEIGHT] [WINDOW]
[PAGE]
Control Commands
ADDRESS The command formats an address according to the postal standards of the
destination country defined in the parameter COUNTRY sap scripts calls function module
ADDRESS_INTO_PRINTFORM to format the address /: ADDRESS[DELIVERY] [PARAGRAPH
a] [PRIORITY p] [LINES l] /: TITLE title /: NAME name1[,name 2[,name 3[,name 4]]] /:STREET
street /:POBOX po box[CODE zip code] /:CITY town1[,town 2] /:REGION region /:COUNTRY
country /: FROMCOUNTRY from country /: ENDADDRESS
Control Commands
BOTTOM /ENDBOTTOM /:BOTTOM The text lines between the two commands are output at
the bottom of MAIN window /:ENDBOTTOM /:DEFINE &symbolname& = value Text symbol
receive their value through an explicit assignment. This assignment can be done interactively in
the editor via include-symbolstext. The assigned value may have a maximum of 60 characters
Incorporating Graphics
For e.g Company Logo 1. .bmp / .jpg file has to be converted to .tiff file 2. Upload the file as text
module using ABAP/4 report RSTXLDMC specify BMON or BCOL 3. System generates a
suggested name for the text e.g ZHEX-MACRO-LOGO Use ID ST and logon language. 4.
Include ZHEX-MACRO-LOGO object Text ID ST in the Layout.
Example of Print Program
Calling an Script from a program created in SE38 REPORT ZSCRIPT . TABLES: SPFLI. DATA:
I_SPFLI LIKE SPFLI OCCURS 0 WITH HEADER LINE. SELECT * FROM SPFLI INTO
CORRESPONDING FIELDS OF TABLE I_SPFLI. CALL FUNCTION 'OPEN_FORM'
EXPORTING FORM = 'ZTEST11'. CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT
= 'HEADER_ITEM' * FUNCTION = 'SET' TYPE = 'BODY' WINDOW = 'MAIN'. (Contd.. Next
Page)
Example of Print Program
CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = 'ADDRESS_LIST' * FUNCTION
= 'SET' TYPE = 'BODY' WINDOW = 'WINDOW1'. LOOP AT I_SPFLI. CALL FUNCTION
'WRITE_FORM' EXPORTING ELEMENT = 'LINE_ITEM' * FUNCTION = 'SET' TYPE = 'BODY'
WINDOW = 'MAIN'. ENDLOOP. CALL FUNCTION 'CLOSE_FORM'.
Example of Print Program
Output of the program
Example
Details of Layout Set Header Data
Example
Pages
Example
Windows
Example
Page Windows
Example
Main Window Details
Formatting Options
Offset - specifying an offset of n , n left most characters are not displayed. E.g &symbol& --->
1234576789 &symbol+3& ----> 456789 Output Length &symbol(3)& ----> 123 &symbol(7)& ---->
1234567 Time Mask &Time& Normally 10:08:12 (hh) : (mm): (ss) /: Set Time Mask = HH:MM
&Time& = 10:08 /: Set Time Mask = HH hours MM minutes &Time& = 10 hours 08 minutes
&Time(Z)& = 10 hours 8 minutes
Example
Date Mask /: Set Date Mask = DDMMYY &Date& = 01 05 01 /: Set Date Mask = MMMM
DD,YYYY &Date& = May 01,2001 Fill Character Leading spaces in a value can be replaced
with a fill character. The F option is used and character to be filled is specified. E.g &KNA1-
UMSAT& = 700.00 &KNA1-UMSAT(F*)& = **700.00 Space Compression &symbol(C)& It has a
effect of replacing each string of space characters with a single space and shifting the words to
left as necessary to close up gaps. Also Leading spaces are completely removed. Omitting
Leading Zeros &symbol(Z)& &Day& = 01 &DAY(Z)& = 1
3asic notes for 3!C
PreDe'ined structures used in >D!
BDCDATA
/ Program
/ D$nPro
/ D$n>egin 4 i' ne+ screen begins t-en 7
else space5
/ Fnam
/ F;al
BDCMSGCOLL 4 used to store log 'ile 4 error records
5 a'ter ;alidation 5
///////////
/ 1sgT$p 4 error li)e 8 B EB ? B A 5
/ 1sg9r 4 error number li)e ###B ##"... 5
BDC CAN BE DONE IN FOLLOWING WA"SD
". recording 4 S=>>4-1 /=3C-5 (5=,;0<3 <-8 ,4<= ;15
2;1 6.-2=>> C08= 5;3;) Q call transaction met-od
4A6Y9!B so 'aster55
%. 0sm+
&. Direct input met-od
SESSION METHODD 4R6>D!6=> Or R6>D!>T!5/For
bac)ground uploading5
P.=D=,41=5 ,1 /-50<= ;.=
". >D!_OPE9_:RO=P
%. >D!_896ERT
&. >D!_!0O6E_:RO=P
". >D!_OPE9_:RO=PA
/ !08E9T 4 6Y/1A9DT 5
/ :RO=P 46ession group name 5
/ =6ER 4 6Y/=9A1E 5
%. >D!_896ERT
/ T!ODE 4 application tcode 5
/ DY9PROTA> 4 bdcdata itab 5
====================================================
========
6eRuenceA
DATAA
FTA> 0i)e >D!DATA O!!=R6 # ?8T2 2EADER 089E.
Or
FTA> TYPE TA>0E OF >D!DATAB ?A TYPE >D!DATA.
=, !A00 F=9!T8O9 :=8_=P0OAD 4into itab 5
ExportingA 'ilename=abc.txtB 'ilet$pe=AscB 2as
Field seperator = 7
TablesA data_tab= 8tab
=, !A00 F=9!T8O9 >D!_OPE9_:RO=P
ExportingA !lient=6Y/1A9DTB:roup=sesB=ser=6Y/
=9A1E
0oop at itab into +a
re'res- Ftab.
per'orm sub8 using Yapplication "##.
per'orm 6ub% using l'a"/li'nr +a/li'nr.
per'orm 6ub% using l'a"/land" +a/land".
per'orm 6ub% using l'a"/name" +a/name".
3 IFOR 6E668O9 1ET2OD / >A!C:RO=9D PRO!E6689:
4OPT8O9A05J
3 Per'orm 6ub% =sing >D!_OC!ODE 896ERT.
3 Per'orm 6ub8 using Yapplication "##.
3 Per'orm 6ub% =sing >D!_OC!ODE E78T.
3///////////////////////////////////
3 IFOR !A00 TRA96A!T8O9
3 Per'orm 6ub% =sing >D!_OC!ODE 896ERT. .To
press enter automtcl$
3 !A00 TRA96A!T8O9 Yapplication =689: Ftab 1ODE
9 1E66A:E6 89TO Cbdc1sg!oll.
!A00 F=9!T8O9 >D!_896ERT
Exporting
tcode = $application
Tables
d$nprotab = Ftab.
End0oop.
!A00 F=9!T8O9 >D!_!0O6E_:RO=P.
3 IFOR 6E668O9 1ET2OD / >A!C:RO=9D PRO!E6689:
4OPT8O9A05J
3 6=>18T RSBDCS!B <8A 6E0E!T8O9/6!REE9.
Form 6ub8 using 1 E.
!lear Ftab. . Or clear ?A.
Ftab/Program = 1 .F?A/PRO:RA1
Ftab/D$nPro = E
Ftab/D$n>egin = 7
Append Ftab.
End'orm.
Form 6ub% =sing 9 0.
!lear Ftab.
Ftab/Fnam=9
Ftab/F;al=0
Append Ftab.
End'orm.
TcodeA 61&* >atc- input session
====================================================
============
SAP ALV ADVANCED LIST VIEWER
IF YOU WANT TO KNOW THE BASICS OF ALV THEN SEE THESE LINKS
SAP ALV Tutorial : SAP ALV programming techniques
Introduction to Field Catalog ( SLIS_T_FIELDCAT_ALV )
Example: Field catalog KEY, COL_POS
Multi-line ALV using ROW_POS in field catalog

You might also like