Você está na página 1de 15

Sap Abap Interview Questions and Answers

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 SAP s !eb Application Server" part of its #et!eaver platform for building business applications. Its synta$ is somewhat similar to %&B&'. What is an ABAP data dictionary? ABAP ( data dictionary describes the logical structures of the ob)ects used in application development and shows how they are mapped to the underlying relational database in tables*views. What are domains and data element? +omains,+omain is the central ob)ect for describing the technical characteristics of an attribute of an business ob)ects. It describes the value range of the field. +ata -lement, It is used to describe the semantic definition of the table fields li.e description the field. +ata 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 e$plicitly defined at field level. 0oreign .eys are used to ensure the consistency of data. +ata entered should be chec.ed against e$isting data to ensure that there are now contradiction. !hile defining foreign .ey relationship cardinality has to be specified. %ardinality mentions how many dependent records or how referenced records are possible. escribe data classes! 1aster data, It is the data which is seldom changed. 2ransaction data, It is the data which is often changed. &rgani3ation data, It is a customi3ing data which is entered in the system when the system is configured and is then rarely changed. System data,It is the data which 4*5 system needs for itself. What are inde"es? Inde$es are described as a copy of a database table reduced to specific fields. 2his data e$ists in sorted form. 2his 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 inde$. 2he inde$es are activated along with the table and are created automatically with it in the database. ifference between transparent tables and pooled tables! 2ransparent tables, 2ransparent tables in the dictionary has a one/to/one relation with the table in database. Its structure corresponds to single database field. 2able in the database

has the same name as in the dictionary. 2ransparent table holds application data. Pooled tables. Pooled tables in the dictionary has a many/to/one relation with the table in database. 2able 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#$ Query? ABAP*( 6uery is a powerful tool to generate simple reports without any coding. ABAP*( 6uery can generate the following 5 simple reports, Basic 'ist, It is the simple reports. Statistics, 4eports with statistical functions li.e Average" Percentages. 4an.ed 'ists, 0or analytical reports. / 0or creating a ABAP*( 6uery" programmer has to create user group and a functional group. 0unctional group can be created using with or without logical database table. 0inally" assign user group to functional group. 0inally" create a 7uery on the functional group generated. What is B % programming? 2ransferring of large*e$ternal*legacy data into SAP system using Batch Input programming. Batch input is a automatic procedure referred to as B+%(Batch +ata %ommunications). 2he central component of the transfer is a 7ueue file which receives the data vie a batch input programs and groups associated data into 8sessions9. What are the functional modules used in se&uence in B %? 2hese are the 5 functional modules which are used in a se7uence to perform a data transfer successfully using B+% programming, B+%:&P-#:G4&;P / Parameters li.e #ame of the client" sessions and user name are specified in this functional modules. B+%:I#S-42 / It is used to insert the data for one transaction into a session. B+%:%'&S-:G4&;P / 2his is used to close the batch input session. What are internal tables? Internal tables are a standard data type ob)ect which e$ists only during the runtime of the program. 2hey are used to perform table calculations on subsets of database tables and for re/organi3ing the contents of database tables according to users need.

Sap Abap Interview Questions and Answers


What is I'S? !hat are the merits of I2S</ I2S is a Internet 2ransaction Server. I2S forms an interface between =22P server and 4*5 system" which converts screen provided data by the 4*5 system into =21' documents and vice/versa. 1erits of I2S, A complete web transaction can be developed and tested in 4*5 system. All transaction components" including those used by the I2S outside the 4*5 system at runtime" can be stored in the 4*5 system. 2he advantage of automatic language processing in the 4*5 system can be utili3ed to language/dependent =21' documents at runtime.

