common questions and answers about abap

Upload: mhku1

Post on 02-Jun-2018

230 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Common Questions and Answers About ABAP

    1/141

    enthil, take from 143 pages

    Common Questions and Answers about ABAP/4 and Developments

    I had seen some of the standard abap that the table name had *, like *ekpo. What is the meaning? What is

    the difference between with * and without * ?

    It just lets you use the table a second time. For example:

    select single * from ekpo where ebeln = '!"#$' and ebelp = ''.

    select single * from *ekpo where ebeln = '%&()' and ebelp = ''.

    ou now ha+e two separate records, one in ekpo and one in *ekpo.

    -nother way to do this is to simply use the 'into' argument in the 'select' statement to read the second ekpo recordinto some other field. he '*' format can be confusing, I think it may be left o+er from earlier releases, like !.!.

    /012 is database table and */012 is internal table.

    2nce you select into /012, you can use it the same way as */012.

    How do I use variables in the FO!"# command?

    3-- 42526I3 1/ I 7-58/ #.F269- I/;IFI/3 2 42526 = 42526I3.

    When using $"%% &'('#)!& id &$O!!"+& field uni-command, how does one capture the results of th

    command? For eample, if the uni-command were the date?

    ou capture the results in the table e.g -

  • 8/10/2019 Common Questions and Answers About ABAP

    2/141

    6un this code and then you will understand.

    How do I concatenate two strings in "bap23?

    For all ;-1 7ersions;6A5/@ = ;65/> ;6I ?.927/ ;6I 2 ;6I".D6I/ ;6I! 2 ;6I"C;6A5/@.

    For ;-1 7ersion ".) choose:

    424-/-/ ;6I ;6I! I2 ;6I".

    If you want a space between both fields:

    424-/-/ ;6I ;6I! I2 ;6I" ;/1-6-/3

  • 8/10/2019 Common Questions and Answers About ABAP

    3/141

    4-55 ';;/9' I3 '4299-3' FI/53 8A4299-3I3 '-9oto 1age 6/:?;7 What are pooled table ?>9oto 1age 6/:?9oto 1age 6/:?:7 What are advantages of using "0"1 ob4ects?=7 What is the advantage of using "0"1 ob4ects in eports ?

    ?

  • 8/10/2019 Common Questions and Answers About ABAP

    4/141

  • 8/10/2019 Common Questions and Answers About ABAP

    5/141

    #. 8se case statement in place of if else

    $. use clear table before select single or where e+er applicable.

    %. check for syBsubrc where e+er applicable

    &. a+oid collect statement if possinble

    . do proper documentation of the program inside abap editor and also in se" >screenBdocumentation radiobutton ?

    (. try to use +iews rather than nested select statement

    ). use -

  • 8/10/2019 Common Questions and Answers About ABAP

    6/141

    he menus and the functions a+ailable directly on the drilldown report make it easy to use the information system

    +ifference 0etween '"1 and "0"1 !emor

    '"1 !emor

    ;-1 memory is a memory area to which all main sessions within a ;-1gui ha+e access. ou can use ;-1 memoryeither to pass data from one program to another within a session, or to pass data from one session to another.-pplication programs that use ;-1 memory must do so using ;1-E1- parameters >also known as ;/E/parameters?. hese parameters can be set either for a particular user or for a particular program using the ;/

    1-6-9//6 statement. 2ther -

  • 8/10/2019 Common Questions and Answers About ABAP

    7/141

    IF TRDIR-EDT% " &%&.MO'E & & TO TRDIR-EDT%.MODIFY TRDIR.RITE: (&Edi)r L+, s re/0ed 1r/&2 P_PROG.

    ELSE.RITE: (&Pr3r/&2 P_PROG2 &des 4) 50e 4 Edi)r L+,&.

    ENDIF.ELSE.RITE: (&N /)+5 164d 1r pr3r/&2 P_PROG.

    ENDIF.

    Protect part of ABAP code from modifyingIs it possible to protect some parts of -

  • 8/10/2019 Common Questions and Answers About ABAP

    8/141

    *1624/;; -F/6 I18.5221 - I.92385/ 8;/6A4299-3A)")).

    /35221.

    Dhat could I ha+e done wrong Q

    BBBBB6eply 9essageBBBBB;ubject: 6/: ;crolling in able 4ontrol

    From: 0.@ariprasad

    ry defining the table control lines in 1

  • 8/10/2019 Common Questions and Answers About ABAP

    9/141

  • 8/10/2019 Common Questions and Answers About ABAP

    10/141

    " " selection tet.

    uestion9iven the two "0"1 +ictioar tables below, the $ustomer number field in table one must containa value from table two. #he $ustomer number field is known as a AAAA.

    #able one

    $ustomer number B1rimar ke7$ompan code B1rimar ke7

    Other data

    #able two

    $ustomer number B1rimar ke7

    $ustomer name

    Other data

    -: ;econdary indexuestion" batch input 4ob with two steps is processed. I!1O#2)C1O# statements are used to pass values

    between the steps.

    'tep 6 contains the statements'#"#5'D&'&. $O# D &$&.)C1O# '#"#5' $O# #O !)!O( I+ &CCCC&.

    'tep / contains the statements

    $%)"$O#, '#"#5', F%"9.I!1O# $O# F%"9 FO! !)!O( I+ &CCCC&.

    What do the fields '(-'50$, $O# and F%"9 contain after the I!1O# statement have been eecuted

    -. ;B;8

  • 8/10/2019 Common Questions and Answers About ABAP

    11/141

    -. o;BI952, ;B3-52

    and ;BH252? are also reset.;B3-52

    8serSs local date, for example ((!(, ((()%!, T

    ;B3-89

    4urrent application ser+er date, for example (("), ((()%!&, T

    ;B3-;

    during summertime, otherwise space.

    ;BF3-D

    Factory calendar day of the week: 9onday = T Friday = $.

    ;BI952

    8serSs local time, for example $#"$", !!$"!, T

    ;BH2/

    ime difference in seconds between local time and reenwich 9ean ime >84?, for example,"%), ))).

    ;B8H/I

    4urrent application ser+er time. for example %#"$", !$"!, T

    ;BH252

    8serSs time Kone, for example, /;, 84, T

    Fields of nternal Tables

    '(-#"0IC

    4urrent line of an internal table. ;B-

  • 8/10/2019 Common Questions and Answers About ABAP

    12/141

    5221 - sets ;B-

  • 8/10/2019 Common Questions and Answers About ABAP

    13/141

    Instead of:E:

  • 8/10/2019 Common Questions and Answers About ABAP

    14/141

    /xample:E: 16IB42625 ;/;41 = *c$

    If you do not use the eMuals sign, a space character is inserted between the print control ;/;41 and the character*c$.

    6efer to 2;; note ;EE< - How can '"1script include printer commands?

    Different font on t%e same line

    ou can ha+e different font on the same line by defining a character format.

    For example < for bold text and 8 for 8nderline.

    In your ;-1;cript apply like this :

    8G8nderline extEG

  • 8/10/2019 Common Questions and Answers About ABAP

    15/141

    +rientations in SAPSC!PT

    BBBBB2riginal 9essageBBBBB;ubject: 2rientations in ;-1;46I1From: -shwini Jaokar

    @i,

    I ha+e ! pages for a Form in ;-1script .

    4an I ha+e ! different 2rientations for ! pagesIe 4an I assign 1age as 1ortrait R page! as 5andscape QQQ

    If so , @ow QQQQ

    hanks in -d+ance.-shwini Jaokar.

    BBBBB6eply 9essageBBBBB;ubject: 6e: 2rientations in ;-1;46I1From: jmersinger

    -shwini,

    ot that I know of in the same layoutset...what you can do is create two layoutsets...one portrait, onelandscape...then in the print program call each one indi+idually.

    jjm

    BBBBB6eply 9essageBBBBB;ubject: 6/: 2rientations in ;-1;46I1From: 6alph 0lassen

    /ach form may only ha+e a single orientation but you can create two forms and include them in the same spooloutput.

    In your -

  • 8/10/2019 Common Questions and Answers About ABAP

    16/141

    6egards,6alph 0lassen ;ylogist

    How to ,pload grap%ics -.A/(0 to your Sapscript?

    4ommand in your ;apscript

    2 I$%5+) A(O5A%O9O O0G)$# #)C# I+ '# %"95"9) )

    hese are the steps to be followed for uploading graphics in 6E" system

    . First sa+e the file as

  • 8/10/2019 Common Questions and Answers About ABAP

    17/141

    -: 2n the erms R 4onditions page, 4hange the 1age counter mode to '@253' to keep the page counter fromincrementing when you print the erm R 4onditions.

    > $an I 1rint a logo on an Invoice?

    -: ;a+e a 5ogo using 1aintshop 1ro or 4orel 3raw as iff file. 8se 6;5394 to con+ert the logo to standardtext in ;ap;cript. Dhen the program is executed, the path and file name ha+e to be correctly specified.

    1rocess could be like the following:6un 6;5394

    /nter file name 4:V9-I5V4291522.IF6esolution for iff file-bsolute Bposition-bsolute Bposition-bsolute positioning6eser+ed height;hift to right829 = 49ext title5ine width for text = "!ext name H@/B9-462B4291522

    ext I3 ;ext language = /1ostscript scalingDidth R @eight according to 1; scalingumber of iff gray le+els >!,#,(? !hen 4reate a new window '4291' with attributesPDindow 4291 description 4ompany 5ogoDindow type 42;5eft margin &.)) 4@ window width ).)) 4@8pper margin 5 window height .)) 5

    Finally in the text element , mentionE: I4583/ 'H@/B9-462B4291522' 2

  • 8/10/2019 Common Questions and Answers About ABAP

    18/141

    o print a form, you need a program for data retrie+al and a ;mart Form that contains the entire from logic. -s daretrievaland form logicare separated, you must only adapt the ;mart Form if changes to the form logic arenecessary. he application program passes the data via a function module interface to the 'mart Form. Dheactivatingthe ;mart Form, the sstem automaticall generates a function module. -t runtime, the systemprocesses this function module.

    ou can insert static and dynamic tables. his includes line feeds in indi+idual table cells, triggering events fortable headingsand subtotals, and sorting databefore output.

    ou can check indi+idual nodes as well as the entire form and find any existing errors in the tree structure. he da

    flow analsis checkswhether all fields >+ariables? ha+e a defined +alue at the moment they are displayed.

    ;-1 ;mart Forms allow you to include graphics, which you can display either as part of the form or asbackground graphics. ou use background graphics to copy the layout of an existing >scanned? form or to lendforms a companyBspecific look. 3uring printout, you can suppress the background graphic, if desired.

    ;-1 ;mart Forms also support postage optimiKing.

    -lso read ;-1 ote o. %"% B ;mart Forms: ew form tool in 6elease #.%4

    What #ransaction to start '"1 'mart Forms?/xecute transaction '!"#FO!'to start ;-1 ;mart Forms.

    e 0enefits of '"1 'mart Forms;-1 ;mart Forms allows you to reduce considerably the implementation costs of my;-1.com solutions since formcan be adjusted in minimum time.

    ou design a form using the graphical Form 1ainter and the graphical able 1ainter. he form logic is representedby a hierarchy structure >tree structure? that consists of indi+idual nodes, such as nodes for global settings, nodesfor tets, nodes for output tables, or nodes for graphics.

    o make changes, use +rag +rop, $op 1aste, and select different attributes.

    hese actions do not include writing of coding lines or using a ;cript language.

    8sing your form description maintained in the Form ;F? to allow the use of "rd party printing too;F passes form content from 6E" to an external product without passing any layout information about the ;martForm.

    Ad2antages of SAP Smart Forms;-1 ;mart Forms ha+e the following ad+antages:

    . he adaption of forms is supported to a large extent by graphic tools for layout and logic, so that noprogramming knowledge is necessary >at least ()U of all adjustments?. herefore, power user forms can also makconfigurations for your business processes with data from an ;-1 system. 4onsultants are only reMuired in specialcases.

    !. 3isplaying table structures >dynamic framing of texts?

  • 8/10/2019 Common Questions and Answers About ABAP

    19/141

    ". 2utput of background graphics, for form design in particular the use of templates which were scanned.

    #. 4olored output of texts

    $. 8serBfriendly and integrated Form 1ainter for the graphical design of forms

    %. raphical able 1ainter for drawing tables

    &. 6eusing Font and paragraph formats in forms >;mart ;tyles?

    . 3ata interface in 95 format >95 for ;mart Forms, in short ;F?

    (. Form translation is supported by standard translation tools

    ). Flexible reuse of text modules

    . @95 output of forms > D)T)

    n t"e +oop section% tic# nternal table and fill in

    TAB= !table in )*)P S()TF/( calling function$ 0T/ TAB>

    1. Define table in smartforms

    /lobal settingsForm interface3ariable name T&pe assignment eference t&peTAB= T4P, Table Structure

    lobal definitions7ariable name ype assignment 6eference typeI#"0/ 1/ able ;tructure

    #. o display the data in the form9ake used of the able 1ainter and declare the 5ine ype in abstrips able

  • 8/10/2019 Common Questions and Answers About ABAP

    20/141

    e.g. @3A/ for printing header details,IA/ for printing data details.

    ou ha+e to specify the 5ine ype in your ext elements in the abstrips 2utput options.ick the ew 5ine and specify the 5ine ype for outputting the data.3eclare your output fields in ext elementsabstrips B 2utput 2ptionsFor different fonts use this ;tyle : I+W#$)#'#(%)For Nuantity or -mout you can used this +ariable 9'AI#"0-"!O5#B6/./7

    $. 4alling ;9-6F269; from your -

  • 8/10/2019 Common Questions and Answers About ABAP

    21/141

    if syBsubrc G ).D6I/: E '/6626 '.

    * 9/;;-/ I3 ;B9;I3 1/ ;B9; 89

  • 8/10/2019 Common Questions and Answers About ABAP

    22/141

    e? ;martforms generates a function module when acti+ated.

    4ontributed by : ;-1 -5tilities -J +ownload form?. It will create a 95 file and sa+e it inthe hard disk.

    For others, if ou want to download2upload the 'martforms source, ou will need the help from the 0asis

    people. What ou can do is to create a #ransport and then F#1 down to our local harddisk. When ou

    need the 'martform source in another sstem, ou have F#1 up the 'martforms file back to the '"1 server

    Finall, the 0asis team, will tp it into our sstem.

    g? he protect and endprotect command in sapscriptdoesn't work with smartforms. For example on a in+oice:First data of position no ). is printed on page one, other data of position no ) is printed on page !. -nd there'snothing you can do about it. -ctually, there is something you can do about it.

  • 8/10/2019 Common Questions and Answers About ABAP

    23/141

    'stem fields of 'mart Forms

    'F'(-+"#)

    3isplays the date. ou determine the display format in the user master record.

    'F'(-#I!)

    3isplays the time of day in the form @@:99:;;.

    'F'(-1"9)

    Inserts the number of the current print page into the text. ou determine the format of the page number >for

    example, -rabic, numeric? in the page node.

    'F'(-FO!1"9)'

    3isplays the total number of pages for the currently processed form. his allows you to include texts such as'1agex of y' into your output.

    'F'(-GO01"9)'

    4ontains the total page number of all forms in the currently processed print reMuest.

    'F'(-WI+OW"!)

    4ontains the name of the current window >string in the Dindow field?

    'F'(-1"9)"!)4ontains the name of the current page >string in the 1age field?

    'F'(-1"9)0)"

    Is set to '' after a page break >either automatic W1age &X or commandBcontrolled W1age #%X?

    'F'(-!"I)+

    Is set as soon as processing of the main window on the current page ends

    'F'(-)C$)1#IO4ontains the name of the raised exception. ou must trigger your own exceptions, which you defined in the forminterface, using the userAexception macro >syntax: userAexception exception name G?.

    ("ample Forms A2ailable in Standard SAP !#

    'FA)C"!1%)A@6

    ;imple exampleP in+oice with table output of flight booking for one customer

    'FA)C"!1%)A@/

    ;imilar to ;FA/-915/A) but with subtotals

    'FA)C"!1%)A@8

    ;imilar to ;FA/-915/A)!, whereby se+eral customers are selected in the application programP the form iscalled for each customer and all form outputs are included in an output reMuest

    Smart forms Fre6uently Asked @uestions

    Forcing a page break within table loop

    4reate a loop around the table. 1ut a 4ommand node before the table in the loop that forces a /D1-/ onwhate+er condition you want. hen only loop through a subset of the internal table >based on the conditions in the4ommand node? of the elements in the able node.

  • 8/10/2019 Common Questions and Answers About ABAP

    24/141

    Font stle and Font siLe

    oto ransaction ;9-6;5/;.here you can create 1aragraph formats etc just like in sapscript.

    hen in your window under 2818 21I2; you include this ;9-6;5/ and use the 1aragraph andcharacter formats.

    %ine in 'martform

    /ither you can use a window that takes up the width of your page and only has a height of mm.

    hen you put a frame around it >in window output options?.hus you ha+e drawn a box but it looks like a line.

    2r you can just draw OAAO accross the page and play with the fonts so that it joins each 83/6A;426/.

    +ifference between &forminterface& and &global definitions& in global settings of smart forms

    he 3ifference is as follows.

    o put it +ery simply:

    Form Interface is where you declare what must be passed in and out of the smartform >in from the print program tthe smartform and out from the smartform to the print program?.

    lobal defs. is where you declare data to be used within the smartform on a global scope.ie: anything you declare here can be used in any other node in the form.

    'martforms function module name

    2nce you ha+e acti+ated the smartform, go to the en+ironment BG function module name. here you can get thename of funtion module name.

    he key thing is the program that calls it. for instance, the in+oice ;9-6F269 5

  • 8/10/2019 Common Questions and Answers About ABAP

    25/141

  • 8/10/2019 Common Questions and Answers About ABAP

    26/141

    - smartform is transported no differently than any other object. if it is assigned to a de+elopment class that isatteched to a transport layer, it will be transported.he definition is transported, and when called, the function module is regenerated.his leads to an interetsing situation. 2n the new machine, it is +ery likely the function module name will bedifferent than the name on the source system. 9ake sure, before you call the function module, you resol+e theexternal name to the internal name using the ';;FAF84I2A92385/A-9/' function module.ypically, generate the ;F, then use the pattern to being in the interface. hen change the call function to use thename you get back from the abo+e function module.

    'martforms protect lines in main window.How to protect lines in the main window from splitting between pages?

    It was easy with ;-1script, but how to do it with ;F's. For #.& +ersion if you are using tables, there are twooptions for protection against line break:B ou can protect a line type against page break.B ou can protect se+eral table lines against page break for output in the main area.

    1rotection against page break for line typesB 3oubleBclick on your table node and choose the able tab page.B ;witch to the detail +iew by choosing the 3etails pushbutton.

    B ;et the 1rotection against page break checkbox in the table for the rele+ant line type. able lines that use this lintype are output on one page.

    1rotection against page break for se+eral table linesB /xpand the main area of your table node in the na+igation tree.B Insert a file node for the table lines to be protected in the main area.B If you ha+e already created table lines in the main area, you can put the lines that you want to protect again pagebreak under the file using 3ragR3rop. 2therwise, create the table lines as subnodes of the file.B 4hoose the 2utput 2ptions tab page of the file node and set the 1age 1rotection option. -ll table lines that are ithe file with the 1age 1rotection option set are output on one page.

    In #.%, -lternati+ely in a paragraph format use the 1age protection attribute to determine whether or not to display

    paragraph completely on one page. 9ark it if you want to a+oid that a paragraph is split up by a page break. If onthe current page >only in the main window? there is not enough space left for the paragraph, the entire paragraphappears on the next page.

    Details information about SAP Barcodes

    - barcode solution consists of the following:B a barcode printerB a barcode readerB a mobile data collection applicationEprogram

    - barcode label is a special symbology to represent human readable information such as a material number or batcnumberin machine readable format.

    here are different symbologies for different applications and different industries. 5uckily, you need not worry tomuch about that as the logistics supply chain has mostly standardiKed on " of ( and ! barcode symbologies Bwhich all barcode readers support and which ;-1 support nati+ely in it's printing protocols.

    ou can print barcodes from ;-1 by modifying an existing output form.

  • 8/10/2019 Common Questions and Answers About ABAP

    27/141

    a +ery easybut frustratingly simplistic form format language? or ;martForms that is more of a graphical form design tool.

    resin? ribbon to create the sharpimage reMuired for barcodes.

    ot to fear though, there are two ways to get around this:B ou can ha+e your I department do some research Bmost laser printers can accept a font cartridgeEdimm chip >similar to computer memory?, called a G)? to support barcodes.

    ow you ha+e a barcode printed B what nextQDell there are two options, depending on your business reMuirements:B ou can use an existing ;-1 transaction on a regular workstation and get a barcode wedge reader to hook upbetween the keyboard and the 14. hese wedge readers comes in a wand or scanner format. here are e+en wirelewedge scanners a+ailable that allows you to roam a few yards from the workstation to scan a label. his approach mostly used where you want to pre+ent human errors in typing in long material, batch or serial numbers inrecei+ing or issuing of material. he problem is that it's just replacing the keyboard input and you are basicallylocked down in one location and ha+e to bring all the material to that location to process.B -nother solution is to use ;-14onsole transactionsor write your own -

  • 8/10/2019 Common Questions and Answers About ABAP

    28/141

    he report output can contain up to () columns in the display with the wide array of display options.

    he commonly used -57 functions used for this purpose areP

    . 6/8;/A-57A7-6I-A3/F-85A/!. 6/8;/A-57A7-6I-AF#". 6/8;/A-57A7-6I-A/I;/4/#. 6/8;/A-57A/7/;A/$. 6/8;/A-57A4299/-6AD6I/%. 6/8;/A-57AFI/534--52A9/6/

    &. 6/8;/A-57A5I;A3I;15-. 6/8;/A-57A6I3A3I;15-(. 6/8;/A-57A12181A2A;/5/4

    1urpose of the abo+e Functions are differ not all the functions are reMuired in all the -57 6eport.

  • 8/10/2019 Common Questions and Answers About ABAP

    29/141

    * -"? type n.

    * D@/ 8;I 926/ @- 2/ -1/B1225;BBBBBBBBBG;5I;?typeBpools : slis.

    ************************************************************************* I/6-5 -

  • 8/10/2019 Common Questions and Answers About ABAP

    30/141

    * 2F slisAtAfieldcatAal+

  • 8/10/2019 Common Questions and Answers About ABAP

    31/141

    perform mergeAfieldcatalog.* ;8

  • 8/10/2019 Common Questions and Answers About ABAP

    32/141

    * BBG 1A0/ ** BBG 1A0/ **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*form fillAfieldsAofAfieldcatalog tables fieldcatalogstructure fieldcatalogusing pAtabnamepAfieldnamepAkey.* pAnoAout.

    fieldcatalogBtabname = pAtabname.fieldcatalogBfieldname = pAfieldname.fieldcatalogBkey = pAkey.fieldcatalogBemphasiKe = '!"#'.*fieldcatalogBnoAout = pAnoAout.append fieldcatalog.endform. O FI55AFI/53;2FFI/534--52

    *BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** F269 12185-/A5-28 **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** ........ **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** BBG FI/535-28 **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*form populateAlayout using fieldlayout type slisAlayoutAal+.fieldlayoutBf!code = 'R/-' .fieldlayoutBKebra = ''.* F26 @/ DI32D I5/.fieldlayoutBwindowAtitlebar = '-57 with /+ents'.

    fieldlayoutBcolwidthAoptimiKe = ''.

    fieldlayoutBnoA+line = ' '.*fieldlayoutBnoAinput = ''.fieldlayoutBconfirmationAprompt = ''.fieldlayoutBkeyAhotspot = ''.* his remo+es the column headings if the flag is set to ''fieldlayoutBnoAcolhead = ' '.*fieldlayoutBhotspotAfieldname = '9-0'.fieldlayoutBdetailApopup = ''.* fieldlayoutBcoltabAfieldname = ''.endform. O 12185-/A5-28

    *BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** F269 ;/5/43--A-3A;26 **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** ........ **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*form selectdataAandAsort.select matnr meins mtart matkl from marainto corresponding fields of tAmaraup to $)) rows .

  • 8/10/2019 Common Questions and Answers About ABAP

    33/141

    select matnr maktx spras from maktinto corresponding fields of tAmaktwhere matnr = tAmaraBmatnr andspras = syBlangu.

    select matnr werks minbe from marcinto corresponding fields of tAmarcwhere matnr = tAmaraBmatnr.append tAmarc.endselect.append tAmakt.endselect.append tAmara.endselect.perform populateAitab.sort itab by matnr.endform. O ;/5/43--A-3A;26

    *BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** F269 9/6/AFI/534--52 **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*

    * ........ **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*form mergeAfieldcatalog.call function '6/8;/A-57AFI/534--52A9/6/'exportingiAprogramAname = syrepidiAinternalAtabname = 'I-

  • 8/10/2019 Common Questions and Answers About ABAP

    34/141

    iAstructureAname = 'I-

  • 8/10/2019 Common Questions and Answers About ABAP

    35/141

    * text*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** BBG1A/7/;-< text **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*form fillAe+entstab tables pAe+entstab structure e+entstab.* D@/ @/ F2552DI F84I2 I; 4-55/3 @/ ;;/9 12185-/; @/* I/6-5 -

  • 8/10/2019 Common Questions and Answers About ABAP

    36/141

  • 8/10/2019 Common Questions and Answers About ABAP

    37/141

    append pAheading.when '@/-3I"'.pAheadingBtyp = '@'.pAheadingBinfo = 'F26/IB21B2FB1-/'.append pAheading.when '@/-3I#'.pAheadingBtyp = '@'.pAheadingBinfo = 'F26/IB/3B2FB1-/'.append pAheading.

    * D@/ '@/-3I$'.* 1A@/-3IB1 = '@'.* 1A@/-3IBIF2 = '5I;B923IF'.* -11/3 1A@/-3I.when '@/-3I%'.pAheadingBtyp = '@'.pAheadingBinfo = '/3B2FB1-/'.append pAheading.when '@/-3I&'.pAheadingBtyp = '@'.pAheadingBinfo = '/3B2FB5I;'.

    append pAheading.when '@/-3I'.pAheadingBtyp = '@'.pAheadingBinfo = '21B2FB5I;'.append pAheading.endcase.endform. O FI55A@/-3I-

  • 8/10/2019 Common Questions and Answers About ABAP

    38/141

    *BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** F269 21A2FA427/61-/ **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** ........ **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*form topAofAco+erpage.call function '6/8;/A-57A4299/-6AD6I/'exportingitAlistAcommentary = headingWX

    exceptionsothers = .endform.

    *BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** F269 /3A2FA427/61-/ **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** ........ **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*form endAofAco+erpage.call function '6/8;/A-57A4299/-6AD6I/'exportingitAlistAcommentary = heading!WXexceptionsothers = .endform.

    *BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** F269 F26/IA21A2FA1-/ **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** ........ **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*form foreignAtopAofApage.

    call function '6/8;/A-57A4299/-6AD6I/'exportingitAlistAcommentary = heading"WXexceptionsothers = .

    endform.

    *BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** F269 F26/IA/3A2FA1-/ **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** ........ **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*form foreignAendAofApage.call function '6/8;/A-57A4299/-6AD6I/'exportingitAlistAcommentary = heading#WXexceptionsothers = .endform.

  • 8/10/2019 Common Questions and Answers About ABAP

    39/141

    *BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** F269 5I;A923IF **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** ........ **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB**F269 5I;A923IF.* 4-55 F84I2 '6/8;/A-57A4299/-6AD6I/'* /126I* IA5I;A4299/-6 = @/-3I$WX

    * /4/1I2;* 2@/6; = .*/3F269.

    *BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** F269 /3A2FA1-/ **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** ........ **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*form endAofApage.call function '6/8;/A-57A4299/-6AD6I/'exportingitAlistAcommentary = heading%WXexceptionsothers = .endform.

    *BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** F269 /3A2FA5I; **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** ........ **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*form endAofAlist.

    call function '6/8;/A-57A4299/-6AD6I/'exportingitAlistAcommentary = heading&WXexceptionsothers = .endform.

    *BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** F269 21A2FA5I; **BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB** ........ *

    *BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*form topAofAlist.call function '6/8;/A-57A4299/-6AD6I/'exportingitAlistAcommentary = headingWXexceptionsothers = .endform.

    *BBB /nd of 1rogram

  • 8/10/2019 Common Questions and Answers About ABAP

    40/141

    !(,S(A$/!DDSP$A: Functions ("ample

    6/126 H-57A6I3.

    -

  • 8/10/2019 Common Questions and Answers About ABAP

    41/141

    .

    F269 f)%$)AbuildAe+ent 8;I +alue>wAcAe+entAname?+alue>wAcAe+entAform?.

    3--: f)%$)AwaAe+ent 1/ slisAal+Ae+ent.

    45/-6 f)%$)AwaAe+ent.f)%$)AwaAe+entBname = wAcAe+entAname.

    f)%$)AwaAe+entBform = wAcAe+entAform.-11/3 f)%$)AwaAe+ent 2 iAe+ents.

    /3F269.F269 f)&$)AuserAcommand 8;I wAucomm 1/ syBucomm

    wAselfield 1/ slisAselfield.

    4-;/ wAucomm.D@/ 'RI4'.

    6/-3 -

  • 8/10/2019 Common Questions and Answers About ABAP

    42/141

  • 8/10/2019 Common Questions and Answers About ABAP

    43/141

  • 8/10/2019 Common Questions and Answers About ABAP

    44/141

    *---------------------------------------------------------------------** 6)p6)s OLE errr i1 4y **----------------------------------------------------------------------** -- p )e9)* -- p= )e9)*----------------------------------------------------------------------*FORM ERR_!DL.IF SY-S#BRC $.RITE: ( &Fe5>er 8ei OLE-A6)/)i4:&$$2 SY-S#BRC.STOP.

    ENDIF.

    ENDFORM. 7 ERR_!DL

    P>ese 4)e )5) )5is e9/p>e /y8e s> ) 1i>>i43 )5e e9+e> )8>eper5ps 16r 1ie>ds per se+4d 4 $$ M! /+5i4e - >/s) $ se+4ds1r s5r) e9/p>e.

    T 3e) )5e d) 4 prper)ies 4d /e)5ds - )5ere is 8i) 1 s/,e 4d /irrrs3i43 4 5ereQ )5ey re E%CEL prper)ies 4d /e)5ds2 4) sp 4es - s y6 4eed) >, ) e9+e> 5e>p ) de)er/i4e 5 pr)i+6>r 164+)i4 is s)r6+)6red. )5e486i>d )5e 8>+, i4 sp2 s s54 i4 )5e e9/p>e.I1 y6 4>y 4) ) )r4s1er )5e d) ) E9+e> >i,e 5e4 y6 )r4s1er )5e d) 1r/AL' ) E9+e> si/p>y 6se )5e F64+)i4 Md6>es:

    %%L_SIMPLE_API

    I1 y6 4) /re /di1i+)i4s 5e4 y6 )r4s1er i) ) E9+e> 6se:

    %%L_F#LL_API

    A sample Tree Programming

    6/126 H77986! .

    -

  • 8/10/2019 Common Questions and Answers About ABAP

    45/141

    * 1arent = . hierarchy nodeD-A/91B086 = [email protected]/3 D-A/91 2 IA/91.D-AD260B086 = D-A/91B086.D-AD260B5/7/5 = .-11/3 D-AD260 2 IAD260.

    * 6eading customer hierarchy >max. % le+el?32 89

  • 8/10/2019 Common Questions and Answers About ABAP

    46/141

    -

  • 8/10/2019 Common Questions and Answers About ABAP

    47/141

  • 8/10/2019 Common Questions and Answers About ABAP

    48/141

    *gAdocumentBokcode = '4@'.gAdocumentBobjlen = ')'.gAdocumentBfileAext = ''.

    gAheaderBobjdes = 'sapBimg.com testing by program'.gAheaderBfileAext = ''.

    call function ';2A32489/A6/12;I26A9--/6'exporting

    method = method

    officeAuser = syBunamerefAdocument = gArefAdocumentnewAparent = gAnewAparent

    importingauthority = gAauthority

    tablesobjcont = gAobjcntobjhead = gAobjheadobjpara = gAobjparaobjparb = gAobjparbrecipients = gAreceipients

    attachments = gAattachmentsreferences = gAreferencesfiles = gAfiles

    changingdocument = gAdocumentheaderAdata = gAheader

    * F259/9A3-- =* 6/4/I7/A3-- =

    .

    * File from the pc to send...

    method = '-46/-/F62914'.

    gAfilesBtext = wsAfile.append gAfiles.

    call function ';2A32489/A6/12;I26A9--/6'exporting

    method = methodofficeAuser = gAownerrefAdocument = gArefAdocumentnewAparent = gAnewAparent

    importing

    authority = gAauthoritytables

    objcont = gAobjcntobjhead = gAobjheadobjpara = gAobjparaobjparb = gAobjparbrecipients = gAreceipientsattachments = gAattachmentsreferences = gAreferences

  • 8/10/2019 Common Questions and Answers About ABAP

    49/141

    files = gAfileschanging

    document = gAdocumentheaderAdata = gAheader

    .

    method = ';/3'.

    gAreceipientsBrecnam = '90)$'.gAreceipientsBrecesc = 'In #.%4 only, ou can go to ;/"& and click the documentation on how to use it. - sample program is pro+idedthere.?;-1office: ;end new document with attachments +ia 6F4ote : If you are using F9 'OA)WA+O$5!)#A"##A')+A"1I6then /xport 1arameter+O$5!)#A+"#"-O0GA+)'$contains the ;ubject.

    'OA)WA+O$5!)#A')+A"1I6

    ;-1office: ;end new document

  • 8/10/2019 Common Questions and Answers About ABAP

    50/141

    How to send a report to an e"ternal mail'id?

    ry this sample code :B

    6/126 H6/126A2A/9-I5 2 ;-3-63 1-/ @/-3I 5I/B;IH/ !)).

    3-- :

  • 8/10/2019 Common Questions and Answers About ABAP

    51/141

    /126IlistAindex = ')'-

  • 8/10/2019 Common Questions and Answers About ABAP

    52/141

    I-

  • 8/10/2019 Common Questions and Answers About ABAP

    53/141

    *REPORT ?SPELL.

    TABLES SPELL.

    DATA : T_SPELL LIKE SPELL OCC#RS $ IT! !EADER LINE.DATA : PAMO#NT LIKE SPELL-N#MBER 'AL#E &=$&.

    SY-TITLE " &SPELLING N#MBER&.

    PERFORM SPELL_AMO#NT #SING PAMO#NT SD&.

    RITE: &N#MBERS&2 T_SPELL-ORD2 &DECIMALS &2 T_SPELL-DECORD.

    FORM SPELL_AMO#NT #SING PRBTR PAERS.

    CALL F#NCTION &SPELL_AMO#NT& E%PORTING AMO#NT " PAMO#NT C#RRENCY " PAERS FILLER " SPACE LANG#AGE " &E& IMPORTING IN_ORDS " T_SPELL E%CEPTIONS

    NOT_FO#ND " TOO_LARGE " = OT!ERS " .ENDFORM. 7 SPELL_AMO#NT

    Con2ert .ont% to ord in ABAPREPORT ?MONT!.DATA %_MONT!.

    CALL F#NCTION &CON'ERSION_E%IT_LDATE_O#TP#T& E%PORTING INP#T " SY-DAT#M IMPORTING O#TP#T " %_MONT!.

    RITE:( &M4)5 i4 rds&2 %_MONT!

  • 8/10/2019 Common Questions and Answers About ABAP

    54/141

    ;ee the below /xample:

    - ;/5/4I2B;46// 2 7-58/B6/N8/; F26 ;/5A

  • 8/10/2019 Common Questions and Answers About ABAP

    55/141

    * ! ) pp6p 4 i4s)4) /ess3e 4 6ser&s /4i)r* ! ) 3e) spe+i1i+ 6ser&s de)i>s* #s3e 1 &POP#P_GET_'AL#ES& 164+)i4 /d6>e ) 3e) d) 1r/ 6ser* i)56) 50i43 ) ri)e G#I +de** S68/i))ed 8y : SAP Bsis2 ABAP Pr3r//i43 4d O)5er IMG S)611* 5))p:((.sp-i/3.+/*REPORT ?POP#P NO STANDARD PAGE !EADING.INCL#DE ICON.

    DATA: BEGIN OF #SR_TABL OCC#RS $. INCL#DE STR#CT#RE #INFO.DATA: END OF #SR_TABL.

    DATA: L_LENGT! TYPE I2 T_ABAPLIST LIKE ABAPLIST OCC#RS $ IT! !EADER LINE2 BEGIN OF T_#SER OCC#RS $2 CO#NTER TYPE I2 SELECTION TYPE C2 MANDT LIKE SY-MANDT2 BNAME LIKE SY-#NAME2 NAME_FIRST LIKE '_ADRP_CP-NAME_FIRST2 NAME_LAST LIKE '_ADRP_CP-NAME_LAST2 DEPARTMENT LIKE '_ADRP_CP-DEPARTMENT2

    TEL_N#MBER LIKE '_ADRP_CP-TEL_N#MBER2 END OF T_#SER2 L_CLIENT LIKE SY-MANDT2 L_#SERID LIKE #INFO-BNAME2 L_OPCODE TYPE %2 L_F#NCT_CODE TYPE C2 L_TEST=$$ TYPE C.

    L_OPCODE " =.CALL &T5#srI41& ID &OPCODE& FIELD L_OPCODE ID &TAB& FIELD #SR_TABL-*SYS*.

    CLEAR T_#SER. REFRES! T_#SER.

    LOOP AT #SR_TABL. T_#SER-MANDT " #SR_TABL-MANDT. T_#SER-BNAME " #SR_TABL-BNAME. APPEND T_#SER.ENDLOOP.

    SORT T_#SER.DELETE ADACENT D#PLICATES FROM T_#SER.LOOP AT T_#SER. T_#SER-CO#NTER " SY-TABI%. SELECT 'NAME_FIRST

    'NAME_LAST 'DEPARTMENT

    'TEL_N#MBER INTO T_#SER-NAME_FIRST2 T_#SER-NAME_LAST2 T_#SER-DEPARTMENT2 T_#SER-TEL_N#MBER FROM #SR= AS # OIN '_ADRP_CP AS ' ON #PERSN#MBER " 'PERSN#MBER AND #ADDRN#MBER " 'ADDRN#MBER !ERE #BNAME " T_#SER-BNAME. ENDSELECT.

    http://www.sap-img.com/index.htmhttp://www.sap-img.com/index.htm
  • 8/10/2019 Common Questions and Answers About ABAP

    56/141

  • 8/10/2019 Common Questions and Answers About ABAP

    57/141

    *---------------------------------------------------------------------** Fr/ DISPLAY_MEN#*---------------------------------------------------------------------*FORM DISPLAY_MEN#. FORMAT COLOR COL_!EADING !OTSPOT. RITE: SY-#LINE2 ( SY-'LINE NO-GAP2 ICON_SELECT_ALL NO-GAP2 &Se>e+) A>>&2 SY-'LINE NO-GAP2 ICON_DESELECT_ALL NO-GAP2 &Dese>e+) A>>&2 SY-'LINE NO-GAP2 ICON_S!ORT_MESSAGE NO-GAP2 &Se4d Pp6p&2 SY-'LINE NO-GAP2 ICON_SORT_#P NO-GAP2 &Ls) N/e& NO-GAP2 SY-'LINE NO-GAP2 ICON_SORT_#P NO-GAP2 &Firs) N/e& NO-GAP2

    SY-'LINE NO-GAP2 ICON_SORT_#P NO-GAP2 &C>ie4)& NO-GAP2 SY-'LINE2 ( SY-#LINE2 ($H SY-#LINE. FORMAT !OTSPOT OFF.

    RITE: ( SY-'LINE2 & &2 SY-'LINE2 &C>i&2 SY-'LINE2 ser &2 SY-'LINE2 &Firs) N/e &2 SY-'LINE2 &Ls) N/e &2 SY-'LINE2 &Depr)/e4) &2 SY-'LINE2 &Te>ep54e &2 SY-'LINE2

    ($H SY-#LINE. FORMAT COLOR OFF.ENDFORM. 7 DISPLAY_MEN#

    *---------------------------------------------------------------------** Fr/ TRANSFER_SELECTION*---------------------------------------------------------------------*FORM TRANSFER_SELECTION. DO. READ LINE SY-INDE% FIELD 'AL#E T_#SER-SELECTION. IF SY-S#BRC $. E%IT. ENDIF.

    MODIFY T_#SER TRANSPORTING SELECTION !ERE CO#NTER " T_#SER-CO#NTER. ENDDO. CLEAR T_#SER.ENDFORM. 7 TRANSFER_SELECTION

    *---------------------------------------------------------------------** Fr/ POP#P_MSG*---------------------------------------------------------------------*FORM POP#P_MSG. DATA: L_MSG LIKE SM$DIC-POP#PMSG 'AL#E &E9peri/e4)> Mess3e&2 L_LEN TYPE I2 L_RET TYPE C.

    LOOP AT T_#SER !ERE SELECTION " &%&. PERFORM GET_MESSAGE C!ANGING L_MSG L_RET. E%IT. ENDLOOP. IF L_RET " &A&. 7#ser +4+e>>ed )5e /ess3e E%IT. ENDIF.* Ge) )5e /ess3e )e9) L_LEN " STRLEN L_MSG . LOOP AT T_#SER !ERE SELECTION " &%&. CALL F#NCTION &T!_POP#P&

  • 8/10/2019 Common Questions and Answers About ABAP

    58/141

    E%PORTING CLIENT " T_#SER-MANDT #SER " T_#SER-BNAME MESSAGE " L_MSG MESSAGE_LEN " L_LENGT!* C#T_BLANKS " & & E%CEPTIONS #SER_NOT_FO#ND " OT!ERS " =. IF SY-S#BRC $. RITE: ser &2 T_#SER-BNAME2 &4) 164d.&.

    ENDIF. ENDLOOP. IF SY-S#BRC $.* Bi3 errr N 6ser 5s 8ee4 se>e+)ed. MESSAGE ID &AT& TYPE &E& N#MBER && IT! &N 6ser se>e+)ed&. E%IT. ENDIF.ENDFORM. 7 POP#P_MSG*---------------------------------------------------------------------** Fr/ GET_MESSAGE*---------------------------------------------------------------------*FORM GET_MESSAGE C!ANGING P_L_MSG LIKE SM$DIC-POP#PMSG P_RET#RNCODE TYPE C.

    DATA: BEGIN OF FIELDS OCC#RS . INCL#DE STR#CT#RE S'AL.DATA: END OF FIELDS2 RET#RNCODE TYPE C.

    FIELDS-TABNAME " &SM$DIC&. FIELDS-FIELDNAME " &POP#PMSG&. FIELDS-FIELDTE%T " &Mess3e :&. CONCATENATE & - Ms3 1r/& SY-#NAME &.& INTO FIELDS-'AL#E SEPARATED BY & &. APPEND FIELDS.

    CALL F#NCTION &POP#P_GET_'AL#ES&

    E%PORTING POP#P_TITLE " &S6pp>y )5e pp6p /ess3e&

    IMPORTING RET#RNCODE " P_RET#RNCODE TABLES FIELDS " FIELDS.

    IF P_RET#RNCODE " &A&. E%IT. ELSE. READ TABLE FIELDS INDE% . P_L_MSG " FIELDS-'AL#E. ENDIF.ENDFORM. 7 GET_MESSAGE*-- E4d 1 Pr3r/

    alue re6uest for parameter* If you ha+e two parameters, you want to display +alues>f#? in parameter !* depending on the +alues entered in parameter .

    6/126 HA;6IA@/51A7-58/AF26A-

  • 8/10/2019 Common Questions and Answers About ABAP

    59/141

    1A0/ 5I0/ 486B0/. O;hort ext*BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB*BBB /xample of updating +alue of another field on the screen BBBBBBBBBB- ;/5/4I2B;46// 2 7-58/B6/N8/; F26 1AD-/6;.45/-6: 3FI/53;WX, 3FI/53;.

    *BBB select currency4-55 F84I2 '@/51A7-58/;A/'

    /126Ifieldname = 'D-/6;'

    tabname = '486'I9126I

    ;/5/4A7-58/ = 1AD-/6;.*BBB get long text for the selected currency;/5/4 ;I5/ 5/ F629 486

    I2 3FI/53;BFI/537-58/D@/6/ ;16-; = ;B5-8-3 D-/6; = 1AD-/6;.

    IF ;B;8

  • 8/10/2019 Common Questions and Answers About ABAP

    60/141

    *---------------------------------------------------------------------

    REPORT ?TEST_IN'ISIBLE_TRICK .

    *************************************************************START-OF-SELECTION.*SAPG#I s+ree4 04is5es 1r/ 6ser s+ree4 >is)

    CALL F#NCTION &SAPG#I_SET_PROPERTY&DESTINATION &SAPG#I&E%PORTING prper)y " &'ISIBLE&

    0>6e " & &E%CEPTIONS sys)e/_1i>6re " +//64i+)i4_1i>6re " =OT!ERS " .

    ***********************************************************************

    DO $$$ TIMES.

    *di43 s/e r, 5i+5 ),es >) 1 )i/e DO $$$ TIMES. ENDDO.*Rese))i43 )i/e +64)er 1 di>3 pr+ess s )5) )i/e-6) des 4)*5ppe4. #se )5is 1/ i)5i4 y6r pr3r/s ) pprpri)e >+)i4s )

    *rese) )i/e +64)er.

    CALL F#NCTION &T!_REDISPATC!&.

    ENDDO.

    **************************************************************r, is +/p>e)e 4d 4 ,e 6p )5e SAPG#I s+ree4

    CALL F#NCTION &SAPG#I_SET_PROPERTY&DESTINATION &SAPG#I&E%PORTING prper)y " &'ISIBLE&0>6e " &%&

    E%CEPTIONS sys)e/_1i>6re " +//64i+)i4_1i>6re " =OT!ERS " .

    *** E4d 1 Pr3r/

    To e"ecute a dos command from ABAP** ri))e4 8y : SAP Bsis2 ABAP Pr3r//i43 4d O)5er IMG S)611* 5))p:((.sp-i/3.+/** T e9e+6)e ds +//4d 1r/ ABAP2 y6 4eed ) +re)e 8) 1i>e.** #se )5e i4ds 4)epd ) +re)e )5is 8) 1i>e i4 +: :-

    ** )es).8)* +:* +d)e/p* dir (p*REPORT ?DOSCOMMAND NO STANDARD PAGE !EADING.

    PARAMETERS: DOSCMD$ DEFA#LT &+:)es).8)& LOER CASE.

    +>> 164+)i4 &G#I_E%EC& e9pr)i43

    http://www.sap-img.com/index.htmhttp://www.sap-img.com/index.htm
  • 8/10/2019 Common Questions and Answers About ABAP

    61/141

    +//4d " DOSCMD.

    *-- E4d 1 pr3r/.

    !FC call to get Ser2er $ist

    @ow to get the 6F4 call to get the list of ;-1 ;er+ers >3ifferent machines?Q3oes such a thing exist >From ;-16F4.II may beQ? but the II file is not a good option as I would need to checthe connection a+ailability.

    - list of application ser+ers within an 6E" system can be obtained by calling function module'#HA+I'1%"(A'))A%I'# '

    For example:

    6/126 H;/67/65I;.

    call function '@A3I;15-A;/67/6A5I;'.

    *** /nd of 1rogram

    "at are )*)P /b8ects6-

  • 8/10/2019 Common Questions and Answers About ABAP

    62/141

    wo of the function modules ha+e input and output parameters. hese form the data interface of the function group.

    -ny -

  • 8/10/2019 Common Questions and Answers About ABAP

    63/141

    APP$$+/!T(DB it" t"is function module &ou write all data fort"e specified ob8ect or sub-ob8ect in localmemor& to t"e database. f t"e log for t"eob8ect or sub-ob8ect in

  • 8/10/2019 Common Questions and Answers About ABAP

    64/141

    BA$DBS(A!CH Find logs in t"e database

    BA$DSP$+/DSP$A: Displa& messages in memor&

    BA$DSP$+/DSP$A: Displa& +og

    BA$DSP$+/PA!A.(T(!S ,it"er output e5tended long te5t or call acallbac# routine !based on t"e data in*)+;S;+/7-P))(S$

    BA$DSP$+/T(CH*CA$DATA /utput all log "eader data

    BA$DSP.S/$+*/T(5T Displa& message long te5t

    BA$DSP.S/PA!A.(T(!S ,it"er output e5tended long te5t or call acallbac# routine !based on t"e data in*)+;S;(S7-P))(S$

    BA$DSP.S/T(CH*CA$DATA /utput tec"nical data of a message suc" aswor# area% error number% etc.

    BA$DSP+,TP,TF!(( ,nd output

    BA$DSP+,TP,T*T nitiali9e output

    BA$DSP+,TP,TS(TDATA Set dataset to be displa&ed

    BA$DSPP!+F$(D(T$(($/(T (essage "ierarc"& in D,T+,3,+

    BA$DSPP!+F$(*+T!((/(T Displa& wit"out tree !fullscreen$

    BA$DSPP!+F$(P+P,P/(T Displa& wit"out tree !popup$

    BA$DSPP!+F$(S*/$($+//(T Standard profile !S+7'$ for one log

    BA$DSPP!+F$(STA*DA!D/(T Standard profile !S+7'$ for a lot of logs

    BA$/$BA,TH+!7AT+*/(T )ssign aut"ori9ation

    BA$/$BA,TH+!7AT+*!(S(T eset aut"ori9ation

    BA$/$BC+*F//(T ead configuration

    BA$/$BC+*F/S(T Set configuration

    BA$/$B.(.+!:(5P+!T Put function group memor& in )*)P-(,(/4

    BA$/$B.(.+!:.P+!T 7et function group memor& from )*)P-(,(/4

    BA$/$B.(.+!:!(F!(SH !Partiall&$ reset global memor&

    BA$/$B.(.+!:!(F!(SH !Partiall&$ initiali9e memor&

    BA$/$B.S/C,!!(*THA*D$(/(T 7et current message "andle

    BA$/$B.S/D(FA,$TS/(T 7et message defaults

    BA$/$BS(A!CH$+/ Find logs in memor&

    BA$/$BS(A!CH.S/ Find messages in memor&

  • 8/10/2019 Common Questions and Answers About ABAP

    65/141

    BA$$+/C!(AT( Create log wit" "eader data

    BA$$+/C!(AT( Create log wit" "eader data

    BA$$+/D($(T( Delete log !from database also at Sa:e$

    BA$$+/(5ST C"ec# e5istence of a log in memor&

    BA$$+/HD!CHA*/( C"ange log "eader

    BA$$+/HD!CH(C C"ec# log "eader data for consistenc&

    BA$$+/HD!!(AD ead log "eader and ot"er data

    BA$$+/.S/ADD Put message in log

    BA$$+/.S/ADD Put message in log

    BA$$+/.S/CHA*/( C"ange message

    BA$$+/.S/CHA*/( C"ange message

    BA$$+/.S/CH(C C"ec# message data for consistenc&

    BA$$+/.S/C,.,$AT( )dd message cumulated

    BA$$+/.S/D($(T( Delete message

    BA$$+/.S/D($(T( Delete message

    BA$$+/.S/(5ST C"ec# e5istence of a message in memor&

    BA$$+/.S/!(AD ead message and ot"er data

    BA$$+/.S/!(P$AC( eplace last message

    BA$$+/!(F!(SH Delete log from memor&

    BA$$+/!(F!(SH Delete log from memor&

    BA$.S/DSP$A:ABAP /utput message as )*)P-(,SS)7,

    BA$+BE(CTS($(CT ead )pplication +og ob8ects table record

    BA$+BE(CTS,B+BE(CT C"ec# w"et"er ob8ect and subob8ect e5ist andt"e combination is allowed

    BA$S,B+BE(CTS($(CT ead subob8ect table record

    BP((*T!AS( Trigger an e:ent from )*)P? program

    BPE+B$+/!(AD Fetc" 8ob log e5ecutions

    CHA*/(D+C,.(*T!(ADH(AD(!S 7et t"e c"ange document "eader for a salesdocument% and put t"e results in an internaltable.

    ("ample)CALL F#NCTION &C!ANGEDOC#MENT_READ_!EADERS&

    E%PORTING 8@e+)+>ss " &EINKBELEG& 8@e+)id " >_8@e+)id

  • 8/10/2019 Common Questions and Answers About ABAP

    66/141

    6ser4/e " sp+e TABLES i_+d5dr " >)_+d5dr.

    LOOP AT >)_+d5dr !ERE 6d)e IN s_ed). CALL F#NCTION &C!ANGEDOC#MENT_READ_POSITIONS& E%PORTING +543e46/8er " >)_+d5dr-+543e4r TABLES edi)ps " >)_edi)ps.

    LOOP AT >)_edi)ps !ERE 14/e " &LOEK?& AND 1_4e " &L&. p_des+ " )e9)-r$. 7 C4+e> C4)r+) ENDLOOP. ENDLOOP.

    CHA*/(D+C,.(*T!(ADP+ST+*S 7et t"e details of a c"ange document% andstore t"em in an internal table. T"is will tell&ou w"et"er a field was c"anged% deleted% orupdated.

    ("ample)CALL F#NCTION &C!ANGEDOC#MENT_READ_!EADERS&

    E%PORTING 8@e+)+>ss " &EINKBELEG& 8@e+)id " >_8@e+)id 6ser4/e " sp+e TABLES i_+d5dr " >)_+d5dr.

    LOOP AT >)_+d5dr !ERE 6d)e IN s_ed). CALL F#NCTION &C!ANGEDOC#MENT_READ_POSITIONS& E%PORTING +543e46/8er " >)_+d5dr-+543e4r TABLES edi)ps " >)_edi)ps.

    LOOP AT >)_edi)ps !ERE 14/e " &LOEK?& AND 1_4e " &L&. p_des+ " )e9)-r$. 7 C4+e> C4)r+) ENDLOOP. ENDLOOP.

    C$AFC$ASSFCAT+*+F+BE(CTS eturn all of t"e c"aracteristics for a material

    C$+P,TS/**F!+*T (o:e t"e negati:e sign from t"e left "and sideof a number% to t"e rig"t "and side of t"enumber. 0ote t"at T"e result will be left

    8ustified !li#e all c"aracter fields$% not rig"t8ustifed as numbers normall& are.

    C$PB(5P+!T ,5port a te5t table to t"e clipboard !onpresentation ser:er$

    C$PB.P+!T mport a Te5t Table from t"e Clipboard !onpresentation ser:er$

    C+..TT(5T To load long te5t into S)P

    C+*(!S+*(5TA$PHA*P,T con:erts an& number into a string fill wit"9eroes% wit" t"e number at t"e e5treme rig"t

  • 8/10/2019 Common Questions and Answers About ABAP

    67/141

    ("ample)i4p6) " =6)p6) " $$$$$$$$$$$$$...$$$$$$$$$$$$=

    C+*(!S+*(5TA$PHA+,TP,T con:erts an& number wit" 9eroes rig"t into asimple integer

    ("ample)i4p6) " $$$$$$$$$$$=

    6)p6) " =C+*(!TABAPSP++$E+B>PDF con:ert abap spool output to PDF

    C+*(!T+TF Con:ert S)P documents !S)PScript$ to ot"ert&pes.

    ("ample)CALL F#NCTION 7CON'ERT_OTF7 E%PORTING FORMAT " 7PDF7 IMPORTING BIN_FILESI?E " FILE_LEN TABLES OTF " OTFDATA LINES " PDFDATA E%CEPTIONS ERR_MA%_LINEIDT! "

    ERR_FORMAT " = ERR_CON'_NOT_POSSIBLE " OT!ERS " .

    C+*(!T+TFSP++$E+B>PDF con:erts a /TF spool to PDF !i.e. Sapscriptdocument$

    C+*(!TT+F+!(/*C,!!(*C: Con:ert local currenc& to foreign currenc&.

    C+*(!TT+$+CA$C,!!(*C: Con:ert from foreign currenc& to localcurrenc&

    DAT(CH(CP$A,SB$T: C"ec# to see if a date is in a :alid format forS)P. or#s well w"en :alidating dates being

    passed in from ot"er s&stems.

    DAT(C+.P,T(DA: eturns a number indicating w"at da& of t"ewee# t"e date falls on. (onda& is returned as a'% Tuesda& as 2% etc.

    DAT(/(T(( will return t"e wee# t"at a date is in.

    DAT(*F,T,!( Calculate a date 0 da&s in t"e future.

    DA:ATT!B,T(S/(T eturn useful information about a da&. ill tell&ou t"e da& of t"e wee# as a word !Tuesda&$%t"e da& of t"e wee# !2 would be Tuedsa&$%

    w"et"er t"e da& is a "olida&% and more.!pro:ided b& Francois Henrotte$

    D+*$+AD download a file to t"e presentation ser:er !PC$

    D:*PA$,(S!(AD ead t"e :alues from a d&npro. T"is functioncan be used to read t"e :alues from a report@sselection screen too !)not"er e5ample$.

    D:*PA$,(S,PDAT( Similar to D40P;3)+=,S;,)D% t"is functionwill allow t"e updating of fields on a d&npro.3er& useful w"en &ou want to c"ange a field

  • 8/10/2019 Common Questions and Answers About ABAP

    68/141

    based on t"e :alue entered for anot"er field.

    (*@,(S$((P ait a specified period of time beforecontinuing processing.

    (*@,(,((SF,*CT+* +oc# an abap program so t"at it cannot bee5ecuted.

    ("ample)Se) )5e pr/e)ers s 1>>s:

    RELID " &??&SRTF= " $SRTF " y6r repr) 4/e

    Please note t"at &ou s"ould not use S4-,PD to pass &our report name to t"e function. T"e :alue of S4-,PD will c"ange as it is being passed to t"e function module% and will no longer "old t"e :alue of t"ecalling report.(PS/(TD!(CT+!:$ST*/ return a list of filenames from a local or

    networ# dri:e

    (PS/(TF$(ATT!B,T(S Pass in a filename and a pat"% and will returnattributes for t"e file

    F;DAT( displa&s a calendar in a popup window andallows user to c"oose a date% or it can bedispla&ed read onl&.

    F;FF($DA$,(!(@,(ST =se :alues from a DDC table to pro:ide a listof possible :alues. T)*0)(, and F,+D0)(,are re6es.

    )_0>6es " GG&. ppe4d )_0>6es.

    +>> 164+)i4 &FIF_INT_TABLE_'AL#E_REU#EST& e9pr)i43 re)1ie>d " &BEGR#& 0>6e_r3 " &S& )8>es 0>6e_)8 " )_0>6es re)6r4_)8 " )_re)6r4 e9+ep)i4s pr/e)er_errr " 4_0>6es_164d " = )5ers " .

  • 8/10/2019 Common Questions and Answers About ABAP

    69/141

    i1 sy-s68r+ " $. red )8>e )_re)6r4 i4de9 .

    _8e3r6-> " )_re)6r4-1ie>d0>.

    i1 _8e3r6-> " &PAR*&. _8e3r6-p)i4 " &CP&. e>se. _8e3r6-p)i4 " &EU&. e4di1.

    _8e3r6-si34 " &I&.

    ppe4d _8e3r6 ) s_8e3r6. e>se. _8e3r6 " i_8e3r6. e4di1.

    F;FSH$P(5T(5A.P$( documents t"e different reasons touse a searc" "elp e5it% and s"ows "owit is done.

    F;P*TTAB$(A$,(!(@,(ST T"is function does not e5ist in ?.A andabo:e. =seF?F;0T;T)*+,;3)+=,;,Q=,ST

    instead.

    F$(*A.(/(T popup to get a filename from a user%returns blan# filename if user selectscancel

    F+!.AT.(SSA/( Ta#es a message id and number% andputs it into a :ariable. or#s bettert"an T,;(,SS)7,% since somemessages use B as a place "older% andT,;(,SS)7, does notaccommadate t"at% it onl& replaces t"eampersands !$ in t"e message.

    FTPC+..A*D ,5ecute a command on t"e FTP ser:er

    FTPC+**(CT /pen a connection !and log in$ to anFTP ser:er

    FTPDSC+**(CT Close t"e connection !and log off$ t"eFTP ser:er

    F, CSAP.ATB+.!(AD 4ou can use t"is function module to

    displa& simple material */(s. 4oucannot displa& */( groups !fore5ample% all :ariants of a :ariant */($.as in transaction CS1. Currentrestrictions 4ou cannot displa& longte5ts. 4ou cannot displa& sub-items.

    4ou cannot displa& classification dataof */( items for batc"es. 4ou canonl& displa& one alternati:e or :ariant.

    4ou cannot enter an alternati:e for

  • 8/10/2019 Common Questions and Answers About ABAP

    70/141

  • 8/10/2019 Common Questions and Answers About ABAP

    71/141

    /S(T/(TA$$A$,(S Fetc" :alues from a set.

    /(TC,!!(*T:(A! 7et t"e current fiscal &ear.

    ("ample)CALL F#NCTION &GET_C#RRENT_YEAR& E%PORTING B#KRS " &$$$& 7 C/p4y Cde

    DATE " SY-DAT#M 7 D)e ) 1i4d 1is+> yer 1r IMPORTING C#RRM " _+6rr/ 7 C6rre4) Fis+> M4)5 C#RRY " _+6rry 7 C6rre4) Fis+> Yer PRE'M " _pre0/ 7 Pre0i6s Fis+> M4)5 PRE'Y " _pre0y. 7 Pre0i6s Fis+> Yer

    /(T/$+BA$S:.B+$S eturns a list of all tables% selectoptions% te5ts% etc for a program. ,:enincludes t"e te5t definitions for t"eselection screen

    /(T*C$,D(TAB eturns a list of all 0C+=D,S in a

    program

    /(TE+B!,*T.(*F+ 7et t"e current 8ob number from aprogram. )lso returns ot"er useful infoabout t"e current 8ob.

    /,C!(AT(D!(CT+!: Create a director& on t"e presentationser:er

    /,D($(T(F$( eplaces S;F+,;D,+,T,. Delete afile on t"e presentation ser:er

    /,D+*$+AD eplaces S;D/0+/)D. Downloadtable from t"e app ser:er topresentation ser:er

    /,(5(C eplaces S;,E,C=T,. Start a File orProgram )s&nc"ronousl& wit"in,5ec

    /,/(TD(ST+P*F+ eplaces S;Q=,4. Deli:ersnformation )bout t"e Des#top !client$

    /,!(.+(D!(CT+!: Delete a director& on t"e presentationser:er

    /,!,* Start a File or Program)s&nc"ronousl& wit" S"ell,5ecute

    /,,P$+AD eplaces S;=P+/)D. =poad filefrom presentation ser:er to t"e appser:er

  • 8/10/2019 Common Questions and Answers About ABAP

    72/141

    H($PSTA!T Displa& "elp for a field. =seful fordoing )T S,+,CT/0 SC,,0 /03)+=, ,Q=,ST for t"ose fields t"atdo not pro:ide F? "elp at t"e DDCle:el.

    H($PA$,(S/(TTHTAB$( S"ow a list of possible :alues for F?popup "elp on selection screens. T"isfunction module pops up a screen t"at

    is 8ust li#e all t"e ot"er F? "elps% so itloo#s li#e t"e rest of t"e S)P s&stem.3er& useful for pro:iding dropdownson fields t"at do not "a:e t"empredefined.

    ("ample))8>es: )$$.

    DATA: >+_er,s LIKE )$$-er,s2 >)8_1ie>ds LIKE 5e>p_0>6e OCC#RS $ i)5 5eder >i4e2

    BEGIN OF >)8_0>6es OCC#RS $2 1e>d$ TYPE +2 END OF >)8_0>6es.

    *-- Se) 6p 1ie>ds ) re)rie0e d) >)8_1ie>ds-)84/e " &T$$&. >)8_1ie>ds-1ie>d4/e " &ERKS&. >)8_1ie>ds-se>e+)1>3 " &%&. APPEND >)8_1ie>ds.

    >)8_1ie>ds-)84/e " &T$$&. >)8_1ie>ds-1ie>d4/e " &NAME&. >)8_1ie>ds-se>e+)1>3 " sp+e.

    APPEND >)8_1ie>ds.

    *-- Fi>> 0>6es se>e+) * 1r/ )$$. >)8_0>6es-1e>d " )$$-er,s. ppe4d >)8_0>6es. >)8_0>6es-1e>d " )$$-4/e. ppe4d >)8_0>6es. e4dse>e+).

    CALL F#NCTION &!ELP_'AL#ES_GET_IT!_TABLE& E%PORTING 1ie>d4/e " &ERKS& )84/e " &T$$& )i)>e_i4_0>6es_>is) " &Se>e+) 0>6e& IMPORTING se>e+)_0>6e " >+_er,s TABLES 1ie>ds " >)8_1ie>ds 0>6e)8 " >)8_0>6es E%CEPTIONS 1ie>d_4)_i4_ddi+ " $ /re_)5e4_4e_se>e+)1ie>d " $= 4_se>e+)1ie>d " $.

    H+$DA:CH(CA*D/(T*F+ =seful for determining w"et"er or not

  • 8/10/2019 Common Questions and Answers About ABAP

    73/141

  • 8/10/2019 Common Questions and Answers About ABAP

    74/141

    ("ample)DATA: IT_TU TYPE TU OCC#RS $ IT! !EADER LINE2

    IT_?L TYPE PC=BF OCC#RS $ IT! !EADER LINE.

    _BEGDA " &=$$$$&. _PERNR " &$$$$$$$&.

    CALL F#NCTION &!R_PAYROLL_PERIODS_GET& E%PORTING 3e)_8e3d " _8e3d

    TABLES 3e)_perids " i)_)V E%CEPTIONS 4_perid_164d " 4_0>id_per/ " =. C!ECK sy-s68r+ " $.

    CALL F#NCTION &!R_TIME_RES#LTS_GET& E%PORTING 3e)_per4r " _per4r 3e)_p8r@ " i)_)V-p8r@ 3e)_p8rp " i)_)V-p8rp TABLES

    3e)_> " i)_> E%CEPTIONS 4_perid_spe+i1ied " r43_+>6s)er_0ersi4 " = 4_red_6)5ri)y " +>6s)er_r+5i0ed " )e+54i+>_errr " .

    NOTE: i)_>-i1)yp " &A& 8se4+e i)_>-i1)yp " &S& ) r,

    H!T.(!(S,$TS/(T 7et t"e time results for a pa&rollperiod. !pro:ided b& Francois

    Henrotte$

    ("ample)DATA: IT_TU TYPE TU OCC#RS $ IT! !EADER LINE2

    IT_?L TYPE PC=BF OCC#RS $ IT! !EADER LINE.

    _BEGDA " &=$$$$&. _PERNR " &$$$$$$$&.

    CALL F#NCTION &!R_PAYROLL_PERIODS_GET& E%PORTING 3e)_8e3d " _8e3d

    TABLES 3e)_perids " i)_)V E%CEPTIONS 4_perid_164d " 4_0>id_per/ " =. C!ECK sy-s68r+ " $.

    CALL F#NCTION &!R_TIME_RES#LTS_GET& E%PORTING 3e)_per4r " _per4r 3e)_p8r@ " i)_)V-p8r@ 3e)_p8rp " i)_)V-p8rp

  • 8/10/2019 Common Questions and Answers About ABAP

    75/141

    TABLES 3e)_> " i)_> E%CEPTIONS 4_perid_spe+i1ied " r43_+>6s)er_0ersi4 " = 4_red_6)5ri)y " +>6s)er_r+5i0ed " )e+54i+>_errr " .

    NOTE: i)_>-i1)yp " &A& 8se4+e i)_>-i1)yp " &S& ) r,

    *TT(5T To load long te5t into S)P

    (!S+FB,!SF*D eturn a list of all plants for a gi:encompan& code.

    $STF!+..(.+!: etrie:es t"e output of a report frommemor& w"en t"e report was e5ecutedusing S=*(T... ,EP/T07 +ST T/(,(/4. See also T,;+ST.

    $STT+ASC con:ert an )*)P report !displa&ed on

    screen$ from /TF to )SC format

    .B((5T(*D 7et t"e stoc# position for t"e pre:iousmont". T"is displa&s t"e same infot"at &ou see in ((1.

    .+*TH*A.(S/(T t returns all t"e mont" and names inrepecti:e language.

    .+*THP$,SD(T(!.*( )dd or subtract mont"s from a date.To subtract a mont"% enter a negati:e:alue for t"e @mont"s@ parameter.

    ("ample)d): 4e_d)e )ype d.

    CALL F#NCTION &MONT!_PL#S_DETERMINE& E%PORTING /4)5s " - 7 Ne3)i0e ) s68)r+) 1r/ >d d)e2 psi)i0e ) dd >dd)e " sy-d)6/IMPORTING NEDATE " 4e_d)e.

    ri)e: ( 4e_d)e.

    .S(5C($+$(STA*DA!D+$( will build a file% and automaticall& start,5cel

    +TFC+*(!T wraps se:eral ot"er function modules.ill con:ert /TF to )SC or PDF

    P+P,PT+C+*F!.$+SS+FDATA Create a dialog bo5 in w"ic" &ou ma#ea

  • 8/10/2019 Common Questions and Answers About ABAP

    76/141

    data.

    P+P,PT+C+*F!.ST(P Create a dialog bo5 in w"ic" &ou ma#ea

  • 8/10/2019 Common Questions and Answers About ABAP

    77/141

    !FCABAP*STA$$A*D!,* uns an )*)P program t"at is storedin t"e table P/7)( w"en t"e(/D, G @F@. Table T,S containst"e ouput of t"e program. )llows &outo run a program wit"out "a:ing t"esource code in t"e target s&stem.

    !H/(TACT(FP$A! eturn t"e acti:e H Plan

    !H/(TDAT(DA:*A.( return t"e da& based on t"e datepro:ied

    !HSTA!T(5C($THDATA starts ,5cel wit" t"e contents of aninternal table. T"is function finds ,5celin t"e des#top registr&. t also uses alocal PC wor#ing director& to sa:e t"efile !t"at@s w"at t"e @@ :alue for datapat" flag does$. 3er& transparent touser

    !HST!,C/(T eturns all related org info

    !HPy2 )5e 6se 1 )8>e BASE_OBIDS is dis8>ed2 s y6 +4&) spe+i1y r) 1r )5e 5ierr+5y y6 disp>y

    !D+!D!AP Con:ert a long string or p"rase intose:eral lines.

    !PCA$CDAT(**T(!A$ )ddsubtract &earsmont"sda&s froma date

    !P$ASTDA:+F.+*THS Determine last da& of mont"

    !P:D:*P!+!(AD ead d&npro% including screen flow

    !P:T!A*SACT+*!(AD 7i:en a transaction% return t"e

  • 8/10/2019 Common Questions and Answers About ABAP

    78/141

    program and screen or gi:en aprogram and screen% return t"etransactions t"at use t"e program andscreen.

    !SC+(!PA/(S($(CT+*S eturns an internal table t"at containsa formatted list of all t"e selectionparameters entered for a report. Tableis read& to print out.

    !S!(F!(SHF!+.S($(CT+PT+*S 7et t"e current contents of selectionscreen

    !SS(*D.A$F+!SP++$$ST Send message from )*)P? programto S)Poffice.

    !SA!A*TC+*T(*TS eturns t"e contents of t"e specified:ariant in a table.

    !SP+D+*$+ADSP++$E+B Download t"e spool from a program toa file. e

  • 8/10/2019 Common Questions and Answers About ABAP

    79/141

    SAP/,P!+/!(SS*DCAT+! Displa& a progress bar on t"e S)P7=% and gi:e t"e user some idea ofw"at is "appening

    SA(T(5T To load long te5t into S)P

    SC!+$$*/*TAB$( f &ou are coding a module pool andusing a table control% &ou can use t"isfunction SC/++07;0;T)*+, to"andle an& scrolling. !pro:ided b& Paul8aer$

    SDDAT(T.(DFF(!(*C( 7i:e t"e difference in Da&s and Timefor 2 dates

    S+*(D+C,.(*TATTS(*DAP= Send a document as part of an email.T"e documentation is better t"annormal for t"is function% so pleaseread it.

    S+SP$TF$(A*DPATH Split a full& pat"ed filename into a

    filename and a pat".

    S+SP++$!(AD Fetc" printer spool according to t"espool number informed. See alsoSP/;,T=0;)*)P;SP//+J/*

    S+*DSP++$$ST *rowse printer spool numbersaccording to user informed.

    SDH($PF;+!/+BE(CTS H (atc"code tailored fororgani9ational units. ncludes a buttonso t"at &ou can browse t"e "ierarc"&

    too.

    S5+BE(CTC+*(!T+TFPDF Con:ersion From /TF to PDF!S)PScript con:ersion$

    S5+BE(CTC+*(!T+TFP!T Con:ersion From /TF to PrinterFormat !S)PScript con:ersion$

    S5+BE(CTC+*(!T+TF!A Con:ersion From /TF to )SC!S)PScript con:ersion$

    S5P/CA$$S:ST(. &ou can c"ec# t"e user@s aut"ori9ationfor t"e specified command and run t"ecommand. T"e command runs on t"e"ost s&stem on w"ic" t"e functionmodule is e5ecuted. T"e functionmodule is FC capable. t cant"erefore be run on t"e "ost s&stem atw"ic" a user "appens to be acti:e oron anot"er designated "ost s&stem atw"ic" an 1 ser:er is acti:e.

  • 8/10/2019 Common Questions and Answers About ABAP

    80/141

  • 8/10/2019 Common Questions and Answers About ABAP

    81/141

    >)8_1i>e_1i>e_)8>e >i,e sd,p)5 ++6rs $ i)5 5eder >i4e.+>> 164+)i4 &TMP_G#I_DIRECTORY_LIST_FILES& e9pr)i43 dire+)ry " >+_dire+)ry 1i>)er " >+_1i>)er i/pr)i43 1i>e_+64) " >i_1i>e_+64) dir_+64) " >i_dir_+64) )8>es 1i>e_)8>e " >)8_1i>e_)8>e dir_)8>e " >)8_dir_)8>e

    e9+ep)i4s +4)>_errr " )5ers " =.

    ,*TC+*(!S+*S.P$( con:ert weig"ts from one =/( toanot"er.

    ,P$+AD upload a file to t"e presentation ser:er!PC$

    ,P$+ADF$(S ill load one or more files from app orpresentation ser:er

    ((/(TF!STDA: For a gi:en wee# !4444(( format$%t"is function returns t"e date of t"e(onda& of t"at wee#.

    !T($ST =seful for writing out t"e list contentst"at result from t"e function+ST;F/(;(,(/4.

    SD+*$+AD Sa:e nternal Table as File on t"ePresentation Ser:er

    S(5C($ Start ,EC,+ on t"e PC

    S(5(C,T( e5ecute a program on a windows PC

    SF$(D($(T( Delete File at t"e Frontend

    SF$(*A.(/(T Call File Selector

    S.S/ Create a dialog bo5 in w"ic" &oudispla& an one line message

    S,P$+AD +oad Files from t"e PresentationSer:er to nternal )*)P Tables

    S+$,.(/(T 7et t"e label from a frontend de:ice.

    $STT+HT.$ )fter running a report% call t"isfunction to con:ert t"e list output toHT(+.

  • 8/10/2019 Common Questions and Answers About ABAP

    82/141

    -

  • 8/10/2019 Common Questions and Answers About ABAP

    83/141

  • 8/10/2019 Common Questions and Answers About ABAP

    84/141

    '2$ "at is step-loop6 ,5plain all t"e steps6Ans A step loop is a repeated series of field'blocks in a screen3 (ac% block can contain one or mo

    fields4 and can e"tend o2er more t%an one line on t%e screen3

    ;tep loops as structures in a screen do not ha+e indi+idual names. he screen can contain more than onestepBloop, but if so, you must program the 5221.../35221s in the flow logic accordingly. he orderingof the 5221.../35221s must exactly parallel the order of the step loops in the screen. he ordering tellthe system which loop processing to apply to which loop. ;tep loops in a screen are ordered primarily byscreen row, and secondarily by screen column.

    ransaction H% >de+elopment class ;3D-? implements a step loop +ersion of the table you saw intransaction H%).

    ;tatic and 3ynamic ;tep 5oops

    ;tep loops fall into two classes: static and dynamic. ;tatic step loops ha+e a fixed siKe that cannot bechanged at runtime. 3ynamic step loops are +ariable in siKe. If the user reBsiKes the window, the systemautomatically increases or decreases the number of step loop blocks displayed. In any gi+en screen, you cadefine any number of static step loops, but only a single dynamic one.

    ou specify the class for a step loop in the ;creen 1ainter. /ach loop in a screen has the attributes 5ooptyp

    >fixed=static, +ariable=dynamic? and 5oopcount. If a loop is fixed, the 5oopcount tells the number of loopblocks displayed for the loop. his number can ne+er change.

    1rogramming with static and dynamic step loops is essentially the same. ou can use both the 5221 and5221 - statements for both types.

    5ooping in a ;tep 5oop

    Dhen you use 5221 - internalBtableG with a step loop, the system automatically displays the step loopwith +ertical scroll bars. he scroll bars, and the updated >scrolled? table display, are managed by thesystem.

    8se the following additional parameters if desired:

    F!+. line=8 and T+ line>8

    C,!S+! scroll'2ar8

    '1$ "at is t"e initial :alue and ma5imum lengt" of all data t&pe6Ans

    Data Type nitial field lengt% alid field lengt% nitial 2alue .eaning

    *umeric types

    ; ; < nteger -w%ole number0

    F Q Q < Floating point number

    P Q = J =R < Packed number

  • 8/10/2019 Common Questions and Answers About ABAP

    85/141

    C%aracter types

    C = = J R 1 1 Te"t field -alp%anumeric c%aracters0

    D Q Q 1

  • 8/10/2019 Common Questions and Answers About ABAP

    86/141

    ;0 Footer

    'N$ "at function module upload data from application ser:er6)ns

    2$ "at are t"e :arious t&pes of selection screen e:ent6Ans S($(CT+*'SC!((* B(/* +F B$+C ABC TH F!A.( TT$( T

  • 8/10/2019 Common Questions and Answers About ABAP

    87/141

    C+$$(CT sets S:'TAB5 to t%e inde" of t%e e"isting or inserted line in t%e table3 f t%e table %as

    t%e type HASH(D TAB$(4 S:'TAB5 is set to

  • 8/10/2019 Common Questions and Answers About ABAP

    88/141

    >0 P,T ' T%e P,T statement directs t%e program flow according to t%e structure ofthe logical database.

    1$ "at is t"e difference between 7et and 7et +ate6Ans /(T ' After t%e logical database %as read an entry from t%e node table83

    /(T $AT( ' After all of t%e nodes of t%e logical database %a2e been processed t%at are belotable8 in t%e database %ierarc%y3

    1'$ "at are t"e t&pes of nternal Tables6Ans T%ere are t%ree types)=0 $ine>0 ey0 Table

    12$ "at are t"e e:ents used in )*)P in t"e order of e5ecution6Ans

    11$ "at are nteracti:e eports6Ans An output list w%ic% displays Lust t%e basic details 9 allow user to interact4 so t%at a new list

    populated based on user'selection3 it% interacti2e list4 t%e user can acti2ely control data retrie2and display during t%e session3

    1?$ "at are t"e commands used for interacti:e reports6Ans Top'of'Page during line'selection

    1I$ "at are t"e s&stem fields u "a:e wor#ed wit"6 ,5plain6Ans %ad worked wit% t%e following -

  • 8/10/2019 Common Questions and Answers About ABAP

    89/141

    !(? ;B9; B 9essage ype")? ;B;122 B ;pool number during printing

    1A$ "at is t"e difference between Primar& #e& and =ni

  • 8/10/2019 Common Questions and Answers About ABAP

    90/141

    3 At PF-nn03 At line'selection3 At user'command

    ?L$ "at is an D*(S6Ans !DB.S J !elational Database .anagement System3 t %elps to create relations%ip between tw

    or more table3

    ?M$ "at standards u use to follow w"ile coding )*)P programs6

    Ans

    ?N$ "at will &ou code in ST)T-/F-S,+,CT/0 ,0D-/F-S,+,CT/0 w"&6Ans STA!T'+F'S($(CT+*

    S($(CT & F!+. D(PTT *T+ C+!!(SP+*D*/ F($DS +F TABH(!( D(PT*+ * D(PT*+3

    APP(*D TAB3(*DS($(CT3

    $++P AT TAB3!T( ) # =< TAB'D(PT*+3HD( ) TAB'D(PT*+3(*D$++P3(*D'+F'S($(CT+*

    I$ "at are 8oins and different t&pes 8oins6Ans T%ere are four types of Eoins)

    =0 Self Eoin>0 nner Eoin0 +uter Eoin

    ;0 (6ui Eoin

    I'$ "ic" is t"e default 8oin6Ans

    I2$ How do u displa& a data in a Detail +ist6)ns *& using two statements

    '$ Top-of-page during line-selection2$ )t line-selection

    I1$ "at are t"e t&pes of windows in S)P Script6)ns T"ere are fi:e Standard +a&outs in S)P Script

    '$ Page2$ indow1$ Page indow?$ Paragrap" FormatI$ C"aracter Format

    I?$ "at are t"e function modules used in a S)P Script dri:er program6

  • 8/10/2019 Common Questions and Answers About ABAP

    91/141

    )ns T"ere are t"ree functions used in S)P Script

    '$ /P,0;F/(2$ T,;F/(1$ C+/S,;F/(

    II$ "at are ,5tracts6)ns ,5tracts are d&namic se0 SAP $, ' A logical unit consisting of dialog steps4 w%ose c%anges are written to t%database in a single database $, is called an SAP $,3 ,nlike a database $,4 aSAP $, can span se2eral dialog steps4 and be e"ecuted using a series of differework processes3

    A$ "at is First e:ent triggered in program6)ns

    A'$ "at are :arious Joins6 "at is rig"t outer 8oin6)ns

    A2$ How do u find out w"et"er a file e5its on t"e presentation ser:er6

    )ns eps;get;director&;listing for director&

    A1$ S&stems fields used for nteracti:e +ists )0D +ists)ns nteracti:e S&stem Fields S4-+S0D% S4-CP)7,% S4-+++% S4-+S,+% S4-+ST%

    S4-+ST)T% S4-ST)C/% S4-ST)/

    +ists S4-C/+0/% S4-+0CT% S4-+00/% S4-+0SO% S4-P)70/%S4-T3)..S4-T3)N% S4-TT+

  • 8/10/2019 Common Questions and Answers About ABAP

    92/141

    A?$ +ogo in S)P Script6)ns Steps for ma#ing and inserting +ogo in S)P Script

    First Procedure'$ Draw t"e picture2$ Sa:e it1$ nS,LM?$ rite name C"oose ColorI$ Clic# on mport

    A$ *rowse pictureL$ ,nter

    Second Procedure

    '$ nS,L'2$ nsert1$ 7rap"ics?$ Clic# on stored on document ser:erI$ ,5ecuteA$ C"oose name of *()P

    AI$ "at are t"e difference between call screen and lea:e screen6)ns Call Screen Calling a single screen is a special case of embedding a screen se

  • 8/10/2019 Common Questions and Answers About ABAP

    93/141

    )ns

    L$ Define Documentation.)ns

    L'$ *rief about Testing of programs.)ns

    L2$ How do u mo:e on to t"e ne5t screen in interacti:e reporting6

    )ns rite code of t"e following

    '$ Top-of-Page during line-selection2$ )t line-selection

    L1$ Create an& functions6 How to go about it6)ns Steps for creating t"e Functions

    First Procedure

    '$ nS,1L

    2$ 7oto1$ Function 7roup !F7$?$ Create 7roupI$ 0ame of F7 !O,H);F7$A$ S"ort Te5tL$ Sa:eM$ +ocal /b8ect

    Second Procedure

    '$ ,n:ironment

    2$ nacti:e /b8ect1$ Function 7roup !O,H);F7$?$ )cti:ateI$ *ac#

    T"ird Procedure

    '$ 0ame of Function (odule !O,H);F($2$ Create1$ rite F7 0ame !O,H);F7$?$ S"ort Te5t

    I$ Sa:e

    Fourt" Step

    Call function O,H);F(R.

    L?$ )d:anced topics6)ns

    LI$ Function modules used in F? "elp.

  • 8/10/2019 Common Questions and Answers About ABAP

    94/141

    )ns T"ere are two t&pes of function modules used in F? "elp

    '$ F?F;F,+D;3)+=,;,Q=,ST2$ F?F;0T;T)*+,;3)+=,;,Q=,ST

    LA$ or# most on w"ic" module 0ame a few tables.)ns Sales Distribution (odule

    '$ Sales Document tem Data 3*)P2$ Sales Document Partner 3*P)1$ Sales Document Header Data 3*)?$ Sales Document Flow 3*F)I$ Sales Document Deli:er& tem Data - +PSA$ Customer (aster 0)'L$ (aterial Data ())M$ Conditions !Transaction Data$ - /03

    LL$ S&stem Table used)ns

    '$ Sales Document tem Data 3*)P2$ Sales Document Partner 3*P)1$ Sales Document Header Data 3*)?$ Sales Document Flow 3*F)I$ Sales Document Deli:er& tem Data - +PSA$ Customer (aster 0)'L$ (aterial Data ())M$ Conditions !Transaction Data$ - /03

    LM$ From a table "ow do u find w"et"er a material is used in anot"er material */(6)ns

    LN$ "at is read line6)ns ,)D +0, and ,)D C=,0T +0, T"ese statements are used to read data from t"

    lines of e5isting list le:els. T"ese statements are closel& connected to t"e HD, tec"ni

  • 8/10/2019 Common Questions and Answers About ABAP

    95/141

    M1$ 7lobal and local data in function modules.)ns

    M?$ "at are t"e differences between S)P memor& and )*)P memor&6)ns )*)P (emor& is a memor& area in t"e internal session !roll area$ of an )*)P program

    Data wit"in t"is area is retained wit"in a seas with -

  • 8/10/2019 Common Questions and Answers About ABAP

    96/141

    N'$ "at are elements6)ns

    N2$ Can we "a:e more t"an one selection-screen and "ow6)ns 4es% we can "a:e more t"an one selection screen.

    Selection-screen begin of bloc# "one& wit" frame title te5t-''.Select-options deptno for 9re#"a;deptt-deptno.

    Selection-screen end of bloc# "one&.

    Selection-screen begin of bloc# "one&' wit" frame title te5t-'2.Select-options dname for 9re#"a;deptt-dname.Selection-screen end of bloc# "one&'.

    N1$ How to declare select-option as a parameter6)ns S,+,CT-/PT/0S specif& are displa&ed on t"e selection screen for t"e user to ent

    :alues.

    Parameters dname li#e dept-dname.Select-options dname for dept-dname.

    (#? @ow can u write programmatically +alue help to a field without using search help andmatc" codes6

    )ns *& using two t&pes of function modules to be called in S)P Script

    '$ H,+P;/*J,CT;SH/;F/;F,+D2$ H,+P;/*J,CT;SH/

    NI$ "at are t"e differences between S,'% S,N and S,'6)ns S,N - Transport /rgani9er !,5tended 3iew$

    S,N - Transport /rgani9er S,' - Transport /rgani9er

    NA$ How to set destination6)ns

    NL$ "at are t"e function module t&pes6)ns

    NM$ "at are tables6)ns Tables O,H);,(P.

    t creates a structure t"e table wor# area in a program for t"e database tables% :iews ostructure O,H);,(P. T"e table wor# area "as t"e same name as t"e ob8ect for w"ic" wcreated it. O,H);,(P must be declared in t"e )*)P dictionar&. T"e name anse

  • 8/10/2019 Common Questions and Answers About ABAP

    97/141

    '$ How to distinguis" client-dependant tables from independent tables6)ns

    ''$ "at is t"e use of Table maintenance allowed6)ns (ar# t"e Table maintenance allowed flag if users wit" t"e corresponding aut"ori9ation ma

    c"ange t"e data in t"e table using t"e Data *rowser !Transaction S,'A$. f t"e data in t"table s"ould onl& be maintained wit" programs or wit" t"e table :iew maintenanctransaction !Transaction S(1$% &ou s"ould not set t"e flag.

    '2$ How to define Selection Screen6)ns Parameters% Select-options Selection-Screen'1$ "at are t"e c"ec# tables and :alue tables6)ns C"ec# Table T"e )*)P Dictionar& allows &ou to define relations"ips between tables usin

    foreign #e&s . ) dependent table is called a foreign #e& table% and t"e referenced table called t"e c"ec# table. ,ac" #e& field of t"e c"ec# table corresponds to a field in t"foreign #e& table. T"ese fields are called foreign #e& fields. /ne of t"e foreign #e& fields designated as t"e c"ec# field for c"ec#ing t"e :alidit& of :alues. T"e #e& fields of t"c"ec# table can ser:e as input "elp for t"e c"ec# field.

    7alue able: 1rior to 6elease #.), it was possible to use the +alue table of a domain to pro+ide input help

    his is no longer possible, primarily because unexpected results could occur if the +alue table had more thone key field. It was not possible to restrict the other key fields, which meant that the en+ironment of thfield was not considered, as is normal with check tables.

    In cases where this kind of +alue help was appropriate, you can reconstruct it by creating a search help fthe data elements that use the domain in Muestion, and using the +alue table as the selection method.

    4heck table will be at field le+el checking.

    7alue table will be at domain le+el checking ex: scarr table is check table for carrid.

    '?$ "at is t"e difference between tables and structures6)ns Tables

    '$ Data is permanentl& stored in tables in t"e database.2$ Database tables are generated from t"em.

    Structure'$ t contains data temporaril& during program run-time.2$ 0o Database tables are generated from it.

    'I$ How to declare one internal table wit"out "eader line wit"out using structures6)ns 0o% we cannot declare internal table wit"out "eader line and wit"out structure because

    gi:es error UT)* cannot be a table% a reference% a string or contain an& of t"ese ob8ectV.

    Code wit" Header wit"out Structure

    T)*+,S O,H);,(P.D)T) T)* +, O,H);,(P /CC=S TH H,)D, +0,.

    S,+,CT K F/( O,H);,(P 0T/ C/,SP/0D07 F,+DS /F T)*.)PP,0D T)*.,0DS,+,CT.

  • 8/10/2019 Common Questions and Answers About ABAP

    98/141

  • 8/10/2019 Common Questions and Answers About ABAP

    99/141

    T,;F/( /utput te5t element in form window. T"e specified element of t"e la&oset window entered is output. T"e element must be defined in t"e la&out set.

    C+/S,;F/( ,nd la&out set printing. Form printing started wit" /P,0;F/( completed. Possible closing operations on t"e form last opened are carried out. Forprinting must be completed b& t"is function module. f t"is is not carried out% not"ing printed or displa&ed on t"e screen.

    ''$ "at are t"e page windows6 How man& main windows will be t"ere in a page window6

    )ns Page indow n t"is window% we define t"e margins for left% widt"% upper and "eig"t fot"e la&out of Header% +ogo% (ain% Footer.

    '''$ "at are control e:ents in a loop6

    -ns 4ontrol le+el processing is allowed within a 5221 o+er an internal table. his means that we can di+ideseMuences of entries into groups based on the contents of certain fields.

    - le+elG.statement blockG/3-.

    ou can react to the following control le+el changes:

    le+elG 9eaning

    FI6; First line of the internal table

    5-; 5ast line of the internal table

    /D fG

  • 8/10/2019 Common Questions and Answers About ABAP

    100/141

  • 8/10/2019 Common Questions and Answers About ABAP

    101/141

    '2'$ "at is t"e t&pical structure of an )*)P program6)ns H,)D,% */D4% F//T,.

    '22$ "at are field s&mbols and field groups6 Ha:e &ou used Wcomponent id5 of structureclause wit" field groups6

    )ns Field S&mbols T"e& are place"older or s&mbolic names for t"e ot"er fields. T"e& do np"&sicall& reser:e space for a field% but point to its contents. t can point to an& datob8ects.

    Field-s&mbols fs>

    Field 7roups Field groups does not reser:e storage space but contains pointers te5isting fields.

    )n e5tract dataset consists of a se

  • 8/10/2019 Common Questions and Answers About ABAP

    102/141

    ransparent able B /xists with the same structure both in dictionary as well as in database exactly with thsame data and fields.

  • 8/10/2019 Common Questions and Answers About ABAP

    103/141

    )ns

    '1I$ Can &ou create a table wit" fields not referring to data elements6)ns 4,S. e.g.- T)* +, SPF+.

    Here we are refering to a data ob8ect !SPF+$ not data element.

    '1A$ "at is t"e ad:antage of structures6 How do &ou use t"em in t"e )*)P programs6-ns 52these could be used by any other program without creating it again?.

    '1L$ "at does an e5tract statement do in t"e )*)P program6)ns /nce &ou "a:e declared t"e possible record t&pes as field groups and defined t"e

    structure% &ou can fill t"e e5tract dataset using t"e following statements

    ,ET)CT F7>.

    "en t"e first ,ET)CT statement occurs in a program% t"e s&stem creates t"e e5tradataset and adds t"e first e5tract record to it. n eac" subse

  • 8/10/2019 Common Questions and Answers About ABAP

    104/141

  • 8/10/2019 Common Questions and Answers About ABAP

    105/141

  • 8/10/2019 Common Questions and Answers About ABAP

    106/141

    'II$ "at are t"e elements of selection screen6)ns T"ere are I elements of selection screen

    Selection-screen include bloc#s *>Selection-screen include parameters P>

    Selection-screen include select-options S>Selection-screen include comment C>Selection-screen include pus"-button pus">

    'IA$ "at are ranges6 "at are number ranges6)ns (ain function of ranges to pass data to t"e actual selection tables wit"out displa&ing t"

    selection screen.

    (in% (a5 :alues pro:ided in selection screens.

    'IL$ "at are select options and w"at is t"e diff from parameters6

    )ns Parameters e can enter a single :alue.1-6-9//6;: 1-6-9>)?.

    Select-options e can enter low and "ig" :alue i.e. range "as to be specif&. *& using 0/0T,3)+ user can process onl& single fields.

    ;/5/4B21I2;: 32 F26 3/1B32.

    ;/5/4B21I2;: 32 F26 3/1B32 2BI/67-5.

    ;/5/4B21I2; declares an internal table, which is automatically filled with +alues or ranges of +alueentered by the end user. For each ;/5/4B21I2;, the system creates a selection table.

    ;/5/4B21I2; ;/5G F26 fieldG.

    - selection table is an internal table with fields ;I, 21I2, 52D and @I@.

    he type of 52D and @I@ is the same as that of fieldG.

    he ;I field can take the following +alues: I Inclusi+e >should apply? / /xclusi+e >should not apply?

    he 21I2 field can take the following +alues: /N /Mual reater than / ot eMual

  • 8/10/2019 Common Questions and Answers About ABAP

    107/141

    /g:B 1arameters name>")?.

    Dhen the user executes the -

  • 8/10/2019 Common Questions and Answers About ABAP

    108/141

    'A?$ 0ame a few s&stem global :ariables &ou can use in )*)P programs6)ns S4-S=*C% S4-D*C0T% S4-+++% S4-D)T=(% S4-=O,T% S4-=C/((%

    S4-T)*E.....

    ;B5I55I is absolute number of lines from which the e+ent was triggered.

    'AI$ "at are internal tables6 How do &ou get t"e number of lines in an internal table6 How use a specific number occurs statement6

    )ns '$ t is a standard data t&pe ob8ect% w"ic" e5ists onl& during t"e runtime of t"e programT"e& are used to perform table calculations on subsets of database tables and for reorgani9ing t"e contents of database tables according to users need.

    2$ =sing S4-D*C0T.1$ T"e number of memor& allocations t"e s&stem need to allocate for t"e ne5t reco

    population.

    'AA$ How do &ou ta#e care of performance issues in &our )*)P programs6)ns Performance of )*)P programs can be impro:ed b& minimi9ing t"e amount of data to b

    transferred. T"e data set must be transferred t"roug" t"e networ# to t"e applications% s

    reducing t"e amount of time and also reduces t"e networ# traffic.

    Some measures t"at can be ta#en are- =se :iews defined in t"e )*)P? DDC !also "as t"e ad:antage of better reusabilit&$.- =se field list !S,+,CT clause$ rat"er t"an S,+,CT K.- ange tables s"ould be a:oided !0 operator$- ):oid nested S,+,CTS.

    'AL$ "at are datasets6)ns T"e se

  • 8/10/2019 Common Questions and Answers About ABAP

    109/141

    )ns To read data from a database tables we use logical database.) logical database pro:ides read-onl& access to a group of related tables to an )*)Pprogram.

    -d+antages: B he programmer need not worry about the primary key for each table.

  • 8/10/2019 Common Questions and Answers About ABAP

    110/141

    'LL$ s a logical database a re

  • 8/10/2019 Common Questions and Answers About ABAP

    111/141

    )ns

    'N'$ "at is t"e field lengt" of Pac#ed 0umber6 "at is t"e default decimal of pac#ednumber6

    )ns

    'N2$ "at are t"e different t&pes of data t&pes6)ns T"ere are t"ree t&pes of data t&pes

    Data T&pes

    ,lementar& Comple5 eferences

    Fi5ed 3ariable Structure Table Data /b8ect3ariable

    'N1$ "at is t"e s&nta5 of Pac#ed 0umber6

    )ns Data 0=( t&pe P decimals 2.

    'N?$ "at are different t&pes of attributes of Function (odule6)ns T"ere are A attributes of F(

    '. mport2. ,5port1. Table?. C"angingI. SourceA. ,5ception

    'NI$ +ist of Screen elements.)ns T"ere are '1 screen elements

    i. nput output fieldsii. Te5t fieldsiii. C"ec#bo5i:. adio button:. Pus" *utton

    :i. Drop down list:ii. Subscreen

    :iii. Table control

    i5. Tabstrip control5. Custom control5i. *o5

    5ii. Status icons5iii. /;C/D, fields

    'NA$ How man& default Tab Strips are t"ere6 How to insert more Tabs in it6)ns T"ere 2 default Tab strips. Screen painter attributes contain Tab Title% w"ic" is used t

    insert more tabs in tab strip.

  • 8/10/2019 Common Questions and Answers About ABAP

    112/141

    'NL$ How to define Selection Screen6)ns T"ere are 1 wa&s of defining selection screen

    '. Parameters2. Select-options1. Selection-Screen

    'NM$ "at are t"e properties of Selection Screen6)ns T"ere are '' properties of selection screen

    '$ Default2$ (emor& D1$ +owercase?$ 3isible lengt"I$ /bligator&A$ (atc"codeL$