Abap
Abap
Answer
#2
A Package is Type of Development object which act as a
container to store a development objects such as screens ,
menus, function , transactions
Re: Hi To all ABAP Guru's while transporting any report program do we need to
trasnport the text elements seprately or not reuired ? if it is so how do u transport the text
elemtns ? Thanks in Advance for ur answers Answer
#1
Hi,
Re: how can we print both side in smartforms? what connects smartform to it's driver
program? in which event validation is done? Answer
#1
We can print page in both sides , By setting print mode as
'DUPLEX' in Print attributes of page node.
FUNCTION MODULE connects Smart form to its driver program.
Re: u r running a report .it is taking a long time for execution .what steps will u do to
reduce the execution time? Answer
#3
If the report is taking time to fetch data from the database
server we have to make sure that there is an optimized
"query". In order to have an optimized query we need to
write an optimized "where" conditions. That's database part.
Say example. Our program has the usage of 95% and the
database usage of 5 % then we have to see the program's
performance. Try to reduce the number of LOOP's in a program
and also try to use the logical operators where ever
necessary to reduce the size of the program . that could
solve the problem.
Performance of reports could be increased by avaioind nested
select statements. Instead use Select ... FOR ALL ENTRIES.
Re: How to compare the two tables between the two systems? what is the process if anyone
tell me please give me the answer? Answer
#2
You can use the Transaction SCMP to compare table or view
of two different systems. For this you need to have R/3
connection.
Re: we can write the select query or any code after the end of selection Answer
#1
yes , you can write.
Re: what is the use of lock object?? Answer
#2
Hi
Technicaly:
When you create a lock object System automatically creat
two function module.
1. ENQUEUE_<Lockobject name>. to insert the object in a
queue.
2. DEQUEUE_<Lockobject name>. To remove the object is being
queued through above FM.
Re: If we put Top of Page in between Start-of-selection and End-of-selection and what
happenes Answer
#1
Nothing will happen!
the run time system picks up the events always in its pre-
defined order.eventough you code any event in any order
always right event is picked and processed.
Re: What is a difference between - RETURN, EXIT, CHECK, STOP & REJECT - To
leave the processing blocks Answer
#1
STOP: This terminates the block and executes end-of selection.
EXIT: It terminates the loop processing and process the next
statements.
CHECK: It evaluates the subsequent logical expression if it
is true the processing continue with the next statement.
CONTINUE terminates the current loop pass, returns the
processing to the beginning of the loop and starts the next
loop pass,
REJECT: it terminates the current event, even from loops or
subroutines.
Re: How to get the table name from a field? NOTE:if only the field name is given in a flat
file. Answer
#2
we can find the table for a specific field from table DD03L which will contain all table names for
corresponding fields.
Re: how many times a main window can be placed on placed on the same page in a layout
Answer
#1
99 main windows we can place in same page Main00, Main01..... Main98
Re: How to deactivate the sort button from the alv output Answer
#1
goto "reuse_alv_grid_display"
Re: diff way of handling errors in call trans ans session methods Answer
#1
In call transaction, the errors can be handled by
BDCMSGCOLL Structure and its fm format_messages to display
the appropriate messages.
Re: can please tell me the differences b/w bapi & bdc? Answer
#1
bapi's are procedural and object oriented .
the main advantage of bapi's is they are also used for the
migration of data from one non-sap to sap system.
Re: 1. Driver prog & executive prog both r same ? 2. what is difference between At
selection screen & At selection out put ? 3 . what is node used in smart form ? Answer
#2
2)Answer; At selection screen event occurs while selection
screen being processed . it is used to validate the user
inputs in the selection screen
Re: What are Major differences in Smart forms and Scripts Answer
#1
SAP Script is Client Dependent, Smartforms is Client
Indipendent.
In Scripts We r unable print the Background Pictures but in
Smartform can do.
In Scripts if u want to access any data from windows we
must call the write_form for every window in Driver Program
but in Smartforms when we are activating the smartform it
automatically generates a FM, using the FM we can call all
windows data From the smartform.
In Scripts Main window is mandatary but in smartform not
necessary.
In Scripts if u want with work with Tables and Templates
long process, in smartforms very easy to work using
navigation.
Re: Which configuration we have to make first before we want to start Business Workflow
with our SAP R/3 Answer
#1
The first of all you should check the TCODE: SWU3
Then config step by step according to the tcode screen
types:begin of itab,
a type i,
b type c,
end of itab.
2.Styles and Forms - Define and print the style and layout of SAPscript form.
3. Composer or From processor - Acts as central output module to prepare final layout and text
for an output device by including styles , various formating options and the respective text.
4. Programming interface - Allows you to include SAPscript component into ABAP program and
control the output of forms from the program.
Re: can any one tell me the following question's answer 1. How can we create PUSH Botton
in presentation layer. 2.How can we print the record. 3.If database has nor records & if we
write 'for all entries' in select statement then what will be happen. Answer
#1
1.create the pushbutton in Presentation server by using the
syntax is given below.
Loop at Itab
write: itab-field.
Endloop.
3.if database has no records it will work as like this.
first up all it will check the base table if this table is
empty then it will retrive the data from the destination
table based on the condition.
Re: 1.What is the difference between append structure and include structure. 2. what is the
logging of technical setting while creating db table. Answer
#1
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.
1. What is the typical structure of an ABAP/4 program?
ANS:-
HEADER ,BODY,FOOTER.
2. What are field symbols and field groups.?
Have you used "component idx of structure" clause with field groups?
ANS:-
Field symbols:-
Field groups :-
Can any body explain me what is field group?
Field groups are groups similar fields together into one name. Field group works in conjuction
with
INSERT f1 f2 INTO fg
EXTRACT fg
SORT BY fg
LOOP ... ENDLOOP
INSERT f1 f2 INTO fg
---------------------
The insert statement is used to create a field group dynamically by inserting the field into it. Only
global data fields can be inserted and not local data fields eg : in form modules.
EXTRACT fg
----------
This will combine all the fields in the fieldgroup and write them to a sequential dataset as a
single record.
SORT BY fg
----------
Sorting of sequential dataset by field group.
LOOP AND ENDLOOP
---------------
LOOP.
AT ***
......
....
ENDAT.
AT ***
.....
....
ENDAT.
ENDLOOP. *-- Chinmaya
3. What should be the approach for writing a BDC program?
ANS:-
STEP 1: CONVERTING THE LEGACY SYSTEM DATA TO A FLAT FILE to internal table
CALLED "CONVERSION".
STEP 2: TRANSFERING THE FLAT FILE INTO SAP SYSTEM CALLED "SAP DATA
TRANSFER".
STEP 3: DEPENDING UPON THE BDC TYPE i)call transaction(Write the program explicity)
ii) create sessions (sessions are created and processed.if success data will transfer).
4. What is a batch input session?
ANS:-
BATCH INPUT SESSION is an intermediate step between internal table and database table.
Data along with the action is stored in session ie data for screen fields, to which screen it is
passed,program name behind it, and how next screen is processed.
5. What is the alternative to batch input session?
ANS:-
Call transaction.
6. A situation: An ABAP program creates a batch input session.
We need to submit the program and the batch session in back ground. How to do it?
ANS:-
go to SM36 and create background job by giving
job name,job class and job steps (JOB SCHEDULING)
8. What are the problems in processing batch input sessions?
How is batch input process different from processing online?
ANS:-
PROBLEMS:-
i) If the user forgets to opt for keep session then the session will be automatically removed from
the session queue(log remains). However if session is processed we may delete it manually.
ii)if session processing fails data will not be transferred to SAP database table.
10. What are the different types of data dictionary objects?
ans:-
tables, structures, views, domains, data elements, lock objects, Matchcode objects.
11. How many types of tables exists and what are they in data dictionary?
ans :-
4 types of tables
i)Transparent tables - Exists with the same structure both in dictionary as well as in database
exactly with the same data and fields. Both Opensql and Nativesql can be used.
ii)Pool tables & iii)Cluster tables -
These are logical tables that are arranged as records of transparent tables.one cannot use native
sql on these tables
(only opensql).They are not managable directly using database system tools.
iv)Internal tables - .
12. What is the step by step process to create a table in data dictionary?
ans:-
step 1: creating domains(data type,field length,range).
step 2: creating data elements(properties and type for a table
field).
step 3: creating tables(SE11).
13. Can a transparent table exist in data dictionary but not in the data base physically?
ANS:- NO.
TRANSPARENT TABLE DO EXIST WITH THE SAME STRUCTURE BOTH IN THE
DICTIONARY AS WELL AS IN THE DATABASE,EXACTLY WITH THE SAME DATA
AND FIELDS.
14. What are the domains and data elements?
ANS:-
DOMAINS : FORMAL DEFINITION OF THE DATA TYPES.THEY SET ATTRIBUTES
SUCH AS DATA TYPE,LENGTH,RANGE.
DATA ELEMENT : A FIELD IN R/3 SYSTEM IS A DATA ELEMENT.
15. Can you create a table with fields not referring to data elements?
ANS:-
YES. eg:- ITAB LIKE SPFLI.here we are referening to a data object(SPFLI) not data element.
16. What is the advantage of structures? How do you use them in the ABAP programs?
ANS:-
Adv:- GLOBAL EXISTANCE(these could be used by any other program without creating it
again).
17. What does an extract statement do in the ABAP program?
ANS:-
Once you have declared the possible record types as field groups and defined their structure, you
can fill the extract dataset using the following statements:
EXTRACT <fg>.
When the first EXTRACT statement occurs in a program, the system creates the extract dataset
and adds the first extract record to it. In each subsequent EXTRACT statement, the new extract
record is added to the dataset
EXTRACT HEADER.
When you extract the data, the record is filled with the current values of the corresponding fields.
As soon as the system has processed the first EXTRACT statement for a field group <fg>, the
structure of the corresponding extract record in the extract dataset is fixed. You can no longer
insert new fields into the field groups <fg> and HEADER. If you try to modify one of the field
groups afterwards and use it in another EXTRACT statement, a runtime error occurs.
By processing EXTRACT statements several times using different field groups, you fill the
extract dataset with records of different length and structure. Since you can modify field groups
dynamically up to their first usage in an EXTRACT statement, extract datasets provide the
advantage that you need not determine the structure at the beginning of the program.
18. What is a collect statement? How is it different from append?
ANS:-
If an entry with the same key already exists, the COLLECT statement does not append a new
line, but adds the contents of the numeric fields in the work area to the contents of the numeric
fields in the existing entry.
19. What is open sql vs native sql?
ANS:- by Madhukar
Open SQL , native SQL are the interfaces to create the database applicatons.
Open SQL is consistant across different types of existing Databases.
Native SQL is the database language specific to database.Its API is specific to the databse.
Open SQL API is consistent across all vendors
20. What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using it?
ANS:-
21. What is the meaning of ABAP/4 editor integrated with ABAP/4 data dictionary?
ANS:-
22. What are the events in ABAP/4 language?
ANS:-
Initialization, At selection-screen,Start-of-selection,end-of-selection,top-of-page,end-of-page, At
line-selection,At user-command,At PF,Get,At New,At LAST,AT END, AT FIRST.
23. What is an interactive report?
What is the obvious diff of such report compared with classical type reports?
ANS:-
An Interactive report is a dynamic drill down report that produces the list on users choice.
diff:-
a) THE LIST PRODUCED BY CLASSICAL REPORT DOESN'T allow user to interact with
the system
the list produced by interactive report allows the user to interact with the system.
b) ONCE A CLASSICAL REPORT EXECUTED USER LOOSES CONTROL.IR USER HAS
CONTROL.
c) IN CLASSICAL REPORT DRILLING IS NOT POSSIBLE.IN INTERACTIVE DRILLING
IS POSSIBLE.
24. What is a drill down report?
ANS:-
Its an Interactive report where in the user can get more relavent data by selecting explicitly.
25. How do you write a function module in SAP? describe.
ANS:-
creating function module:-
called program - se37-creating funcgrp,funcmodule by assigning
attributes,importing,exporting,tables,exceptions.
calling program - SE38-in pgm click pattern and write function name- provide
export,import,tables,exception values.
26. What are the exceptions in function module?
ANS:-
COMMUNICATION_FAILURE
SYSTEM_FAILURE
27. What is a function group?
ANS:-
GROUP OF ALL RELATED FUNCTIONS.
28. How are the date and time field values stored in SAP?
ANS:-
DD.MM.YYYY. HH:MM:SS
30. Name a few data dictionary objects? //rep//
ANS:-
TABLES,VIEWS,STRUCTURES,LOCK OBJECTS,MATCHCODE OBJECTS.
31. What happens when a table is activated in DD?
ANS:-
It is available for any insertion,modification and updation of records by any user.
32. What is a check table and what is a value table?
Check table will be at field level checking.
Value table will be at domain level checking ex: scarr table is check table for carrid.
33. What are match codes? describe?
ans:-
It is a similar to table index that gives list of possible values for either primary keys or non-
primary keys.
34. What transactions do you use for data analysis?
ANS:-
35. What is table maintenance generator?
ANS:-
36. What are ranges? What are number ranges?
ANS:-
max,min values provided in selection screens.
37. What are select options and what is the diff from parameters?
ANS:-
select options provide ranges where as parameters do not.
SELECT-OPTIONS declares an internal table which is automatically filled with values or
ranges
of values entered by the end user. For each SELECT-OPTIONS , the system creates a selection
table.
SELECT-OPTIONS <SEL> FOR <field>.
A selection table is an internal table with fields SIGN, OPTION, LOW and HIGH.
The type of LOW and HIGH is the same as that of <field>.
The SIGN field can take the following values: I Inclusive (should apply) E Exclusive (should not
apply)
The OPTION field can take the following values: EQ Equal GT Greater than NE Not equal BT
Between LE Less
than or equal NB Not between LT Less than CP Contains pattern GE Greater than or equal NP
No pattern.
diff:-
PARAMETERS allow users to enter a single value into an internal field within a report.
SELECT-OPTIONS allow users to fill an internal table with a range of values.
For each PARAMETERS or SELECT-OPTIONS statement you should define text elements by
choosing
Goto - Text elements - Selection texts - Change.
Eg:- Parameters name(30).
when the user executes the ABAP/4 program,an input field for 'name' will appear on the
selection screen.You can change the comments on the left side of the input fields by using text
elements as described in Selection Texts.
38. How do you validate the selection criteria of a report?
And how do you display initial values in a selection screen?
ANS:-
validate :- by using match code objects.
display :- Parameters <name> default 'xxx'.
select-options <name> for spfli-carrid.
39. What are selection texts?
ANS:-
40. What is CTS and what do you know about it?
ANS:-
The Change and Transport System (CTS) is a tool that helps you to organize development
projects in the ABAP Workbench and in Customizing, and then transport the changes between
the SAP Systems and clients in your system landscape.
This documentation provides you with an overview of how to manage changes with the CTS and
essential information on setting up your system and client landscape and deciding on a transport
strategy. Read and follow this documentation when planning your development project.
For practical information on working with the Change and Transport System, see Change and
Transport Organizer and Transport Management System.
41. When a program is created and need to be transported to prodn does selection texts
always go with it? if not how do you make sure? Can you change the CTS entries? How do
you do it?
ANS:-
42. What is the client concept in SAP? What is the meaning of client independent?
ANS:-
43. Are programs client dependent?
ANS:-
Yes.Group of users can access these programs with a client no.
44. Name a few system global variables you can use in ABAP programs?
ANS:-
SY-SUBRC,SY-DBCNT,SY-LILLI,SY-DATUM,SY-UZEIT,SY-UCOMM,SY-TABIX.....
SY-LILLI IS ABSOLUTE NO OF LINES FROM WHICH THE EVENT WAS TRIGGERED.
45. What are internal tables? How do you get the number of lines in an internal table?
How to use a specific number occurs statement?
ANS:-
i)It is a standard data type object which exists only during the runtime of the program.
They are used to perform table calculations on subsets of database tables and for re-organising
the contents of database tables according to users need.
ii)using SY-DBCNT.
iii)The number of memory allocations the system need to allocate for the next record population.
46. How do you take care of performance issues in your ABAP programs?
Performance of ABAPs can be improved by minimizing the amount of data to be transferred.
The data set must be transferred through the network to the applications, so reducing the amount
OF time and also reduces the network traffic.
Some measures that can be taken are:
- Use views defined in the ABAP/4 DDIC (also has the advantage of better reusability).
- Use field list (SELECT clause) rather than SELECT *.
- Range tables should be avoided (IN operator)
- Avoid nested SELECTS.
i)system tools
ii)field symbols and field groups.
ans:-
Field Symbols : Field symbols are placeholders for existing fields. A Field Symbol does not
physically reserve space for a field,but points to a field which is not known until runtime of the
program.
eg:- FIELD-SYMBOL <FS> [<TYPE>].
Field groups : A field group combines several fields under one name.At runtime,the INSERT
command is used to define which data fields are assigned to which field group.
There should always be a HEADER field group that defines how the extracted data will be
sorted,the data is sorted by the fields grouped under the HEADER field group.
47. What are datasets?
ANS:-
The sequential files(ON APPLICATION SERVER) are called datasets. They are used for file
handling in SAP.
48. How to find the return code of a statement in ABAP programs?
ANS:-
Using function modules.
49. What are interface/conversion programs in SAP?
ANS :
CONVERSION : LEGACY SYSTEM TO FLAT FILE.
INTERFACE : FLAT FILE TO SAP SYSTEM.
50. Have you used SAP supplied programs to load master data?
51. What are the techniques involved in using SAP supplied programs?
Do you prefer to write your own programs to load master data? Why?
52. What are logical databases? What are the advantages/disadvantages of logical
databases?
ANS:-
To 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/4 program.
adv:-
The programmer need not worry about the primary key for each table.Because Logical database
knows how the different tables relate to each other,and can issue the SELECT command with
proper where clause to retrieve the data.
i)An easy-to-use standard user interface.
ii)check functions which check that user input is complete,correct,and plausible.
iii)meaningful data selection.
iv)central authorization checks for database accesses.
v)good read access performance while retaining the hierarchical data view determined by the
application logic.
disadv:-
i)If you donot specify a logical database in the program attributes,the GET events never occur.
ii)There is no ENDGET command,so the code block associated with an event ends with the next
event
statement (such as another GET or an END-OF-SELECTION).
53. What specific statements do you using when writing a drill down report?
ans:-
AT LINE-SELECTION,AT USER-COMMAND,AT PF.
54. What are different tools to report data in SAP? What all have you used?
ans:-
55. What are the advantages and disadvantages of ABAP/4 query tool?
56. What are the functional areas? User groups? and how does ABAP/4 query work in
relation to these?
57. Is a logical database a requirement/must to write an ABAP/4 query?
59. What are Change header/detail tables? Have you used them?
60. What do you do when the system crashes in the middle of a BDC batch session?
ans:-
we will look into the error log file (SM35).
61. What do you do with errors in BDC batch sessions?
ANS:-
We look into the list of incorrect session and process it again. To correct incorrect session we
analyize the session to determine which screen and value produced the error.For small errors in
data we correct them interactively otherwise
modify batch input program that has generated the session or many times even the datafile.
62. How do you set up background jobs in SAP? What are the steps? What are the event
driven batch jobs?
ans:-
go to SM36 and create background job by giving job name,job class and job steps(JOB
SCHEDULING)
63. Is it possible to run host command from SAP environment? How do you run?
64. What kind of financial periods exist in SAP? What is the relavent table for that?
65. Does SAP handle multiple currencies? Multiple languages?
ans:-
Yes.
66. What is a currency factoring technique?
67. How do you document ABAP/4 programs? Do you use program documentation menu
option?
68. What is SAPscript and layout set?
ans:-
The tool which is used to create layout set is called SAPscript. Layout set is a design document.
69. What are the ABAP/4 commands that link to a layout set?
ans:-
control commands,system commands,
70. What is output determination?
71. What are IDOCs?
ans:-
IDOCs are intermediate documents to hold the messages as a container.
72. What are screen painter? menu painter? Gui status? ..etc.
ans:-
dynpro - flow logic + screens.
menu painter -
GUI Status - It is subset of the interface elements(title bar,menu bar,standard tool bar,push
buttons) used for a certain screen.
The status comprises those elements that are currently needed by the transaction.
73. What is screen flow logic? What are the sections in it? Explain PAI and PBO.
ans:-
The control statements that control the screen flow.
PBO - This event is triggered before the screen is displayed.
PAI - This event is responsible for processing of screen after the user enters the data and clicks
the pushbutton.
74. Overall how do you write transaction programs in SAP?
ans:-
Create program-SE93-create transcode-Run it from command field.
75. Does SAP has a GUI screen painter or not? If yes what operating systems is it available
on? What is the other type of screen painter called?
76. What are step loops? How do you program pagedown pageup in step loops?
ans:-
step loops are repeated blocks of field in a screen.
77. Is ABAP a GUI language?
ANS:-
Yes.
ABAP IS AN EVENT DRIVEN LANGUAGE.
78. Normally how many and what files get created when a transaction program is written?
using reports
Using Report: we can dispaly, insert and modify the data.Its executable program.
Dialog Programming: we can create our own screens and transactions.we can't execute directly
this.
How to convert SD data in to ABAP?
By using ALE technique
What is the difference betn field group, extract dataset, and internal table?
A field group does not reserve storage space for the fields, but contains pointers to existing
fields.> Internal take up memory. Depending on how much memory your system has . > Once
you have declared the possible record types as field groups and defined their structure, you can
fill the extract dataset using the following statements: EXTRACT. When the first EXTRACT
statement occurs in a program, the system creates the extract dataset and adds the first extract
record to it. In each subsequent EXTRACT statement, the new extract record is added to the
dataset EXTRACT HEADER. When you extract the data, the record is filled with the current
values of the corresponding fields. As soon as the system has processed the first EXTRACT
statement for a field group , the structure of the corresponding extract record in the extract
dataset is fixed. You can no longer insert new fields into the field groups and HEADER. If you
try to modify one of the field groups afterwards and use it in another EXTRACT statement, a
runtime error occurs. By processing EXTRACT statements several times using different field
groups, you fill the extract dataset with records of different length and structure. Since you can
modify field groups dynamically up to their first usage in an EXTRACT statement, extract
datasets provide the advantage that you need not determine the structure at the beginning of the
program.
what is the use of pretty printer ?
generally used to search the fields of SAP Tables . and respective data.
The 2 editors are se38 and se80 both have the abap editor in place.In se38 u can go create
programs and view online reports and basically do all thedevelopmet of objects in this editor.In
se80 ( object navigator) there are additional features such as creating packages,module pool ,
function group ,classes, programs ( where u can create ur programs)
What is the difference between following two SQL statments :
- GET table_name
- SELECT * FROM table_name.
GET IS A KEY-WORD WHICH IS USED TO GET SOMETHING ( DATA )IN THE NODES
OF A LOGICAL DATABASE DIRECTLY WHERE AS USING SELECT WE CAN SELECT
N-NUMBER OF TABLES DATA THROUGH INTERNAL TABLES IN OUR PROGRMS.
Select option work like _____________on Selection Screen ?
The system treats select-options like an internal table.<br><br>This table will have four columns
- sign high low and option.This is used to set teh attributes on the select <br>
What is the main point while using controll bareak in internal table ?
when you are using control break commands.internal table must be sorted with key field.and
control-break commands must be used in between the LOOP and ENDLOOP only.
The Precautions taken care while using Control Break Statements are:<br>1.Sort the internal
table before we use Control Break Statements.<br>2.We Must compulsory place the Control
Break Statements with in loop ....endloop.<br>EX:(Sample Code)<br>sort itab by vbeln.
What is Field sysmbol ?
You can use field symbols to make the program more dynamic. In this exanmple the name of a
table control is substituted<br>by a field symbol. Thus you cal call the form with any internal
table, using the name of the tabl?control as a parameter.
Re: How to validate the entry in Screen & dialog proframming?? Is there any way to send
the error?? Answer
#2
at PAI of screen write
CHAIN.
FIELD <field name > MODULE module_name.
ENDCHAIN
double click on module name and write the code with error
message. it'll through the message and will give the chance
to correct it.
1) Asynchronous - A
2) Synchronous - S
3) Local - L
Re: if u write a write statement after end of selection ,will that be triggered? Answer
#2
Without Stop statement also it will trigger.
End-of-selection normally triggers when all the records
have been read from database.
start-of-selection.
end-of-selection.
write : / 'endofselection'
1)
In Smartforms also have standard Forms.
Goto Smartform-> Form -> F4
You can find all the standard smartforms.
2)
Whenever you copied standard script you have to change the
configuration in NACE then it will work.
Re: what are the events in sap script print progam. Answer
#1
as SAPscript print program itself is a report program and
it does not create any secondary lists, all the events for
Basic List will be applicable here.
Initialization.
At selection-screen.
start-of-selection.
end-of-selection.
Ex:
Data : bdc_msg type table of bdcmsgcoll with header line,
bdc_tab type table of bdcdata with header line.
if sy-subrc = 0.
call function 'FORMAT_MESSAGE'.
...
..
..
Re: how to run bdc program in background? Answer
#2
1.If your using call transaction method the on the syntax
for call transaction as shown below put "N" as the option
which stands for no screens.
2. What are field symbols and field groups? Have you used "component idx of structure" clause
with field groups?
6. A situation: An ABAP program creates a batch input session. We need to submit the program
and the batch session in background. How to do it?
7. What is the difference between a pool table and a transparent table and how they are stored at
the database level?
8. What are the problems in processing batch input sessions? How is batch input process
different from processing on line?
11. How many types of tables exist and what are they in data dictionary?
13. Can a transparent table exist in data dictionary but not in the database physically?
14. What are the domains and data elements?
15. Can you create a table with fields not referring to data elements?
16. What is the advantage of structures? How do you use them in the ABAP programs?
20. What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using it?
21. What is the meaning of ABAP editor integrated with ABAP data dictionary?
23. What is an interactive report? What is the obvious diff of such report compared with classical
type reports?
28. How are the date abd time field values stored in SAP?
38. How do you validate the selection criteria of a report? And how do you display initial values
in a selection screen?
41. When a program is created and need to be transported to prodn does selection texts always go
with it? if not how do you make sure? Can you change the CTS entries? How do you do it?
42. What is the client concept in SAP? What is the meaning of client independent?
44. Name a few system global variables you can use in ABAP programs?
45. What are internal tables? How do you get the number of lines in an internal table? How to
use a specific number occurs statement?
46. How do you take care of performance issues in your ABAP programs?
50. Have you used SAP supplied programs to load master data?
Smartforms
Forcing a page break within table loop.
Create a loop around the table. Put a Command node before the table in the loop that forces a
NEWPAGE on whatever condition you want. Then only loop through a subset of the internal
table (based on the conditions in the Command node) of the elements in the Table node.
Font style and Font size
Goto Transaction SMARTSTYLES.
There you can create Paragraph formats etc just like in sapscript.
Then in your window under OUTPUT OPTIONS you include this SMARTSTYLE and use the
Paragraph and character formats.
Line in Smartform
Either you can use a window that takes up the width of your page and only has a height of 1 mm.
Then you put a frame around it (in window output options).
Thus you have drawn a box but it looks like a line.
Or you can just draw "__" accross the page and play with the fonts so that it joins each
UNDER_SCORE.
Difference between 'forminterface' and 'global definitions' in global settings of smart forms
The Difference is as follows.
To put it very simply:
Form Interface is where you declare what must be passed in and out of the smartform (in from
the print program to the smartform and out from the smartform to the print program).
Global defs. is where you declare data to be used within the smartform on a global scope.
ie: anything you declare here can be used in any other node in the form.
Smartforms function module name
Once you have activated the smartform, go to the environment -> function module name. There
you can get the name of funtion module name.
The key thing is the program that calls it. for instance, the invoice SMARTFORM
LB_BIL_INVOICE is ran by the program RLB_INVOICE.
This program uses another FM to determine the name of the FM to use itself. The key thing is
that when it calls this FM (using a variable to store the actual name), that the parameters match
the paramters in your smartform.
Another thing to note is that the FM name will change wherever the SF is transported to.
So you need to use the FM to determine the name of the SF.
Here is the code that can be use to determine the internal name of the function module:
Code:
if sf_label(1) <> '/'. " need to resolve by name
move sf_label to externalname.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = externalname
importing
fm_name = internalname
exceptions
no_form = 1
no_function_module = 2
others = 3.
if sy-subrc <> 0.
message 'e427'.
endif.
move internalname to sf_label.
endif.
It checks to see if the sf_label starts with a '/', which is how the internal names start. if it does, the
name has already been converted. If not, it calls the FM and converts the name.
You would then CALL FUNCTION sf_label.
Smartforms FAQ Part Two
Smartforms output difference
Problem with Smartforms: in a certain form for two differently configured printers, there
seem to be a difference in the output of characters per inch (the distance between
characters which gives a layout problem - text in two lines instead of one.
It happens when the two printers having different Printer Controls' if you go to SPAD Menu
(Spool Administrator Menu) you can see the difference in the Printer Control and if you make
the Printer control setting for both the printers as same. then it will be ok. and also u have to
check what is the device type used for both the output devices.
SmartForms Output to PDF
There is a way to download smartform in PDF format.
Please do the following:
1. Print the smartform to the spool.
2. Note the spool number.
3. Download a PDF file (Acrobat Reader) version of the spool by running Program RSTXPDFT4
and entering the
noted spool number.
SmartForm Doublesided printing question
Your customer wants your PO SmartForm to be able to print "Terms and Conditinos" on
the back side of each page. They don't want to purchase pre-printed forms with the
company's logo on the front and terms & conditions on the back. Now this presents an
interesting problem.
Has anyone else ever had a request like this? If for example there was a 3 page PO to be
printed, they want 3 pieces of paper, the front side of each to containe the PO information
(page 1, 2, and 3) and the back side of each piece of paper to containg the static "Terms &
Conditions" information.
Anyone have a clue how to force this out?
Easy - page FRONT lists page CONTACTS as next page and CONTACTS lists FRONT as next
page. Since CONTACTS does not contain a MAIN window, it will print the contacts info and
then continue on to FRONT for the rest of the main items. Additionally, set print mode on
FRONT to D (duplex) and set CONTACTS to 'blank' (for both resource name and print mode -
this is the only way to get to the back of the page).
Transport Smart Forms
How does one transport SMARTFORM? SE01?
How do you make sure that both, the SMARTFORM & it's function module gets
transported? Or does the FM with same name gets generated automatically in the
transported client?
A smartform is transported no differently than any other object. if it is assigned to a development
class that is atteched to a transport layer, it will be transported.
The definition is transported, and when called, the function module is regenerated.
This leads to an interetsing situation. On the new machine, it is very likely the function module
name will be different than the name on the source system. Make sure, before you call the
function module, you resolve the external name to the internal name using the
'SSF_FUNCTION_MODULE_NAME' function module.
Typically, generate the SF, then use the pattern to being in the interface. Then change the call
function to use the name you get back from the above function module.
Smartforms: protect lines in main window.
How to protect lines in the main window from splitting between pages?
It was easy with SAPscript, but how to do it with SF's. For 4.7 version if you are using tables,
there are two options for protection against line break:
- You can protect a line type against page break.
- You can protect several table lines against page break for output in the main area.
Protection against page break for line types
- Double-click on your table node and choose the Table tab page.
- Switch to the detail view by choosing the Details pushbutton.
- Set the Protection against page break checkbox in the table for the relevant line type. Table
lines that use this line type are output on one page.
Protection against page break for several table lines
- Expand the main area of your table node in the navigation tree.
- Insert a file node for the table lines to be protected in the main area.
- If you have already created table lines in the main area, you can put the lines that you want to
protect again page break under the file using Drag&Drop. Otherwise, create the table lines as
subnodes of the file.
- Choose the Output Options tab page of the file node and set the Page Protection option. All
table lines that are in the file with the Page Protection option set are output on one page.
In 4.6, Alternatively in a paragraph format use the Page protection attribute to determine whether
or not to display a paragraph completely on one page. Ma rk it if you want to avoid that a
paragraph is split up by a page break. If on the current page (only in the main window) there is
not enough space left for the paragraph, the entire paragraph appears on the next page.
What are the differences between SAP Scripts and Smartforms?
SAP Scripts are client dependent whereas Smartforms are client independent.
SAP Scripts require a driver program to display the output whereas in smartforms the form
routines can be written so that it is standalone.
An integrated Form Builder helps to design Smartforms more easily than SAP Scripts
Smartforms generates XML output which can be viewed through the web
I have a smartform which works fine in DEV. After trasnsporting it to PROD, there is no
Function module generated for this smartform. As a result my program dumps in PROD?
The Smartform that is created in the Development may not have the same name in the
Production server. So it is always advised to use the Function Module
SSF_FUNCTION_MODULE_NAME to get the Function Module name by passing the
Smartform name.
The output options is of the type SSFCOMPOP which contains the field TDDEST. Set the
TDDEST field to your default printer name.
How can I make the Smartforms to display a print preview by default without displaying
the popup for print parameters?
In the SSF_OPEN function module,
Set the OUTPUT OPTIONS paramter TDDEST to your printer name.
Set the CONTROL PARAMETERS and control parameters as shown below,
control-preview = 'X'.
control-no_open = 'X'.
control-no_close = 'X'.
control-no_dialog = 'X'.
control-device = 'PRINTER'.
control_parameters-no_dialog = 'X'.
control_parameters-no_open = 'X'.
control_parameters-no_close = 'X'.
OUTPUT_OPTIONS-TDDEST = 'PRINTER NAME'.
OUTPUT_OPTIONS-TDNOPRINT = 'X'.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
I'm using the variable SFSY-FORMPAGES, I get a star "*" instead of the total number of pages.
There may not be enough space in the window to display the variable, either increase the
window dimensions or condense the spaces using &SFSY-FORMPAGES(C)&
I have defined my own Program Lines, where I have used a global variable G_TEXT. I get
an error G_TEXT is not defined?
Whenever using the global variables in the Program Lines, enter the variable name in Input
Parameters if you are going to use(read) the variable. If you are going to both read/write the
variable value enter the same in Output Parameters.
I have created a table node for display. Where can I check the condition which must satisfy
to display the table?
The conditions can be defined in the Conditions tab. In smartforms all the nodes have a condition
tab where you can specify the condition to be satisfied to access the node.
Where can I define the paragraph and character format for the smartforms?
The paragraph and character format for the smartforms can be defined in the transaction
SMARTSTYLES
SAP Scripts require a driver program to display the output whereas in smartforms the form
routines can be written so that it is standalone.
An integrated Form Builder helps to design Smartforms more easily than SAP Scripts
Smartforms generates XML output which can be viewed through the web
I have a smartform which works fine in DEV. After trasnsporting it to PROD, there is no
Function module generated for this smartform. As a result my program dumps in PROD?
The Smartform that is created in the Development may not have the same name in the
Production server. So it is always advised to use the Function Module
SSF_FUNCTION_MODULE_NAME to get the Function Module name by passing the
Smartform name.
The output options is of the type SSFCOMPOP which contains the field TDDEST. Set the
TDDEST field to your default printer name.
How can I make the Smartforms to display a print preview by default without displaying
the popup for print parameters?
In the SSF_OPEN function module,
Set the OUTPUT OPTIONS paramter TDDEST to your printer name.
Set the CONTROL PARAMETERS and control parameters as shown below,
control-preview = 'X'.
control-no_open = 'X'.
control-no_close = 'X'.
control-no_dialog = 'X'.
control-device = 'PRINTER'.
control_parameters-no_dialog = 'X'.
control_parameters-no_open = 'X'.
control_parameters-no_close = 'X'.
OUTPUT_OPTIONS-TDDEST = 'PRINTER NAME'.
OUTPUT_OPTIONS-TDNOPRINT = 'X'.
I'm using the variable SFSY-FORMPAGES, I get a star "*" instead of the total number of pages.
There may not be enough space in the window to display the variable, either increase the
window dimensions or condense the spaces using &SFSY-FORMPAGES(C)&
I have defined my own Program Lines, where I have used a global variable G_TEXT. I get
an error G_TEXT is not defined?
Whenever using the global variables in the Program Lines, enter the variable name in Input
Parameters if you are going to use(read) the variable. If you are going to both read/write the
variable value enter the same in Output Parameters.
I have created a table node for display. Where can I check the condition which must satisfy
to display the table?
The conditions can be defined in the Conditions tab. In smartforms all the nodes have a condition
tab where you can specify the condition to be satisfied to access the node.
Where can I define the paragraph and character format for the smartforms?
The paragraph and character format for the smartforms can be defined in the transaction
SMARTSTYLES
Difference between 'forminterface' and 'global definitions' in global settings of smart forms
The Difference is as follows.
To put it very simply:
Form Interface is where you declare what must be passed in and out of the smartform (in from
the print program to the smartform and out from the smartform to the print program).
Global defs. is where you declare data to be used within the smartform on a global scope.
ie: anything you declare here can be used in any other node in the form.
Forcing a page break within table loop
Create a loop around the table. Put a Command node before the table in the loop that forces a
NEWPAGE on whatever condition you want. Then only loop through a subset of the internal
table (based on the conditions in the Command node) of the elements in the Table node.
Font style and Font size
Goto Transaction SMARTSTYLES.
There you can create Paragraph formats etc just like in sapscript.
Then in your window under OUTPUT OPTIONS you include this SMARTSTYLE and use the
Paragraph and character formats.
Line in Smartform
Either you can use a window that takes up the width of your page and only has a height of 1
mm.
Then you put a frame around it (in window output options).
Thus you have drawn a box but it looks like a line.
Or you can just draw "__" accross the page and play with the fonts so that it joins each
UNDER_SCORE.
System fields of Smart Forms
&SFSY-DATE&
Displays the date. You determine the display format in the user master record.
&SFSY-TIME&
Displays the time of day in the form HH:MM:SS.
&SFSY-PAGE&
Inserts the number of the current print page into the text. You determine the format of the page
number (for example, Arabic, numeric) in the page node.
&SFSY-FORMPAGES&
Displays the total number of pages for the currently processed form. This allows you to include
texts such as'Page x of y' into your output.
&SFSY-JOBPAGES&
Contains the total page number of all forms in the currently processed print request.
&SFSY-WINDOWNAME&
Contains the name of the current window (string in the Window field)
&SFSY-PAGENAME&
Contains the name of the current page (string in the Page field)
&SFSY-PAGEBREAK&
Is set to 'X' after a page break (either automatic [Page 7] or command-controlled [Page 46])
&SFSY-MAINEND&
Is set as soon as processing of the main window on the current page ends
&SFSY-EXCEPTION&
Contains the name of the raised exception. You must trigger your own exceptions, which you
defined in the form interface, using the user_exception macro (syntax: user_exception
<exception name >).
Conversion of SAPSCRIPT to SMARTFORMS
SAP provides a conversion for SAPscript documents to SMARTforms.
This is basically a function module, called FB_MIGRATE_FORM. You can start this function
module by hand (via SE37), or create a small ABAP which migrates all SAPscript forms
automatically.
You can also do this one-by-one in transaction SMARTFORMS, under
Utilities -> Migrate SAPscript form.
You could also write a small batch program calling transaction SMARTFORMS and running the
migration tool.
Advantages of SAP Smart Forms
SAP Smart Forms have the following advantages:
1. The adaption of forms is supported to a large extent by graphic tools for layout and logic, so
that no programming knowledge is necessary (at least 90% of all adjustments). Therefore, power
user forms can also make configurations for your business processes with data from an SAP
system. Consultants are only required in special cases.
2. Displaying table structures (dynamic framing of texts)
3. Output of background graphics, for form design in particular the use of templates which were
scanned.
4. Colored output of texts
5. User-friendly and integrated Form Painter for the graphical design of forms
6. Graphical Table Painter for drawing tables
7. Reusing Font and paragraph formats in forms (Smart Styles)
8. Data interface in XML format (XML for Smart Forms, in short XSF)
9. Form translation is supported by standard translation tools
10. Flexible reuse of text modules
11. HTML output of forms (Basis release 6.10)
12. Interactive Web forms with input fields, pushbuttons, radio buttons, etc. (Basis-Release 6.10)
SAP ABAP Smart forms Interview faqs
1)How can I insert symbols in Smartforms?
Select the Text node.
Change Editor (Click the button above Check near the Editor)
Go to menu Include->Characters->SAP Symbols
Choose the SAP symbol that you want to insert.
2)I have a smartform which works fine in DEV. After trasnsporting it to PROD, there is no
Function module generated for this smartform. As a result my program dumps in PROD?
The Smartform that is created in the Development may not have the same name in the
Production server. So it is always advised to use the Function Module
SSF_FUNCTION_MODULE_NAME to get the Function Module name by passing the
Smartform name.
DATA: fm_name TYPE rs38l_fnam.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSMARTFORM'
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION fm_name
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
3)How can I make the Smartforms to choose a printer name by default?
In the CALL FUNCTION of the Smartform Function Module, set the output options parameter
to set the printer name.
The output options is of the type SSFCOMPOP which contains the field TDDEST. Set the
TDDEST field to your default printer name.
4)How can I make the Smartforms to display a print preview by default without displaying
the popup for print parameters?
In the SSF_OPEN function module,
Set the OUTPUT OPTIONS paramter TDDEST to your printer name.
Set the CONTROL PARAMETERS and control parameters as shown below,
control-preview = 'X'.
control-no_open = 'X'.
control-no_close = 'X'.
control-no_dialog = 'X'.
control-device = 'PRINTER'.
control_parameters-no_dialog = 'X'.
control_parameters-no_open = 'X'.
control_parameters-no_close = 'X'.
OUTPUT_OPTIONS-TDDEST = 'PRINTER NAME'.
OUTPUT_OPTIONS-TDNOPRINT = 'X'.
CALL FUNCTION 'SSF_OPEN'
EXPORTING
output_options = output_options
control_parameters = control
user_settings = ' '
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
5)How can I display the total number of pages in Smartforms?
Use SFSY-FORMPAGES to display the total number of pages in the Smartforms
&SFSY-PAGE&
Current page number
&SFSY-FORMPAGE&
Total number of pages in the currently formatted layout set
&SFSY-JOBPAGE&
Total number of pages in the currently formatted print request
&SFSY-COPYCOUNT&
Original-1,1st copy-2
&SFSY-DATE&
Date
&SFSY-TIME&
Time
&SFSY-USERNAME&
Username
6)I'm using the variable SFSY-FORMPAGES, I get a star "*" instead of the total number
of pages.?
There may not be enough space in the window to display the variable, either increase the
window dimensions or condense the spaces using &SFSY-FORMPAGES(C)
7)What are the various text formatting options in Smartforms?
&symbol(Z)&
Omit Leading Zeros
&symbol(S)&
Omit Leading Sign
&symbol(<)&
Display Leading Sign to the Left
&symbol(>)&
Display Leading Sign to the Right
&symbol(C)&
Compress Spaces
&symbol(.N)&
Display upto N decimal places
&symbol(T)&
Omit thousands separator
&symbol(R)&
Right justified
&symbol(I)&
Suppress output of the initial value
8)How can I provide a background shading to the table?
In the Table Painter, you can specify the color and shading for the table lines.
Where can I provide the input parameters to the smartform?
The input parameters for the smartform can be defined in Global Settings->Form Interface.
The Associated Type must be defined in the ABAP Dictionary.
Where can I define my own global types for the smartform?
The global types(within the smartform) can be defined in Global Settings->Global Definitions-
>Types
The types defined here will be global through the entire smartform.
Also the form routines can be defined Global Settings->Global Definitions->Form Routines
I have defined my own Program Lines, where I have used a global variable G_TEXT. I get
an error G_TEXT is not defined?
Whenever using the global variables in the Program Lines, enter the variable name in Input
Parameters if you are going to use(read) the variable. If you are going to both read/write the
variable value enter the same in Output Parameters.
I have created a table node for display. Where can I check the condition which must satisfy
to display the table?
The conditions can be defined in the Conditions tab. In smartforms all the nodes have a condition
tab where you can specify the condition to be satisfied to access the node.
How can I define Page Protect in Smartforms?
To define Page Protect for a node go to the Output options and check the Page Protection
checkbox
can anyone tell me how to copy script from one user to another (000 to 800) in details i can copy
it but cannot edit it can i download a script from a user (000) and upload it in another user(800)
se71 --> utilities--> copy from client (Here specify the details)
utilities--> convert original language (here specify the details)
REPORTING – GENERAL
The system field, which indicates success or failure of a SQL operation, is SY-SUBRC.
What is the syntax for specifying database table name at runtime in SELECT statement.
NAME = ‘SPFL1’.
SELECT * FROM (NAME).
……………….
……………….
ENDSELECT.
How do you read selected lines of database table into an internal table in packages of predefined
size.
SELECT * FROM <SPFLI>INTO TABLE <ITAB>PACKAGE SIZE<N>.
Where n is variable.
Name the WILDCARD characters which are used for comparisons with character strings &
numeric strings. ‘%’ and ‘-‘.
In SELECT statements can you specify a variable in WHERE condition or a part of the
condition, if so what is the syntax.
SELECT * FROM <table>WHERE <var1><condition><var or const>.
Name the ABAP/4 key words, which are used to change the contents of database table.
UPDATE or MODIFY.
7. How to specify a client for database table processing.
TABLES SPFLI.
SELECT * FROM SPFLI CLIENT SPECIFIED WHERE MANDT BETWEEN ‘001’ AND
‘003’.
……..
ENDSELECT.
How do you write a DATA object from ABAP/4 program to ABAP/4 memory and restore the
same from memory to program.
EXPORT <f1>[FROM <g1>]<f2>[FROM <g2>]…. TO MEMORY ID <key>.
The ID <key>, which can be up to 32 characters long, identifies the data in memory.
What are DATA CLUSTERS?
You can group any complex internal data objects of an ABAP/4 program together in data
clusters and store them temporarily in ABAP/4 memory or for longer periods in databases. You
can store data clusters in special databases of the ABAP/4 Dictionary. These databases are
known as ABAP/4 cluster databases and have a predefined structure. Storing a data cluster is
specific to ABAP/4. Although you can also access cluster databases using SQL statements, only
ABAP/4 statements are able to decode the structure of the stored data cluster.
Statements used to delete data objects in ABAP/4 memory FREE MEMORY [ID <key>].
How will you create a file on application server.
Open dataset <dsn> for output.
ABAP/4 statement for opening a file on application server for reading Open dataset <dsn> for
input.
How will you transfer data into a file in application server?
Data fname(60) value ‘mYFILE’.
Data num type i.
Open dataset fname for output.
Do 10 times.
Num = Num +1.
Transfer num to fname.
Enddo.
…….etc.
Name the function modules to write data from an Internal Table to the Presentation Server.
DOWNLOAD and WS_DOWNLOAD.
Name the function module that can be used to give information about files on Presentation
Server and about its Operating System.
WS_QUERY.
Name the ABAP/4 key word, which is used to clear the Headerline of an Internal Table.
CLEAR<itab>.
Name the function modules to read data from Presentation Server into an Internal Table.
UPLOAD and WS_UPLOAD.
Name the ABAP/4 keywords to initialize an Internal Table with and without headerline.
REFRESH <itab>.
How to determine the attributes of an internal table?
DESCRIBE TABLE <itab>[LINES <lin>] [OCCURS <occ>].
Name the ABAP/4 key word for searching a string in an Internal Table.
SEARCH <itab> FOR <str><options>.
The different options (<options>) for the search in an internal table are:
ABBREVIATED
Searches table<itab>for a word containing the character string specified in <str>, where other
characters might separate the characters. The first letter of the word and the string <str> must be
the same.
STARTING AT<lin1>
Searches table<itab> for <str>, starting at line <line1>. <\lin1> can be a variable.
ENDING AT<n2>
Searches table <itab>for <str>upto line<lin2>. <lin2>can be a variable.
AND MARK
If the search string is found, all the characters in the search string (and all the characters in
between when using ABBREVIATED) are converted to upper case.
What are the different attributes that can be assigned to a variant?
The different attributes that can be assigned to a variant are….
Description
Enter a short, meaningful description of the variant. This may be upto 30 characters long.
Background only
Specify whether you want to use the variant in background processing only, or in online
environment as well.
Protected variant.
Mark the field if you want to protect your variant against being changed by other users.
Do not display variant.
Mark this field if you want the variant name to be displayed in the catalog only, but not in the F4
value list.
For the selections you cover in a variant, you can enter the following attributes:
Type
The system displays whether the field is a parameter or a select option.
Protected
Mark this field for each field on the selection screen you want to protect from being overwritten.
Values that you mark this way are displayed to the users, but they cannot change them, that are
they are not ready to accept input.
Invisible
If you mark this column, the system will not display the corresponding field on the selection
screen the user sees when starting the report program.
Variable
Mark this column if you want to set the value for this field at runtime.
Is it possible to create new dynamic programs during runtime of an ABAP/4 program? If so
how?
To create new dynamic programs during the runtime of an ABAP/4 program, you must use an
internal table. For this purpose, you should create this internal table with one character type
column and a line width of 72. You can use any method you like from Filling Internal Tables to
write the code of your new program into the internal table. Especially, you can use internal
fields in which contents are dependent on the flow of the program that you use to create a new
one, to influence the coding of the new program dynamically. The following example shows
how to proceed in principal:
DATA CODE (72) OCCURS 10.
APPEND ‘REPORT ZDYN1.’
TO CODE.
APPEND ‘WRITE/”Hello, I am dynamically created!”.’
TO CODE.
Two lines of a very simple program are written into the internal table CODE.
In the next step you have to put the new module, in the above example it is a report, into the
library. For this purpose you can use the following statement:
Syntax
INSERT REPORT <prog>FROM <itab>.
The program <prog> is inserted in your present development class in the R/3 Repository. If a
program with this name does not already exists, it is newly created with the following attributes:
Title: none,
Type: 1 (Reporting),
Application: S (Basis).
You can specify the name of the program <prog> explicitly within single quotation marks or you
can write the name of a character field, which contains the program name. The name of the
program must not necessarily be the same as given in the coding, but it is recommended to do
so. <itab> is the internal table containing the source code. For the above example you could
write:
INSERT REPORT ‘ZDYN1’ FROM CODE.
Or
DATA REP (8).
REP = ‘ZDYN1’
INSERT REPORT REP FROM CODE.
Data types can be elementary or structured (T/F).
TRUE.
The amount of memory associated with a data type is ZERO.
Data objects are the physical units a program uses at runtime. (T/F).
TRUE.
The data object does not occupy any space in memory. (T/F)
FALSE.
What are the three hierarchical levels of data types and objects?
Program-independent data, defined in the ABAP/4 Dictionary.
Internal data used globally in one program.
Data used locally in a procedure (subroutine, function module)
How would you find the attributes of a data type or data object?
DESCRIBE FIELD <f> [LENGTH <l.] [TYPE <t> [COMPONENTS <n>]]
[OUTPUT-LENGTH <o>] [DECIMALS <d>]
[EDIT MASK <m>].
The components of a field string cannot have different data types. (T/F).
FALSE.
Field strings are also called as Record or Structures.
If a field string is aligned (Left, centered, right justified etc.), the filler fields are also added to the
length of the type C field. (T/F).
TRUE.
You cannot assign a local data object defined in a subroutine or function module to a field group.
(T/F)
TRUE.
Field group reserves storage space for the fields, and does not contain pointers to existing fields
(T/F).
False.
Defining a field group as ‘HEADER’ is optional (T/F)
FALSE.
How would you define a field symbol?
FIELD-SYMBOLS<FS>.
Which function module would you use to check the user’s authorization to access files before
opening a file?
AUTHORITY_CHECK_DATASET
37. Name the function module used to convert logical file names to physical file names in
ABAP/4 programs.
FILE_GET_NAME.
Parameters, which are defined during the definition of a subroutine with the FORM statement,
are called Formal Parameters.
Parameters which are specified during the call of a subroutine with the PERFORM statement are
called Actual Parameters.
In subroutines internal tables that are passed by TABLES, are always called by value and result.
(T/F)
FALSE. They are called by reference.
INTERACTIVE REPORTING
1. What is interactive reporting?
It helps you to create easy-to-read lists. You can display an overview list first that contains
general information and provide the user with the possibility of choosing detailed information
that you display on further lists.
What are the uses of interactive reporting?
The user can actively control data retrieval and display during the session. Instead of an
extensive and detailed list, you create a basic list with condensed information from which the
user can switch to detailed displays by positioning the cursor and entering commands. The
detailed information appears in secondary lists.
What are the event key words in interactive reporting?
Event Keyword Event
AT LINE-SELECTION Moment at which the user selects a line by double
clicking on it or by positioning the cursor on it and pressing F2.
AT USER-COMMAND Moment at which the user presses a function key.
TOP-OF-PAGE DURING Moment during list processing of a
LINE-SELECTION secondary list at which a new page starts.
What is secondary list?
It allows you to enhance the information presented in the basic list. The user can, for example,
select a line of the basic list for which he wants to see more detailed information. You display
these details on a secondary list. Secondary lists may either overlay the basic list completely or
you can display them in an extra window on the screen. The secondary lists can themselves be
interactive again.
How to select valid lines for secondary list?
To prevent the user from selecting invalid lines, ABAP/4 offers several possibilities. At the end
of the processing block END-OF-SELECTION, delete the contents of one or more fields you
previously stored for valid lines using the HIDE statement. At the event AT LINE-
SELECTION, check whether the work area is initial or whether the HIDE statement stored field
contents there. After processing the secondary list, clear the work area again. This prevents the
user from trying to create further secondary lists from the secondary list displayed.
How to create user interfaces for lists?
The R/3 system automatically, generates a graphical user interface (GUI) for your lists that offers
the basic functions for list processing, such as saving or printing the list. If you want to include
additional functionality, such as pushbuttons, you must define your own interface status. To
create a new status, the Development Workbench offers the Menu Painter. With the Menu
Painter, you can create menus and application toolbars. And you can assign Function Keys to
certain functions. At the beginning of the statement block of AT END-OF-SELECTION, active
the status of the basic list using the statement: SET PF-STATUS ‘STATUS’.
What is interactive reporting?
A classical non-interactive report consists of one program that creates a single list. Instead of
one extensive and detailed list, with interactive reporting you create basic list from which the
user can call detailed information by positioning the cursor and entering commands. Interactive
reporting thus reduces information retrieval to the data actually required.
Can we call reports and transactions from interactive reporting lists?
Yes. It also allows you to call transactions or other reports from lists. These programs then use
values displayed in the list as input values. The user can, for example, call a transaction from
within a list of change the database table whose data is displayed in the list.
What are system fields for secondary lists?
SY-LSIND Index of the list created during the current event (basic list = 0)
SY-LISTI Index of the list level from which the event was triggered.
SY-LILLI Absolute number of the line from which the event was triggered.
SY-LISEL Contents of the line from which the event was triggered.
SY-CUROW Position of the line in the window from which the event was triggered
(counting starts with 1)
SY-CUCOL Position of the column in the window from which the event was
triggered (counting starts with 2).
SY-CPAGE Page number of the first displayed page of the list from which the event was
triggered.
SY-STARO Number of the first line of the first page displayed of the list from which the
event was triggered (counting starts with 1). Possibly, a page header occupies this line.
SY-STACO Number of the first column displayed in the list from which the event was
triggered (counting starts with 1).
SY-UCOMM Function code that triggered the event.
SY-PFKEY Status of the displayed list.
How to maintain lists?
To return from a high list level to the next-lower level (SY-LSIND), the user chooses Back on a
secondary list. The system then releases the currently displayed list and activates the list created
one step earlier. The system deletes the contents of the released list. To explicitly specify the
list level, into which you want to place output, set the SY-lsind field. The system accepts only
index values, which correspond to existing list levels. It then deletes all existing list levels
whose index is greater or equal to the index specify. For example, if you set SY-LSIND to 0, the
system deletes all secondary lists and overwrites the basic list with the current secondary list.
What are the page headers for secondary lists?
On secondary lists, the system does not display a standard page header and it does not trigger the
event. TOP-OF-PAGE. To create page headers for secondary list, you must enhance TOP-OF-
PAGE: Syntax TOP-OF-PAGE DURING LINE-SELECTION. The system triggers this event
for each secondary list. If you want to create different page headers for different list levels, you
must program the processing block of this event accordingly, for example by using system fields
such as SY-LSIND or SY-PFKEY in control statements (IF, CASE).
How to use messages in lists?
ABAP/4 allows you to react to incorrect or doubtful user input by displaying messages that
influence the program flow depending on how serious the error was. Handling messages is
mainly a topic of dialog programming. You store and maintain messages in Table T100.
Messages are sorted by language, by a two-character ID, and by a three-digit number. You can
assign different message types to each message you output. The influence of a message on the
program flow depends on the message type. In our program, use the MESSAGE statement to
output messages statically or dynamically and to determine the message type.
Syntax:REPORT <rep> MESSAGE-ID <id>.
What are the types of messages?
A message can have five different types. These message types have the following effects during
list processing:
.A (=Abend):
.E (=Error) or W (=Warning):
.I (=Information):
.S (=Success):
What are the user interfaces of interactive lists?
If you want the user to communicate with the system during list display, the list must be
interactive. You can define specific interactive possibilities in the status of the list’s user
interface (GUI). To define the statuses of interfaces in the R/3 system, use the Menu Painter
tool. In the Menu Painter, assign function codes to certain interactive functions. After an user
action occurs on the completed interface, the ABAP/4 processor checks the function code and, if
valid, triggers the corresponding event.
What are the drill-down features provided by ABAP/4 in interactive lists?
ABAP/4 provides some interactive events on lists such as AT LINE-SELECTION (double click)
or AT USER-COMMAND (pressing a button). You can use these events to move through layers
of information about individual items in a list.
What is meant by stacked list?
A stacked list is nothing but secondary list and is displayed on a full-size screen unless you have
specified its coordinates using the window command.
Is the basic list deleted when the new list is created?
No. It is not deleted and you can return back to it using one of the standard navigation functions
like clicking on the back button or the cancel button.
What is meant by hotspots?
A Hotspot is a list area where the mouse pointer appears as an upright hand symbol. When a user
points to that area (and the hand cursor is active), a single click does the same thing as a double-
click. Hotspots are supported from R/3 release 3.0c.
What is the length of function code at user-command?
Each menu function, push button, or function key has an associated function code of length
FOUR (for example, FREE), which is available in the system field SYUCOMM after the user
action.
Can we create a gui status in a program from the object browser?
Yes. You can create a GUI STATUS in a program using SET PF-STATUS.
In which system field does the name of current gui status is there?
The name of the current GUI STATUS is available in the system field SY-PFKEY.
Can we display a list in a pop-up screen other than full-size stacked list?
Yes, we can display a list in a pop-up screen using the command WINDOW with the additions
starting at X1 Y1 and ending at X2 Y2 to set the upper-left and the lower-right corners where x1
y1 and x2 y2 are the coordinates.
What is meant by hide area?
The hide command temporarily stores the contents of the field at the current line in a system-
controlled memory called the HIDE AREA. At an interactive event, the contents of the field are
restored from the HIDE AREA.
When the get cursor command used in interactive lists?
If the hidden information is not sufficient to uniquely identify the selected line, the command
GET CURSOR is used. The GET CURSOR command returns the name of the field at the cursor
position in a field specified after the addition field, and the value of the selected field in a field
specified after value.
How can you display frames (horizontal and vertical lines) in lists?
You can display tabular lists with horizontal and vertical lines (FRAMES) using the ULINE
command and the system field SY-VLINE. The corners arising at the intersection of horizontal
and vertical lines are automatically drawn by the system.
What are the events used for page headers and footers?
The events TOP-OF-PAGE and END-OF-PAGE are used for pager headers and footers.
How can you access the function code from menu painter?
From within the program, you can use the SY-UCOMM system field to access the function
code. You can define individual interfaces for your report and assign them in the report to any
list level. If you do not specify self-defined interfaces in the report but use at least one of the
three interactive event keywords. AT LINE-SELECTION, AT PF<nn>, OR AT USER-
COMMAND in the program, the system automatically uses appropriate predefined standard
interfaces. These standard interfaces provide the same functions as the standard list described
under the standard list.
How the at-user command serves mainly in lists?
The AT USER-COMMAND event serves mainly to handle own function codes. In this case,
you should create an individual interface with the Menu Painter and define such function codes.
How to pass data from list to report?
ABAP/4 provides three ways of passing data:
---Passing data automatically using system fields
---Using statements in the program to fetch data
---Passing list attributes
How can you manipulate the presentation and attributes of interactive lists?
---Scrolling through Interactive Lists.
---Setting the Cursor from within the Program.
---Modifying List Lines.
How to call other programs?
Report Transaction
Call and return SUBMIT AND RETURN CALL TRANSACTION
Call without return SUBMIT LEAVE TO TRANSACTION
You can use these statements in any ABAP/4 program.
What will exactly the hide statement do?
For displaying the details on secondary lists requires that you have previously stored the contents
of the selected line from within the program. To do this, ABAP/4 provides the HIDE statement.
This statement stores the current field contents for the current list line. When calling a secondary
list from a list line for which the HIDE fields are stored, the system fills the stored values back
into the variables in the program. In the program code, insert the HIDE statement directly after
the WRITE statement for the current line. Interactive lists provide the user with the so-called
‘INTERACTIVE REPORTING’ facility. For background processing the only possible method
of picking the relevant data is through ‘NON INTERACTIVE REPORT’ . After starting a
background job, there is no way of influencing the program. But whereas for dialog sessions
there are no such restrictions.
How many lists can a program can produce?
Each program can produce up to 21 lists: one basic list and 20 secondary lists. If the user creates
a list on the next level (that is, SY-LSIND increases), the system stores the previous list and
displays the new one. Only one list is active, and that is always the most recently created list.
FALSE.
Ans: ABAP dictionary is the central information base for the developers. This manages all
definitions(metadata) required for different applications in SAP. ABAP dictionary is completely
integrated into ABAP development workbench. All other component of ABAP development
workbench can access the data definitions(meta data) stored in the data dictionary.
Tables: Tables are defined in the ABAP Dictionary independently of the database.
A table having the same structure is then created from this table definition in the underlying
database.
Views: are logical views on more than one table. The structure of the view is defined in the
ABAP Dictionary. A view on the database can then be created from this structure.
Types (elements, structures, table types): Types are created in ABAP programs. The structure of
a type can be defined globally in ABAP programs. Changes to a type automatically take effect in
all the programs using the type.
Lock objects:are used to synchronize access to the same data by more than one user. Function
modules that can be used in application programs are generated from the definition of a lock
object in the ABAP Dictionary.
Domains: Different fields having the same technical type can be combined in domains. Domain
defines the value range of all table fields and structure components that refer to this domain.
Data element: The ABAP Dictionary also contains the information displayed with the F1 and F4
help for a field in an input template. The documentation about the field is created for a data
element.
Input help: The list of possible input values that appears for the input help is created by a
foreign key or a search help.
Ans:
Table fields: For table fields, field names and data types are defined.
Foreign keys: Relationship between the table and the other tables are defined.
Technical settings: Data class and size category defines that what type of table
to be created and how much space required.
Indexes: Secondary indexes are created for a table for faster data selection.
Field name can be of maximum 16 characters in a table and must start with a letter.
Key flag determines if a field should be the table key.
Field type depicts the data type of the field in the ABAP dictionary.
Field length denotes the number of valid places in the field.
Decimal places Number of places after decimal point for float type value.
Short text describes the business meaning of the field.
Also fields from other structures can be added to the table definition as include.
Q. How data Type, field Length and short Text of any field is assigned?
Ans: i. Data type, field length (and if necessary decimal places) short text can be directly
assigned to a field in the table definition.
ii. Data element can be assigned to a field so that data type, field length (and decimal places) are
automatically determined from the domain of the data element. The short description of the data
element is then assigned to the field as a short text.
Ans: i. Direct assignment of data types, field length, short text to a field.
iii. An input check(check table) for a field can be defined with a foreign key.
v. Reference field or reference table must be specified for a table field that holds currency or
quantity type value.
E.g.: TAB1 contains the field PRICE which holds price values. Field UNIT contains currency
key for PRICE.
So,TAB1 is the reference table for field PRICE and UNIT is the reference field for field PRICE.
Ans: In addition to listing the individual fields in a table or structure, fields from another
structure can be included as includes.
Ans: If an include is added to define a database table or database structure, a name can be
assigned to that included (included substructure). The group of fields of that include can be
addressed as a whole in ABAP application programs with a group name which is called as
named include.
E.g.:We can access field of a table/ structure in the ABAP application program in the following
manner:
Ans: Relationships between tables are defined in the ABAP dictionary by creating foreign keys.
Ans:
Using foreign keys(as main table-field is linked with check table), input value check for any input
field can be done.
Foreign keys can also be used to link several tables.
Ans: One field of the foreign key table corresponds to each key field of the check table. That
field of the is called as foreign key field.
Uses: A foreign key permits assigning data records in the foreign key table and check table. One
record of the foreign key table uniquely identifies a record of the check table (using the value
entries in the foreign key fields of the foreign key table).
Ans: One of the foreign key field is marked as the check field. This depicts that the foreign key
relationship is maintained for that field. When a value is entered for that check field in the table,
input validation checking is done i.e. a checking is done that whether the inserted value exists in
the check table or not. If doesn’t exist then system rejects the entry else input validation check
for that field is successful.
Q. What’s cardinality?
i.Choose APPL0(master data) for data that is frequently accessed but rarely updated/changed.
ii.Choose APPL1(transaction data) for data that is frequently changed.
iii.Choose APPL2(organizational data) for customizing data that is defined/entered
during system installation and rarely changed.
The other two types of data classes are:USR and USR1(for customer’s own development
purpose).
Ans: The Size category is used to defined the space requirement for the table in the database.
Ans: There are five size categories. Size category from 0 to 4 can be choosen for the tables. A
certain fixed memory size is assigned to each category in the SAP database.
Ans: During table creation, the SAP system reserves an initial space i.e. an initial extent) in the
database.If in any case more space is needed, then additional memory is added according to the
mentioned size category for that table. correct size category prevents the creation of a large
number of small extents for a table i.e. prevents memory wastage.
Q. What’s buffering?
Q. What’s logging?
Ans: The tables which create 1-to-1 correspondence between the table definition in the ABAP
data dictionary and the table definition in the physical database are called as transparent tables in
SAP.
Ans: Table pool is a table in the SAP database in which many pool tables are assigned.
Ans: Table cluster is a table in the SAP database in which many cluster tables are stored.
Ans: Table pool or table cluster is used to store SAP’s internal control information (screen
sequences, program parameters, temporary data, continuous texts such as documentation).
Ans: i. The table cluster RFBLG holds data for five transparent tables i.e. BSEC, BSED, BSEG,
BSES and BSET.
ii. Other examples of table clusters are CDCLS, CDHDR, RFBLG, DOKCLU, DOKTL .
Ans: i. A transparent table has 1-to-1 cardinality between the table definition in the data
dictionary and in the table definition of sap database whereas cluster/pool tables have many-to-1
cardinality between the table definition in the data dictionary and in the table definition of sap
database.
ii. Transparent tables are accessible both by Open and native SQL statements whereas table
pool/cluster tables are accessible only by open SQL but never by native SQL.
iii. Transparent tables can store table relevant data whereas table pool or cluster tables can store
only system data/ application data based on the transparent tables.
Q. What are tabs under the maintenance screen of the ABAP data dictionary screen?
Ans: We need to insert an delivery class value while creating customized table in SAP through
the transaction code SE11. Delivery class is that which regulates the transport of the table’s data
records (during SAP installations, SAP software upgrade, client copies, and data transport to
other SAP system). SAP and its customers have different write types depending on the variety of
delivery class. If Delivery class is A, it depicts that the application table for master and
transaction data changes only rarely.
iv. G: Customer table, new data records can be inserted but may not overwrite or delete existing
ones.
vi. S: System table, data changes have the status of program changes i.e. System table
for program’s nature. Maintained only by SAP. E.g.: Codes for SAP transactions.
vii. W: System table for system operation and maintenance. Table contents are maintained by
maintenance transactions. E.g.: function module table.
Q. What are the differences between domain and data element?
Ans: i.Domain depicts the technical attributes of a field (its data type, field length, no. of decimal
places, appreance on the sreen) of a SAP database table. Whereas data element denotes the
semantic attributes(short description, label names) for a field.
ii.Data elements are directly attaced to the fields of SAP database tables and each data element
has an underlying domain within it. Whereas domains are not directly attached to the fields and a
single domain can be under many data elements.
iii.Within domain value range of a field can be described. Whereas within the data element
parameter id and search help for a particular field can be assigned.
Ans: Value table is maintained at domain level in SAP. During domain creation, value range of
the domain is defined by specifying value table. Suppose for a particular domain, its value table
holds the values ‘A’, ‘B’, ‘Z’. So whenever the domain will be used, system will allow to use
these values only.
Re: How you can perform field-validation in your dialog program ? Answer
#2
Re: HOW MANY EDITORS ARE THERE IN SAP ABAP. WHAT ARE THEY AND THERE USES. Answer
#2
Hi,
I think there r 3 types of editors.
1. ABAP Editor------> SE38.
2. Screen Editor----> SE51.
3. Script Editor----> Se71.