Professional Documents
Culture Documents
HP
WORKAREA: It is used to hold once record at a time and also it is used to increase
performance of the data processing.
Note: While converting sapscript into smartforms, only layout has passed. But you have do all
logic coding in your smartforms.
Cluster tables:
--These are very large tables so many records in each of them! But, these tables were
used for storing the system data!
--In these tables at least one primary key will be present to find the record! These tables
r having many - to - one relationship!
--These tables were used by basis people to calculate the system performance!
8. Difference between select single and select upto 1 row in sap abap?
Ans. According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT
SINGLE because you are not using all the primary key fields.
Select single is a construct designed to read database records with primary key. In the
absence of the primary key, it might end up doing a sequential search.
Whereas the select up to 1 row may assume that there is no primary key supplied and will try
to find most suitable index.
The best way to find out is through Sql trace or runtime analysis.
Use "select up to 1 rows" only if you are sure that all the records returned will have the same
value for the field(s) you are interested in. If not, you will be reading only the first record which
matches the criteria, but may be the second or the third record has the value you are looking
for.
The System test result showed that the variant Single * takes less time than Up to 1 rows as
there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.
The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the
'WHERE' clause. If this results in multiple records then only the first one will be returned and
therefore may not be unique.
Mainly: to read data from the 'SELECT .... UP TO 1 ROWS' statement is subtly different. The
database selects all of the relevant records that are defined by the WHERE clause, applies any
aggregate, ordering or grouping functions to them and then returns the first record of the result
set.
ex code
Ans. BAPI - These are published programs which is used to upload data into SAP system.
BAPI is Business Application Programming Interface and has the role as communication platform
for developing applications, e.g. booking material documents from flat files, see more in trx
BAPI.
BAPI - Business Application - commonly a function module that is normally RFC enabled as well
and acts as a method of a business object. For example, Sales Order as the business object with
a method of create - the BAPI is BAPI_SALESORDER_CREATEFROMDAT2.
BAdI is Business Add-In, and it should take the place from the user- exits (trx: SE18, SE19)
BADI - This is a program enhancement technique. SAP provides BADI openings in the standard
programs. You need to search for the suitable BADI as your requirement and then do the coding
and plug in the program.
To implement BADI,
Follow the below steps to find out what all BADI's are called when you press any button in any
transaction.
Now
5) Press the required button for which you need to write an exit logic, the execution will stop at
the break point.
6) Check the values of variable 'exit_name', it will give you the BADI name called at that time.
7) This way you will find all the BADIs called on click of any button in any transaction. .
performance tuning ?
1. Run Extended syntax checks with character literals checkbox switched on & Code Inspector to
rectify all relevant errors and warning (e.g. Use the results of the above checks to remove all
variables/constants etc that are declared but are not used)
2. Internal Table is defined with “TYPE STANDARD TABLE OF” & Work-Areas is used instead of
header lines
3. In SELECT statement, only the required fields are selected in the same order as they reside on
the database table/structure/view
5. Usage of JOIN is limited to a maximum of 2 i.e. not more than 3 database tables are joined at
one time
6. CHECK that the internal table used in FOR ALL ENTRIES is NOT empty as this will retrieve all
entries from the table
8. Sort internal table by fields in the correct order, which are used in a READ TABLE statement
using BINARY SEARCH. If the order of sorting is invalid the BINARY SEARCH will never work.
10. Use transaction ST05 (SQL Trace) to see what indices your database accesses are using.
Check these indices against your “where” clause to assure they are significant. Check other
indices for this table and where you have to change your “where” clause to use it. Create new
indices if necessary, but do not forget to check the impact by consulting onsite coordinator.
Ans.
Hi
It's the same but the structure are different of course.
Here you can find the structures BAPI_TE_<TABLE NAME> and BAPI_TE_<TABLE NAME>X.
So if you add new field in MARA and you want to transfer its value by this BAPI, you have to add
it in the BAPI structures too.
- MARA-ZFIELD
- BAPI_TE_MARA-ZFIELD
- BAPI_TE_MARAX-ZFIELD.
So if you've to transfer the new fields by BAPI you've to fill the extensions structure in this way:
BAPI_TE_MARAX-ZFIELD1 = 'X'.
BAPI_TE_MARAX-ZFIELD2 = 'X'.
BAPI_TE_MARAX-ZFIELD3 = 'X'.
............................
BAPIPAREXX-STRUCTURE = 'BAPI_TE_MARAX'.
BAPIPAREXX+30 = BAPI_TE_MARAX.
BAPI_TE_MVKEX-ZFIELD1 = 'X'.
BAPI_TE_MVKEX-ZFIELD2 = 'X'.
BAPI_TE_MVKEX-ZFIELD3 = 'X'.
............................
BAPIPAREXX-STRUCTURE = 'BAPI_TE_MVKEX'.
BAPIPAREXX+30 = BAPI_TE_MVKEX.
When this BAPI works, it runs a piece of code like this to transfer the data from extension
structure to database table:
LOOP AT EXTENSIONIN.
CASE EXTENSIONIN-STRUCTURE.
WHEN 'BAPI_TE_MARA'.
MOVE EXTENSIONIN+30 TO BAPI_TE_MARA.
WHEN 'BAPI_TE_MVKE'.
MOVE EXTENSIONIN+30 TO BAPI_TE_MVKE.
WHEN ........
....................................
ENDCASE.
ENDLOOP.
LOOP AT EXTENSIONINX.
CASE EXTENSIONIN-STRUCTURE.
WHEN 'BAPI_TE_MARAX'.
MOVE EXTENSIONIN+30 TO BAPI_TE_MARAX.
WHEN 'BAPI_TE_MVKEX'.
MOVE EXTENSIONIN+30 TO BAPI_TE_MVKEX.
WHEN ........
....................................
ENDCASE.
ENDLOOP.
After check the field where the flag is setted and move the value to database (i.e. MARA,
MVKE ,.....)
Max.
Se71->utilities->activate debugger.
This may be a time-consuming process. Instead, open a session and execute the program
RSTXDBUG. Even if you follow the above menu path to activate the script, it will internally
execute the program RSTXDBUG. So you are saving some time in going through all of the above
processes.
Another advantage of using this program: when a developer works in the support environment
and the client requests to makes some changes to a form, but doesn't know which form, he can
just show the form output and request for changes.
Example: Transaction Code HRBEN0001. This contains a confirmation form, benefits form and
others.
In this scenario, just open the other session and run the program RSTXDBUG program, click a
push button on the transaction code and if a form is associated with that button it is
automatically opened in debug mode. Once the form is in debug mode you can find the form
name then open one more session and make the changes to the form while debugging it.
Final window:
You may want to display or query values on the first page that are determined only during
processing. For example, you may want to name the grand total in the letter text of
an invoice. However, this amount is determined only after listing all individual items. Or you may
want to query on the first page within a condition the total number of pages, which the system
calculates only after processing all pages.
In such a case, you use the final window: Processing first skips all windows of this type in the
tree and works its way to the end of the tree. Only after the actual processing is finished, the
final windows are processed in the order in which they appear in the tree (from top to
Bottom). Now any information is available that is known only at the end of the form processing.
Ans. Function modules are procedures that are defined in function groups (special ABAP
programs with type F) and can be called from any ABAP program. Function groups act as
containers for function modules that logically belong together. You create function groups and
function modules in the ABAP Workbench using the Function Builder.
Function modules allow you to encapsulate and reuse global functions in the R/3 System. They
are stored in a central library. The R/3 System contains a wide range of predefined function
modules that you can call from any ABAP program. Function modules also play an important
role in database updates and in remote communications between R/3 Systems or between an
R/3 System and a non-SAP system.
Unlike subroutines, you do not define function modules in the source code of your program.
Instead, you use the Function Builder. The actual ABAP interface definition remains hidden from
the programmer. You can define the input parameters of a function module as optional. You can
also assign default values to them. Function modules also support exception handling. This
allows you to catch certain errors while the function module is running. You can test function
modules without having to include them in a program using the Function Builder.
The Function Builder also has a release process for function modules. This ensures that
incompatible changes cannot be made to any function modules that have already been
released. This applies particularly to the interface. Programs that use a released function
module will not cease to work if the function module is changed.
15. BAPIS AND RFC’S?
Technically, not much at all. They are both remote enabled functions that can be accessed from
outside of SAP (to be more technically correct, from outside of the ABAP stack).
From a usage/functional perspective however, BAPIs are a little bit more special from RFCs.
Bapis:
- are designed as the methods of business objects in the business object repository (accessable
using transaction BAPI or SWO1)
- have non-technical parameter names (the technical field names in SAP are mapped)
- have a fixed interface and functionality across all SAP releases (this is probably the key point as
it means you can develop integrations with them which do not need to be changed when you
upgrade)
Generally, if you are trying to find a function for a particular requirement you should look for a
BAPI first, then for a RFC function which has a released status (check the function attributes in
SE37), and then just a normal RFC last.
The benefit of an RFC function with released status means that it also has a fixed interface
which will not change with new SAP releases.
MOVE:
Move the content of an internal table/variable to another internal table/variable
Syn: MOVE T_TEST-FIELD1 TO T_TEST2-FIELD1.
ACCENTURE
Ans. When working with BDC for Table Control you require work around to get next page of table
control. You need to use the BDC OKCODE ‘=P+’.BCD_OKCODE is for Page down that can be used for
scrolling down in table control. so you can fill data in to table grid.
Ans 2. BDC table control is an area on the screen in which you can display data in tabular form. You
process it using a loop. Table controls are comparable to step loop tables. While a table control consists
of a single definition row, step loop blocks may extend over more than one row. Table controls are more
flexible than step loops, and are intended to replace them.
When you need to handle a scenario like in sales order, it may contain more than one material, if you
have more than one material we have to use table control, it will have number of columns and number
of rows.
Table controls allow you to enter, display, and modify tabular data easily on the screen
Ans. Yes, but at a time it is not possible. After completion of first transaction
Ans. You can specify either in the style or in the layout set that a particular paragraph should not be split
in two by a page break. If the page protect attribute is set then the complete paragraph is always
output on a single page. This property applies only to that particular paragraph. SAP Script provides the
PROTECT... ENDPROTECT command pair to allow you to define the areas to be protected against a page
break on an individual basis. Thus the PROTECT/ENDPROTECT commands may be regarded as a kind of
conditional NEW-PAGE command, the condition being whether or not the lines enclosed between the
two commands fit in the space remaining in the current main window.
11. how to display alv output in 3 blocks using normal alv reports( like header part , middle part,
footer part)?
Example code:
Perform bdc_field using 'BDC_CURSOR'
'PROJ-PSPID'.
Perform bdc_field using 'BDC_OKCODE'
'=BU'.
Accneture(client):
To create a function module, you first need to start the Function Builder. Choose Tools
® ABAP Workbench, Function Builder. For more information about creating function modules,
refer to the ABAP Workbench Tools documentation.
To be able to call a function module in an update work process, you must flag it in the Function
Builder. When you create the function module, set the Process Type attribute to one of the
following values:
Function modules that run in the update task have a limited interface:
Result parameters or exceptions are not allowed since update-task function modules
cannot report on their results.
You must specify input parameters and tables with reference fields or reference
structures defined in the ABAP Dictionary.
12. Instead of using commit and rollback why u r using IN UPDATE TASK?
13. Some tables of customer master?
14. Which module u are working?
15. Have u worked on pricing in sd?
16. Have u write any formulas?
17. Have u worked on currency conversions?
18. vbpa Table description?
19. Have u worked on IDOCS?
20. Have u knowledge on Adobe forms?
21. Have u worked on enhancements frame work?
22. ALV FM'S?
Wipro
Rfc enabled are basically for sap systems whereas BAPI are for non sap systems like i want to
access data via java or vb.
BDC stands for Batch Data Communication; Through BDC you are going to update
screens.
BAPI stands for Business Application Programming Interface. Through bapi you are going
to update Data Base Tables directly.
Whenever screen of a particular transaction changes, you need to redo the work in case of
BDC.
Whereas in case of BAPI SAP will take care as it will update the Database Tables Directly.
BAPI is directly updated the database instead BDC run through the screen flow.
So BAPI can't handle all the flow logic checking and enhancement put by programmer to
facilitate the user requirement.
BAPI is a higher end usage for transferring the data from SAP to non-SAP and vice-versa. for
ex: if we are using VB application, where in that we want to connect to SAP and retrieve the
data, and then change and update the data in SAP for that purpose we can use that.
There is one more advantage using BAPI instead of BDC. When we go for up gradation, there
might be possibility to change the screen elements for transactions depending on the
requirement.
In that case, our BDC program may or may not work (depending on the screen changes they
have made).
BAPI is used only when it is available for the particular transaction like Delivery Sales order. But
BDC can be used for any transactions which have screen and fields.
----------------------------------------
1. Diff b/w call transaction and session methods?
Ans. Here the differences between session and call transaction
Call transaction:
1) Synchronous process
2) Asynchronous /synchronous update
3) Single transaction only handled
4) Small amount of data uploaded.
5) Explicit error handling (Means all the error records move to internal table and validate)
6) Time requirement is low.
Session method:
1) Asynchronous process.
2) Synchronous update.
3) Multiple transactions can be handled (Means u can upload the data at a time for more than
one t-code).
4) Huge amount of data can be uploaded.
5) Implicit error handling (Means for errors SM35)
6) Execute the session on a specific date. (By using hold date parameter)
7) Time requirement is more
Ans. Scenario: Need to find the name of the BADI available in a transaction
1. Go to Transaction SE24
2. Enter the Object Type CL_EXITHANDLER and click on Display.
4. Put a Break-point on
This way you will find all the BADIs called on click of any button in any transaction.
3. You can also go the t-code SPRO, you can also find plenty of BADIs in the related area.
4. You can also find the BADI call using ST05. Below are the steps:
Go to ST05, then choose ‘table buffer trace’ and activate the trace.
Run the t-code from where you want to find the BADI.
Using selection criteria object ‘V_EXT_IMP’ and ‘V_EXT_ACT’ and then you can get
called BADI list.
This analyzing technique is based on the fact that all BAdIs are registrated in SAP database
tables. So for each BAdI call these database tables will be accessed. The BAdI database tables
are SXS_INTER, SXC_EXIT, SXC_CLASS and SXC_ATTR. These tables are always accessed by the
views V_EXT_IMP and V_EXT_ACT. So these two ABAP views (T: SE11) will be the basis for the
trace.
Ans 3.
FIND A BADI
these steps should enable you to find any BADI related to any transaction in a matter of
minutes.
1) Go to the transaction SE37 to find your function module.
2) Locate the function SXV_GET_CLIF_BY_NAME.
3) Put a breakpoint there.
4) Now open a new session.
5) Go to your transaction.
6) At that time, it will stop this function.
7) Double click on the function field EXIT_NAME.
8) That will give you name of the BADI that is provided in your transaction.
OR
Ans.
A BAPI is a method of a SAP Business Object. BAPI enables SAP and third party applications to
interact and integrate
with each other at the Business Object / Process level.
Batch Data Communication (BDC) is the oldest batch interfacing technique that SAP provided
since the early versions of R/3. BDC is not a
typical integration tool, in the sense that, it can be only be used for uploading data into R/3 and
so it is not bi-directional.
BDC works on the principle of simulating user input for transactional screen, via an ABAP
program. Typically the input comes in the form
of a flat file. The ABAP program reads this file and formats the input data screen by screen into
an internal table (BDCDATA). The
transaction is then started using this internal table as the input and executed in the background.
In ‘Call Transaction’, the transactions are triggered at the time of processing itself and so the
ABAP program must do the error handling.
It can also be used for real-time interfaces and custom error handling & logging features. .
In case of bdc data transfer takes place from flat file into sap system ie the file existing in sap
system to sap system.
Where as bapi's are remotely enabled function modules which are assigned to some business
objects n used to transfer the data between different business partners who are using different
systems other than sap.
when you plan to upgrade your system version then bdc will not support those upgradation
where as bapi's will support.
Method 1:—-
a) Create a subscreen area in your screen layout where you want to create the select options.
b) In the top include of your module pool program declare a selection screen as a subscreen e.g.
c) In the PBO and PAI of the main screen where the select options needs to be created do a call
subscreen of the above screen (100).
This CALL SUBSCREEN statement is necessary for transport of values between screen and
program.
Note: All validations of the selection screen fields e.g. the s_matnr field created above should
be done in selection screen events like AT SELECTION-SCREEN etc and not in PAI. These selection
screen validations etc should be done in the top include only.
Method 2:——-
a) Create 2 separate fields in your screen layout – one for the low value and one for the high
value. Insert an icon beside the high value which will call the multiple selections popup screen
on user command. Use function module COMPLEX_SELECTIONS_DIALOG to achieve this.
continued ……
You can use the return table rng_kunnr to populate your own internal range table with the
values entered by the user. Basically here you are just simulating the work of a select-options
parameter by module pool screen elements.
Honey Well
Whenever lock object applies on a table, two function modules will work.
Those are 1) ENQUE: It is used to lock the table while a command is working on table.
2) DEQUE: It is used to unlock the table after command working is complete.
11. Before Developing Objects we are create transforms/transports, who created those
transforms/transports?
12. T.Code for transports creation?
Ans. The main transactions used to create/maintain a Transport Request are:
Tx SE01, Tx SE09 and Tx SE10.
With Development and Configuration Transport Requests are usually created
automatically then use Tx SE09 or Tx SE10 to release the Request and Task .
IGATE
Syntax:
Data: <int tab> like SORTED table of <wa> with UNIQUE/NON-UNIQUE KEY <F1>.
Syntax:
Data: <int tab> like HASHED table of <WA> WITH UNIQUE KEY <F1>.
Robert Bosch
1. ASAP methodology in sap abap?
Use
The ASAP Roadmap provides the methodology for implementing and continuously optimizing
your SAP System. It divides the implementation process into five phases and offers detailed
Project Plans to assist you (in Microsoft Project format). The documentation stored at each level
of the Roadmap tree structure contains recommendations on implementing your SAP System
and links to helpful tools and accelerators.
Purpose
When you install the Implementation Assistant you can choose from several Roadmap types and flavors.
APO
Business-to-Business Procurement
In your implementation project (Roadmap type: Implementation), you can bring together
several Roadmap flavors in one Roadmap. The Implementation Assistant also helps you to
implement a combination of software implementation projects.
Features
1. Project Preparation
In this phase you plan your project and lay the foundations for successful
implementation. It is at this stage that you make the strategic decisions crucial to your
project:
o Establish the project organization and relevant committees and assign resources
2. Business Blueprint
In this phase you create a blueprint using the Question & Answer database (Q&A db),
which documents your enterprise’s requirements and establishes how your business
processes and organizational structure are to be represented in the SAP System. You also
refine the original project goals and objectives and revise the overall project schedule in
this phase.
3. Realization
In this phase, you configure the requirements contained in the Business Blueprint.
Baseline configuration (major scope) is followed by final configuration (remaining scope),
which can consist of up to four cycles. Other key focal areas of this phase are conducting
integration tests and drawing up end user documentation.
4. Final Preparation
In this phase you complete your preparations, including testing, end user training,
system management, and cutover activities. You also need to resolve all open issues in
this phase. At this stage you need to ensure that all the prerequisites for your system to
go live have been fulfilled.
After your system has gone live, you can use a separate Roadmap with six work
packages, in order to optimize your SAP System continuously.
These phases are the main milestones for your SAP System implementation project. Each phase
has:
Work packages, which consist of activities, for which project teams are responsible.
Activities, which consist of tasks, which are processed by one or more team members.
Tasks, which are carried out by a project team member. You can also access the How-to
sections and accelerators at this level.
Ans. You use the HIDE technique while creating a list level to store line-specific information
for later use. To do so, use the HIDE statement as follows:
HIDE <f>.
This statement places the contents of the variable <f> for the current output line (system field
SY-LINNO) into the HIDE area. The variable <f> must not necessarily appear on the current line.
To make your program more readable, always place the HIDE statement directly after the output
statement for the variable <f> or after the last output statement for the current line.
As soon as the user selects a line for which you stored HIDE fields, the system fills the variables
in the program with the values stored. A line can be selected
By an interactive event.
For each interactive event, the HIDE fields of the line on which the cursor is positioned
during the event are filled with the stored values.
By the READ LINE statement.
You can think of the HIDE area as a table, in which the system stores the names and values of all
HIDE fields for each list and line number. As soon as they are needed, the system reads the
values from the table.
4. Different types of alv reports?
1. AT-FIRST: This is used when we want to execute the statements before records are processed.
2. AT-NEW: This event is used when we want to execute the statement before group of records
are processed.
3. AT-END: This event is used when we want to execute the statements after processing of
group of records.
4. AT-LAST: This event is used when we want to execute the statements after all records are
processed.
Suppose we have a requirement in which we have to align the customer address in such a way
as shown below:-
Ans. In ALV Reports, the output is displayed by using the function module:
REUSE_ALV_GRID_DISPLAY or REUSE_ALV_LIST_DISPLAY
Input for the above function modules is program name and fieldcatalog and data internal table.
You can edit the records in the output list by using EDIT = 'X' option in the field catalog.
While filling the field catalog we have to consider the field EDIT = 'X'.
But this is used for print purpose only we cannot save into database.
Ntt data:
1. Which syntax is used for BDC in application server?
ASAP is Accelerated SAP, a methodology being used to complete an SAP implementation from
End to End. Means, it has five phases and starts with
1) Project Preparation : where the SAP consultants try to understand the AS IS business process
of the industry for which implementation is being done. The hardware and software
requirements are analysed. Infact all the basic preparation is done at this stage.
2) Blue Print : After the AS IS study is made a TO BE process is evolved where in the client
business is put in technically as to how it would be like in SAP. Blue is a binding between the
implementor and Client. So, there is a sign off from the client on what is going to be done.
3) Realization : Here the blue print is configured on the system. For some processes where SAP
cannot do as it is,like when there is a difference between AS IS and TO BE called a GAP , we use
developers(ABAP) . The functional guys give the functional spec based on which the ABAP'rs
prepare technical specs and fulfill the object ( may be reports, user exits, enhancements and so
on). Also the unit and integration testing is done here.
4) Final Preparation : Here the enduser, core user training is completed on how he has to use
the sap system. Master data uploads into the production server. In a way the system is getting
for going live. And just before the go live date the data that needs to be put into sap is fixed and
the remaining transactions of the business are recorded may be in a flat file or sometimes they
are taken off so that upto date data in the production server is maintained.
5) Go Live and Support : Here finally the SAP system goes live and followed by some support as
agreed upon in the service level agreements.
IBM
1. How to give accessing of report to another person?
Ans 2. Authorization Objects are used to manipulate the current user’s privileges for specific
data selection and activities from within a program.
We could always create our own authorization objects and implement it in our own abap
programs. As an example, we will create our own authorization field similar to TCD used in
S_TCODE Authorization object.
Next step is to create the authorization class (see #1 in figure 1) and authorization object (see
#2 in figure 1).
Now we’re done creating our own authorization object, let us now use and assign it to a user.
(Figure 2)
Now let’s implement this authorization in our ABAP program. Let say we have a dialog program
(ZCOMM) wherein we have a button on the screen that when clicked, the user will go to the
Create/Edit screen(1000) if he’s authorized. On the other hand, he will go to display only screen
(2000) if he’s not authorized. To do that, simply add the code below on your program.
3. What is authorization?
If the validation has to be done for more than one field those fields are included between chain
and end chain.
Ex
In PAI if you want to validate group of fields put in chain and End chain statement.
CHAIN.
FIELD chk_ABC.
FIELD chk_DEF.
FIELD chk_GHI.
FIELD CHK-JKL.
MODULE CHK_screenfields.
ENDCHAIN.
BAPIs themselves must not trigger any messages (such as MESSAGE xnnn) in the coding. In
particular they must not generate terminations or display dialog boxes. Instead, all messages
must be intercepted internally and reported back to the calling program in the Return
parameter. Otherwise the BAPI will not be processed correctly and control may not be given
back to the calling program.
All error messages or indeed any message that may be returned by the BAPI, must be defined
in message table (Tools ® ABAP Workbench ® Development ® Programming environment ®
Messages) and described in the documentation for the return parameter. This also applies to
the most important or most likely error messages generated by other programs that can be
indirectly passed via the BAPI to the application program.
Application developers are provided with two service BAPIs to diagnose and process error
messages from BAPI calls:
BapiService.MessageGetDetail () displays the short and long texts of BAPI error messages.
Features
The export parameter Return can be implemented as follows:
As a table, whereby it must be defined in the function module as a table parameter, as well as in
the method in the BOR as an export parameter.
Before filling the Return parameter you should either initialize the structure with CLEAR or the
table with REFRESH and CLEAR.
If the return parameter is not set or is set to an initial value this means that no error has
occurred.
BAPIRET2
You must use this reference structure when developing new BAPIS.
BAPIRET1, BAPIRETURN
Example: if we create a form and driver program related to BILLING (invoice) or if we want to identify the
Form and program name of an application (Purchase order, sales order, billing, delivery note etc).
Goto NACE t.code
|
Click on Output types
|
Now scroll down and identify the required output type (Ex: invoice) and select it
|
Now double click on ‘Processing routines’
|
Now click on Change icon to include our form name and program name
|
Save
first way is go to SE 71 and from menu bar select Utilities->activate debugger .then go
to SE38 execute the print program ,it automatically goes to debugging mode.
The other way is, run the program RSTXDBUG in se38. Execute it. A message will show
that debugger is activated .now open the print program in se38.u will notice that the print
program is automatically diverted to debugging mode.
11. Difference b/w elementary search help and collective search help?
Ans. 1) Elementary search helps describe a search path. The elementary search help must define
where the data of the hit list should be read from (selection method), how the exchange of values
between the screen template and selection method is implemented (interface of the search help) and
how the online input help should be defined (online behavior of the search help).
2) Collective search helps combine several elementary search helps. Collective search help thus can offer
Several alternative search paths.
3) An elementary search help defines the standard flow of an input help.
4) A collective search help combines several elementary search helps. The user can thus choose one of
several alternative search paths with collective search help.
5) A collective search help comprises several elementary search helps. It combines all the search paths
that are meaningful for a field.
6) Both elementary search helps and other search helps can be included in a collective search help. If
other collective search helps are contained in collective search help, they are expanded to the level of
the elementary search helps when the input help is called.
Ans. The Enhancement Framework enables you to add functionality to standard SAP software
without actually changing the original repository objects and to organize these enhancements as
effectively as possible.
● Support for grouping enhancements and appropriate tool support for documentation.
An enhancement project needs even more planning than a normal development project
because it combines the customer code with the code of the underlying application.
Enhancements are changes at a very low technical level and should be performed very carefully
so that they do not violate the logic of the program they enhance. It is highly recommended to
set up a process that defines who is allowed to design and implement enhancements.
The new Enhancement Framework is intended to integrate existing enhancement and modification
concepts and addresses recent developments such as Web Dynpro. The classic technology for appends
and includes cooperates perfectly with the Enhancement Framework but is not yet integrated in it. If you
want to be able to enhance all layers of an application, the classic append technology is still necessary.
Integration
The main tool for performing enhancements is the Enhancement Builder, which is integrated in the
ABAP Workbench.
The enhancements can be switched using the Switch Framework. An enhancement takes effect when
the package in which the above enhancement components are defined is assigned to a switch of the
Switch Framework and this switch is not deactivated.
Ans. Main difference Between: Enhancements is Client Dependent BADI is client in-dependent.
Classic enhancements can have only one Implementation. Whereas BADI can have Multiple
Implementations, Enhancement means to modify the standard transaction based on the user
requirements. But BADI is one part of enhancement. It’s full and full oops oriented concept.
ACCENTURE
KPMG
Function modules are procedures that are defined in function groups (special ABAP programs
with type F) and can be called from any ABAP program. Function groups act as containers for
function modules that logically belong together, Function modules allow you to encapsulate and
reuse global functions in the R/3 System. They are stored in a central library, unlike subroutines,
you do not define function modules in the source code of your program.
3. what is UPDATE function module in sap bap? How to create it? And whats the use of
UPDATE function module?
8. HOW TO upload the 1000 records of excel sheet using Table Maintanace Genereator?
10. how to copy the reports from one client to another client?
Ans. Prerequisite for READ statement is, we must sort the internal table before reading.
Read statement is basically to read an internal table...while mentioning the key they should be
in the same order as they appear...we can use binary search statement
as well in READ. But the perquisite for it is that the table should be sorted as per the key...
FOR ALL ENTRIES is used to replace nested select loops by operations on internal tables.
1) Make sure that the select contains atleast the primary key fields
Ans. In ALV Reports, the output is displayed by using the function module:
REUSE_ALV_GRID_DISPLAY or REUSE_ALV_LIST_DISPLAY
Input for the above function modules is program name and fieldcatalog and data internal
table.
You can edit the records in the output list by using EDIT = 'X' option in the field catalog.
While filling the field catalog we have to consider the field EDIT = 'X'.
But this is used for print purpose only we cannot save into database.
Ans. This concept is mainly used in IDOC where u select the partner profile using Tcode We20
.with Tcode SM59 you create RFC(remote function call) to create communication link to a
remote system.
Ans. Occurs addition to the Declaration will give initial size to that table. Occur statement
allocates 8kb of memory to the internal table.
12. What is the difference between scrolling a table horizontally and vertically..??
Ans. In table control when you scroll a table vertically presentation server needs to call
application server to fetch the next record and display in the table while in case of horizontal
scroll there is no need to call application server.
Ans. A group that combines several fields fewer than one name, at runtime, the INSERT
command is used to define which data fields are assigned to which field group are called Field
Groups. It should always be a HEADER field group that defines how the extracted data will be
sorted; the fields grouped under the HEADER field group sort the data.
ii. Field group is old method of creating a array processing.. Like the internal tables..From help..
A field group combines related fields together into a meaningful unit. It provides you with a
preselect ion, so that you do not have to search through all fields of a data source just to
produce a simple list.
This means that the end-user only has access to precisely those fields assigned to a field group.
Fields must be assigned to a field group before they can be used in queries.
RFC is Remote Function call so it can’t access the values with Pass by reference.
Ans: Select single fetches first matching record. If more than one matching records are there
then only the first matching record will be considered other records will not be taken into
account. (It is based on primary key).
Whereas select up to 1 rows will fetch all the matching records from the database.(Again it
will assign only One Record to the internal table/Work area).(it is based on all records).
Ans2: Select Single * will pick up only one matching record from the database into the buffer,
and returns the same to the internal table.
Select up to 1 row will pick up all the records matching the condition into the buffer, but
return the top record to the internal table.
Ans: Chain and end chain are used for multiple field validation in Module pool programming .It
is written inside the screen flow logic.
Ans: SE38 –> Utilities –> Settings –> ABAP Editor –> Debugging
Activate the external debugging and choose the New Debugger option in ABAP debugger.
Go to the particular place in the code and put break point, pop will appear then choose the
HTTP break point.
If you are triggering the RFC from SAP portal make sure that both the user ID should be same
If the users are different then provide the XI/Portal User ID in the user’s field.
Ans: User exit is for single implementation and it is procedural approach while BADIs are for
multiple implementations and object oriented approach.
Multiple implementations means Reusability… because we use OOPS Concepts for BADI.
1. AT-FIRST: This is used when we want to execute the statements before records are processed.
2. AT-NEW: This event is used when we want to execute the statement before group of records
are processed.
3. AT-END: This event is used when we want to execute the statements after processing of group
of records.
4. AT-LAST: This event is used when we want to execute the statements after all records are
processed.
25.I am uploading 100 records out of which say 59th record has error so what will happen if i
am using synchronous or asynchronous method of BDC? Can we update the database using
local update mode how?
LOAD-OF-PROGRAM.
WRITE:/”HELLO”.
Ans: HELLO
(Explain the importance of LOAD-OF-PROGRAM Event. If you don’t know Tell the interviewer as
this event is used in such cases when you want to clear sum buffers or something Before calling
that Program)
Ans. TMG stands for Table Maintenance generator. It is a tool available in abap by which we can
add or delete multiple records at a time and it is executed or triggered by the transaction code
SM30.
Ans. The main difference between select option and Ranges is that ranges implicitly or
automatically creates internal table with fields like OPTION, LOW, HIGH, SIGN, etc.
When u declares select options it will implicitly declare an internal table (ranges) for you.
The only need of declaring ranges is when you r not taking input from the user but you want
make limit based selection at that time it will be use full e.g. SELECT ** from ** where MATNR
in val_range.
Method 1:—
a) Create a subscreen area in your screen layout where you want to create the select options.
b) In the top include of your module pool program declare a selection screen as a subscreen e.g.
c) In the PBO and PAI of the main screen where the select options needs to be created do a call
subscreen of the above screen (100).
This CALL SUBSCREEN statement is necessary for transport of values between screen and
program.
Note: All validations of the selection screen fields e.g. the s_matnr field created above should
be done in selection screen events like AT SELECTION-SCREEN etc and not in PAI. These selection
screen validations etc should be done in the top include only.
Method 2:——-
a) Create 2 separate fields in your screen layout – one for the low value and one for the high
value. Insert an icon beside the high value which will call the multiple selections popup screen
on user command. Use function module COMPLEX_SELECTIONS_DIALOG to achieve this.
continued ……
You can use the return table rng_kunnr to populate your own internal range table with the
values entered by the user. Basically here you are just simulating the work of a select-options
parameter by module pool screen elements.
30. how we can retrieve data using secondary index. Explain with simple example
Ans: First create secondary indexes on required fields of a particular database table.
We can create one primary index and 15 secondary indexes. Once the respective secondary
indexes are created write select queries and within select queries specify secondary indexes
field name with where clause.
Line index indicates which line of Table control is to be use for BDC transaction
Indicates 1st line of table control is going to be used for transaction which is Line index of Table
Control
32. If i want to execute a BDC program only in background not in foreground is there any
option for this?
Ans. The sm37 transaction can be used for running a program in the background. Also in the
session method while processing the session you can specify the processing type as background
or foreground.
Ans. For up loading text file we use the pre-defined FM gui_upload. in that FM we have the
parameter has_field_seperator for that we assign the default delimiter ‘x’.
HAS_FIELD_SEPERATOR ‘X’
‘X’ can provide the Whatever delimiter we used in flat file for separation.
Ans. In every organization sap landscape involves three servers viz, Development server, Quality
server and Production server. Whatever new development we do as per clients requirement is
done in development server. Later to test the developed object we move it to quality server for
testing and finally once everything goes clear then the object is moved to production server,
production server data is ready for final business use.
(Common Man Workbench request holds the Program, FM etc…. How it can be Client
Dependent!!!!)
Ans. Workbench (ABAP Dev) request is client independent when you import it into one system
it reflect it in all client in same system.
But customized request has to import in that client particular client where it is created, actually
it is client dependent.
Ownqs:--
Different types of DB tables?
Transparent Table: Exists with the same structure both in dictionary as well as in
database exactly with the same data and fields.
Pooled Table: Pooled tables are logical tables that must be assigned to a table pool when they
are defined. Pooled tables are used to store control data. Several pooled tables can be
combined in a table pool. The data of these pooled tables are then sorted in a common table in
the database.
Cluster Table: Cluster tables are logical tables that must be assigned to a table cluster when
they are defined. Cluster tables can be used to store control data. They can also be used to
store temporary data or texts, such as documentation.
Q. Could anyone tell me what is the major difference between Standard tables, Pooled tables
and Clustered Tables?
A transparent table is a table that stores data directly. You can read these tables directly on the
database from outside SAP with for instance an SQL statement.
Transparent table is a one to one relation table i.e. when you create one transparent table then
exactly same table will create in data base and if is basically used to store transaction data.
A clustered and a pooled table cannot be read from outside SAP because certain data are
clustered and pooled in one field.
One of the possible reasons is for instance that their content can be variable in length and build
up. Database manipulations in Abap are limited as well.
But pool and cluster table is a many to one relationship table. This means many pool table store
in a database table which is known as table pool.
All the pool table stored table in table pool does not need to have any foreign key relationship
but in the case of cluster table it is must. And pool and cluster table is basically use to store
application data.
Table pool can contain 10 to 1000 small pool table which has 10 to 100 records. But cluster
table can contain very big but few (1 to 10) cluster table.
For pool and cluster table you can create secondary index and you can use select distinct, group
for pool and cluster table. You can use native SQL statement for pool and cluster table.
A structure is a table without data. It is only filled by program logic at the moment it is needed
starting from tables.
A view is a way of looking at the contents of tables. It only contains the combination of the
tables at the basis and the way the data needs to be represented. You actually call directly upon
the underlying tables.
Ans. Include structure allows to add one or more structure into structure or table. Also placed
positioning anywhere. Up to 6 include structure can be used in a table.
Append structure can be placed only at the end of a structure or table which also stops
further insertion of fields. Only one append structure can be used.
Ans2. 1. Append structure: it will add Fields to the table from last. We can't use that structure
in another table.
2. Include structure: we can add fields in middle. We can use include structure in more than
one table.
Whereas include structure can be used more than one time in a table
2) Pooled table: it is the imaginary table which is used to store the temporary data
3) Clustered table: It is also imaginary table which is used to store the temporary
Contain a single table. They are used to hold a They are used to hold
Used to store master large number of very data from a few number
data small tables(stores of large tables.(stores
customizing data or system data)
system data)
For each transparent It is stored with other Many cluster tables are
table there is one pooled tables in a single stored in a single table
associated table in the table called table pool in the database called a
database in the database table cluster
The database table has The database table has The database table has
the same name, same different name, different name, different
number of fields and different number of number of fields and
the fields have the same fields and fields have fields have different
names different names names
There is only a single Table pools contain Contains less tables than
table more tables than table table pools
clusters
Single table can have Primary key of each Primary key of each
one or more primary table does not begin table begins with same
key with same fields or fields or fields
fields
USE: They are used to USE: They reduce the USE: They would be
hold master data e.g. amount of database used when the tables
Table vendors or table resources needed when have primary key in
of customers. Example many small tables have common and data in
of transaction data is to be opened at the these tables are all
orders placed by same time accesses simultaneously
customers
Difference b/w pooled and cluster tables?
Ans. pooled tables: these r small tables having 100 records in each of them! But, these
tables were used for storing the system data! in these tables there will be no keys! These tables
r having many - to - one relationship! These tables r having different names which doesn’t
match with database tables.
cluster tables: these r very large tables so many records in each of them! But, these tables were
used for storing the system data! in these tables at least one primary key will be present to find
the record! these tables r having many - to - one relationship!
these tables were used by basis people to calculate the system performance!
Delivery class: it controls the transport of the data from one system (Ex: Development) to
another system (Ex: Testing).
APPL0: master data (frequently read, rarely updated. Ex: vendor & customer details).
APPL1: transaction data (frequently read & frequently updated. Ex: material prices,
no.of.items).
APPL2: Organization data: (rarely updated. Ex: company name, logo).
Search help?
it is used to display the list of all possible input values for a screen field to give as an
input to the table.
2) Collective Search help: it is the combination of different elementary search helps. In this, all
possible input values will be extracted from multiple (Different) tables And displayed as an
input
Lock Object?
it is used to provide the protection for the database table and also to avoid the
inconsistence at the time of data is being read or write to DB table
Whenever lock object applies on a table, two function modules will work.
Those are 1) ENQUE: It is used to lock the table while a command is working on table
2) DEQUE: It is used to unlock the table after command working is complete
it is an SAP provided option to enter(create) multiple records(data) into the table and to
modify the existing data and to delete the existing data(one or multiple records tcode:SM30).
Note: parameter should be filled while passing to the select statement to extract the data
SELECT-OPTIONS: it is a key word which accepts single value, multiple single values
Single ranges and multiple single ranges.
In order to avoid nested select statements we can go for "FOR ALL ENTRIES". First fetch
values from database table to internal table and only for the values in the internal table we can
fetch values from other database table based on conditions in the where clause.
it is mandatory that we have to declare all the primary keys in either select Stmt or in where
condition. or else duplicate records will not get selected.
Internal table: it is used to hold the multiple records and it is a temporary storage location in
application server. i.e. The data inside an internal table was not saved anywhere in SAP.
Internal tables are dynamic memory storage locations and hence need not to provide the size.
Or
Syntax:
Data: <int_tab> like STANDARD table of <wa>.
Syntax:
Data: <int tab> like SORTED table of <wa> with UNIQUE/NON-UNIQUE KEY <F1>.
Syntax:
Data: <int tab> like HASHED table of <WA> WITH UNIQUE KEY <F1>.
INITIALIZATION TECHNIQUES:
These techniques are used to initial (empty) the WA and int table
1) CLEAR: it is used to clear the content of the work area.
Syntax: CLEAR <WA>.
2) REFRESH : it is used to clear the content of the internal table
Syntax: Refresh <int name>.
3) FREE: it is used to clear the content of the internal table and memory allocated to int table.
Syntax: Free <int table>.
READ is the key word to get a single record from the internal table into WA or variable with key
combination.
Syntax:
READ TABLE <int table> INTO <wa> WITH KEY <Condition> .
Or
READ TABLE <int table> INTO <wa> WITH KEY
<Condition> BINARY SEARCH.
Note: int table need to be sorted when BINARY SEARCH is used for standard table or hashed
table.
To decide on which to implement, consider whether you need the content to be used just for a
limited program
or wheteher it can be called from many independent programs.
For the first purpose it is better to implement a form whereas for the second we implement an
FM.
--Classical reports are normal reports. These reports are not having any sub reports. IT IS
HAVING ONLY ONE SCREEN/LIST FOR OUTPUT.
--Interactive report: we can generate 1 basic list and up to 20 secondary lists. User interaction
will be there. If u clicks on particular field in basic list it will go to secondary list. Easy to analyze
the report.
Ans1. Events in Classical report Events associated with classical report are as follows and each
one will be discussed in detail.
1. INITIALIZATION: this event triggers before the selection screen. It is used to select the
default values in selection screen.
2. AT SELECTION-SCREEN: this event trigger after giving the input and before leaving the
selection screen. It is used to validate the given input in the selection screen.
3. AT SELECTION-SCREEN ON
4. START-OF-SELECTION : this event trigger after leaving the selection-screen and before
extracting data. It is used to extracting data.
5. TOP-OF-PAGE : it will trigger at top of each page .is used to provide header information.
6. END-OF-SELECTION :this is used processing the data and display the data.this will trigger
after extracting the data before processing the data.
7. END-OF-PAGE : this will trigger at end of each page. This used to provide the footer
information.
AT LINE-SELECTION: It will trigger when ever user double click on any record of any list.
Advantage: It is used to pass the list number on which double clicked to the next list.
AT USER-COMMAND: It will trigger when we click on any menu items.
AT PF-STATUS: it will trigger when we click on any function keys
TOP-OF-PAGE DURING LINE-SELECTION: it will trigger at the top of secondary list
Advantage: it is used to provide the header in the secondary list.
Ans1. Hide: it will stores the selected values in a temporary storage area. When using hide if we
click anywhere (ex: blank spaces also) in the basic list it will displays the secondary list. This is
the main disadvantage with hide.
HIDE wa_kna1-kunnr.
Get cursor: when using the get cursor if we click on the particular field it will display the
secondary list.
Ans2.HIDE is used generally when you want to display secondary lists in your output before
using write statement. The field which is used in hide statement is used to display the output in
the secondary lists.
Get cursor is used for referring all the fields of an internal table.
You use type groups to store user-defined data types or constants in the ABAP Dictionary for
cross-program use.
In your ABAP program, you declare type groups with the TYPE-POOLS statement as follows:
Syntax
TYPE-POOLS <name>.
This statement allows you to use all the data types and constants defined in the type group
<name> in your program. You can use several type groups in the same program.
You maintain type groups either by choosing Tools ABAP Workbench Development ABAP
Dictionary or directly from your ABAP program.
INCLUDE,
TYPES,
TYPE-POOLS,
CONSTANTS,
--Type pool SLIS is used in ALV as all related data types are defined in type pool
Parameters:
I. Export :
i. I_callback_program : report id
ii. I_callback_pf_status_set : routine where a user can set his own pf status or change the
functionality of the existing pf status
vi. It_fieldcat : internal table with the list of all fields and their attributes which are to be printed
(this table can be populated automatically by the function module
REUSE_ALV_FIELDCATALOG_MERGE
vii. It_events : internal table with a list of all possible events of ALV and their corresponding
form names.
II. Tables :
REUSE_ALV_GRID_DISPLAY: A new function in 4.6 version, to display the results in grid rather
than as a preview.
II Changing
ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is declared in the type
pool SLIS.
Parameters :
I. Import :
Et_Events : The event table is returned with all possible CALLBACK events
for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM'
field must be filled. If the field is initialized, the event is ignored. The entry can be read from the
event table, the field 'FORM' filled and the entry modified using constants from the type pool
SALV.
II. Export :
I_List_type :
0 = simple list REUSE_ALV_LIST_DISPLAY
1 = hierarchcal-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY
2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND
3 = hierarchical-sequential block list
REUSE_ALV_BLOCK_LIST_HS_APPEND
REUSE_ALV_HIERSEQ_LIST_DISPLAY
Parameters:
I. Export:
i. I_CALLBACK_PROGRAM
ii. I_CALLBACK_PF_STATUS_SET
iii. I_CALLBACK_USER_COMMAND
iv. IS_LAYOUT
v. IT_FIELDCAT
vi. IT_EVENTS
vii. i_tabname_header : Name of the internal table in the program containing the
output data of the highest hierarchy level.
viii. i_tabname_item : Name of the internal table in the program containing the
output data of the lowest hierarchy level.
ix. is_keyinfo : This structure contains the header and item table field
names which link the two tables (shared key).
II. Tables
Important Attributes :
G. icon(1) : icon
H. symbol(1) : symbol
I. checkbox(1) : checkbox
K. do_sum(1) : sum up
S. datatype : datatype
T. hotspot(1) : hotspot
1. USER_COMMAND
2. TOP_OF_PAGE
3. PF_STATUS_SET
4. TOP_OF_LIST
5. END_OF_PAGE
6. END_OF_LIST
7. SUBTOTAL_TEXT
what is slis_t_fieldcat_alv?
slis_t_fieldcat_alv : This internal table contains the field attributes. This internal table can be
populated automatically by using ‘REUSE_ALV_FIELDCATALOG_MERGE’.
LSMW:
The LSM Workbench is an R/3-based tool that supports single or periodic data transfer from
your non-SAP system to R/3
Yes. The data is loaded via the standard interfaces of the applications. This will include all checks
that are run for online transactions. Invalid data will be rejected.
Can I be certain that conversions are carried out identically across the applications?
Yes. The LSM Workbench works on the principle of central (reusable) rules. This approach
guarantees that, for example, the material number is converted in the same way wherever the
reusable rule is used for conversion.
No. The LSM workbench provides the main conversion techniques at the push of a button. For
complex conversions, individual ABAP coding can be added.
No. Business objects such as material master, customer master or FI document are migrated
Yes. The LSM workbench can read the data directly from your PC. Only when using the periodic
interface, the data has to be on a server accessible by R/3
No. The LSM Workbench can be downloaded for free from SAPNET:
http://service.sap.com/LSMW
No. The LSM Workbench is available free of charge to SAP’s customers and partners
Yes, but:
BDC(scn)
1)What is BDC ?
14)What is bapi?
17)for uploading master data(ex:customer data) into sap, which methods you prefer? call
transaction/session/lsmw/bapi? why?
Answers.
1 BDC is used to upload the data from the legacy system to SAP
Syntx is: CALL TRANSACTION T_CODE USING BDCDATA MODE 'N' UPDATE 'S' MESSAGES INTO
MESSTAB
3) Session method is one of the method in BDC,, we use the Function moduels in this one,
BDC_OPEN_GROUP, BDC_INSERT and BDC_CLOSE_GROUP.
4) Session method.
6) Direct i/p method Consistency checks are executed by function modules.Its performance
wise better then batch i/p and call tarnsaction bcoz both the above methods Consistency Check
are executed with the help of screen logic.
7) In LSMW, we do not write that much of code, and the code will be generated bu system just
can run the program by using the Mouse
8) http://www.sapbrain.com/TOOLS/LSMW/SAP_LSMW_steps_introduction.html
11) synchronous means it will update the records directly when the both servers are up, in the
asynchronous mode, it will update the data when the server is up
15) BAPI will update the Database directly where as the call transaction method/ session
method will go and insert the records in the transaction
16) BAPI is used only when it is available for the particular transaction like Delivery Sales order.
but BDC can be used for any transaction which have screen and fields.
BAPI is directly updated the database instead BDC run through the screen flow. So BAPI can't
handle all the flow logic checking and enhancement put by programmer to faciliate the user
requirement.
17) LSMW is better
18) Goto BAPI Transaction code and see the BAPI's there
----------------------
1. Can we write the code both call transaction and session method in single program?
Ans. Yes it is possible to write call transaction and session in one program.
Ans. If we want to transfer large amount of data and when we need to use more than one
transaction code we prefer session method. For small or less amount of data and for single
transaction use call transaction.
(This is more generic answer but you can add more on to this if you have worked on BDC)
Ans. When we need to update medium amount of data we use LSMW. LSMW is also used when
the person like functional consultant has less programming language.
Ans: Module pool programs are created in abap development work bench (TCODE: SE80).
Module pool programs are also called dialog programs.
The module Pool are reports prepared for different screens and to manage the sequence
of events of these screens, in the transaction SE80 you can see all the dynpros that you have for
this kind of report, add new ones, add all types of element to the report.
Process before Output is the part of the dynpro code that is processed before the user can do
anything with the data in the screen
Process after Input is the part of the dynpro code that is processed after the interaction with the
user.
No batch input processing log Detailed Log will be generated for all the
sessions
While execution it starts from the first. While executing it won’t start from the first. It
will start from the place where it ends with
error.
When you work with the operating systems UNIX or WINDOWS NT, you can send an operating
system command with the statement OPEN DATASET. To do so, use the option FILTER
To receive the operating system message after trying to open a file, use the MESSAGE option of
the OPEN DATASET statement
To close a file on the application server, use the CLOSE DATASET statement
To delete a file on the application server, use the DELETE DATASET statement
To write data to a file on the application server, use the TRANSFER statement
To read data from a file on the application server, use the READ DATASET statement
What is BDC_OKCODE ?
The command field is identified by a special name in batch input called BDC_OKCODE. This
name is constant and always identifies the command field.
The data in BDC tables is saved by using the field name ‘BDC_OKCODE’ and field value of ‘/11’
Synchronous update: is used to no transaction is stored until the previous transaction has been
written into the sap database.
Asynchronous: is used to the program is need not wait for the previous transaction. Any kind of
transaction is stored into the database.
Errors while updating the database using call transaction technique are trapped using a
structure bdcmsgcall, whose field msgtyp become ‘e’ when an error record is encountered.
Those records are formatted using format_message function call in the desired format and
stored in an internal table for listing of all error records in one shot.
BDC stands for Batch Data Communication, Through BDC you are going to update
screens.
BAPI stands for Business Application Programming Interface. Through bapi you are going
to update Data Base Tables directly.
Whenever screen of a particular transaction changes, you need to redo the work in case of
BDC.
Whereas in case of BAPI SAP will take care as it will update the Database Tables Directly.
BAPI is directly updated the database instead BDC run through the screen flow.
So BAPI can't handle all the flow logic checking and enhancement put by programmer to
facilitate the user requirement.
BAPI is a higher end usage for transferring the data from SAP to non-SAP and vice-versa. for
ex: if we are using VB application, where in that we want to connect to SAP and retrieve the
data, and then change and update the data in SAP for that purpose we can use that.
There is one more advantage using BAPI instead of BDC. When we go for up gradation, there
might be possibility to change the screen elements for transactions depending on the
requirement.
In that case, our BDC program may or may not work (depending on the screen changes they
have made).
BAPI is used only when it is available for the particular transaction like Delivery Sales order. but
BDC can be used for any transaction which have screen and fields.
The Business Object Repository (BOR) is the central access point for the SAP business object
types and their BAPIs. The BOR contains all the relevant information on the SAP business object
types, their key fields, and their BAPI methods that are needed to integrate the correct object
type definitions and BAPI calls in an application program. This makes the integration of
middleware (such as the DCOM Connector, ActiveX Controls, CORBA Gateway, and so on)
possible.
Creates instances of SAP business objects. The runtime environment of the BOR receives
requests to create runtime objects from client applications and creates the appropriate object
instances.
A business object type, which represents of a business entity in the SAP R/3 System,
encompasses both the functionality (in the form of methods) and the data (in the form of
attributes) of this entity. The implementation details of the business object type are hidden
from the user. The business object type is accessed through defined functions (methods). This is
referred to as encapsulation.
Business object types form the point of entry to the data and the functionality of the SAP R/3
System. At the business object type level, both non-SAP systems and the various SAP business
components can communicate with each other.
The business object type SalesOrder represents a customer’s request to
the company to supply a particular quantity of material at a certain point in time or to perform
services at a certain point in time. A specific sales order is identified by a sales document
number. The business object type contains all the necessary information for a sales order: sold-
to party, sales organization, document date, net value of the order, and currency of the sales
and distribution document.
41. Tell any 2 standard Bapi function modules used for uploading sales order data?
1. BAPI_SALESORDER_CREATEFROMDAT2
2. Bapi_salesorder_getstatus
3. BAPI_CUSTOMER_CREATEFROMDATA
4. BAPI_PROJECT_MAINTAIN
5. BAPI_COMPANYCODE_GETLIST
6. BAPI_COMPANYCODE_GETDETAIL
7. BAPI_CUSTOMER_GETDETAIL2
8. BAPI_PO_CREATE
9 BAPI_PO_getdetail
10. BAPI_MATERIAL_GET_DETAIL
BAPI is a remote enabled function module i.e. it can be accessed from anywhere and from any
system, where as a normal function module can't.
* BAPI perform accurate validation checks,
Each BapiObject has Interface, Key Fields, Attributes, Methods and Events.
Bapi Function Modules can be attached to these Bapi objects.
Function module has a single bound functionality
While a BAPI object can contain many functionalities.
Commit is the thing which saves the changes you made to the database .it is an interface
technique it is a direct input method.
for example you have inserted some data into one table by using this BAPI technique but you
not done the Commit BAPI then what happens is the changes u made to the database cannot
been seen in the table these will get effective once u have Done the Commit BAPI
Rollback
see by taking the above example only we can know what is Rollback it is nothing but UNDO
option in ms office se until saving if we want one step back we will do it by undo option am i
right.
similalry until commit in i.e. nothing until saving the changes made u can delete the modified
change .
call function 'BAPI_PO_CREATE1'
'....................
After that
if u want to do commit , just add this statement.
COMMIT WORK.
if u want to do roll back , just add this statement
ROLLBACK WORK.
BADI?
Object: To create a BADI implementation for CS01 transaction, that does not allow user to
create alternative BOMs for already created BOM.
Approach: If an alternative BOM is created, the field STLAL from MAST table will be increased
by 1. We can control future creation of BOM using this field by writing the condition. i.e before
updating to MAST table we need to write the condition to stop duplicate BOM
So need to identify the correct badi (Location) in which we write the condition
Identify all the badi of this application CS01 using CL_EXITHANDLER class using SE24 t.code .
1. A user exit is considered a modification, since technically objects in SAP namespace are
modified. Customer exits do not affect standard SAP source code.
2. User Exits are forms (in the SAP Standard Includes) and are called by SAP standard programs
using perform.
Customer Exits are functions so they are called using call function (or more exactly Call
customer function).
3. Inside the form (user exit) you can read and change almost any global data from host
program.
Inside a function (customer exit) you can only access your import/export/changing/tables
parameters.
4. User exits are more flexible because you have more information to use in your code but on
the other hand, it is very easy to manipulate erroneously global data and lead the standard
program to a dump or even to make database inconsistent.
Customer exits are more restrictive but you are sure any change you can make to any
parameters will never lead to inconsistency.
1.USER EXITS are FORMS and are called by SAP standard programs using
PERFORM(subroutines).
CUSTOMER EXITS are FUNCTIONS so they are called using CALLFUNCTION (function modules)
2.Inside the form (user exit) you can read and change almost any global data from host program.
Inside a function (customer exit) you can only acces your import/export/changing/tables
parameters.
3.User exits are more flexible because you have more information to use in your code but on
the other hand , it is very easy to manipulate erroneously global data and lead the standard
program to a dump or even to make database inconsistent.
Customer exits are more restrictive but you are sure any change you can make to any
parameters will never lead to inconsistency
4.User-exit doesn’t have any classification.
In customer-exit we have function-module exit, screen exit, menu exit.
5. User exits are basically designed For SD module.
Customer exits Are available for MM,SD,FI,HR€¦..Basically Designed for all modules.
Making enhancements using the transactions SMOD/CMOD has The following disadvantages:
Advantages of BAdI
SMOD is used to identify the EXIT and CMOD is used to implement the exit using project
45. I have created a script in language DE. Now I need to translate it to EN. How could I do
this?
Open your script in transaction SE71.
In the Header screen, in the Language Attributes Option, choose Translate to... Option to
translate to other languages.
46. How can I copy SAPScripts from one client to another?
In the transaction SE71, enter the Form name and choose the menu, Utilities->Copy from client
to copy SAPScripts from one client to another.
Use RSTXSCRP to import/export SAPScripts.
first way is go to SE 71 and from menu bar select Utilities->activate debugger .then go to SE38
execute the print program ,it automatically goes to debugging mode …..
The other way is, run the program RSTXDBUG in SE 38. Execute it. A message will show that
debugger is activated. Now open the print program in SE 38 …u will notice that the print
program is automatically diverted to debugging mode.
Ans. page window is nothing but a container of a page ,which uniquely identifies a set of data …
for example while creating invoice …we create logo window , billing document header window ,
customer window , terms and condition window etc …
22. Why sap scripts are client dependent and smart forms are client independent?
Ans-: Smart forms create its own function module so it doesn’t need to transport the request
through SCC1.As all the Development Object are stored in client independent tables.
Whereas Script doesn’t generate any function module while executing so we need to
transport the request number through SCC1.Sap script is stored inside the client depended
table as a TEXT. So sap scripts are client dependent and smart forms are client independent.
VIEWS:
Data about an application object is often distributed on several tables. By defining a view, you
can define an application-dependent view that combines this data. The structure of such a view
is defined by specifying the tables and fields used in the view. Fields that are not required can
be hidden, thereby minimizing interfaces. A view can be used in ABAP programs for data
selection.
The data of a view is derived from one or more tables, but not stored physically. The simplest
form of deriving data is to mask out one or more fields from a base table (projection) or to
include only certain entries of a base table in the view (selection). More complicated views can
comprise several base tables, the individual tables being linked with a relational join operation.
See also Join, Projection and Selection.
The base tables of the view must be selected in the first step of a view definition. In the second
step, these tables must be linked by defining the join conditions. It is also possible to use the
join condition from a foreign key defined between the tables (see Foreign Key Relationship
and Join Condition). In the third step, you must select the fields of the base tables to be used in
the view. Selection conditions that restrict the records in the view can be formulated in the
fourth step.
Four different view types are supported. These differ in the way in which the view is
implemented and in the methods permitted for accessing the view data.
Database views are implemented with an equivalent view on the database.
Projection views are used to hide fields of a table (only projection).
Help views can be used as selection method in search helps.
Maintenance views permit you to maintain the data distributed on several tables for
one application object at one time.
Database views implement an inner join. The other view types implement an outer join (see
Inner and Outer Join).
The join conditions for database views can be formulated using equality relationships between
any base fields. The join conditions for the other view types must be obtained from existing
foreign keys. Tables therefore can only be combined in a maintenance view or help view if they
are linked to one another with foreign keys.
The maintenance status defines whether you can only read data with the view or whether you
can also insert and change data with it.
6. Performance techniques?
Ans.
2. During writing select query write all fields in sequence as per database table.
4. Use st05 SQL trace, se30 run time analysis, code inspector, slin, etc.
7. Use binary search but before using binary search sort that table.
ALE/IDOCS:
When you restart processing of a failed IDoc in BD87 you only deal with this failed IDoc.
If you open an existing IDoc in WE19 and process it again you create a new IDoc.
Use transaction WE19 to test inbound function module in debugging mode. Also use WE05 to
view the IDocs and their statuses.
In WE19 you can process only one idoc at a time, whereas in BD87 you can process any number
of idocs.
In WE19 a new idoc number gets generated every time you process on idoc.
P.S: Please do not use we19 for reprocessing. It is only for testing and debugging purposes.
The test tool is a two-step process. In the first step, you create an IDoc by using one of the
following options:
The option you choose depends on your tastes and program requirements. The first option is
most commonly used because it enables you to modify an existing IDoc (inbound or outbound)
to suit your needs.
In the second step, the IDoc created is passed to the inbound process. You have several options
to select the method of starting the inbound process :
Start the inbound processing via the standard path. This method uses all inbound components.
Call the inbound function module directly. The system bypasses the checks for partner profile
and hands the IDoc data to your inbound function module directly. This method is useful for
testing an inbound process without having to maintain any inbound configuration. You can also
start the function module in debug mode and select the processing option for your posting
module.
Save the IDoc in a file, and start the inbound process. This method is similar to the first method
except that you also create an IDoc file at the operating system level. This method is used
mainly for EDI processes.
IDOC BAPI
IDocs are text encoded documents with a rigid structure that BAPIs are a subset of the RFC-enabled function modules,
are used to exchange data between R/3 and a foreign system especially designed as Application Programming Interface
(API) to the SAP business object, or in other words: are
function modules officially released by SAP to be called
from external programs.
Idocs are processed asynchronously and no information BAPIs are called synchronously and (usually) return
whatsoever is returned to the client, information
The target system need not be always online. The IDOC whereas for BAPIs the client code needs to do the
would be created and would send the IDOC once the target appropriate error handling.
system is available (tRFC concept). Hence supports
guaranteed delivery
With asynchronous links the sub-process on the client can be Problems with synchronous links occur if the
finished even if the communication line or the server is not communication line or the server is temporarily not
available. In this case the message is stored in the database available. If this happens, the sub-process on the client
and the communication can be done later cannot be finished (otherwise there would be data
inconsistencies).
The disadvantage of asynchronous links is that the sub- Synchronous links have the advantage that the sub-process
process on the server cannot return information to the calling on the server can return values to the sub-process on the
sub-process on the client. A special way for sending client that has started the link.
information back to the client is required. In addition, a
special error handling mechanism is required to handle errors
on the receiving side.
Just go to SE16 Transaction -> enter table name EDIFCT -> enter Idoc type ORDERS05 -> here
you can see list of FM
01 – Idoc created
30 – ready to dispatch
03 – Dispatched successfully
50 – Idoc reached
51 – Error in ale
68 – Idoc deletion
69 – Idoc is edited
FM’s in idocs?
Idoc filtering ?
ALE IDocs in SAP is a lot about configuration and a lot about Tcodes . So if you have worked on
at least one end to end scenario in ALE IDocs in SAP , you probably already have answers to a
lot of questions.
Cheers!!
But if you haven't , make sure you do this exercise. There are plenty of step by step guides to
ALE IDocs available on the internet . Make sure you read one understand it all the way . Sending
IDoc from client 800 to say client 810 on the same server is easy . If possible ,Try an exercise in
which you send an IDoc from one system to another system.
Application layer refers to the application data ( SD , MM , FI or data for any SAP application ) .
In this layer the data is collected to be distributed and then sent to the distribution layer.
Distribution layer determines to whom should the data generated by the application layer has
to be distributed i.e. it is in the distribution layer that the recipient is determined, the data is
formatted or filtered and then an actual is created.
Communication layer takes the responsibility of delivering the Idoc to the receiving system and
communicates to the receiving system via tRFC , File ports , FTP or TCP/IP etc.
EDI stands for Electronic Data Interchange. It refers to the electronic exchange of business data
in a structured format between two systems. The EDI subsystem generally converts the Idoc
data into one of the many EDI formats and generates an EDI file in an X12 format. The
middleware then translates the X12 file to an IDOC format and the IDOC is sent to the SAP
system.
An IDoc (Intermediate document) is a vehicle that is used to transfer data from one system to
another.
IDoc is not a technology of some sort , but it is just a container that holds data .
It holds data in a structured format i.e. in the Fields of the Segments.
The transaction code to view an IDoc type (Basic and extension) is WE30.
Examples: ORDERS04, DEBMAS04, MATMAS04, CREMAS04.
These are all SAP standard Basic IDoc Types.
You can even have an IDoc extension in which you can use the existing Basic IDoc type and add
extra segments and fields to it. Usually we extend an IDoc when the standard SAP IDoc type is
not able to cater to the business process.
Question 4: What are the types of records in SAP ALE Idocs and where is this information
stored?
Question 5: What is an Idoc status? What are the different types of Idoc statuses that you
know ?
When an IDoc is sent from one system to another, it goes through various stages. The IDoc
status indicates the stage that the Idoc in currently in.
There about 75 IDoc statuses. There is no way you can remember those all .
Don't even try to ! You will probably remember only those on which you have worked .
01 IDoc generated
02 Error passing data to port
03 Data passed to port OK
A port is a communication channel through which Messages can be sent or received in SAP .
The sender and the receiver both specify the port through which they will communicate.
The common port types are the TRFC Port and the File Port.
If both sender and receiver mention TRFC ports, data is exchanged via RFC connections.
If however, a file port is mentioned, the IDOC is written in a flat file at the specified location at
the sender system. Then a FTP transfer should be done from that location to the receiver system
or a Middleware that will send the file to the receiver system.
Question 7: What is a Message type and Idoc Type? What is the difference between Message
type and an IDoc type?
A Message type and an IDoc type are closely related . In fact, you will find that a
Message type is always associated with an IDoc type.
Whereas an IDoc type is a detailed version with all the segments and fields , a Message type is
used just to specify the kind of information that a system can send or receive to or from another
system.
So If system SAP1 has a Partner Profile where it specifies MATMAS as an outbound message
type , it just means that SAP1 can send material master data to say system SAP2.
If system SAP1 has a Partner Profile where it specifies MATMAS as an inbound message type , it
just means that SAP1 can receive material master data from say system SAP2.
What all fields can be sent and received will be specified in the IDoc type.
Some other message types: DEBMAS ( Customers), CREMAS (Vendors) belong to the Master
data.
The link between a message Type and an IDoc type is maintained in Tcode WE82.
Question 8: What is a partner profile? What are the types of partner profiles?
To be able to communicate with a partner via an IDoc interface, each system needs to
maintain a partner profile. A partner profile is a mechanism by which the system can specify
what kind of messages (message types) it can send or receive.
Partner profiles can be maintained in WE20.
I don't want to make this post too big. So, I will stop here for the time being.
=================================================
DATA DICTIONARY
3.what will happen if i use projection view and maintainence view together?
4. I created ZEMP table now i want to add more data but prev. data should not disturb how can i
do this?
=====================================================
REPORTS
====================================================
BDC
2.If u want to do bdc for xd01 explain me how will be the flow?
=================================================
user exits
1.what r enhancement points?
=====================================================================
1. When a program is created and need to be transported to production does selection texts
always go with it? if not how do you make sure?
Ans: This is the very common problem faced by most of the ABAPers.
When you create a report for the first time, you can see it as 'PROGRAM' in SE10, which means
it includes all the report source code as well selection texts.
Fine, you transport it to Quality system from DEV, here if you transport this same req to
Production, then there won't be any problem, since all changes will go.
But, by any means you have modififed and again re-transported (without touching the selection
text, then only the source code will move (type REPS in SE10).
To avoid this pit fall just save and activate your selection text, Then this should be reflected in
SE10 with sub-object type REPT - report text.
If you have already transported the report, except the selection text, then follow the prior step
what I have mentioned.
2. What is the client concept in SAP? What is the meaning of client independent?
In commercial, organizational and technical terms, the client is a self-contained unit in the R3
system, with separate set of Master data and its own set of Tables. When a change is made in
one client all other clients are affected in the system - this type of objects are called Client
independent objects.
ii. Hi ,
now if u dont make tables client dependent then , same table data will be used by all clients ...
So making a table client dependent , u r using same database table, to store data of different
clients.
A client is a logical division of data within an SAP system. Some things, like application data are
mostly client-dependent, meaning that for example, a G/L account defined in client 123 of
system ABC is only visible in that client. Therefore if you logon to client 456 of system ABC you
will not be seeing the same database entity (if it is defined at all).
At a technical level, client dependent data simply resides in database tables that have the client
number as a key field (typically the first key field).
Multiple clients within an SAP system are often used in development, testing and training
systems - so that individuals can work in the same system (on the same codeset) but in isolation
of each other.
Very rarely will a production system have multiples clients (ignoring the internal SAP clients like
000 and 066).
ii. no, the programs are client independent because, as this software is platform independent so
any client can use any program from anywhere.
Sap scripts are client dependent and smart forms client independent.
4. Name a few system global variables you can use in ABAP programs?
5. What are internal tables? How do you get the number of lines in an internal table? How to
use a specific number occurs statement?
10. Have you used SAP supplied programs to load master data?
11. What are the techniques involved in using SAP supplied programs? Do you prefer to write
your own programs to load master data? Why?
12. What are logical databases? What are the advantages/disadvantages of logical databases?
13. What specific statements do you using when writing a drill down report?
14. What are different tools to report data in SAP? What all have you used?
15. What are the advantages and disadvantages of ABAP query tool?
16. What are the functional areas? User groups? And how does ABAP query work in relation
to these?
19. What are Change header/detail tables? Have you used them?
20. What do you do when the system crashes in the middle of a BDC batch session?
22. How do you set up background jobs in SAP? What are the steps? What are the events
driven batch jobs?
23. Is it possible to run host command from SAP environment? How do you run?
24. What kind of financial periods exist in SAP? What is the relevant table for that?
27. How do you document ABAP programs? Do you use program documentation menu
option?
33. What is screen flow logic? What are the sections in it? Explain PAI and PBO.
35. Does SAP have a GUI screen painter or not? If yes what operating systems is it available
on? What is the other type of screen painter called?
36. What are step loops? How do you program page down page up in step loops?
38. Normally how many and what files get created when a transaction program is written?
What is the XXXXXTOP program?
40. Can you call a subroutine of one program from another program?
41. What are user exits? What is involved in writing them? What precautions are needed?
42. What are RFC’s? How do you write RFC’s on SAP side?
44. How do you find if a logical database exists for your program requirements?
45. How do you find the tables to report from when the user just tells you the transaction he
uses? And all the underlying data is from SAP structures?
46. How do you find the menu path for a given transaction in SAP?
47. What are the different modules of SAP?
50. What are different ABAP editors? What are the differences?
52. Can you use if then else, perform etc statements in sap script?
53. What type of variables normally used in sap script to output data?
57. How do you backup SAPScripts layout sets? Can you download and upload? How?
59. In an ABAP program how do you access data that exists on a presentation server v/s on an
application server?
63. What has to be done to the packed fields before submitting to a BDC session?
ALV
wa_fieldcat-do_sum = 'X'.
append wa_fieldcat to it_fieldcat.
wa_sort-fieldname = 'KUNNR'.
wa_sort-tabname = 'IT_FINAL'.
wa_sort-subtot = 'X'.
append wa_sort to it_sort.