Thursday, February 10, 2011

SAP ABAP Technical Questions ( Data Dictonary )

  1. What is data Dictionary?
  2. What is the difference between open sql & native sql ?
  3. Difference between Pooled, cluster & transparent tables?
  4. What is Primary key, foreign key ? what is primary index?
  5. secondary index?
  6. how many indexes can be created for a table?
  7. what is a value table?
  8. what are the components of a table?
  9. what is a domain?
  10. what is a data element?
  11. what is data class?
  12. can you create a table with out a data element?
  13. can you create a field with out a data element?
  14. What approach you prefer for creating a table?
  15. Give few names of cluster tables in sap?
  16. Give few names of pooled tables in sap?
  17. give few names of transparent tables?
  18. what is a buffer and how many types?
  19. what is table maintenance generator and how to create that?
  20. What is the transaction code? How to add new fields to a standard sap table ?
  21. How many types of table joins are there? difference between inner join & outer join?
  22. Difference between "select * from mara" and "select single * from mara"?
  23. what is a match code ? Lock objects ? what are views?
  24. what are logical tables/database?
  25. what is the difference bet'n table and a structure?

SAP ABAP Real Time Questions

  1. Which client number you use for the current project?
  2. You are running a report. It is taking long time for execution. What steps will you do to reduce the execution time.
  3. After running a BDC program in background, next day morning when you see the results, few records are not updated(error records). What will you do then?
  4. You are given functional specs for a BDC program and you need to decide whether to write a method call transaction or a session. How u will decide?
  5. What is the difference between report and script?
  6. what are the differences between scripts & smart forms?
  7. what are enhancements?
  8. what are user-exits?
  9. what is badi?
  10. what is the difference between user-exit & BADIs?
  11. what is the difference between user-exit & customer-exit?
  12. how do you get functional specs when you are assigned some object? (specs through email..??)
  13. How do you write technical specs?
  14. Howdo you write UTP?(unit test plan)

SAP ABAP Reports Questions

  1. what is a report?
  2. what are types of reports?
  3. difference bet'n simple and interactive reports?
  4. what are the events in interactive reports?
  5. what is the first event that will be triggered in a report?
  6. what is the use of Initialization event? give one example.
  7. what is the use of start-of-selection event?
  8. what is the difference betn end-of-page and end-of-selection?
  9. if you write a write statement after end-of-selection, will that be triggered?
  10. how to create a button in selection screen?
  11. how to add a gui status in a selection screen?
  12. what is at-line-selection event?
  13. How many secondary lists can be created in an interactive report?
  14. how to create a check box/option button in a list?
  15. can you call a bdc program from a report? how?
  16. can you call a transaction from a report? how?
  17. what are ALV reports? how they are different from normal reports?
  18. what are the main events that are used in an ALV report?
  19. what is the use of SLIS type pool in alv reports?
  20. difference betn top-of-page and top-of-page during at-line-selection?
  21. in an interactive report, after going to 5th list, can you come back to 2nd list? how?

SAP ABAP Internal Tables Questions

SAP ABAP Internal Tables Questions

  1. what is an internal table?
  2. how many type of internal tables are there?
  3. what is the difference between hashed & sorted internal tables?
  4. what is the difference between standard and sorted internal tables? (in performance wise)
  5. Difference between internal table and a dictionary table?
  6. can you create an internal table dynamically?(at run time)
  7. what is the use of select for all entries in an internal table?
  8. when you are using 2 internal table in program, you have decided to use for all entries
    statement to retrieve data but unfortunately there are no records in the first internal table. What will be the result? (2nd internal table contains records).
  9. in a loop of an internal table, what is the use of at first & at last statements?
  10. What is the use of at new statement?
  11. what is the difference between at first & at new statements?
  12. what is a binary search ? and how it is useful in a sorted internal table?
  13. when do you need to create an internal table with header line ?and with out a header line?
  14. what does it mean occurs 0 while creating an internal table?
  15. what will happen if you don't give occurs clause while creating an internal table?
  16. what is the difference between clear, delete & refresh with respect to an internal table?

SAP Scripts and Smart Forms Questions

SAP Scripts and Smart Forms Questions

  1. What is the difference between a script & a report ?
  2. What are the components/elements in sap script ?
  3. Can you create a script with out a main window ?
  4. How many main windows can be created for a script ?
  5. How can we use tables in sap scripts?
  6. How to print a logo in a sap script?
  7. When we need to modify standard scripts(eg:medruck) given by sap?
  8. What is the use of transaction code NACE in sap scripts?
  9. what is the table name that will contain all the script form names and print program names?
  10. Can you assign your own form to a standard print program? how?
  11. What is the use of PROTECT & ENDPROTECT?
  12. How to add extra functionality to a standard print program with out touching the print program?
  13. what is sub routine pool in sap script? when it is used?
  14. How to read text in sapscripts?
  15. What is the transaction code for logo uploading?
  16. what is the difference between paragraph & character format?
  17. How to use a sapscript for multiple languages ? (english, germany etc)
  18. How to download/upload sapscripts from & to your PC ?
  19. What is the difference between scripts & smart forms?
  20. What is the standard program used for uploading the logo to script?
  21. How can you send forms from one client to other?
  22. what does open_form, write_form, close_form do?
  23. How to convert a sapscript to smart form?
  24. How to send a smartform result through mail?
  25. how to select desired paper size in sapscript?

SAP ABAP Scripts Question and Answers Part 1

