Sunday, March 8, 2009

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 be printed.
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 we 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 ADNAME & KNA1-NAME&STREET & KNA1-STRAS&POSTCODE & KNA1-PSTLZ & CITY & KNA1-ORT01 & 'COUNTRY & KNA1-LAND1 & FROM COUNTRY 'DE' END ADDRESS

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 DateDAY DayNAME_OF_DAY Name of dayMONTH MonthYEAR YearTIME Time
HOURS HoursMINUTES MinutesSECONDS SecondsPAGE Page numberNEXTPAGE Number of next pagreDEVICE Output deviceSPACE Blank spaceULINE UnderlineVLINE 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 commandsINCLUDE
INCLUDE name
Parameters: OBJECT
E.g. TEXT, DOKU (Document), DSYS (Hypertext). ID Text ID -Text ID is a way to group texts - Se transaction SO10LANGUAGE If the parameter is not specefied, the logon language will be usedPARAGRAPH The text to be included is formatted using the style allocated. The PARAGRAPH parameter can be used

Friday, February 27, 2009

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 islater 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 SAPscripteditor, 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.
3. 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.
4. What are components of SAPscript?
Layout set, SAPscript Text, ABAP Print program , symbols, function modules like open_form, close_From, Read_text etc,.
5. 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 SAPScriptThe 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 foundTry 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 laterUse 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
6. What type of variables normally used in sap script to output data?
&Tables name- fields&.
7. How do you number pages in sap script layout outputs?
& page &
&next Page &
8. What takes most time in SAP script programming?
Defining layout set up / sets.
9. How do you use tab sets in layout sets?
Define paragraph with defined tabs.
10. 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.
11. 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.StylesLayout setsDocumentsWith the Compare tool we can do the following :Check whether an object exists in both clientsDisplay 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.
12. 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.
13. 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.
14. 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.
15. 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.
16. 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 Scripts and Smart Forms Questions

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

SAP ABAP Internal Tables Questions

what is an internal table?
how many type of internal tables are there?
what is the difference between hashed & sorted internal tables?
what is the difference between standard and sorted internal tables? (in performance wise)
Difference between internal table and a dictionary table?
can you create an internal table dynamically?(at run time)
what is the use of select for all entries in an internal table?
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).
in a loop of an internal table, what is the use of at first & at last statements?
What is the use of at new statement?
what is the difference between at first & at new statements?
what is a binary search ? and how it is useful in a sorted internal table?
when do you need to create an internal table with header line ?and with out a header line?
what does it mean occurs 0 while creating an internal table?
what will happen if you don't give occurs clause while creating an internal table?
what is the difference between clear, delete & refresh with respect to an internal table?
.

SAP ABAP Reports Questions

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

SAP ABAP Real Time Questions

Which client number you use for the current project?
You are running a report. It is taking long time for execution. What steps will you do to reduce the execution time?
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?
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?
What is the difference between report and script?
what are the differences between scripts & smart forms?
what are enhancements?
what are user-exits?
what is badi?
what is the difference between user-exit & BADIs?
what is the difference between user-exit & customer-exit?
how do you get functional specs when you are assigned some object? (specs through email..??)
How do you write technical specs?
Howdo you write UTP?(unit test plan)

SAP ABAP Technical Questions (Data Dictonary)

What is data Dictionary?
What is the difference between open sql & native sql ?
Difference between Pooled, cluster & transparent tables?
What is Primary key, foreign key ? what is primary index?
secondary index?
how many indexes can be created for a table?
what is a value table?
what are the components of a table?
what is a domain?
what is a data element?
what is data class?
can you create a table with out a data element?
can you create a field with out a data element?
What approach you prefer for creating a table?
Give few names of cluster tables in sap?
Give few names of pooled tables in sap?
give few names of transparent tables?
what is a buffer and how many types?
what is table maintenance generator and how to create that?
What is the transaction code? How to add new fields to a standard sap table ?
How many types of table joins are there? difference between inner join & outer join?
Difference between "select * from mara" and "select single * from mara"?
what is a match code ? Lock objects ? what are views?
what are logical tables/database?
what is the difference bet'n table and a structure?

Thursday, February 5, 2009

Some General Interview Questions

1 Tell me about yourself?

2 What are your greatest strengths?
3 What are your greatest weaknesses?
4 Tell me about something you did – or failed to do – that you now feel a little ashamed of.
5 Why are you leaving (or did you leave) this position
6 The “Silent Treatment"
7 Why should I hire you?
8 Aren’t you overqualified for this position?
9 Where do you see yourself five years from now?
10 Describe your ideal company, location and job?
11 Why do you want to work at our company?
12 What are your career options right now?
13 Why have you been out of work so long?
14 Tell me honestly about the strong points and weak points of your boss (company, management team, etc.,?
15 What good books have you read lately?
16 Tell me about a situation when your work was criticized?
17 What are your outside interest?
18 The “Fatal Flaw” question
19 How do you feel about reporting to a younger person (minority, woman, etc)?
20 On confidential matters?
21 Would you lie for the company?
22 Looking back, what would you do differently in your life?
23 Could you have done better in your last job?
24 Can you work under pressure?
25 What makes you angry?
26 Why aren’t you earning more money at this stage of your career?

27 Who has inspired you in your life and why?
28 What was the toughest decision you ever had to make?
29 Tell me about the most boring job you’ve ever had?
30 Have you been absent from work more than a few days in any previous position?
31 What changes would you make if you came on board?
32 I’m concerned that you don’t have as much experience as we’d like in
33 How do you feel about working nights and weekends?
34 Are you willing to relocate or travel?
35 Do you have the stomach to fire people? Have you had experience firing many people?
36 Why have you had so many jobs?
37 What do you see as the proper role/mission of… …a good (job title you’re seeking); …a good manager; …an executive in serving the community; …a leading company in our industry; etc.
38 What would you say to your boss if he’s crazy about an idea, but you think it stinks?
39 How could you have improved your career progress?
40 What would you do if a fellow executive on your own corporate level wasn’t pulling his/her weight…and this was hurting your department?
41 You’ve been with your firm a long time. Won’t it be hard switching to a new company?
42 May I contact your present employer for a reference?
43 Give me an example of your creativity (analytical skill…managing ability, etc.)
44 Where could you use some improvement?
45 What do you worry about?
46 How many hours a week do you normally work?
47 What’s the most difficult part of being a (job title)?
48 The “Hypothetical Problem”
49 What was the toughest challenge you’ve ever faced?
50 Have you consider starting your own business?
51 What are your goals?
52 What do you for when you hire people?
53 Sell me this stapler…(this pencil…this clock…or some other object on interviewer’s desk).
54 “The Salary Question” – How much money do you want?
55 The Illegal Question?
56 The “Secret” Illegal Question?
57 What was the toughest part of your last job?
58 How do you define success…and how do you measure up to your own definition?
59 “The Opinion Question” – What do you think about …Abortion…The President…The Death Penalty…(or any other controversial subject)?
60 If you won $10 million lottery, would you still work?
61 Looking back on your last position, have you done your best work?
62 Why should I hire you from the outside when I could promote someone from within?

63 Tell me something negative you’ve heard about our company?
64 On a scale of one to ten, rate me as an interviewer?

Java | Unix