What is ynPro? +ynPro is a +ynamic Programming which is a combination of screen and the associated flow logic Screen is also called as +ynPro. What are screen painter and menu painter? Screen painter, Screen painter is a tool to design and maintain screen and its elements. It allows user to create G;I screens for the transactions. Attributes" layout" filed attributes and flow logic are the elements of Screen painter. 1enu painter, 1enu painter is a tool to design the interface components. Status" menu bars" menu lists" 0/.ey settings" functions and titles are the components of 1enu painters. Screen painter and menu painter both are the graphical interface of an ABAP*( applications. What are the components of SAP scripts? SAP scripts is a word processing tool of SAP which has the following components, Standard te$t. It is li.e a standard normal documents. 'ayout sets. / 'ayout set consists of the following components, !indows and pages" Paragraph formats" %haracter formats. %reating forms in the 4*5 system. -very layout set consists of =eader" paragraph" and character string. ABAP*( program. What is A() programming in ABAP? When is this grid used in ABAP? A'> is Application 'ist viewer. Sap provides a set of A'> (ABAP 'IS2 >I-!-4) function modules which can be put into use to embellish the output of a report. 2his set of A'> functions is used to enhance the readability and functionality of any report output. %ases arise in sap when the output of a report contains columns e$tending more than ?@@ characters in length. In such cases" this set of A'> functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. 2his is a very efficient tool for dynamically sorting and arranging the columns from a report output. 2he report output can contain up to AB columns in the display with the wide array of display options. What are the events in ABAP#$ language? Initiali3ation" At selection/screen" Start/of/selection" end/of/selection" top/of/page" end/ of/page" At line/selection" At user/command" At P0" Get" At #ew" At 'AS2" A2 -#+" A2 0I4S2. What is %'S and what do you know about it? 2he %hange and 2ransport System (%2S) is a tool that helps you to organi3e development pro)ects in the ABAP !or.bench and in %ustomi3ing" and then transport the changes between the SAP Systems and clients in your system landscape. 2his documentation provides you with an overview of how to manage changes with the %2S and essential information on setting up your system and client landscape and deciding on a transport strategy. 4ead and follow this documentation when planning your development pro)ect.

What are logical databases? What are the advantages# dis*advantages of logical databases? 2o read data from a database tables we use logical database. A logical database provides read/only access to a group of related tables to an ABAP*( program. Advantages, i)chec. functions which chec. that user input is complete" correct"and plausible. ii)1eaningful data selection. iii)central authori3ation chec.s for database accesses. iv)good read access performance while retaining the hierarchical data view determined by the application logic. dis advantages, i)If you donot specify a logical database in the program attributes"the G-2 events never occur. ii)2here is no -#+G-2 command"so the code bloc. associated with an event ends with the ne$t event statement (such as another G-2 or an -#+/&0/S-'-%2I&#). What is a batch input session? BA2%= I#P;2 S-SSI&# is an intermediate step between internal table and database table. +ata 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 ne$t screen is processed. +ow to upload data using %A'' ? 2hese are the steps to be followed to ;pload data through %A22, %reation of the %A22 test case C recording the sample data input. +ownload of the source file template. 1odification of the source file. ;pload of the data from the source file. What is Smart ,orms? Smart 0orms allows you to create forms using a graphical design tool with robust functionality" color" and more. Additionally" all new forms developed at SAP will be created with the new Smart 0orm solution. +ow can I make a differentiation between dependent and independent data? %lient dependent or independent transfer re7uirements include client specific or cross client ob)ects in the change re7uests. !or.bench ob)ects li.e SAPscripts are client specific" some entries in customi3ing are client independent. If you display the ob)ect list for one change re7uest" and then for each ob)ect the ob)ect attributes" you will find the flag client specific. If one ob)ect in the tas. list has this flag on" then that transport will be client dependent. What is the difference between macro and subroutine? 1acros can only be used in the program the are defined in and only after the definition are e$panded at compilation * generation. Subroutines (0&41) can be called from both the program the are defined in and other programs . A 1A%4& is more or less an abbreviation for some lines of code that are used more than once or twice. A 0&41 is a local subroutine (which can be called e$ternal). A 0;#%2I&# is (more or less) a subroutine that is called e$ternal. Since debugging a 1A%4& is not really possible" prevent the use of them (IDve never used them" but seen them in action). If the subroutine is used only local (called internal) use a 0&41. If the subroutine is called e$ternal (used by more than one program) use a 0;#%2I&#.

What is the differences between structure and table in data dictionary in ABAP? Structure and table both are ?*? matrices but there are many differences between table and structure. E. 2able can store the data physically but a structure dose not store. ?. 2able can have primary .ey but a structure dose not have. 5. 2able can have the technical attribute but a structure dose not have. structure doesn t contain technical attributes. structure doesn t contain primary .ey. structure doesn t stores underline database level. What is the difference between collect and sum? S;1. !hen processing an internal table in a bloc. starting with '&&P and concluded by -#+'&&P " S;1 calculates the control totals of all fields of type I " 0 and P (see also ABAP*( number types ) and places them in the '&&P output area (header line of the internal table or an e$plicitly specified wor. area). !hen you use S;1 in a '&&P with an e$plicitly specified output area" this output area must be compatible with the line type of the internal table.!hen using '&&P to process a sorted e$tract (see S&42 )" the control total of f at the end of the group appears in the field S;1(f) / / if f is type I " 0 or P . %&''-%2. %&''-%2 is used to create uni7ue or compressed datsets. 2he .ey fields are the default .ey fields of the internal table itab . If you use only %&''-%2 to fill an internal table" %&''-%2 ma.es sure that the internal table does not contain two entries with the same default .ey fields. If" besides its default .ey 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 .ey fields. If the default .ey of an internal table processed with %&''-%2 is blan." all the values are added up in the first table line. If you specify wa I#2& " the entry to be processed is ta.en from the e$plicitly specified wor. area wa . If not" it comes from the header line of the internal table itab . After %&''-%2 " the system field SF/2ABIG contains the inde$ of the / e$isting or new / table entry with default .ey fields which match those of the entry to be processed. %&''-%2 can create uni7ue or compressed datasets and should be used precisely for this purpose. If uni7ueness or compression are unimportant" or two values with identical

default .ey field values could not possibly occur in your particular tas." you should use APP-#+ instead. =owever" for a uni7ue or compressed dataset which is also efficient" %&''-%2 is the statement to use. If you process a table with %&''-%2 " you should also use %&''-%2 to fill it. &nly by doing this can you guarantee that the internal table will actually be uni7ue or compressed" as described above and %&''-%2 will run very efficiently. If you use %&''-%2 with an e$plicitly specified wor. area" it must be compatible with the line type of the internal table. +ow we format the data before before write statement in report ? !e can format the reports output by using the loop events li.e, E.at first ?.at new 5.at last etc chec. docu What is the difference between 'able and 'emplate? table is a dynamic and template is a static When do we use -nd*of*selection? -nd/of/selection event are mostly usedH when we are writing =4/ABAP code. In the =4/ABAP code" data is retrived in the Start/of/selection event and Printing on the list and all will beH done in -nd/of/selection event. In events start*of*selection is default event! When we have to use this event e"plicitly? Why? 2he default event in the ABAP is Start/of/selection.!e have to call e$plicitely this event when you are writing other than ths eventH " that is when you write A2H S-'-%2I&#/ S%4--# ->-#2S &4 I#I2IA'IIA2I&# ->-#2 etc"you have to e$plicitely 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 ..ABAP! In which situation we use ..ABAP? &&ABAP is used to develop BSP*P%;I applications and also anthing involved ob)ect oriented li.e BA+Is" Smart0orms..etc.where as ABAP is used to develop traditional programs in 4*5. 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 ? -$actly where can we lin. the functional module to abap coding. Pretty Printer is used to format the ABAP %ode we write in ABAP -ditor "li.e J-F !&4+S in %apitals and remaining are in small letters which is also depend on system settings. !e can call the function module in the ABAP %ode .Press the Pattern button on Appl. tool bar then u will get bo$ where u write the function module #A1- which u want to call in the code by selecting the radio button %A'' 0;#%2I&#. In this way we lin. function module to ABAP %ode. What is the difference between SAP memory and ABAP memory? AnswerE, data sending between main sessions using get parameter and set parameter is sap memory data sending between internal sessions using import or e$port parameters is abap memory Answer?, sap memory is a global memory whereas abap memory is local memory. 0or e$ample" we have four programs in abap memory and assigned some varibles to a particular program in abap memory then those varibles can t 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 .ind of modifications. Answer5, SAP memory is available to the user during the entire terminal session. ABAP memory is available to the user duringH life timeH ofH e$ternal session. What is the difference between 'ype and (ike? AnswerE, 2FP-" you assign datatype directly to the data ob)ect while declaring. 'IJ-"you assign the datatype of another ob)ect to the declaring data ob)ect. 2he datatype is referenced indirectly. Answer?, 2ype is a .eyword used to refer to a data type whereas 'i.e is a .eyword used to copy the e$isting properties of already e$isting data ob)ect.

Answer5, type refers the e$isting data type li.e refers the e$isting data ob)ect What is 'code S-/0! ,or what is it used! -"plain briefly? AnswerE, S-EK is a 2/code for ob)ect browser. Generally used to search the fields of SAP 2ables . and respective data. Answer?, seEK is a data browse and it is used to view the contents of the table and we cannot change or append new fields to the e$isting structure of the table as we cannot view the structure level display using the seEK What are different ABAP#$ editors? What are the differences? 2he ? editors are se5L and seLB both have the abap editor in place. In se5L you can go create programs and view online reports and basically do all thedevelopmet of ob)ects in this editor. In seLB ( ob)ect navigator) there are additional features such as creating pac.ages"module pool " function group "classes" programs ( where you can create ur programs) and BSP applications . What is difference between dialog program and a report? 4eport is a e$cecutable program +ialog is a module pool program.It has to be e$ecuted via a transaction only. +ialog programming is used for customi3ation ofscreens +ow do you connect to the remote server if you are working from the office for the client in remote place! !AS web application server or I2S 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 I+&%" intermidiate documents which carry the data you want to transfer or the documents you want to transfer" these I+&% 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. -"plain about roll area 1 ispatcher1 ABAP*Processor! AnswerE, 4oll area is nothing but memory allocated by wor. process. It holds the information needed by 4*5 about programs e$ecution such as value of the variables. +ispatcher ,All the re7uests that come from presentation server will be directed first to dispatcher. 0urther dispatcher sends this re7uests to wor. process on 0I0&(0irst In and 0irst &ut) basis. Answer?, +ispatcher recieves the re7uest from client and assigns the re7uest to one of the wor.

