Friday, November 7, 2014

32 [UPDATED] ABAP SAP SCRIPTS Interview Questions and Answers

ABAP SAP SCRIPTS Interview Questions and Answers :


Q1: What is the meaning of a SAP Script and what is the role of it?
A1: SAP Script is in fact the word processor of the SAP system, very similar to the most used text processors available for personal use on computers. Usually companies print the documents in their own layout like invoices, delivery notes and others. There is a standard layout (or predefined) but sometimes the standard layout has to be expanded according to the requirements with additional data like addresses or purchase orders. These details are inserted by employees or they are extracted from database tables. Companies use a high amount of these documents, so printing them has become a big requirement. Larger documents are printed like paychecks, reminders, order confirmations, payslips and others, for making this possible SAP Script is developed in such a way that it can make all the document types mentioned above, it has the IT tool that is used for text insertion and the printing of forms in the R/3 programs. Usually SAP can give us these document types in a standard form but each company can modify them or replace them at their desire and according to their needs.

Q2: Which are the variables that we can utilize for data output in SAP Script?
A2: &Tables name-fields&

Q3: What is the meaning of a Compare Tool in SAP Script?
A3: For object comparison between clients there are many utilities within SAP Script, for example for the comparison of these objects-Documents, Layout sets and Styles we have a Compare Tool. With the Compare Tool we can make many things like: verifying if an object can be found in each of the two clients or showing why multiple versions of an object are different. For the page layout management or to format the text in a document we can use Layout Sets. The Standard styles and layout sets are found in Client 000 in the SAP system.

Q4: How can we describe better the SAP Script ?
A4: SAP Script is by definition the text handling system of SAP R/3, it has a high degree of integration in the SAP system, it is the standard and the most used tool for several tasks that involve the processing of text in the entire SAP system.

Q5: What is the meaning of Layout Sets?
A5: In SAP Script Layout Sets are the tools that define the layout of pages (documents). A layout is constructed from many components, some of them even handle the layout itself for single pages or some are filled with details about the text that is about to be printed on the pages. The Layout Set speaks about how a document will look and how it will be constructed, it will contain text blocks with areas for variables that can be useful for other programs, each SAP Script document has a Layout Set. When we want to modify our documents, for instance when we have to move text blocks, choose a different font, set a specific paragraph type, insert tabs all these can be made from the Layout Set. For text formatting we have two possibilities: We insert the text and output it in normal text maintenance or we can insert the text through the Layout Set.
    The text can be formatted through the ABAP/4 application and the Layout Set, the application will output single text blocks, elements of a text or a whole document. The formatting of our text is given by the use of Styles, they make the formatting by configuring the character formats and the paragraphs that we use in the document. Styles can be useful for highlighting strings of characters and even entire paragraphs, they can be attributed to every type of text but mainly they will be used in the basic windows of Layout Sets, where the text is inserted straight from the user in a document.
     An important element is the header data, which can be used on Styles for show valuable details( in this way an end user can choose a style in the simplest way) and Layout Sets as well, where it has the role of control and information.
     The Layout Set maintenance also contains windows, which are places in a page where the text will output in the near future, every Layout Set contains one or multiple windows, if the window is missing then text formatting will not be possible in SAP Script.
      Window types that are used in Layout Sets:
a)      MAIN-in this type of window the output of text is made continuously, it is a window type that is common to the dialog users, like the body text of letters.
b)      VAR- this type of window contains variable text in every page where the window is found, these windows will be formatted for every page.
c)      CONST-this type of window contains constant text so it will be formatted only one time.

W can classify the elements of a Layout Set like this:
a)      The header data- it contains data about the construction and the Layout Set like who made the document, what elements were used etc. This is the start page.
b)      The paragraph formats –they are needed for text formatting exactly as in Styles but their usage extends to the processing of text like formatting the text elements as well.
c)      The character formats-these can be used for formatting paragraphs and text, they actually format the text from inside paragraphs
d)     The windows- they are placed only after their assigning to pages and attributing measurement units.
e)      The pages- They give us a beginning and a finish in the formatting of text.
f)        The page windows- They bring the pages and the windows together and their measurements are stated.
The management commands in SAP Script are meant for handling the output formatting and they are not read by the SAP Script Editor but processed by the SAP Script Composer which is an application that transforms the text from the editing form to the printing form.