SAP Scripts

  1. .What is sap script and layout set?
    Ans - SAPscript is the integrated text management system of the SAP R/3 System. SAPscript is tightly integrated into the SAP System. It is used for many different word-processing tasks all over the SAP System.

  2. .What is layout set?

    A layout set in SAPscript is used for page layout. The layout set contains various elements, which are used for layout control of the individual pages and also contain layout information for texts which are to be output on the individual pages.

    The layot of a document is defined in a layot set.
    A layout set specified the appearance and structure of a document.

    Layout sets contain predefined text modules with space reserved for variable data. You can use these text modules for different application.

    Every SAPscript document uses a layout set.

    To make changes to your documents, such as moving a piece of text, or changing fonts, paragraph formats, and tabs, you only need to change the layout set.

    There are two ways of formatting texts using layout sets:
    The text is entered and output in standard text maintenance. You can assign any layout set. Text can also be entered via the layout set a letter header, for example.
    The text is formatted via an ABAP/4 program using a layout set. The program can either dynamically output individual predefined text modules, text elements or transfer entire texts, which are to be output in the layout set.

    You can use Styles to define the formatting of the text in your documents. A style determines text formatting by setting the paragraph and character formats used in a document. You can, for example, use a style to highlight character strings or whole paragraphs. You can assign a style to any text. Typically, however, you’ll use styles primarily in the main windows of layout sets, where users type or enter text directly in documents.

    Header data is found in both style and layout set maintenance.
    In style maintenance, it is used primarily to present important information - designed to make it easier for the end user to select a style. The header data in layout set maintenance, on the other hand, is used for information and control purposes.

    Windows are defined in layout set maintenance. They represent areas which are positioned on pages as page windows and in which text is
    later output. At least one window must be defined for each layout set. If not, a text cannot be formatted by SAP script.

    The following window types can be used:

    MAIN – Main window in which continuous text is output. This is the window used by dialog users of a print program and layout set. For example the body text of a letter would be entered in MAIN.

    VAR – Window with variable contents. The text can vary on each page in which the window is positioned. Variable windows are formatted for each page.

    CONST – Window with constant contents which is only formatted once.

    A layout set has the following elements:

    Header data - Data related to development (created by, development class, etc.) and layout set information (which elements are used) are both stored in the header data. A start page must be entered here.

    Paragraph formats - Paragraph formats are required in layout sets - as in styles - in order to format texts. However, they are also used for word processing in layout sets, for example, to format text elements.

    Character formats - You can also use character formats to format texts or paragraphs. Unlike paragraph formats, however, they are used to format text within a paragraph.

    Windows - Windows are names and window types, which are not physically positioned until they are allocated to pages and units of measurement are specified.

    Pages - Pages are defined to provide the system with a start and end point in text formatting.

    Page windows - Page windows are the combination of windows and pages, where the dimensions of a window and its position on a page are specified.

    The purpose of SAP script control commands is to allow control of the output formatting. These commands are not interpreted by the SAPscript
    editor, but are passed through to the SAPscript Composer for processing. The composer is the program that converts text from the form displayed in the editor to the form used for printing.

    What is SAPscript and explain its purpose?
    Ans:- SAP Script is the SAP system’s own text-proessing system. You’ll find that it looks and feels a lot like other leading text-processing system that you may use on your personal computer.

    Every company needs to output documents with a uniformly defined layout (eg. Invoices, delivery notes, etc..) all the time.

    The basic layout of the document is pre-defined , but in many cases, other data has to be merged with it, such as address data or purchase order items. This data might be entered manually by a employee, or retrieved from a database table.

    Large quantities of these documents have to be produced. From printing is usually a mattter of large print runs of documents such as payslips, checks, order confirmation, reminders etc.

    SAPscript has been developed to meet the above requirements. IT is an integrated tool for text entry and form printing in R/3 applications.

    These documents are normally provided by SAP but every organization have their unique waqys of these documents so to customize these and for creating newer ones if required; SAP script is used.

    What are components of SAPscript?
    Layout set, SAPscript Text, ABAP Print program , symbols, function modules like open_form, close_From, Read_text etc,.

    What are the ABAP/4 Commands that link to a layout set?
    Call function OPEN-form.
    Call function WRITE-from.
    Call function CLOSE-from

    Importing Graphics (Logos) into SAPScript
    The program RSTXLDMC can be used to upload graphics (file extension .tif on PC files) into individual standard text.

    Other useful programs for SAPScript
    RSTXFCON - Converts page format
    RSTXSCRP - Upload/Download layout sets
    RSTXDBUG - SAPScript debugger

    Debug SAPScript
    You can debug a SAPScript: Use Tools - Word Processing - Layout Set.
    Enter name of layout set and then Utilities - Activate Debugger.
    It is of no consequence which layout set you enter when selecting the SAPscript debugger. (Menu path: Tools-Word-processing - Forms, Utilities - Activate Debugger) The next layoutset called will invoke the debugger. This is quite handy when verifying which layoutset is being called (Verifying customizing settings).
    Another way to set the SAPScript debugger is to run program RSTXDBUG.

    When a Form is copied from one client to another .And If U try to display or change the form in the copied client .The possible error message cud be :
    1.Form not found
    Try coping again specifing the language .

    2.IF IT dispalys an error message saying That the text file is inconsistent .
    Then go to SE38 and Run “RSTXCHKO” .
    It will ask for the form name ,then check all the checkboxes and then run the program.
    Note : all Script related problems can be solved using Program ‘RSTX*’.

    How to take a back up of script layout into U’r hard disk and load it later
    Use Program RSTXSCRP.
    Use EXPORT mode, when downloading and IMPORT when uploading a script. Don’t forget to give the form name in the object field. This will create a script with the same name as that of the original script . If a script with the same name exists in the same client ,then it will give an error ‘Object cannot be overwritten ’ .

    I want to copy table across clients
    Use Program RSCLTCOP

    To transfer script files across systems (Not Clients) - RSTXSCRP

    To compare the contents of a table across clients: RSTBSERV

    To change the development class of any object - RSWBO052

    What type of variables normally used in sap script to output data?
    &Tables name- fields&.

    How do you number pages in sap script layout outputs?
    & page &
    &next Page &

    What takes most time in SAP script programming?
    Defining layout set up / sets.

    How do you use tab sets in layout sets?
    Define paragraph with defined tabs.

    How do you backup sap script layout sets? Can you download and upload? How?
    SAP script backup :- In transaction SE71 goto Utilities -> Copy from client -> Give source form name, source client (000 default), Target form name.
    Download :- SE71, type form name -> Display -> Utilities -> form info -> List -> Save to PC file.
    Upload :- Create form with page, window, pagewindow with the help of downloaded PC file. Text elements for Page windows to be copied from PC file.

    What is Compare Tool in SAP Script ?
    SAP Script offers tools for comparing objects across clients. We can compare or copy the following kinds of objects.
    Styles
    Layout sets
    Documents
    With the Compare tool we can do the following :
    Check whether an object exists in both clients
    Display the differences between the versions of an object

    Layout Sets are used to control page layout and text formatting in documents .

    SAP Standard styles and layout sets are always held in Client 000.

    In what format does SAP Script store text ?
    SAPscript texts are stored in Interchange Text Format (ITF). SAPscript offers conversion programs for the text file formats Rich Text Format (RTF) and ASCII as an interface to other word processors.

    The various window types in SAP Script are Main, Variable and Constant.

    The New-Page command is used to force a Page break in the text at any point.

    Protect ... Endprotect command pairs can be nested (True / False).
    False.

    Delimiter & must be used immediately before and after the symbol.

    What does the composer do?

    The final appearance of your documednt depends on interaction between the print program and the layout set.

    The SAPscript print program initializes the printing process. Every command entered using the SAPscript programming interfaces is transferred to the composer.

    The composer received layout information from the layout set specified by the print program. The documents are formatted according to this layout information.

    If the documents contain variables, the compoer replaces these variables with data from the R/3 system, such as the current date, or with the userdata selected by the print program.

    The print program controls the completion of thelayout set. Once this is done, the composer places the completed document in the spool.

    Where do we define Tab space for data in SAPScript?

    When defining the paragraph for the text element we can define the TABS then. There is parameter called TABS to be defined in paragraph definition.

    what is difference between Window & a Page Window?

    Window: An area that is predefined in the layout set. Windows are text modules, which are positioned on a document page.

    We define the window type, Default Paragraph, specify the text elements or a SAPscript text to be included etc in the Windcow Component.

    PageWindow: we define the parameters of the earlier defined Window, appearance on the document like left or right margins, Width & Height.

    What are symboles & state their different types with E.g.

    A Symbol is a constant, which can be inserted in a document. It saves the user unnecessary work when replacing sections of text, phrases, etc. Each symbol has a name which is encloses by &.

    Eg. &variable name &
    System symbols eg &Date&, &time& etc.

    Standard symbols :Standard symbols are user-defined. They are maintained centrally in table TTDTG. Eg. &SGDH& for the opening salutation : “dear sir/madam”.
    &MFG& for the closing saluta

SAP ABAP Scripts Question and Answers Part 2

what is the purpose of “Protect and EndProtect”?.