process. 4oll area, -ach wor.process wor.s in a particular memory that memory is .nown as 4ole Area" which consists of ;ser conte$t and session data. ABAP/ Processor ,is an interpretor which can e$ecute logic Which one is not an e"it comand ? 2-"it1 cencle1 stop1 back3 S2&P. -ffect ,2he statement S2&P is only to be used in e$ecutable programs -GI2. -ffect ,If the -GI2 statement is e$ecuted outside of a loop" it will immediately terminate the current processing bloc.. BA%J. -ffect , 2his statement positions the list cursor on the first position of the first line in a logical unit. So M%ancleM is not an e$it command What is ,ield symbol ? AnswerE, Fou can use field symbols to ma.e the program more dynamic. In this e$ample the name of a table control is substituted by a field symbol. 2hus you cal call the form with any internal table" using the name of the table control as a parameter. -$ample form insert:row using p:tc:name. field/symbols NtcO type c$tab:control. M2able control assign (p:tc:name) to NtcO. P insert EBB lines in table control NtcO/lines Q EBB. Answer?, fieldsymbol has the same concept as pointer in c" fieldsymbol don t point to a data type li.e char" num instead of that it points to the memory bloc.. the synta$ for fieldsymbol is 0I-'+/SF1B&' N#O. -G. 0&4 0I-'+ SF1B&'. +A2A, +A2 'IJ- SF/+A2;1" 2I1 'IJ- SF/;I-I2" %=A4(5) 2FP- % >A';- A+0 . 0I-'+/SF1B&' , N0SO.