Q6: Can we describe the way in which the Layout Sets are backed up, uploaded and downloaded in SAP Script?
A6: For the SAP Script backup we have go to transaction SE71to select Utilities then Copy from client then Give source from name then source client (000 default) and Target from name. For downloading we must go to transaction SE71 the we must write the name of the form then we select Display, Utilities, form info, List and we hit Save to PC file. Fro Upload we have to create form with page then window, pagewindow with the downloaded PC file. From the PC file we will have the page window text elements.

Q7: What is the way to count pages the SAP Script outputs?
A7: &page&, &nextPage&.

Q8: How can we classify the SAP Script components?
A8: SAP Script can be classified in: SAP Script text, Layout Set, Symbols, ABAP print program and function modules such as read text, open/close form and others.

Q9: What is the way to deposit the text in SAP Script?
A9: For text storage SAO Script uses ITF or the Interchange Text Format but it also has the options to convert RTF or Rich Text Format and also ASCII which are formats for other text processors.

Q10: How can we describe symbols and what are the main types with example?
A10: The constant that may be entered into a document has the name of symbol and has the role of keeping the supplementary work if phrases or portions of the text get replaced, the symbol name is enclosed with &. Example: &variable name&, or system symbols like &Date&, &time& an others. Standard symbols are the ones that the user has defined and they are kept in the table TTDTG. Examples of standard symbols: &SGDH& for :”dear sir/madam” and &MFG& for:”yours Faithfully”. The program symbols show ABAP/4 program data that invoked a function for text processing, example: Itab-connid. The text symbols are good for every block type of text to define but it becomes valid just where it has been defined, example: Define &Symbol&=’value’.

Q11: How can we implement the tab sets in Layout Sets?
A11: We can do this by defining the paragraphs using defined tabs.

Q12: What is the role of the composer?
A12: For getting a final look of our documents we will combine the Layout Set with the print program, the print program is being started by SAP Script so the process of printing begins, each of the commands inserted with the aid of the SAP Script interface is given to the composer. The print program specifies a Layout Set which contains the details that will be sent to the composer, and in this way the documents will be formatted base on the details provided. When there are variables in a document they are they will be replaced with R/3 data, for example the actual date or with data from the print program. In the end the document is finished with the use of the print program and the composer will put it in the spool.

Q13: What is the way to define the text symbols?
A13: We can define the text symbols with the aid of the control command DEFINE &x1&=’56’

Q14: What activity is the most time-consuming from all in SAP Script coding?
A14: The most time-consuming is when we define Layout Sets.

Q15: What commands are used in ABAP/4 for connecting a Layout Set?
A15: We can use the following: the call functions OPEN-form, WRITE-form or CLOSE-form.

Q16: How do we define the data tab space in SAP Script and where?
A16: We may define the tabs after we define the text element paragraphs.

Q17: Which are the commands mainly used for control?
A17: The main control commands are PROTECT, ENDPROTECT, DEFINE, NEW-PAGE, INCLUDE, IF, ENDIF.

Q18: How can we introduce a logo in our program and what is the name of the program for logo upload and also what syntax can be used for this in SAP Script?
A18: We can use the “RSTXLDMC” report for uploading a logo and this statement: /:INCLUDE’ZHEX-MACRO-XXX’OBJECTTEXTID ST LANGUAGE’E’. The name of the object is represented by ‘XXX’.

Q19: What purpose has an ABAP application in SAP Script?
A19: The purpose of an ABAP application can include multiple parts like:
a)      It makes the definition of the processing logic of the Layout Set, or so to speak-what order the elements of text have and when are they used again.
b)      It takes the data from the R/3 program that is found in the database.
c)      It selects a Layout Set to print.
d)     Chooses printer, fax or monitor as the output device.
e)      It makes print configurations regarding the counting of pages that will be printed.