You can specify either in the style or in the layout set that a particular paragraph should not be slit in two by a page beak. If the page protect attribute is set then the complete paragraph is always output ona single page. This property applies only to that particular paragraph. SAPScript provides the PROTECT… ENDPROTECT command pair to allow you to define the areas to be protected against a page beak 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.

How do we set the date, time format?

SET TIME MASK : CONROLS THE TIME FIELD FORMAT.
SET DATE MASK : CONTRLS THE DATE FIELD FORMAT.

EG. Set Time Mask = “ HH:MM:SS”.

what is the role of an ABAP progrm in SAPScript?

Retrieves R/3 application data from the database.

Defines the layout set processing logic ( The order and repetition of text elements).

Chooses a layout set for printing.

Selects the output device, such as printer,monitor, or fax.

Sets print attributes such as immediate output, number of copies ,and pages to beprinted.

How to reuse some components of the script layout to other program?
Is this script layout is standard for all the printer? If not then y we are going for script layout?

Give me couple of methods that I will take standard script layout printout for different printer.

How u will analysis script program? ( which goes to main and how many windows etc….)

Can V inserted logo on your program?. Give me the program name which uploads my logo and syntax for logo inserting in sap script.
Yes u can insert a logo on your script layout.
Use this Report “RSTXLDMC” which will uploads the logo.
Use the following statement which includes the logo on your script prog.
/: INCLUDE 'ZHEX-MACRO-XXX' OBJECT TEXT ID ST LANGUAGE 'E'.

XXX – object name, u will gives @ runtime in rstxldmc program.

Give me syntax for box command.
BOX XPOS 2 MM WIDTH 0 CM HEIGHT '9.5' CM FRAME 10 TW

Script Commands.

Defining a variable

DEFINE &CUST& = '00000021'.

Define and insert a standard text:

Standard texts is predifined textst that can be used in more than one form. Standard texts are can be created, changed and displayed using transaction SO10.

The text ID is used to callsify texts.

To include a stadard text in a form, use the INCLUDE command:

/: INCLUDE Z_BC460_EX4_HF OBJECT TEXT ID SDVD

When formatting the standard text the PARAGRAPH parameter is used. To center the text use:

/: INCLUDE Z_BC460_EX4_HF OBJECT TEXT ID SDVD LANGUAGE EN PARAGRAPH C.

Formatting addresses

The ADDRESS-ENDADDRESS command formats addresses according to the postal norms of the recipient's country, as defined in the

country parameter.

ADDRESS DELIVERY PARAGRAPH AD
NAME &KNA1-NAME&
STREET &KNA1-STRAS&
POSTCODE &KNA1-PSTLZ&
CITY &KNA1-ORT01&'
COUNTRY &KNA1-LAND1&
FROMCOUNTRY 'DE'
ENDADDRESS

Avoiding pagebreaks in a paragraph

/: PROTECT
:
:
/: ENDPROTECT

The text lines to be protected are enclosed between the two commands

Conditonal text ouput IF - ENDIF

You can use IF/ENDIF like in a normal ABAP program

/: IF condition
:
:
/: ENDIF

and

/: IF condition
:
/: ELSE
:
/: ENDIF

Example:

/: IF &SPFLI-CITYTO& = "BERLIN"
..... put some text here
/: ENDIF

Symbols and Control commands

Symbols are placeholders for values that are inserted during print formatting.

Symbols are indentified by name surrounded by "&" and are not case sensitive

Types of symbols

System symbols

DATE Date
DAY
Day
NAME_OF_DAY
Name of day
MONTH
Month
YEAR
Year
TIME
Time

HOURS Hours
MINUTES
Minutes
SECONDS
Seconds
PAGE
Page number
NEXTPAGE
Number of next pagre
DEVICE
Output device
SPACE
Blank space
ULINE
Underline
VLINE
Vertical line

Standard symbols

Standard symbols are user defined and are maintained in table TTDG(table is not available???). You use transaction SM30 to change or display standard symbols.

An examples of standard symbols is &MFG& fot "Yours faithfully"

Standard text

Standard texts is predifined texts that can be used in more than one form. Standard texts are can be created, changed and displayed using transaction SO10.

The text ID is used to classify texts.

To include a standard text in a form, use the INCLUDE command:

/: INCLUDE Z_BC460_EX4_HF OBJECT TEXT ID SDVD

When formatting the standard text the PARAGRAPH parameter is used. To center the text use:

/: INCLUDE

= Object, ID, Language, Paragraph

Example:

/: INCLUDE Z_BC460_EX4_HF OBJECT TEXT ID SDVD LANGUAGE EN PARAGRAPH C.

Name: Z_BC460_EX4_HF

Object: Text

Text id: SDVD (Text id from SO10)

Language: EN

Paragraph: C (Centered)

Tip: You can use menu Insert->Text->Standard to make it easier to insert the text

Program symbols

Program symbols are for contents of database fields or global program symbols. When you print the form, data from the database tables are printed isntead of the symbols.

In the print program:

TABLES: kna1.

In the form:

&KNA1-NAME1&

Formatting

&SYMBOL& No formatting
&SYMBOL+4& Offset - Output begins here. Offset refers to formatted value
&SYMBOL(5)& Length - Output data in the specified length
&SYMBOL(I)& Suppress initial value - If the field has been initialized, nothing is output
&SYMBOL(Z)& Suppress leading zeros
&SYMBOL(C)& Compress blank spaces - Consecutice spaces are compressed into a single space. Leading spacesare suppressed.

&SYMBOL(R)& Right align output
&SYMBOL(S)& Operators are suppressed
&SYMBOL(*)& Dictionary length - The data length is defined by the ABAP dictionary
&SYMBOL(8.2)& Decimal format. Length 8 decimals 2
&'text1'SYMBOL'text2'& Text can be inserted before and after the symbol

Control commands

Control command are used to modify text output. Use format key /: in the format column.

/: INCLUDE
/: DEFINE
/: ADDRESS....ENDADDRESS
/: PROTECT.....ENDPROTECT

/: NEW-PAGE
/: IF....ENDIF
/: CASE...ENDCASE

Examples of control commands
INCLUDE

INCLUDE name

Parameters:

OBJECT E.g. TEXT, DOKU (Document), DSYS (Hypertext).
ID Text ID -Text ID is a way to group texts - Se transaction SO10
LANGUAGE If the parameter is not specefied, the logon language will be used
PARAGRAPH The text to be included is formatted using the style allocated. The PARAGRAPH parameter can be used

.

SAP ABAP Scripts Question and Answers Part 3

61. Calling a form from SapScript (*****)

/:DEFINE &CUST& = '00000021'.
/:PERFORM GET_NAME IN PROGRAM Z_BC460_EX4_HF
/: USING &CUST&
/: CHANGING &NAME&
/:ENDPERFORM.

Dear &NAME&

The ABAP routine could be defined as follows:

IMPORTANT: The structure itcsy must be used for the parameters.

REPORT Z_HENRIKF_SCRIPT_FORM .
tables scustom.
form get_name tables in_tab structure itcsy
out_tab structure itcsy.

read table in_tab index 1.

select single * from scustom
where id = in_tab-value.