1&>- +A2 2& N0SO. !4I2-,* N0SO. 1&>- 2I1 2& N0SO. !4I2-,* N0SO. 1&>- %=A4 2& N0SO. !4I2-,* N0SO. 2he output will be 2oday s date current time What is lock ob4ect ? 'oc.&b)ects used to synchorni3e access of several users using same data. Why BAPI need then B % ? BAPIMS provide the standard interface to other applications apart from SAP and within differnt vesions of SAP too. Also it is &&+ bases so dosenMt depends on screen flow. B+% gets failed if we ma.e changes for screen changes through I1G customi3ation 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 Pmemory wastage is reduced Pfaster than )oins to retrieve the data from database tables disadvantages, view is not a container"it will not hold the data Pview memory is not permanent memory +ow data is stored in cluster table? A cluster table conatins data from mulitple ++I% tables. It stores data as a name value pair ( var.ey" vardata) +ave you used performance tuning? What ma4or steps will you use for these? 0irst of all tunning can be done In three ways, dis. i*o "s7l tunning " memory tunning" Before tunning u have to get the status of your database using &racle utility called statpac. " t.prof" then you should go for tunning +ow to create client independent tables? client independent tables, the table in which the first field is not mandt is the client independent tables Pmandt is the field with mandt as the data element Pautomatically client which we login is populated to mandt What type of user e"its have you written? there are four types E.function e$it ?.menu i$it