Q20: What is the correct syntax used for a box command?
A20: The syntax looks like this one: BOX XPOS 2MM WIDTH 0 CM HEIGHT ‘9.5’ CM FRAME 10 TW.

Q21: How do we define variables?
A21:  DEFINE &CUST&=’00000021’.

Q22: How can we describe symbols more detailed?
A22: The values that are entered in the time of print formatting are stored in symbols and these symbols can be found under names between”&” and they are not case sensitive.
System symbols are: DATE, DAY, NAME_OF_DAY, MONTH, YEAR, TIME, HOURS, MINUTES, SECONDS, PAGE, NEXTPAGE, DEVICE, SPACE, ULINE, VLINE. Standard symbols are the ones from table TTDG and are defined by the user. To show them or modify them we can use the transaction SM30. An example of standard symbol: &MFG&. The standard text is a normal text that can be found in one or multiple forms and they can be written , modified or shown with the aid of the transaction SO10. For text classification we have text ID. For putting standard texts in forms we can do this with the command INCLUDE like the following: INCLUDEZ_BC460_EX4_HF OBJECTTEXT ID SDVD. We can use the PARAGRAPH parameter to format standard texts, in the next example we will see how we can center the text:
INCLUDEZ_BC460_EX4_HF OBJECTTEXT ID SDVD LANGUAGE EN PARAGRAPH C.
Name:Z_BC460_EX4_HF
Object: Text
Text id: SDVD(TEXT id from SO10)
Language EN
Paragraph: C (Centered0.
Program symbols are used for database content. For tables: kna1, in forms: &KNA1-NAME1&, for formatting: &SYMBOL& (it means there is no formatting), &SYMBOL(5)&Length(the data and length), &SYMBOL(Z)&Suppress leading zeros, &SYMBOL+4&Offset(the start of the output), &SYMBOL(I)&Suppress initial value, &SYMBOL(C)&Compress blank spaces(one space from the compression of consecutive spaces), &SYMBOL(S)&Operators are suppressed, &SYMBOL(R)&Right align output, &SYMBOL(8.2)&Decimal format(length), &SYMBOL(*)&Dictionary length(the ABAP dictionary), &’text1’SYMBOL’text2’&Text entered prior to and after the symbol.

Q23: Can we give a detailed description on the Control commands?
A23: For the changing of text output we use control commands./: is the format key that can be used in the format column, there is the intensity (grey scale) in percents, the frame thickness is given by frame parameters with zero as the initial value. Every parameter such as width and height, xpos and ypos or frame will have a measurement unit like: CH-character, TW-twip, IN-inch, PT-point, MM-millimeter, LN-line, CM-centimeter; as an example we have: BOX XPOS ’10.14’ MM YPOS ‘5.79’ MM HEIGHT ‘9’ MMWIDTH ‘14’ MM INTENSITY 8 FRAME 0 TW. This is making 2 lines and 2 rectangles for building a 3 column table and a highlighting heading section.
     POSITION and SIZE are commands used for configuring the initial box parameters, a very good thing when we have many boxes with equal parameters. With POSITION WINDOW we can configure the position in relation to the window (to the left or to the right), after that we can use POSITION for setting the coordinates related to the window start. “+” and “-“ can be used for position configuration in ORIGIN.
        The Styles are utilized in forms for setting paragraphs or formats of characters and for this we have multiple standard Styles in SAP; we can also define personal styles. For the creation, finding and keeping of styles there is the transaction SE72. With the aid of the Format menu and then Style we will give the text a style and for non permanent modifications to the style we will use /: as a command.

Q24: How do we import or use graphics in Sap Script?
Q24: For importing graphics in SAP there is the transaction SE78. We may include using Edit, Graphic, Create in the form painter or we can use the statement INCLUDE, case in which we will use the window script editor-Include, Graphic like in this example (with a bitmap):
/:BITMAP MYLOGO OBJECT GRAPHIC ID BMAP TYPE BMON.

Q25: How are the modifications made?
A25:  Changes to the normal SAP program have to be made only in the case when this is compulsory. When we require supplementary data , we should use the statement PERFORM and we don’t have to modify the print program. He print program modification can take place due to reasons like these: modifications in structure or the requirement for fresh text elements. The print program the will print supplementary forms will be crucial to deciding what are the print programs and forms that we will use. They exist in the TNAPR table and they are specific for a particular output type; the programs used for output are: view V_TNAPR for entry modification from transaction SE30, for importing or exporting a SAP Script form from a PC file we will use RSTXSCRP, for getting the print application name we will use SD or the TNAPR table (for SD documents).

Q26: How can we define and enter a standard text?
A26: The default text type that can be implemented in multiple forms is called a standard text. With the aid of the transaction SO10 we can make, modify or display a standard text. For classifying the texts we will use text ID. With the command INCLUDE we can introduce a standard texts in forms like in this example: /:INCLUDEZ_BC460_EX4_HF OBJECT TEXT ID SDVD. With the aid of the parameter PARAGRAPH we can format standard texts and for centering texts we can see the example: /:INCLUDEZ_BC460_EX4_HF OBJECT TEXT ID SVD LANGUAGE EN PARAGRAPH C. For address format we can use the command ADRESS-ENDADRESS which is determined by the country parameter from the postal standards that the country of the recipient has. Example:
ADDRESS DELIVERY PARAGRAPH AD
NAME &KNA1-NAME&
STREET & KNA1-STRAS&
POSTCODE&KNA1-PSTLZ&
CITY&KNA1-ORT01&’
COUNTRY &KNA1-LAND1&
FROMCOUNTRY ‘de’
ENDADDRESS.
For pagebreak avoiding in paragraphs :
/:PROTECT
:
:
/:ENDPROTECT.
The lines of text that are to be defended against pagebreaks will be met between the command IF and the command ENDIF, as in every ABAP program like this:
/:IF condition
:
:
/:ENDIF
and
/:IF condition
:
/:ELSE
:
/:ENDIF. An exact expression would be: /: &SPFLI-CITYTO&=”BERLIN” …text… /:ENDIF.

Q27: What separates a Window from a Page Window?
A27: The Page Window is when we declare the parameters of a window that was declared before and the document look (width, height and the margins –left and right). Window is when we talk about the type window, about the initial paragraph or the text components (SAP Scripts) that have to be included. The windows are those places stated from the start in the layout set , the text blocks that we find on a page are the windows.

Q28: How do we load graphics like logos in SAP Script?
A28: We can load graphics like files with the .tif extension in SAP Script in standard text with the aid of RSTXLDMC.

Q29: Which are the most used programs from SAP Script?
A29: For the transformation of the page format we have RSTXFCON, for downloading and uploading the layout sets we have RSTXSCRP, for the debugging of SAP Script we have RSTXDBUG, for moving script files from system to system we can use RSTXSCRP, to modify development classes of different objects we will use RSWBO052, for table contents comparison between clients we have to use RSTBSERV.

Q30: What are the steps and other details of debugging?
A30: We will use Tools then Word Processing then Layout Set and we will write the layout name the we go to Utilities and Activate Debugger. It doesn’t matter which layout set we choose we choose the debugger. The layout set will call the debugger. If we try to copy a form from client to client and we try to also modify the copied form we will have these error messages:
a)      Form not found. The solving of this problem is trying to copy again but with a language specification.
b)      Text file is inconsistent. From SE38 we have to run “RSTXCHKO”, the form name will be required and checking all the checkboxes (and running the program) fixes the problem.

Q31: How can we copy a table from client to client?
A31: We can do this with the aid of RSCLTCOP.

Q32: What is the way for making a script layout backup for future loading from the HDD?
A32: This can be done with the EXPORT MODE, a script with a similar name to the initial script will be made, if this is already made we will receive an error.

No comments:

Post a Comment