if sy-subrc = 0.
read table out_tab index 1.
move scustom-name to out_tab-value.
modify out_tab index sy-tabix.
else.
read table out_tab index 1.
move 'No name' to out_tab-value.
modify out_tab index sy-tabix.
endif.

** You could also fill the ouput parameter table this way
READ TABLE out_par WITH KEY 'NAME1'.
out_par-value = l_name1.

MODIFY out_par INDEX sy-tabix.

endform.

Note that if you use more than one parameter you must use Using or Changing before every parameter !

/: PERFORM

IN PROGRAM
/: USING &INVAR1&
/: USING &INVAR2&
......
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
......
/: ENDPERFORM

62. Structure of a print program

The print program is used to print forms. The program retieves the necesary data from datbase tables, defines the order of in which text elements are printed, chooses a form for printing and selects an output device and print options.

Open form printing - Must be called before working with any of the other form function modules.
call function 'OPEN_FORM'.....

Must be ended with function module CLOSE FORM

*To begin several indentical forms containing different data within a single spool request, begin each form using START_FORM, and end it using END_FORM
call funtion 'START_FORM'.....

Write text elements to a window of the form
call function 'WRITE_FORM'.....

Ends form
call funtion 'END_FORM'.....

Closes form printing
call function 'CLOSE_FORM'.
...

Examples of function calls

OPEN FORM

CALL FUNCTION 'OPEN_FORM'
EXPORTING
* APPLICATION = 'TX'
* ARCHIVE_INDEX =
* ARCHIVE_PARAMS =
DEVICE = 'PRINTER'
DIALOG = 'X'
* FORM = ' '
* LANGUAGE = SY-LANGU
OPTIONS = OPTIONS

* MAIL_SENDER =
* MAIL_RECIPIENT =
* MAIL_APPL_OBJECT =
* RAW_DATA_INTERFACE = '*'
IMPORTING
* LANGUAGE =
* NEW_ARCHIVE_PARAMS =
* RESULT =
EXCEPTIONS
CANCELED = 1
DEVICE = 2
FORM = 3
OPTIONS = 4

UNCLOSED = 5
MAIL_OPTIONS = 6
ARCHIVE_ERROR = 7
INVALID_FAX_NUMBER = 8
MORE_PARAMS_NEEDED_IN_BATCH = 9
OTHERS = 10
.


START_FORM

CALL FUNCTION 'START_FORM'
EXPORTING
* ARCHIVE_INDEX =
FORM = 'MY_FORM'

* LANGUAGE = ' '
* STARTPAGE = ' '
* PROGRAM = ' '
MAIL_APPL_OBJECT =
IMPORTING
* LANGUAGE =
EXCEPTIONS
FORM = 1
FORMAT = 2
UNENDED = 3
UNOPENED = 4
UNUSED = 5
OTHERS = 6

WRITE_FORM

See 'WRITE_FORM'

END_FORM

CALL FUNCTION 'END_FORM'

IMPORTING
* RESULT =
EXCEPTIONS
* UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
OTHERS = 3

CLOSE_FORM

Structure for Print options (return values) - Pages selected for printing, Number of copies etc.
DATA BEGIN OF RESULT.
INCLUDE STRUCTURE ITCPP.
DATA END OF RESULT.

CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = RESULT

* RDI_RESULT =
TABLES
* OTFDATA =
EXCEPTIONS
* UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
* SEND_ERROR = 3
* OTHERS = 4.

63. CONTROL_FORM - Calling Commands Using a program

The function module CONTROL_FORM can be used to create SapScript control statements from within an ABAP program.

Example:

call function 'CONTROL_FORM'
EXPORTING
COMMAND = 'PROTECT'.

call function 'WRITE_FORM'.....................

call function 'CONTROL_FORM'
EXPORTING
COMMAND = 'ENDPROTECT'.

Styles

Styles are used to predefine paragraph and character formats for forms. SAP provides several standard styles e.g. for Address includes, on-line documentation and so on. You can define your own styles.

To find styles, create styles and maintaine styles, use transaction SE72.

You assign style to a text by using menu Format -> Style

You can make temporary style changes using the control command /: STYLE

Using graphics in SapScript

Use transaction SE78 to inmport graphics to SAP.

In the form painter, you can either include directly to the form using menu Edit->Graphic->Create or using the INCLUDE statement in a window.

To use an INCLUDE stanment, goto into the woindow script editor and use menu Include->Graphic. The include can look like this for a bitmap:

/: BITMAP MYLOGO OBJECT GRAPHICS ID BMAP TYPE BMON

Modifications
Considerations in connection with modifications

The standard SAP print program should only be changed when it is absolutely necessary. If additional data is needed, these can in many cases be retrieved using a a PERFORM statement in the form instead of changing the print program..

There can be the following reasons to change the print program:

Structureal changes
New text eloements are needed
Print program to be used to print additional forms

Determine/change which forms and printprograms that are used for printing

The forms and print programs for a given output type and application can be found in table TNAPR Processing programs for output

Use view V_TNAPR in (Transaction SE30) to change entries

.

SAP ABAP Scripts Question and Answers Part 4

Module Pool

Transactions:
A transaction is a program that conducts a dialog with the user. In a typical dialog, the system displays a screen on which the user can enter or request information. Based on the the user input or request, the program executes the appropriate actions like, it branches to the next screen, displays an output, or changes the database.

Explain what is a transaction in SAP terminology.
- In SAP terminology, a transaction is series of logically connected dialog steps.

Explain how SAP GUI handles output screen for the user.
- User terminal input is accepted by SAP GUI and sent to the SAP dispatcher. The dispatcher co-ordinates the information exchange between the SAP GUIs and the work processes. The dispatcher first places the processing request in request queues, which it then processes. The dispatcher dispatches the requests to the available work process. The actual processing takes place in the work process. When processing is complete, the result of a work process is returned via the dispatcher to the SAP GUI. The SAP GUI interprets the received data and generates the output screen for the user.

What is LUW or Database LUW or Database Transaction ?
- A “LUW” ( logical unit of work ) is the span of time during which any database updates must be performed . Either they are all performed ( committed ) , or they are all thrown away ( rolled back ).

LUW ( or “database LUW” or “database transaction” )
This is the set of updates terminated by a database commit. A LUW lasts, at most, from one screen change to the next ( because the SAP system triggers database commits automatically at every screen change ).

LUWs help to guarantee database integrity. When an LUW has been successfully concluded, the database is once again in a correct state. If, however, an error occurs within an LUW, all database changes made since the beginning of the LUW are canceled and the database is then in the same state as before the LUW started.

An LUW begins

- Each time you start a transaction
- When the database changes of the previous LUW have been confirmed (database commit) or
- when the database changes of the previous LUW have been cancelled (database rollback)

An LUW ends

- When the database changes have been confirmed (database commit) or
- When the database changes have been canceled (database rollback)

What is SAP LUW or Update Transaction ?
- Update transaction ( or “SAP LUW”)
This is a set of updates terminated by an ABAP/4 commit. A SAP LUW may last much longer than a database LUW, since most update processing extends over multiple transaction screens.The programmer terminates an update transaction by issuing a COMMIT WORK statement.

Does the external program run in the same SAP LUW as the caller, or in a separate one?
- Transactions run with a separate SAP LUW
- Reports run with a separate SAP LUW
- Dialog modules run in the same SAP LUW as the caller
- Function modules run in the same SAP LUW as the caller
The only exceptions to the above rules are function modules called with IN UPDATE TASK (V2 function only) or IN BACKGROUND TASK (ALE applications). These always run in their own (separate) update transactions.