5.screen e$it. (.field e$it. these are the user e$its +ow can you debug a script form? S-RE /O give the form name /O utilities /O activate debugger +ow do we debug sapscript? 0irst we need to put Brea. point in Print program where ever you want to stop the e$ecution. After in S-RE give your form name and go to ;tilities//OActive +e/bugger. 2hen go to your transcation li.e >0B5(for Invoice or %redit memo) etc to see the print preview or print the form e$ecute it. !hen you e$ecute it the the form +ebugging will get activated and you can see your 0orm e$ecution step by step. What are the different types of data dictionary ob4ects? AnswerE +ata +ictionary &b)ects P 2ables P >iews P +omain P +ata -lement P 2ype Groups P Search =elps*1atchcode &b)ects P 'oc. ob)ects P Structures P 2able 2ypes Answer? the dictionary ob)ects are, domain dataelements tables views structures typegroups search helps loc. ob)ects etc which are data base related ob)ects in sap What is the step by step process to create a table in data dictionary? AnswerE steps to create database tables E.go to seEE ?.give name the database table

5.give short description for the table (.Give delivery class name as A and data browser * table view maint as +isplay*maintenence allowed @.select fields tab K.give field name data type(user defined element type*built/in/type)"short te$t R.select technical settings tab "give data class as applB and si3e category as B L.save it A.go utillities menu clic. table contents select create and enter the field values then select display in table contents and u can view the table values with field lables Answer? bottom to top approach, ::::::::::::::::::::::::: step E, creating a domain, PseEE"select the ob)ect type as domain "name it "create"description"enter the datatype and length(si3e)"save "activate step?, creating a dataelementS seEE"select the ob)ect type as ,date element"name it "create"desc"assign it with a domain what we created now"save"activate it. step5, creating a tableS seEE"select the ob)ect type as table"name it" create" enter the field name and assign it with the data element instead of assigning a datatype to it" li.e this create re7 fields, on behalf of this, table maintainence, assign the type of the table ie."A % G ' S #-G2 maintaince, allowed"not allowed "allowed with restricions :::::::::::::::::::::::::::::::::::::::::::::: fields of a table,(as descripted above) ::::::::::::::::::::::::::::::::::::::::::: techical settings, AB &4 AE A#+ B;00-4-+ &4 #&#/B;00-4-+ %an a transparent table e"ist in data dictionary but not in the data base physically? AnswerE #&. 24A#SPA4-#2 2AB'- +& -GIS2 !I2= 2=- SA1- S24;%2;4- B&2= I#

2=- +I%2I&#A4F AS !-'' AS I# 2=- +A2ABAS-"-GA%2'F !I2= 2=SA1- +A2A A#+ 0I-'+S. #o" at the point you will activate your table a same transparent table is going to be create in database Answer? Fes" a transparent table(definition) can e$ist in the data dictionary and not in the database. In this case" it is not activated What are the domains and data elements? domains, ::::::::::: domains are the dictionary ob)ects that are assigned with constants and data types data elements, :::::::::::::: data elements are dictionary ob)ects that are assigned with the domains. uses, P data elements are used to create relation between tables. P data elements are used to transfer the data from one 4*5 to another 4*5. P to create search helps. What is a collect statement? +ow is it different from append? APP-#+ , I2 IS ;S-+ 2& G-2 2=- 4-%&4+ 04&1 2=- I#2-4#A' 2AB'- =-A+-4 2& 2=- B&+F A4-A I2 A''&!S +;P'I%A2I&# %&''-%2, I2 IS ;S-+ 2& A G-2 A 4-%&4+ 04&1 =-A+-4 2& 2=- B&+F A4-A B;2 I2 !I'' #&2 A''&! A#F +;P'I%A2I&# -G%-P2 I0 2=-4- IS A#F #;1-4I% 0I-'S I2 A++S 2=A2 0I-'+S +A2A B;2 #&2 AS A #-! 4-%&4+ .n ABAP5 id you set up a workflow? Are you familiar with all steps for setting up a workflow? Fes. -$ecute the 2$n S!++(%reating a new !or.flow). In the header of the !or.flow" define the Business &b)ect and -vent you refer to for triggering the !f. %reate the Steps re7uired for your wor.flow(Activity). Inside the Activity" %reate the tas. and assign the Business &b)ect and the related method for that business ob)ect. Activate the !or.flow.

In the 6select7 statement what is 8group by9? Group by clause is used to fetch the data from the table by the specified field e$.select count (P) from emptable group by deptno where deptno Q E. It is used to find the number of employees present in the specified department no. +ow can I copy a standard table to make my own :;table? !- %A# %4-A2- A S24;%2;4- 'IJ- 2=- SA1- S24;%2;4- AS +A2ABAS- 2AB'- A#+ !- %A# ;SS-'-%2P 04&1 +A2ABAS- 2AB'- I#2& 2AB'- I2AB &4 I#S-42 I#2& I2AB >A';-S +A2ABAS- 2AB',rom -"cel to ABAP * Is batch mode possible ? +A2A w:file 2FP- string. P %onvert the file path into string w:file Q p:input. P Internal 2able should have same field se7uence as -G' 0ile. %'-A4 t:upload. 4-04-S= t:upload. P %all function to upload the data into internal table %A'' 0;#%2I&# G;I:;P'&A+ -GP&42I#G filename Q w:file filetype Q AS% has:field:separator Q G 2AB'-S data:tab Q t:upload -G%-P2I&#S file:open:error Q E file:read:error Q ? no:batch Q 5 gui:refuse:filetransfer Q ( invalid:type Q @ no:authority Q K un.nown:error Q R bad:data:format Q L header:not:allowed Q A separator:not:allowed Q EB header:too:long Q EE un.nown:dp:error Q E? access:denied Q E5 dp:out:of:memory Q E( dis.:full Q E@

dp:timeout Q EK &2=-4S Q ER. I0 sy/subrc #- B. P 1-SSAG- I+ sy/msgid 2FP- sy/msgty #;1B-4 sy/msgno P !I2= sy/msgvE sy/msgv? sy/msgv5 sy/msgv(. -'S-. P +elete the first row of heading from the uploaded table +-'-2- t:upload I#+-G E. -#+I0. M I0 sy/subrc -6 B.

Você também pode gostar