What are the requirements a dialog program must fulfill ?
- A dialog program must fulfill the following requirements
. a user friendly user interface
. format and consistency checks for the data entered by the user
. easy correction of input errors
. access to data by storing it in the database.

What are the basic components of dialog program ?
- Screens (Dynpros)
Each dialog in an SAP system is controlled by dynpros. A Dynpro consists of a screen and its flow logic and controls exactly one dialog step.
- ABAP/4 module pool
Each dynpro refers to exactly one ABAP/4 dialog program. Such a dialog program is also called a module pool, since it consists of interactive modules.

What is a dynpro ? What are its components ?
- A dynpro (DYnamic PROgram) consists of a screen and its flow logic and controls exactly
one dialog step.
- The different components of the dynpro are:
Flow logic: Calls of the ABAP/4 modules for a screen
Screen layout: Positions of the texts, fields, pushbuttons, and so on for a screen
Screen attributes: Number of the screen, number of the subsequent screen, and others
Field attributes: Definition of the attributes of the individual fields on a screen

What is screen flow logic? What are the selections in it? Explain PAI and PBO?

Ans - Screen flow logic contains the procedural part of a screen. The screen flow logic is like an ABAP program in that it serves as a container for processing blocks. There are four event blocks, each of which is introduced with the screen keyword PROCESS:

PROCESS BEFORE OUTPUT.
...
PROCESS AFTER INPUT.
...
PROCESS ON HELP-REQUEST.
...
PROCESS ON VALUE-REQUEST.

Selections are performed in PAI.

PROCESS BEFORE OUTPUT (PBO) is automatically triggered after the PAI processing of the previous screen and before the current screen is displayed. You can program the PBO processing of the screen in this block. At the end of the PBO processing, the screen is displayed.

PROCESS AFTER INPUT (PAI) is triggered when the user chooses a function on the screen. You can program the PAI processing of the screen in this block. At the end of the PAI.
processing, the system either calls the next screen or carries on processing at the point from which the screen was called.

PROCESS ON HELP-REQUEST (POH) and PROCESS ON VALUE-REQUEST (POV) are triggered when the user requests field help (F1) or possible values help (F4) respectively. You can program the appropriate coding in the corresponding event blocks. At the end of processing, the system carries on processing the current screen.

Can we use WRITE statement in screen fields ? If not how is data transferred from field data to screen fields
- We cannot write field data to the screen using the WRITE statement. The system instead transfers data by comparing screen field names with ABAP/4 variable names. If both names are the same, it transfers screen field values to ABAP/4 program fields and vice-versa. This happens immediately before and immediately after displaying the screen.

How does the interaction between the Dynpro and the ABAP/4 modules takes place ?
- A transaction is a collection of screens and ABAP/4 routines, controlled and executed by a Dialog processor. The Dialog processor processes screen after screen, thereby triggering the appropriate ABAP/4 processing for each screen. For each screen, the system executes the flow logic that contains the corresponding ABAP/4 processing. The control passes from screen flow logic to ABAP/4 code and back.

How does the Dialog handle user requests ?
- When an action is performed, the system triggers the PROCESS AFTER INPUT event. The data passed includes field screen data entered by the user and a function code. A function code is a technical name that has been allocated in the Screen Painter or Menu Painter to a menu entry, a pushbutton, the ENTER key or a function key of a screen. An internal work field (ok-code) in the PAI module evaluates the function code, and the appropriate
action is taken.

How are the function codes handled in flow logic ?
- When the user selects a function in a transaction, the system copies the function code into a specially designated work field called OK_CODE. This field is global in the ABAP/4 module pool. The OK_CODE can then be evaluated in the corresponding PAI module.
The function code is always passed in exactly the same way, regardless of whether it comes from a screen's pushbutton, a menu option, function key or other GUI element.

What controls the screen flow ?
- The SET SCREEN and LEAVE SCREEN statements control screen flow.

What are “field” and “chain” statements ?
- The FIELD and CHAIN flow logic statements let you program your own field checks. FIELD and CHAIN tell the system which fields you are checking,and whether the system should perform checks in the flow logic or call an ABAP/4 module.

What is an on “*-input field” statement ?
- ON *-INPUT
The ABAP/4 module is called if the user has entered a "*" in the first character of the field, and the field has the attribute *-entry in the Screen Painter. You can use this option in exceptional cases where you want to check only fields with certain kinds of input.

What are conditional chain statements ?
- ON CHAIN-INPUT similar to ON INPUT.
The ABAP/4 module is called if any one of the fields in the chain contains a value other than its initial value (blanks or nulls).
ON CHAIN-REQUEST
This condition functions just like ON REQUEST, but the ABAP/4 module is called if any one of the fields in the chain changes value.

What is “at exit-command” ?
- The flow logic keyword AT EXIT-COMMAND is a special addition to the MODULE statement in the flow logic. AT EXIT-COMMAND lets you call a module before the system executes the automatic field checks.

Which function type has to be used for using “at exit-command” ?
- To use AT EXIT-COMMAND, we must assign a function type ‘E’ to the relevant function in the Menu Painter or Screen Painter.

What is the difference between SET SCREEN and CALL SCREEN ?
With SET SCREEN, the current screen simply specifies the next screen in the chain. control branches to this next screen as soon as the current screen has been processed. Return from next screen to current screen is not automatic. It does not interrupt processing of the current screen. If we want to branch to the next screen without finishing the current one, use LEAVE SCREEN.

With CALL SCREEN, the current (calling) chain is suspended, and a next screen (or screen chain) is called in. The called screen can then return to the suspended chain with the statement LEAVE SCREEN TO SCREEN 0. Sometimes we might want to let an user call a popup screen from the main application screen to let them enter secondary information. After they have completed their entries, the users should be able to close the popup and return directly to the place where they left off in the main screen. Here comes CALL SCREEN into picture. This statement lets us insert such a sequence into the current one.

Can we specify the next-screen number with a variable. ( Yes / No ).
Yes.

The field SY-DYNNR refers to ________________.
Number of the current screen.

What is a dialog module ?
A dialog module is a callable sequence of screens that does not belong to a particular transaction. Dialog modules have their own module pools, and can be called by any transaction.

The syntax used to call a screen as a dialog box ( popup ) is _________________.
CALL SCREEN
STARTING AT
ENDING AT .

What is a “call mode” ?
In the ABAP/4 world, each stackable sequence of screens is a "call mode". This is important because of the way you return from a given current sequence. To terminate a call mode and return to a suspended chain, set the "next screen" to 0 and leave to it:
LEAVE TO SCREEN 0 or ( SET SCREEN 0 and LEAVE SCREEN ). When you return to the suspended chain, execution resumes with the statement directly following the original CALL SCREEN statement. The original sequence of screens in a transaction is itself is a
calling mode. If you LEAVE TO SCREEN 0 in this sequence ( that is, without having stacked any additional call modes ), you return from the transaction altogether.

The maximum number of calling modes stacked at one time is ______.
Nine.

What is LUW or Database LUW or Database Transaction ?
A “LUW” ( logical unit of work ) is the span of time during which any database updates must be performed in an “all or nothing” manner. Either they are all performed ( committed ) , or they are all thrown away ( rolled back ). In the ABAP/4 world, LUWs and transactions can have several meanings:
LUW ( or “database LUW” or “database transaction” )
This is the set of updates terminated by a database commit. A LUW lasts, at most, from one screen change to the next ( because the SAP system triggers database commits automatically at every screen change ).

What is SAP LUW or Update Transaction ?
Update transaction ( or “SAP LUW”)
This is a set of updates terminated by an ABAP/4 commit. A SAP LUW may last much longer than a database LUW, since most update processing extends over multiple transaction screens.The programmer terminates an update transaction by issui

.

SAP ABAP Scripts Question and Answers Part 5

What is a screen group ? How it is useful ?
Screen group is a field in the Screen Attributes of a screen. Here we can define a string of up to four characters which is available at the screen runtime in the SY-DNGR field. Rather than maintaining field selection separately for each screen of a program, we can combine logically associated screens together in a screen group.

What is a Subscreen ? How can we use a Subscreen ?
A subscreen is an independent screen that is displayed in an area of another ("main") screen. To use a subscreen we must call it in the flow logic ( both PBO and PAI ) of the main screen. The CALL SUBSCREEN statement tells the system to execute the PBO and PAI events for the subscreen as part of the PBO or PAI events of the main screen. The flow logic of your main program should look as follows:
PROCESS BEFORE OUPTPUT.
CALL SUBSCREEN INCLUDING '' ''.
PROCESS AFTER INPUT.
CALL SUBSCREEN .
Area is the name of the subscreen area you defined in your main screen. This name can have up to ten characters. Program is the name of the program to which the subscreen belongs and screen is the subscreen's number.

What are the restrictions on Subscreens ?
Subscreens have several restrictions. They cannot:
Set their own GUI status
Have a named OK code
Call another screen
Contain an AT EXIT-COMMAND module
Support positioning of the cursor

How can we use / display table data in a screen ?
ABAP/4 offers two mechanisms for displaying and using table data in a screen. These mechanisms are TABLE CONTROLS and STEP LOOPS.

What are the differences between TABLE CONTROLS and STEP LOOPS ?
- TABLE CONTROLS are simply enhanced STEP LOOPS that display data with the look and feel of a table widget in a desktop application. But from a programming standpoint, TABLE CONTROLS and STEP LOOPS are almost exactly the same. One major difference between STEP LOOPS and TABLE CONTROLS is in STEP LOOPS their table rows can span more than one line on the screen. By contrast the rows in a TABLE CONTROLS are always single lines, but can be very long. ( Table control rows are scrollable ). The structure of table controls is different from step loops. A step loop, as a screen object, is simply a series of field rows that appear as a repeating block. A table control, as a screen object consists of : i ) table fields ( displayed in the screen ) ii ) a control structure that governs the table display and what the user can do with it.

Why do we need to code a LOOP statement in both the PBO and PAI events for each table in the screen ?
We need to code a LOOP statement in both PBO and PAI events for each table in the screen. This is because the LOOP statement causes the screen fields to be copied back and forth between the ABAP/4 program and the screen field. For this reason, at least an empty LOOP......ENDLOOP must be there.

The field SY-STEPL refers to ___________________ .
The index of the screen table row that is currently being processed. The system variable SY-STEPL only has a meaning within the confines of LOOP...ENDLOOP processing. Outside the loop, it has no valid value.

How can we declare a table control in the ABAP/4 program ?
Using the syntax controls

type tableview using screen .

Differentiate between static and dynamic step loops.
Step loops fall into two classes: Static and dynamic. Static step loops have a fixed size that cannot be changed at runtime. Dynamic step loops are variable in size. If the user re-sizes the window the system automatically increases or decreases the number of step loops blocks displayed. In any given screen you can define any number of static step loops but only a single dynamic one.

What are the two ways of producing a list within a transaction ?
By submitting a separate report.
By using leave to list-processing.

What is the use of the statement Leave to list-processing ?
Leave to list-processing
statement is used to produce a list from a module pool. Leave to list-processing statement allows to switch from dialog-mode to list-mode within a dialog program.

When will the current screen processing terminates ?
A current screen processing terminates when control reaches either a Leave-screen or the end of PAI.

How is the command Suppress-Dialog useful ?
Suppressing entire screens is possible using this command. This command allows
us to perform screen processing “in the background”. The system carries out all PBO and PAI logic, but does not display the screen to the user. Suppressing screens is useful when we are branching to list-mode from a transaction dialog step.

What happens if we use Leave to list-processing without using Suppress-Dialog ?
If we don't use Supress-Dialog the next screen will be displayed but as empty.
when the user presses ENTER, the standard list output is displayed.

How the transactions that are programmed by the user can be protected ?
By implementing an authority check.

What are the modes in which any update tasks work ?
Synchronous and Asynchronous.

What is the difference between Synchronous and Asynchronous updates ?
A program asks the system to perform a certain task, and then either waits or doesn't wait for the task to finish. In synchronous processing, the program waits: control returns to the program only when the task has been completed. In asynchronous processing, the program does not wait: the system returns control after merely logging the request for execution.

What is the difference between Leave Transaction and Call Transaction ?
- In contrast to LEAVE TO TRANSACTION, the CALL TRANSACTION statement causes the system to start a new SAP LUW . This second SAP LUW runs parallel to the SAP LUW for the calling transaction.

Overall how do you write transaction program in SAP?
Create the transaction using object browser (SE80)
Define the objects e.g. screen, Transactions. – Modules – PBO, PAI.
And you can create a transaction from SE93 also.

Does SAP has a GUI screen painter? If yes What operating systems is it available on? What is the other type of screen painter called?
Yes
On what OS is it available – Window based.
Other type of screen painter – alpha numeric screen painter.

What are step loops? How do you program page down page up in step loop?
Step loops: Method of displaying a set of records.
Page down & Page up: decrement / increment base counter
Index = base + sy-step1 – 1

Normally how many and what files get created when a transaction program is written? What is top XXXXXXTOP program?
Main program with A Includes
I ) TOP INCLUDE – GLOBAL DATA
II ) Include for PBO
III) Include for PAI
IV) include for Forms

Where is processing logic located in an on-line program?
Ans :- ABAP/4 program (module pool)

Describe the online processor. What is its function?
Ans :- Controls the flow of online program.

How are screen names defined? Do you create a screen first or define your program first?
Ans :- Define the program first and then create a screen.

What does PBO stands for? When is the PBO logic performed?
Ans :- PROCESS BEFORE OUTPUT –Processed before the screen is displayed.

What does PAI stands for? When is the PAI logic performed?
Ans :- PROCESS AFTER INPUT –Processed after the user has pressed ENTER.

How is data passed from the screen fields to the ABAP/4 program?
Ans :- Through the flow logic.

What does the TOP Include do for you as a programmer?
Ans: For global declarations.

What are the steps in creating screen?
Where are the module statement declared? Where is the logic within each module?
Ans :-

1.
Go to SE41 ( Screen Painter )
Enter the program name and screen number . Press Enter.
2.
Design the screen and save, check and activate it.

Module statements are in the flow logic within each module is in the ABAP/4 module pool
Program.

What is the significance of the word ‘OUTPUT’ in the declaration

MODULE TEST_KNOWLEDGE OUTPUT

ENDMODULE.
Ans :- Then we know that it is part of the PBO, therefore is processed before the screen is presented.

Describe the fields on the screen ?

Ans :- Attributes screen , Screen types ,follow up screens , cursor position etc. After you have entered the screen number, the screen branches to the screen attribute maintenance. Enter a short description , select the type NORMAL and specify the number of the follow-up screen.

What are the three components of ON-LINE program?

Ans :- Screen , ABAP/4 program and transaction code.

What is gained by using the Dictionary Fields menu option when creating your screen?

Ans :- The fields you have created inherits the same attributes as those in the Data Dictionary.

How to Create a checkbox , frame, pushbuttons and radio buttons on a screen?

Ans :- Just type a name and go to graphic element push button.

How do you assign an OK_CODE for a push button? How it is used in your ABAP?

Ans :- In the field list ,name the element and give it the value that it will represent when pushed You must make sure that you clear the field that represents the pushbutton after every check.
What automatic checks does the screen perform? (should be four)

Describe all four and how they are used?

Ans :- The field format, required input, a foreign key table ,parameters.

What are the two methods to declare input field as mandatory?

If you set required field as program attribute, the user must enter a value in the field. Required fields appear on the screen containing a question mark (?).

How does foreign key work? What you have to put in your screen to identify the foreign key?


No? Then where is the foreign key identified?

Ans :- You have defined a screen field by referring to a Data Dictionary, which has a check table. When the foreign key is checked the system compares the values of the fields to be checked with the contents of the key fields of the corresponding table.

What are the two effects of the foreign key from a user standpoint?

Ans :- Possible entries & a check against the key field contents.

What is user defined validation checks in the flow logic?

Ans :- FIELD…SELECT FIELD…VALUES or in the module pool FIELD…MODULE.

Does the value command in the flow logic go in the PAI or the PBO event?

Ans :- PAI.

If an error occurs in the module pool, which fields are available for entry and which are display only fields?
Ans :- Only those fields defined with the FIELD statement before MODULE & relevant checks in a chain.

When is the chain command used in the PBO event?

Ans :- If you want to make more than one field ready for input after an error.

What table stores the online messages? What is the message class and what is its significance?

Ans :- Table T100. The message class is a specific class of messages for a group of transactions.

What are the 5 different message types and how are they handled by the system? What is then difference between the Warning and Error messages?
Ans :-
A : Abend Message displayed on the current screen and subsequent task terminated
I : Information Message displayed on the current screen , but user can continue program by pressing ENTER
E: Error Message displayed on the current screen. With FIELD statements , the fields concerned become ready again for input and user is required to make the entry /entries again
W : Warning As E message , but correcting input is optional
S: Success Message displayed on the follow-up screen as an I message.

What does WITH statement add to a message?

Ans :- In the place of the & or $ the fields or values are placed in the error message.

What effect does the FIELD statement have within the flow logic?

Ans :- The field statement resets the fields so those fields are ready for input again.

Where are the messages displayed on the screen?

Ans :- At the bottom.

Is the SET PARAMETER statement to be issued in PBO or PAI module? Why?

Ans :- PAI, the value must be input into the fields first before it can be placed in the buffer.

Where does the GET PARAMETER statement get its values? Which field gets populated with the new value?
Ans :- From the buffer.

Where can the SET CURSOR command be executed? What is its effect?

Ans :- In PBO, To position the CURSOR in a particular field after the screen is displayed.

What are the matchcodes and how do they affect the screen field? Where are they specified in the online program?
Ans :- In the Properties window of the Field.

What is the effect of an ON CHAIN-REQUEST command in your flow logic?

Ans :- When value of any of the fields between CHAIN…..ENDCHAIN is attempted to change.

What commands are used to change database table entries?

Ans :-

How can you check if the changes to the database were successful?

Ans :-

What is the difference between the Long form and the short form of making database changes?

SAP ABAP Scripts Question and Answers Part 5

What is a screen group ? How it is useful ?
Screen group is a field in the Screen Attributes of a screen. Here we can define a string of up to four characters which is available at the screen runtime in the SY-DNGR field. Rather than maintaining field selection separately for each screen of a program, we can combine logically associated screens together in a screen group.

What is a Subscreen ? How can we use a Subscreen ?
A subscreen is an independent screen that is displayed in an area of another ("main") screen. To use a subscreen we must call it in the flow logic ( both PBO and PAI ) of the main screen. The CALL SUBSCREEN statement tells the system to execute the PBO and PAI events for the subscreen as part of the PBO or PAI events of the main screen. The flow logic of your main program should look as follows:
PROCESS BEFORE OUPTPUT.
CALL SUBSCREEN INCLUDING '' ''.
PROCESS AFTER INPUT.
CALL SUBSCREEN .
Area is the name of the subscreen area you defined in your main screen. This name can have up to ten characters. Program is the name of the program to which the subscreen belongs and screen is the subscreen's number.

What are the restrictions on Subscreens ?
Subscreens have several restrictions. They cannot:
Set their own GUI status
Have a named OK code
Call another screen
Contain an AT EXIT-COMMAND module
Support positioning of the cursor

How can we use / display table data in a screen ?
ABAP/4 offers two mechanisms for displaying and using table data in a screen. These mechanisms are TABLE CONTROLS and STEP LOOPS.

What are the differences between TABLE CONTROLS and STEP LOOPS ?
- TABLE CONTROLS are simply enhanced STEP LOOPS that display data with the look and feel of a table widget in a desktop application. But from a programming standpoint, TABLE CONTROLS and STEP LOOPS are almost exactly the same. One major difference between STEP LOOPS and TABLE CONTROLS is in STEP LOOPS their table rows can span more than one line on the screen. By contrast the rows in a TABLE CONTROLS are always single lines, but can be very long. ( Table control rows are scrollable ). The structure of table controls is different from step loops. A step loop, as a screen object, is simply a series of field rows that appear as a repeating block. A table control, as a screen object consists of : i ) table fields ( displayed in the screen ) ii ) a control structure that governs the table display and what the user can do with it.

Why do we need to code a LOOP statement in both the PBO and PAI events for each table in the screen ?
We need to code a LOOP statement in both PBO and PAI events for each table in the screen. This is because the LOOP statement causes the screen fields to be copied back and forth between the ABAP/4 program and the screen field. For this reason, at least an empty LOOP......ENDLOOP must be there.

The field SY-STEPL refers to ___________________ .
The index of the screen table row that is currently being processed. The system variable SY-STEPL only has a meaning within the confines of LOOP...ENDLOOP processing. Outside the loop, it has no valid value.

How can we declare a table control in the ABAP/4 program ?
Using the syntax controls

type tableview using screen .

Differentiate between static and dynamic step loops.
Step loops fall into two classes: Static and dynamic. Static step loops have a fixed size that cannot be changed at runtime. Dynamic step loops are variable in size. If the user re-sizes the window the system automatically increases or decreases the number of step loops blocks displayed. In any given screen you can define any number of static step loops but only a single dynamic one.

What are the two ways of producing a list within a transaction ?
By submitting a separate report.
By using leave to list-processing.

What is the use of the statement Leave to list-processing ?
Leave to list-processing
statement is used to produce a list from a module pool. Leave to list-processing statement allows to switch from dialog-mode to list-mode within a dialog program.

When will the current screen processing terminates ?
A current screen processing terminates when control reaches either a Leave-screen or the end of PAI.

How is the command Suppress-Dialog useful ?
Suppressing entire screens is possible using this command. This command allows
us to perform screen processing “in the background”. The system carries out all PBO and PAI logic, but does not display the screen to the user. Suppressing screens is useful when we are branching to list-mode from a transaction dialog step.

What happens if we use Leave to list-processing without using Suppress-Dialog ?
If we don't use Supress-Dialog the next screen will be displayed but as empty.
when the user presses ENTER, the standard list output is displayed.

How the transactions that are programmed by the user can be protected ?
By implementing an authority check.

What are the modes in which any update tasks work ?
Synchronous and Asynchronous.

What is the difference between Synchronous and Asynchronous updates ?
A program asks the system to perform a certain task, and then either waits or doesn't wait for the task to finish. In synchronous processing, the program waits: control returns to the program only when the task has been completed. In asynchronous processing, the program does not wait: the system returns control after merely logging the request for execution.

What is the difference between Leave Transaction and Call Transaction ?
- In contrast to LEAVE TO TRANSACTION, the CALL TRANSACTION statement causes the system to start a new SAP LUW . This second SAP LUW runs parallel to the SAP LUW for the calling transaction.

Overall how do you write transaction program in SAP?
Create the transaction using object browser (SE80)
Define the objects e.g. screen, Transactions. – Modules – PBO, PAI.
And you can create a transaction from SE93 also.

Does SAP has a GUI screen painter? If yes What operating systems is it available on? What is the other type of screen painter called?
Yes
On what OS is it available – Window based.
Other type of screen painter – alpha numeric screen painter.

What are step loops? How do you program page down page up in step loop?
Step loops: Method of displaying a set of records.
Page down & Page up: decrement / increment base counter
Index = base + sy-step1 – 1

Normally how many and what files get created when a transaction program is written? What is top XXXXXXTOP program?
Main program with A Includes
I ) TOP INCLUDE – GLOBAL DATA
II ) Include for PBO
III) Include for PAI
IV) include for Forms

Where is processing logic located in an on-line program?
Ans :- ABAP/4 program (module pool)

Describe the online processor. What is its function?
Ans :- Controls the flow of online program.

How are screen names defined? Do you create a screen first or define your program first?
Ans :- Define the program first and then create a screen.

What does PBO stands for? When is the PBO logic performed?
Ans :- PROCESS BEFORE OUTPUT –Processed before the screen is displayed.

What does PAI stands for? When is the PAI logic performed?
Ans :- PROCESS AFTER INPUT –Processed after the user has pressed ENTER.

How is data passed from the screen fields to the ABAP/4 program?
Ans :- Through the flow logic.

What does the TOP Include do for you as a programmer?
Ans: For global declarations.

What are the steps in creating screen?
Where are the module statement declared? Where is the logic within each module?
Ans :-

1.
Go to SE41 ( Screen Painter )
Enter the program name and screen number . Press Enter.
2.
Design the screen and save, check and activate it.

Module statements are in the flow logic within each module is in the ABAP/4 module pool
Program.

What is the significance of the word ‘OUTPUT’ in the declaration

MODULE TEST_KNOWLEDGE OUTPUT

ENDMODULE.
Ans :- Then we know that it is part of the PBO, therefore is processed before the screen is presented.

Describe the fields on the screen ?

Ans :- Attributes screen , Screen types ,follow up screens , cursor position etc. After you have entered the screen number, the screen branches to the screen attribute maintenance. Enter a short description , select the type NORMAL and specify the number of the follow-up screen.

What are the three components of ON-LINE program?

Ans :- Screen , ABAP/4 program and transaction code.

What is gained by using the Dictionary Fields menu option when creating your screen?

Ans :- The fields you have created inherits the same attributes as those in the Data Dictionary.

How to Create a checkbox , frame, pushbuttons and radio buttons on a screen?

Ans :- Just type a name and go to graphic element push button.

How do you assign an OK_CODE for a push button? How it is used in your ABAP?

Ans :- In the field list ,name the element and give it the value that it will represent when pushed You must make sure that you clear the field that represents the pushbutton after every check.
What automatic checks does the screen perform? (should be four)

Describe all four and how they are used?

Ans :- The field format, required input, a foreign key table ,parameters.

What are the two methods to declare input field as mandatory?

If you set required field as program attribute, the user must enter a value in the field. Required fields appear on the screen containing a question mark (?).

How does foreign key work? What you have to put in your screen to identify the foreign key?


No? Then where is the foreign key identified?

Ans :- You have defined a screen field by referring to a Data Dictionary, which has a check table. When the foreign key is checked the system compares the values of the fields to be checked with the contents of the key fields of the corresponding table.

What are the two effects of the foreign key from a user standpoint?

Ans :- Possible entries & a check against the key field contents.

What is user defined validation checks in the flow logic?

Ans :- FIELD…SELECT FIELD…VALUES or in the module pool FIELD…MODULE.

Does the value command in the flow logic go in the PAI or the PBO event?

Ans :- PAI.

If an error occurs in the module pool, which fields are available for entry and which are display only fields?
Ans :- Only those fields defined with the FIELD statement before MODULE & relevant checks in a chain.

When is the chain command used in the PBO event?

Ans :- If you want to make more than one field ready for input after an error.

What table stores the online messages? What is the message class and what is its significance?

Ans :- Table T100. The message class is a specific class of messages for a group of transactions.

What are the 5 different message types and how are they handled by the system? What is then difference between the Warning and Error messages?
Ans :-
A : Abend Message displayed on the current screen and subsequent task terminated
I : Information Message displayed on the current screen , but user can continue program by pressing ENTER
E: Error Message displayed on the current screen. With FIELD statements , the fields concerned become ready again for input and user is required to make the entry /entries again
W : Warning As E message , but correcting input is optional
S: Success Message displayed on the follow-up screen as an I message.

What does WITH statement add to a message?

Ans :- In the place of the & or $ the fields or values are placed in the error message.

What effect does the FIELD statement have within the flow logic?

Ans :- The field statement resets the fields so those fields are ready for input again.

Where are the messages displayed on the screen?

Ans :- At the bottom.

Is the SET PARAMETER statement to be issued in PBO or PAI module? Why?

Ans :- PAI, the value must be input into the fields first before it can be placed in the buffer.

Where does the GET PARAMETER statement get its values? Which field gets populated with the new value?
Ans :- From the buffer.

Where can the SET CURSOR command be executed? What is its effect?

Ans :- In PBO, To position the CURSOR in a particular field after the screen is displayed.

What are the matchcodes and how do they affect the screen field? Where are they specified in the online program?
Ans :- In the Properties window of the Field.

What is the effect of an ON CHAIN-REQUEST command in your flow logic?

Ans :- When value of any of the fields between CHAIN…..ENDCHAIN is attempted to change.

What commands are used to change database table entries?

Ans :-

How can you check if the changes to the database were successful?

Ans :-

What is the difference between the Long form and the short form of making database changes?

Tutorials on SAP-ABAP

Adobe Interactive Forms Tutorials

Business Server Pages (BSP)

Userexits/BADIs

Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro,)

ALV Tutorials

Blog Archive

goodsites