置顶随笔

[置顶]10 Best Practices to Be a Successful SAP ABAP Developer

1. Review Business Requirements & Write Functional Specification
The first part of any ABAP development project begin with meeting the end users or business experts and understand the business requirements that need to be implemented in the SAP system during the realization phase. A best approach is to conduct workshops to gather all the business requirements. Make sure that if any SAP function consultants are involved than they are in the meetings as well. After all the business requirements are collected, either a SAP functional consultant or business expert will write a detailed functional specification. Review the functional specification until the document has all the details, different business scenarios and expected goals clearly defined. A well defined functional specification should contain UML diagrams and test case scenarios. It is important to have an official signoff on the functional specification before continuing with design and development.

2. Review ABAP Development Standards
In ideal case, your SAP Project Lead or ABAP Development Manager should have created a programming standards and guidelines document. Review this document so that you follow the naming conventions for function modules, classes, dictionary objects, software components, name spaces and proxies (if using SAP XI / PI), program input/output parameters, etc just to name a few. Following the guideline for the project helps maintain a consistent coding approach and also helps other functional and technical analysts to read and debug your code. ABAP objects naming should begin with Z if it will be migrated to SAP production system and Y if it will not be migrated into the production system.

3. Write and Review Test Cases

The test case documents are written by the business experts or functional SAP consultants in most SAP implementation projects. But on some SAP implementation projects a programmer may be required to write test cases. Before writing a test case review the functional specification document thoroughly and review the written test case with the business users or functional consultants. Get a sign-off as mentioned in most steps in this article. As an ABAP Development Manager for a variety of SAP implementation projects, my goal has been to keep my team motivated and always cover the team against any change of scope on the development tasks. Having a sign-off at each phase of a SAP custom development or enhancement tasks always helps the SAP implementation team and project management team keep in sync which is a vital to complete the SAP implementation in time and budget.

4. Write and Review Technical Design Specifications
Read the functional specification and list all the development objects that would be needed to implement the required functionality in the SAP system. First step is to draw a flowchart and review with technical and business experts. The technical design document should include a technical overview, list of new database objects, ABAP objects that can be reused, a data model and class diagram (if using ABAP OO classes). It is highly recommended to have a rough prototype in the sandbox system (Development system if no SAP sandbox system is available) if the development being done is complex or if the end deliverable is not well defined. You should then review your prototype with functional experts and business users. Make sure that the ABAP Development team lead or manager signs off on the prototype. If effort required to complete the ABAP programming task is not presented and approved by the senior project management then this would be a good time to get the development estimate and timeline approved.

5. Realization of the Specification - ABAP Development
During this step you will be creating development objects and implementing the code in the SAP development system. Before you begin, if prototype was done in the sandbox system then analyze the prototype and design specification. Remember that quality and reusability of existing ABAP objects are more important than strictly following the design specification. Determine which existing dictionary objects can be reused for this topic. If new dictionary objects or classes needs to be created then ensure that these objects can be extended and reused for other development tasks. It may require extra effort to develop objects that are reusable and flexible. This one time effort for building reusable ABAP objects during the course of a development project can potentially save a lot of work for programming similar objects that could otherwise utilize already built objects. Review your approach with an SAP technical team lead or a development manager on your project before deviating from the technical design specification and implementing your own ideas. If you are involved in SAP XI (now Process Integration) related tasks or creating enterprise services then this is the best area where you could reuse existing objects. Review the message types that already exist within your SAP business unit and see if any existing messages can be extended with new fields. Review with the team lead whether the communication should be synchronous or asynchronous before you generate proxies.

6. SAP Development Best Practices
SAP ABAP (or JAVA if working on SAP Netweaver) development best practices should be followed throughout the development lifecycle of the project. Although this aspect depends on your project technical manager, I personally have maintained a checklist for developers in my team on all projects and it has been a tremendous success in delivering high quality output on all development tasks. Here are a few best practices worth adapting in your project. Check whether you adhere to all naming conventions as described in the programming standards set for your implementation project. Include comments in your code to allow someone else to easily understand your programs. This is particularly helpful when you work in large teams and multiple people work with same objects. Ensure that you have check for user authorization if you are building transactions or web user-interfaces that will require human interaction. Check that you do not have ABAP code segments that could take a hit on performance like nested loops, nested select statements (use views if desired), excess database commits (persistent objects or buffering alternatives may be a good option), etc. Field symbols are a great asset when it comes to processing internal tables and also variables with unknown data types that are resolved at runtime. Field symbols are very similar to concept of using pointers in OO programming landscape. Check if all exceptions are handled and error messages are communicated accurately to the end users. As an ABAP programmer it should be well accepted by now that short dumps should not be OK to occur. All these do occur in unknown special case scenarios the short dumps should be fixed.

7. ABAP Code Reviews and Performance
As a ABAP programmer you should test your code upon completion for all possible scenarios. Verify that end results are same as that expected in the documented test cases. Perform ABAP runtime analysis to check for performance of your code. Seek suggestions from your technical team lead or manager on how to improve code performance if you notice any red flags during the runtime analysis. Schedule a formal code review with your mentor or a senior ABAP developer once the development is completed and tested by all responsible developers. Make any revisions and retest your code against the desired output as documented in the test scripts. Remember that code reviews is not to find flaws in your programming but it will only make you a better ABAP developer and maintain consistency.

8. Documentation
Make sure you write an end user documents with overview of the functionality or enhancement upon completion. Include screenshots where possible. Prepare documentation keeping in mind that an end user unfamiliar with your deliverable can read the document and test the functionality. Include contact information in this document for users to easily reach the SAP technical team for any questions.

9. User Acceptance Testing
Now that your ABAP coding is completed and reviewed by technical experts, it is time for the business users to perform a formal user acceptance testing. UAT testers will check whether the output meets business process requirements and suggest any improvements or modifications to the delivered functionality. After completion of these fixes or modifications you should request a formal sign-off on the functionality.

10. Migration to SAP Test System and Production System
Quality assurance engineers will test your functionality in the SAP QA environment to verify that everything is working in your delivered functionality as tested during user acceptance testing. Also any problems in transporting your ABAP objects across SAP systems will be identified and addressed during this step. If no problems are found then your transports will be approved to be migrated to SAP production system in the next transport cycle.

posted @ 2009-04-12 12:47 高岭的天空| 编辑 收藏

2009年4月12日

SAP ABAP 培训测试 试卷 答案

嘿嘿,别人的考试试卷拿过来看看,你也来测试下吧!

1. 1, At each new event,the system resets all FORMAT options to their default values.

A True B False (A)

2. You can use__________ keyword to scroll to any column or page in the list.

a. PAGESCROLL

b. SCROLL

c. SCROLLCOLUMN

d. LISTSCROLL (b)

3.In a list , the upper-left corner of the header’s first line contains:

A. The program title

B. The page number

C. The system date

D. Nothing ( c)

4.It is recommended that you use Native SQL to read data from a logical database to maintain portability from one RDBMS to another.

A . true b .false ( B)

5. If you address subordinate nodes in the hierarchy, the selection screen criteria for only that subordinate node appears.

A . true B False ( false)

6. Checks such as Authorization checks are usually performed during the event Process Before Output(PBO).

A True B . False (B)

7. If there is a _________________ statement within the END-OF-SELECTION processing block, program processing ends and the list buffer is displayed.

A . REGECT

B. CHECK

C. STOP

D EXIT (C)

8.Open SQL enables portability between different RDBMS system.

A True B False (A)

9. Join conditions are limited to key fields.

A True B False (B)

10. You can create structured lists using control-level processing

A. True B False (A)

11. When implementing control-level processing ,the AT FIRST and AT LAST statements functions as first time and last time switches and execute only once.

A True B False (A)

12. Loops over extract datasets can be nested.

A . True B False (b)

13. internal tables rely on the compiler to determine the combinations of group levels and cumulating field control level totals require.

A true B false (A)

14. Which of the following options is suitable for printing interactive lists?

A. Printing from the selection screen.

B. Printing from within the program

C Printing after the list is generated

D. Printing in the background

B

15.The user should delete all detail lists whose list level is greater than the current list level

A true B false (B)

16 . You can create object at any point in the program to generate and link objects

A true B false (b)

17. Which of the following are the standard functions offered by SAP Grid Control?

A Sorting by any column

B. Generate objects

C. Adding number columns

D Link objects

E Fixed lead columns

( A C E )

18 .when you create a screen, you must:
a. Design the screen layout in the layout editor.
b. Set the general screen attributes on the attribute screen.
c. Write the flow logic in the flow logic editor.
d. Set the field attributes in the field list.
Select the correct order:
A a, b, c, d
B c, d, b, a
C b, a, d, c
D d, b, a, c
C
19. To allow you to set the attributes of all screen elements, the Screen Painter contains an element list with four views.
A TRUE B FALSE b
20. To interrupt processing of the current screen and branch to a new screen, or sequence of screens, you use the following statement:
A CALL SCREEN
B SET SCREEN
C LEAVE SCREEN
D LEAVE TO SCREEN

A
21 The function keys that contain proposals, which comply with the SAP system's ergonomic standards are:
A Reserved
B Recommended
C Freely
D All of the above

B
22. The content of the Icontext attribute appear in the status bar of the screen when the user chooses the function.
A TRUE b FALSE b
23 .ou can initialize the command field only at PAI.
True
False
B

24. If your text consists of more than one word, use the following character as separators:
A Underscore
B Comma
C Question mark
D Space
a
25.The group box text cannot be changed dynamically.
True
False
B
26. The subscreen call must occur before the function module call.
True
False
B
27. To program a tabstrip control to scroll locally at the frontend, you must call all subscreens from the flow logic.
True
False

A
28. The following attributes contain information about the properties of the entire table control, such as the number of fixed columns:
A Column
B General
C Special
D Row
B
29. In order to display the current screen, include the ABAP statement SUPRESS DIALOG in a PBO module.
True
False
B
30 For which of the following predefined data types should you use the original variants of the standard string processing statements or the optional addition IN CHARACTER MODE?
A D
B C
C X
D T
E N
F STRING
G XSTRING
Answer: A, B, D, E, F
31 . Which of the following statements are correct?
A Sorted tables can only contain non-unique keys.
B Standard tables can only contain non-unique keys.
C Sorted and hashed tables are index tables.
D Standard tables are index tables.
E The standard key is the key of a standard table.
F The standard key always contains all components of the row type.
Answer: B, D
32 . Generic types are type definitions that are missing certain information. These missing type attributes are inherited from an actual parameter at runtime if you use the generic type for typing interface parameters.
True
False
Answer: False
33 . Which of the following statements are correct?
A Only key access works with hashed tables.
B Key access means that the search clause may only appear in the key fields of the internal table.
C Index access allows access using the row number.
D Single-record key access using READ TABLE can return several data records if you are using standard tables, because then the key is always non-unique.
E The SORT statement can sort standard tables.
F If you use INSERT ... INTO TABLE to insert a data record into a sorted table with a unique key, this will only work if the internal table contains no other data record with the same combination of values for the key components. Otherwise, the SY-SUBRC return value will be set to a number other than 0.
Answer: A, C, E, F

34. SAP recommends using internal tables without header lines to make the syntax easier to read. This is particularly helpful with nested internal tables.
True
False
Answer: True

35. Which of the following statements are correct?
A As far as possible, when you use key access, the runtime system always chooses the fastest possible variant, depending on the table kind.
B Hashed tables should not be used if you need to make many changes when you are accessing data.
C You can save lots of runtime by using field symbols and references, especially with nested internal tables.
D Binary searching is possible for standard tables.
E The fastest form of access in loop processing is usually through the row number.
Answer: A, B, C, E
36. The object-oriented programming model was developed considerably later than the procedural one. It offers more possibilities to solve problems that previously could not be solved with purely procedural programming languages.
True
False
Answer: False
37. If you copy a subclass reference to a reference variable that is typed on the superclass (narrowing cast), which components can you access with this reference variable?
A Redefined components of the superclass
B Newly defined components of the subclass
C Inherited components of the superclass
D Redefined components of the subclass
Answer: A, C
38. If a reference variable that is typed on an interface contains an instance reference of a class that implements this interface and you copy this to a reference variable that is typed on the class (widening cast), which of the following components can you access with this reference variable?
A The components of the interface
B The components from the class that are not defined on the interface
C All components of the class
D The components of the interface for which alias names have been defined
Answer: A, B, C, D
39 . If you copy an instance reference of a class, which implements an interface, to a reference variable that is typed on the interface (narrowing cast), what components can you access using this reference variable?
A The components of the interface
B The components of the class that are not defined in the interface
C All components of the class
D The components of the interface for which alias names have been defined
Answer: A
40. For a user to be able to execute an object-oriented program, you always need to supply a module pool program or a function group program. Otherwise, there is nowhere for the CREATE OBJECT statement to create the instance.
True
False
Answer: False
41. Which of the following statements are correct?
A A non-abstract class can contain abstract methods.
B An abstract class contains no implementations.
C An abstract method contains no implementations.
D Final classes cannot be superclasses within a class hierarchy.
E A final method must be redefined.
F Final classes can contain non-final methods.
G A friend of a class is also a friend of its subclasses.
H The subclasses of a class's friend are also the class's friend.
I The visibility of an instance constructor can be limited.
J A private instance constructor (instantiation only by the class itself) can be defined in the private section.
Answer: C, D, H, I
42. The new exception concept replaces the old one. Thus, all old source code sections must be rewritten. As of SAP Web AS 6.20, function modules from the SAP standard system automatically raise object-oriented exceptions.
True
False
Answer: False
43. The new exception classes can only be defined globally. This ensures central maintenance and reuse.
True
False
Answer: False
44 . The pushbuttons screen area gives a short introduction of the QuickViewer with links to the online documentation.
True
False
Answer: False
45. List fields once placed in trash can, can be retrieved.
True
False
Answer: True
46. You can access all the events of an executable ABAP program associated with a query.
True
False
Answer: False
47. The SELECT-OPTIONS statement generates an internal table with a standard structure. The fields of this table are:
A Sign
B Option
C High
D Interval
Answer: A, B, C
48 . You can delete an InfoSet whenever you want.
True
False
Answer: False
49. What are the two options available for menu enhancements?
A Customer exits
B Menu entries
C Business add-ins
D Standard Menu
Answer: A, C
50 .Screen exits are a type of customer exit.
True
False

Answer: True
51. From SAP Web Application Server 6.20 onwards, Business Add-Ins cannot contain screen exits.
True
False
Answer: False
52. Customizing includes cannot be inserted into more than one table.
True
False
Answer: False
53. Identify the step that is not followed for creating an SAP enhancement project.
A Create an enhancement project and then choose the SAP enhancements that you want to use.
B Analyze the program source code or the screen source code.
C Edit your individual components using the project management function and document the entire enhancement project.
D Activate the enhancement project. This activates all the project’s component parts
Answer: B
54. When an event is triggered in a process interface, only one external process can replace the process in the standard program.
True
False
Answer: True
55. What are the requirements for new enhancement techniques?
A Reusable
B All enhancement types
C Administration level
D Customer exits
E Implemented using the latest technology
Answer: A, B, C, E
56. You can create function codes only for single use BAdIs, which must not be filter-dependent.
True
False
Answer: True
57.To include function codes in a BAdI definition, you enter the program name, function code, and a short description on the relevant tab page.
True
False
Answer: True
58. To provide a screen enhancement using a BAdI, you need to first generate the BAdI class.
True
False
Answer: True
59.The implementing program gets the data from the Add-In class by calling the appropriate interface method.
True
False
Answer: True
60. You can modify the ABAP Dictionary objects that belong to the core of your system.
True
False
Answer: False

61. When you define a Business Add-In, the system generates a Business Add-In class.
True
False
Answer: True
62. Using data elements, structures and table types, you can create complex user-defined type.
True
False
Answer: True
63. Foreign key definitions are imparted from include to the including table.
True
False
Answer: True
64. The records of a buffered table are read directly from the local buffer of the application server.
True
False
Answer: True
1. 65. Select the statement that is NOT correct.
A The object lists created by the Repository Information System are entirely integrated in the ABAP Workbench.
B The Where-used list for Repository objects cannot be called from the information system.
C The information system enables you to search for objects by their attributes.
D You can search for all objects by the development class, short description or author, and date of last change.
Answer: B
66. Correct access by ABAP programs to a database table is only possible if the runtime object of the table is consistent with the structure of the table in the database.
True
False
Answer: True
67.Even if a table has no data, it is retained in the database.
True
False
Answer: False
68.During conversion, the tables are locked to prevent further structural changes from being made before the conversion is completed correctly.
True
False
Answer: True
69 . Maintenance views may be used as the selection method for search helps.
True
False
Answer: False
70. Which feature of SAPscript enables it to run on all front-end applications supported by SAP?
A Multilingual capability
B High performance when printing large quantities
C Uniform corporate design in documents
D Word processing scalability
E SAP R/3 Enterprise transport and translation connections
F Platform independence
Answer: F
71. Main windows cannot have different heights and cannot be positioned differently on pages where they appear.
True
False
Answer: False
72.Which sub-objects allow you to structure pages in SAPscript?
A Page layout
B Paragraph formats
C Character formats
D Windows
Answer: A, B, C
73. Which operations are performed using control commands?
A Including text in a document
B Assigning values to text symbols
C Starting or suppressing a page break
D Resetting outline paragraphs
E Evaluating conditions
Answer: A, B, C, D, E
74. Which command is used to print text elements in form windows?
A CONTROL_FORM
B DELETE_FORM
C MODIFY_FORM
D WRITE_FORM
Answer: D
75. The function module OPEN_FORM initializes form printing in a print program. Before using START_FORM in a print program for the first time, you must call OPEN_FORM.
True
False
Answer: True
76. SAP does not simultaneously support SAPscript forms and SAP Smart forms. As a result, you need to migrate SAPscript forms to SAP Smart forms.
True
False
Answer: False
77. Packages have the same attributes as development classes, but also possess additional options suitable to modeling techniques.
True
False

Answer: True
78. A form page can be used only once in a document.
True
False
Answer: False
79. Which of the following options specifies that the text of the second node begins in a new line and the two text nodes are completely independent of each other?
A New Line
B New Paragraph
C Append Directly
D Include Text
Answer: B
80. Identify the parameters of a generated function module or a form interface.
A Import
B Export
C Global Data
D Tables
Answer: A, B, D

posted @ 2009-04-12 22:53 高岭的天空 阅读(727) | 评论 (0)编辑 收藏

10 Best Practices to Be a Successful SAP ABAP Developer

1. Review Business Requirements & Write Functional Specification
The first part of any ABAP development project begin with meeting the end users or business experts and understand the business requirements that need to be implemented in the SAP system during the realization phase. A best approach is to conduct workshops to gather all the business requirements. Make sure that if any SAP function consultants are involved than they are in the meetings as well. After all the business requirements are collected, either a SAP functional consultant or business expert will write a detailed functional specification. Review the functional specification until the document has all the details, different business scenarios and expected goals clearly defined. A well defined functional specification should contain UML diagrams and test case scenarios. It is important to have an official signoff on the functional specification before continuing with design and development.

2. Review ABAP Development Standards
In ideal case, your SAP Project Lead or ABAP Development Manager should have created a programming standards and guidelines document. Review this document so that you follow the naming conventions for function modules, classes, dictionary objects, software components, name spaces and proxies (if using SAP XI / PI), program input/output parameters, etc just to name a few. Following the guideline for the project helps maintain a consistent coding approach and also helps other functional and technical analysts to read and debug your code. ABAP objects naming should begin with Z if it will be migrated to SAP production system and Y if it will not be migrated into the production system.

3. Write and Review Test Cases

The test case documents are written by the business experts or functional SAP consultants in most SAP implementation projects. But on some SAP implementation projects a programmer may be required to write test cases. Before writing a test case review the functional specification document thoroughly and review the written test case with the business users or functional consultants. Get a sign-off as mentioned in most steps in this article. As an ABAP Development Manager for a variety of SAP implementation projects, my goal has been to keep my team motivated and always cover the team against any change of scope on the development tasks. Having a sign-off at each phase of a SAP custom development or enhancement tasks always helps the SAP implementation team and project management team keep in sync which is a vital to complete the SAP implementation in time and budget.

4. Write and Review Technical Design Specifications
Read the functional specification and list all the development objects that would be needed to implement the required functionality in the SAP system. First step is to draw a flowchart and review with technical and business experts. The technical design document should include a technical overview, list of new database objects, ABAP objects that can be reused, a data model and class diagram (if using ABAP OO classes). It is highly recommended to have a rough prototype in the sandbox system (Development system if no SAP sandbox system is available) if the development being done is complex or if the end deliverable is not well defined. You should then review your prototype with functional experts and business users. Make sure that the ABAP Development team lead or manager signs off on the prototype. If effort required to complete the ABAP programming task is not presented and approved by the senior project management then this would be a good time to get the development estimate and timeline approved.

5. Realization of the Specification - ABAP Development
During this step you will be creating development objects and implementing the code in the SAP development system. Before you begin, if prototype was done in the sandbox system then analyze the prototype and design specification. Remember that quality and reusability of existing ABAP objects are more important than strictly following the design specification. Determine which existing dictionary objects can be reused for this topic. If new dictionary objects or classes needs to be created then ensure that these objects can be extended and reused for other development tasks. It may require extra effort to develop objects that are reusable and flexible. This one time effort for building reusable ABAP objects during the course of a development project can potentially save a lot of work for programming similar objects that could otherwise utilize already built objects. Review your approach with an SAP technical team lead or a development manager on your project before deviating from the technical design specification and implementing your own ideas. If you are involved in SAP XI (now Process Integration) related tasks or creating enterprise services then this is the best area where you could reuse existing objects. Review the message types that already exist within your SAP business unit and see if any existing messages can be extended with new fields. Review with the team lead whether the communication should be synchronous or asynchronous before you generate proxies.

6. SAP Development Best Practices
SAP ABAP (or JAVA if working on SAP Netweaver) development best practices should be followed throughout the development lifecycle of the project. Although this aspect depends on your project technical manager, I personally have maintained a checklist for developers in my team on all projects and it has been a tremendous success in delivering high quality output on all development tasks. Here are a few best practices worth adapting in your project. Check whether you adhere to all naming conventions as described in the programming standards set for your implementation project. Include comments in your code to allow someone else to easily understand your programs. This is particularly helpful when you work in large teams and multiple people work with same objects. Ensure that you have check for user authorization if you are building transactions or web user-interfaces that will require human interaction. Check that you do not have ABAP code segments that could take a hit on performance like nested loops, nested select statements (use views if desired), excess database commits (persistent objects or buffering alternatives may be a good option), etc. Field symbols are a great asset when it comes to processing internal tables and also variables with unknown data types that are resolved at runtime. Field symbols are very similar to concept of using pointers in OO programming landscape. Check if all exceptions are handled and error messages are communicated accurately to the end users. As an ABAP programmer it should be well accepted by now that short dumps should not be OK to occur. All these do occur in unknown special case scenarios the short dumps should be fixed.

7. ABAP Code Reviews and Performance
As a ABAP programmer you should test your code upon completion for all possible scenarios. Verify that end results are same as that expected in the documented test cases. Perform ABAP runtime analysis to check for performance of your code. Seek suggestions from your technical team lead or manager on how to improve code performance if you notice any red flags during the runtime analysis. Schedule a formal code review with your mentor or a senior ABAP developer once the development is completed and tested by all responsible developers. Make any revisions and retest your code against the desired output as documented in the test scripts. Remember that code reviews is not to find flaws in your programming but it will only make you a better ABAP developer and maintain consistency.

8. Documentation
Make sure you write an end user documents with overview of the functionality or enhancement upon completion. Include screenshots where possible. Prepare documentation keeping in mind that an end user unfamiliar with your deliverable can read the document and test the functionality. Include contact information in this document for users to easily reach the SAP technical team for any questions.

9. User Acceptance Testing
Now that your ABAP coding is completed and reviewed by technical experts, it is time for the business users to perform a formal user acceptance testing. UAT testers will check whether the output meets business process requirements and suggest any improvements or modifications to the delivered functionality. After completion of these fixes or modifications you should request a formal sign-off on the functionality.

10. Migration to SAP Test System and Production System
Quality assurance engineers will test your functionality in the SAP QA environment to verify that everything is working in your delivered functionality as tested during user acceptance testing. Also any problems in transporting your ABAP objects across SAP systems will be identified and addressed during this step. If no problems are found then your transports will be approved to be migrated to SAP production system in the next transport cycle.

posted @ 2009-04-12 12:47 高岭的天空| 编辑 收藏

程序模版

* Description : Template of Program
*
*
*
* Special features: N/A
*
*
*----------------------------------------------------------------------*
* Modifications:
* Author      Date     Commented as  Description
*-----------  --------  -----------  ----------------------------------*
*
*----------------------------------------------------------------------*

REPORT  Z_YYY_TEMPLATE.
*$*$----------------------------------------------------------------$*$*
*$*$       Global Types, Data Statements, Ranges, Constants         $*$*
*$*$----------------------------------------------------------------$*$*

*-----------------------------------------------------------------------
*                   Type Pools
*-----------------------------------------------------------------------
TYPE-POOLS: SLIS,VRM, SBDST, SOI.

*-----------------------------------------------------------------------
*                   Tables
*-----------------------------------------------------------------------
TABLES: MAKT, VBAK.

*-----------------------------------------------------------------------
*                        Types
*-----------------------------------------------------------------------
TYPESBEGIN OF T_ITAB.
        INCLUDE STRUCTURE MAKT.
TYPESEND OF T_ITAB.

*-----------------------------------------------------------------------
*                    Internal Tables and Work Areas
*-----------------------------------------------------------------------
DATA GT_ITAB TYPE STANDARD TABLE OF T_ITAB.

*-----------------------------------------------------------------------
*                  Variables
*-----------------------------------------------------------------------
DATA: G_FLAG.
*-----------------------------------------------------------------------
*                    Constants
*-----------------------------------------------------------------------
CONSTANTS:      C_TOTAL(8)  TYPE C       VALUE 'WA_TOTAL'.

*-----------------------------------------------------------------------
*                   Field Symbols
*-----------------------------------------------------------------------
FIELD-SYMBOLS:<FS_LINE>.
*-----------------------------------------------------------------------
*                   Ranges
*-----------------------------------------------------------------------
RANGES: R_OSD_DOCTYPS FOR VBAK-AUART.
*-----------------------------------------------------------------------
*     Global GUI Controls Variables / Structures
*-----------------------------------------------------------------------

*--Data Definition of OLE
DATA: GS_EXCEL TYPE OLE2_OBJECT ,
      GS_WBOOKLIST TYPE OLE2_OBJECT ,
      GS_APPLICATION TYPE OLE2_OBJECT ,
      GS_WBOOK TYPE OLE2_OBJECT ,
      GS_ACTIVESHEET TYPE OLE2_OBJECT ,
      GS_SHEETS TYPE OLE2_OBJECT ,
      GS_NEWSHEET TYPE OLE2_OBJECT ,
      GS_CELL1 TYPE OLE2_OBJECT ,
      GS_CELL2 TYPE OLE2_OBJECT ,
      GS_CELLS TYPE OLE2_OBJECT ,
      GS_RANGE TYPE OLE2_OBJECT ,
      GS_FONT TYPE OLE2_OBJECT ,
      GS_INTERIOR TYPE OLE2_OBJECT ,
      GS_COLUMNS TYPE OLE2_OBJECT ,
      GS_CHARTS TYPE OLE2_OBJECT ,
      GS_CHART TYPE OLE2_OBJECT ,
      GS_CHARTTITLE TYPE OLE2_OBJECT ,
      GS_CHARTTITLECHAR TYPE OLE2_OBJECT ,
      GS_CHARTOBJECTS TYPE OLE2_OBJECT .

DATA GV_SHEET_NAME(20TYPE C .
DATA GV_OUTER_INDEX LIKE SY-INDEX .
DATA GV_INTEX(2TYPE C .
DATA GV_LINE_CNTR TYPE I .          "line counter
DATA GV_LINNO TYPE I .              "line number
DATA GV_COLNO TYPE I .              "column number
DATA GV_VALUE TYPE I .              "data
*$*$----------------------------------------------------------------$*$*
*$*$                      Selection Screen                          $*$*
*$*$----------------------------------------------------------------$*$*
*-----------------------------------------------------------------------
*                   Selection Screen
*-----------------------------------------------------------------------
SELECT-OPTIONS S_MATNR FOR MAKT-MATNR.
*-----------------------------------------------------------------------
*                   At Selection Screen
*-----------------------------------------------------------------------
*--------- INITIALIZATION ----------
INITIALIZATION.

*--------- AT SELECTION-SCREEN OUTPUT ----------
AT SELECTION-SCREEN OUTPUT.

*--------- AT SELECTION-SCREEN ----------
AT SELECTION-SCREEN.

*--------- AT SELECTION-SCREEN ON ----------
AT SELECTION-SCREEN ON ***.

*--------- AT SELECTION-SCREEN ON VALUE-REQUEST ----------
AT SELECTION-SCREEN ON VALUE-REQUEST FOR ***.

*--------- AT SELECTION-SCREEN ON HELP-REQUEST ----------
AT SELECTION-SCREEN ON HELP-REQUEST FOR ***.

*$*$----------------------------------------------------------------$*$*
*$*$                          Main Program                          $*$*
*$*$----------------------------------------------------------------$*$*

*--------- START-OF-SELECTION ----------

  PERFORM ADD.

*--------- END-OF-SELECTION ----------

*$*$----------------------------------------------------------------$*$*
*$*$                         Subroutines                            $*$*
*$*$----------------------------------------------------------------$*$*

*&---------------------------------------------------------------------*
*&      Form  ADD
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM ADD .

ENDFORM.                    " ADD

*-----------------------------------------------------------------------
*                     PBO Modules
*-----------------------------------------------------------------------
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.

ENDMODULE.                 " STATUS_0100  OUTPUT

*-----------------------------------------------------------------------
*                     PAI Modules
*-----------------------------------------------------------------------
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.

ENDMODULE.                 " USER_COMMAND_0100  INPUT

posted @ 2009-04-12 12:07 高岭的天空 阅读(142) | 评论 (0)编辑 收藏

2009年4月2日

ABAP Interview Question (4)

  1. why SAP scripts are client dependent and smart forms are not?
  when we create a smartform in development server its automatically will copy to the testing server like other
classical report becoz it generates a function module after creating a smart form.but in sap script it will not copy to
the testing server, we have to use scc1 transaction code to transfer the request then only we can test the output.so the
sap script is client-dependent.
  2. Table ztest has a secondary index on the following fields: tnum, tcode.
Select * from ztest where tnum ne '123' and tcode = '456'.

Why is the index not used in the above case?
Choices:
    a) Indexes are not allowed on Z tables
    b) Variables must be used, NOT literals
    c) Select individual fields, not select *
    d) Client is not in the where clause
    e) NE invalidates the use of an index
Info: Can someone explain in detail why this happened? It will be really helpful to handle to case in Secondary index.
In my opinion, the correct answer is E: NE invalidates the use of an index

  3. How many types of table types?
   There are 4 types of tables:
   1). Transparent tables
   2). Pooled Tables
   3). Cluster tables
   4). Internal Tables
 
   4. how to call the smart form from the report?is it Possible or not?
yes it is possiple to call smartform from a report, all we have to do is at first execute the smarform once, it will
generate a function module number.
   Go to the report where to call the smartform call the funcntion module(ctrl+f6)give function name
SSF_FUNCTION_MODULE_NAME press enter. In the export parameters FORMNAME give the smartform name within single
codes and in import parameters FM_NAME (F_NAME TYPE RS38L_FNAM ), give F_NAME which stores the function module
number generated after executing the smart form.

  5. How you can perform field-validation in your dialog program ?
 
You can validate your fields in the PAI module of the program by placing them between the CHAIN & ENDCHAIN Statement.
 
  6. Which configuration we have to make first before we want to start Business Workflow with our SAP R/3
   The first of all you should check the TCODE: SWU3 Then config step by step according to the tcode screen.

  7.WHAT IS FIELD-SYMBOLS?
   Fields symbols are just like pointers in C. They points to the data object at runtime but do not allocate any memory for that data object.

  8. WHAT IS TABLE BUFFERING AND ADVANTAGE?
   TABLE BUFFERING IS USED TO IMPROVE PERFORMANCE OF OPEN SQL STATEMENTS.
   TABLE BUFFERING IS NOTHING BUT STORING THE CONTENTS OF THE DB TABLES IN THE APPLICATION SERVER BUFFER.
   BUFFERING IS OF THREE TYPES.
      1) SINGLE RECORD BUFFERING
      2) GENERIC BUFFERING
      3) FULL BUFFERING
  9.  WHAT IS THE USE OF SECONDARY INDEXES AND WHAT IS MAX LIMIT OD SECONDARY INDEXES?
  
SECONDARY INDEXES ARE USED FOR FAST RETRIEVAL OF DAT FROM THE DB TABLES.
   WE CAN CREATE MAXIMUM OF 15 SECONDARY INDEXES.
 10. WHAT IS TCODE TO CREATE NEW MESSAGE TYPE?
We use these t-codeS in the case of IDOC's only :- WE81 TO CREATE MESSAGE TYPE
WE82 TO LINK MESSAGE WITH IDOC TYPE
But if we want to create a message in ABAP report then we use the following t-codes:
se91 for message maintainance.

posted @ 2009-04-02 10:29 高岭的天空 阅读(308) | 评论 (0)编辑 收藏

2009年3月29日

ABAP interview Faq (3)

1
. Can you create a table with fields not referring to data elements?
YES. eg:- ITAB LIKE SPFLI.here we are referening to a data object(SPFLI) not data element.
What are the different types of data dictionary objects?
tables, structures, views, domains, data elements, lock objects, Match code objects.
2. What should be the approach for writing a BDC program?
STEP 1: CONVERTING THE LEGACY SYSTEM DATA TO A FLAT FILE to internal table CALLED "CONVERSION".
STEP 2: TRANSFERING THE FLAT FILE INTO SAP SYSTEM CALLED "SAP DATA TRANSFER".
STEP 3: DEPENDING UPON THE BDC TYPE
        i)call transaction(Write the program explicity)
       ii) create sessions (sessions are created and processed.if success data will transfer).

3. What are the problems in processing batch input sessions and How is batch input process different from processing online?
PROBLEMS:
i) If the user forgets to opt for keep session then the session will be automatically removed from the session queue(log remains). However if session is processed we may delete it manually.
ii)if session processing fails data will not be transferred to SAP database table.

4. What does an extract statement do in the ABAP program?
Once you have declared the possible record types as field groups and defined their structure, you can fill the extract dataset using the following statements: EXTRACT. When the first EXTRACT statement occurs in a program, the system creates the extract dataset and adds the first extract record to it. In each subsequent EXTRACT statement, the new extract record is added to the dataset EXTRACT HEADER. When you extract the data, the record is filled with the current values of the corresponding fields. As soon as the system has processed the first EXTRACT statement for a field group , the structure of the corresponding extract record in the extract dataset is fixed. You can no longer insert new fields into the field groups and HEADER. If you try to modify one of the field groups afterwards and use it in another EXTRACT statement, a runtime error occurs. By processing EXTRACT statements several times using different field groups, you fill the extract dataset with records of different length and structure.
Since you can modify field groups dynamically up to their first usage in an EXTRACT statement, extract datasets provide the advantage that you need not determine the structure at the beginning of the program.

5. Can a transparent table exist in data dictionary but not in the data base physically?

NO. TRANSPARENT TABLE DO EXIST WITH THE SAME STRUCTURE BOTH IN THE DICTIONARY AS WELL AS IN THE DATABASE,EXACTLY WITH THE SAME DATA AND FIELDS.

6. What is the step by step process to create a table in data dictionary?
step 1: creating domains(data type, field length, range).
step 2: creating data elements(properties and type for a table field).
step 3: creating tables(SE11).

7. What is the typical structure of an ABAP/4 program?
HEADER ,BODY,FOOTER.

8. A situation: An ABAP program creates a batch input session. We need to submit the program and the batch session in back ground. How to do it?
go to SM36 and create background job by giving job name, job class and job steps (JOB SCHEDULING)

9. What are the domains and data elements?
DOMAINS : FORMAL DEFINITION OF THE DATA TYPES.THEY SET ATTRIBUTES SUCH AS DATA TYPE,LENGTH,RANGE. DATA ELEMENT : A FIELD IN R/3 SYSTEM IS A DATA ELEMENT.

10. What is the alternative to batch input session?
Call transaction.

12. What is a batch input session?
BATCH INPUT SESSION is an intermediate step between internal table and database table. Data along with the action is stored in session ie data for screen fields, to which screen it is passed, program name behind it, and how next screen is processed.

13. What is the advantage of structures? How do you use them in the ABAP programs?
Adv:- GLOBAL EXISTANCE(these could be used by any other program without creating it again).

14. How many types of tables exists and what are they in data dictionary?

There are 4 types of tables
i)Transparent tables - Exists with the same structure both in dictionary as well as in database exactly with the same data and fields. Both Opensql and Nativesql can be used.
ii)Pool tables &
iii)Cluster tables - These are logical tables that are arranged as records of transparent tables. one cannot use native sql on these tables (only open sql).They are not managable directly using database system tools.
iv)Internal tables


posted @ 2009-03-29 11:53 高岭的天空 阅读(281) | 评论 (0)编辑 收藏

ABAP Interview Question (2)

PART I.
1,下面的语句中,哪一个语句编译会报错(假设XXX 和结构sflight都已经定义). ( )

A)write at 12 XXX.

B)data type type sflight.

C)sflight-price = a+b.

D)write sy-vline.
2.在ABAP/4的开发工作中,哪一个TCODE是直接进入就可以创建程序,函数组以及程序内部各种元素的. ( )

A) SE80 B) SE11 C) SE93 D)SE16
3.直接进入就可以查询表的结构是哪个TCODE. ( )

A) SE80 B) SE11 C) SE93 D)SE16
4. 很多表当中都有一个字段,叫做MANDT, 为第一个主键,这个字段的用处是.( )

A)区分后台数据库的类型

B)区分表中记录属于哪个客户端(client)

C)区分表的数据量大小

D)SAP系统保留字段
5.下面的定义语句中,哪一个语句定义出来的结果是一个内表. ()

A)DATA zsflight TYPE sflight.

B)DATA: COLS LIKE LINE OF TC-COLS.

C)TABLES SFLIGHT.

D)DATA: zsflight TYPE TABLE OF sflight.
6.ABAP中三种基本的数据对象是. ( )

A)内表 结构 基本数据对象

B)内表 程序 语句

C)字符 数字 日期

D)语句 程序 表
7.语句loop at itab into wa. 的准确意思是. ( )

A)把wa中的值进行循环,每一次循环都写回内表

B)求出迷宫itab的出口放在wa里

C)对内表itab的数值列进行累加放入wa中

D)对内表itab进行循环,把循环中每一行的结果写入结构wa中
8.程序中执行了这么一段代码

DATA it_sflight type sflight with header line.

Loop at it_sflight.

it_sflight-carrid = 'AA'.

Modify it_sflight.

Endloop.

该段语法中出现了四次it_sflight,其中后三次分别代表的是内表还是结构. ( )

A)内表 内表 内表

B)内表 结构 内表

C)内表 结构 结构

D)内表 内表 结构
9.在设计报表程序时,选择的程序类型应该是. ( )

A)可执行程序

B)模块池程序

C)包含程序

D)函数组程序
10.在报表程序的屏幕筛选条件里,SELECT-OPTIONS定义出来的元素是. ()

A)内表

B)结构

C)基本数据对象

D)指针型字段
11.在报表程序的屏幕事件里,有一个事件叫做AT LINE-SELECTION.参见如下代码:

WRITE / ‘ABAP’.

AT LINE-SELECTION.

WRITE /‘TEST’.

那么,以下哪种情况会发生. ( )

A)先显示出一行ABAP,当用户双击一次时,屏幕上在原来ABAP那行下面换

行一次显示出一行新的TEST

B)先显示出一行ABAP,当用户双击一次时,屏幕上每次只显示出一行的TEST取

代原先的屏幕

C)先显示出一行ABAP,当用户双击一次时,屏幕上永远只显示出一行TEST

(放在原来ABAP那行下面)

D)先显示出一行ABAP,当用户第一次双击时,产生一个新屏幕,显示一行

TEST,然后每次双击都在其下换行显示一行新的TEST
12.选择事件的执行顺序正确的一组. ( )

A)INITIALIZATION / START-OF-SELECTION / TOP-OF-PAGE / AT LINE-SELECTION

B)INITIALIZATION / TOP-OF-PAGE / START-OF-SELECTION / AT LINE-SELECTION

C)START-OF-SELECTION/ INITIALIZATION / TOP-OF-PAG / AT LINE-SELECTION

D)INITIALIZATION / TOP-OF-PAGE / AT LINE-SELECTION / START-OF-SELECTION
13.在层级报表的开发里,下面哪个条件不是必需的. ( )

A)对内表先按层级字段排序

B)对内表和结构定义时层级字段必须排在前面

C)层级字段不能出现在at 和 end at 语句之外

D)层级字段必须存在
14.在明细报表的开发中,双击一行转向明细报表的取数依据是. ()

A)你双击那行的主键字段

B)你双击的那个字段本身

C)你双击那行在循环中预先hide的字段

D)你双击那行在循环中预先已经write出来的字段
15.在交互式报表的设计中,假如想在明细报表里加入任意字段的排序功能,

请选择正确的选项(多选). ( )

A)要先用get cursor field XXX.取得字段

B)对内表排序时该字段要用括号括起来

C)在排序时要把该字段加上一个数字以去除前面的结构名称

(如果是用结构-字段定义的话)

D)排序后显示完要把sy-lsind = 0,以防止产生多余的list
16.在屏幕编程的设计中,下面共有四个主要步骤:

a 设计屏幕的格式(有哪些字段,放在什么位置)

b 设计屏幕的整体属性

c 设计屏幕上字段的属性

d 编写屏幕的流逻辑( flow logic )

请选择通常请况下正确的顺序. ( )

A)a b c d

B)c d b a

C)b a c d

D)d b a c
17. 如果屏幕A 的下一个屏幕仍然是A , 那么当执行程序时,对于屏幕的主要事件,下面哪种顺序是正确的. ()

A)A 的 PAI ? A 的 PBO ? A 的 PAI ? A 的 PBO

B)A 的 PBO ? A 的 PAI ? A 的 PAI ? A 的 PBO

C)A 的 PAI ? A 的 PAI ? A 的 PBO ? A 的 PBO

D)A 的 PBO ? A 的 PAI ? A 的 PBO ? A 的 PAI
18.屏幕编程中一个屏幕所使用的工具栏应如何设计. ( )

A) 先设计一个Gui Status,再在程序中绑定

B) 先设计一个Gui Titles,再在程序中绑定

C) 在程序中用Add button 语法添加

D)在屏幕设计格式的界面上添加工具栏及其按钮
19. 以下四种系统变量,各是什么含意. ( )

SY-UCOMM SY-DATUM SY-SUBRC SY-TABIX

A)用户触发的屏幕上的功能码 当前日期 当前时间 循环次数

B)当前日期 当前时间 循环次数 用户触发的屏幕上的功能码

C)用户触发的屏幕上的功能码 循环次数 语句执行结果返回值当前日期

D)用户触发的屏幕上的功能码 当前日期 语句执行结果返回值循环次数
20.一个程序的子屏幕编程是如何实现的. ( )

A)子屏幕区域外加屏幕(属性设置为正常屏幕)

B)自定义控件外加屏幕(属性设置为正常屏幕)

C)子屏幕区域外加屏幕(属性设置为子屏幕)

D)自定义控件外加屏幕(属性设置为子屏幕)
21.对于表格控件和内表的绑定的做法,下面哪种说法是正确的. ()

A)PBO时同步循环内表和表格控件把内表的值写入表格控件,PAI时用同样的

循环把表格控件的值写回内表

B)PBO时同步循环内表和表格控件把表格控件的值写入内表,PAI时用同样的

循环把内表的值写回表格控件

C)在定义内表时定义与之绑定的表格控件,PBO和PAI事件要各循环内表一次

D)在制作表格控件时定义与之绑定的内表,PBO和PAI事件要各循环表格控件一次
22.如果要把表格控件某列的属性动态的改变成不可输入,下面哪种做法是可行的. ( )

A)在PAI事件中修改table的general attribute值

B)在PBO事件中修改table的general attribute值

C)在PAI事件中取得table的COLS属性,利用它本身是个内表的特点循环找到该列修改之,修改完后写回COLS内表

D)在PAI事件中取得table的COLS属性,利用它本身是个结构的特点找到其中表示该列的字段修改
23.要对表格控件增加一个可由用户写入信息的列,下面哪种方式是可行的(多选).()

A)在设计屏幕上点击dictionary / program fields window 按钮,输入字典表或者程序中定义的元素,把它拖到表格控件中

B)在设计屏幕上修改table的attributes,增加一列

C)在设计屏幕中的表格控件里拖入一个text field(文本字段)

D)在设计屏幕中的表格控件里拖入一个input/output field(输入/输出字段)
24.在编写ALV GRID CONTROL时,应遵循以下哪种顺序. ( )

A)在屏幕上建区域,创建区域对象,创建ALVGRID对象,调用ALVGRID的set_table_for_first_display方法

B)在屏幕上建区域,创建ALVGRID对象,创建区域对象,调用ALVGRID的set_table_for_first_display方法

C)调用ALVGRID的set_table_for_first_display方法,在屏幕上建区域,创建ALVGRID对象,创建区域对象

D)创建区域对象,调用ALVGRID的set_table_for_first_display方法,在屏幕上建区域,创建ALVGRID对象,
25.自己制作一个搜索帮助,引用的表是SBOOKINGS,Dialog Type是Dialog with value restriction,里面customid和name这两个字段的IMP属性打勾,customid,name,carrid,connid这四个字段的EXP属性打勾,四个字段都设定了LPOS和SPOS,这个搜索帮助的输出效果是. ( )

A)先输出两个栏位的筛选屏幕,再按照筛选结果输出两个栏位的表格信息让用户选择,

选择结果影响到四个栏位

B)先输出两个栏位的表格信息让用户选择,选择结果影响到四个栏位

C)先输出四个栏位的表格信息让用户选择,选择结果影响到两个栏位

D)先输出四个栏位的筛选屏幕,再按照筛选结果输出四个栏位的表格信息让用户选择,

选择结果影响到两个栏位
26.ABAP的OPEN SQL的取数语句是否可以实现数据库无关性,其原因是什么. ( )

A)不可以,数据库的SQL格式不同

B)可以,因为它的名字叫做OPEN SQL

C)可以,因为中间有一层DB Interface做转换

D)不可以,各种数据库的版本不同
27.对ABAP的OPEN SQL语句的两个返回系统变量,描述正确的是. ()

A)Sy-dbcnt表示执行结果是否正确,sy-subrc表示执行影响到的数据条数

B)Sy-dbcnt表示执行影响到的数据条数,sy-subrc表示执行结果是否正确

C)Sy-dbamt表示执行结果是否正确,sy-sudnc表示执行影响到的数据条数

D)Sy-dbamt表示执行影响到的数据条数,sy-sudnc表示执行结果是否正确
28.一个表TA有三个字段,其中第一个字段是主键,目前有一条记录是1 /‘first’/ 19,结构wa_result是和表相同类型的,当前值是2 / ‘second’ / 20 .执行OPEN SQL语句 :modify TA from wa_result.执行后对系统的影响为. ( )

A)没有任何影响

B)TA有两条记录1 / ‘first’/ 19 和 2 / ‘second’ / 20

C)TA有一条记录2 / ‘second’ / 20

D)系统出错退出,对表没有任何影响29.SAP对锁的主要实现手段是. ( )

A)在SE11里加锁对象,然后在程序中调用锁对象生成的函数

B)在数据库里加锁,在程序中声明

C)由数据库自动进行,SAP不用处理

D)在程序中通过SQL语句实现
30.有一程序,起始画面里有一个用户可以输入字段为A ,如果想在程序进入的时候自动设置成上次退出时的值,可以采用的方法是. ( )

A)在退出时使用GET PARAMETER ID 'XXX' FIELD A.

在进入时使用SET PARAMETER ID 'XXX' FIELD A.

B)在退出时使用SET PARAMETER ID 'XXX' FIELD A.

在进入时使用GET PARAMETER ID 'XXX' FIELD A.

C)不管是退出还是进入时,都执行语句GET PARAMETER ID 'XXX' FIELD A.

D)不管是退出还是进入时,都执行语句SET PARAMETER ID 'XXX' FIELD A.
31.SAP的SMARTFORM和ABAP PROGRAM的对应关系是. ( )

A)一个SMARTFORM对应多个程序

B)一个程序对应多个SMARTFORM

C)一个SMARTFORM对应多个程序,一个程序也可以对应多个SMARTFORM

D)一个SMARTFORM对应一个程序
32.设计SMARTFORM显示一个表格,如果第一页是一种格式,后面几页是一种格式,

如何设计. ( )

A)第一页指向第二页,第二页指向空

B)第一页指向自己,第二页指向第一页

C)第一页指向第二页,第二页指向第一页

D)第一页指向第二页,第二页指向自己
33.如果想设计SMARTFORM中大家公用的文本,应该使用什么技术. ()

A)SMART TEXT

B)SMART STYLE

C)SAP SCRIPT

D)TEXT MODULE
34.下面对于SMARTFORM中TABLE和 TEMPLATE的描述,正确的是. ()

A)TEMPLATE用来设计表格模版,TABLE用来设计表格实体

B)TEMPLATE用来设计表格样式,TABLE用来设计表格实体

C)TEMPLATE用来设计静态表格,TABLE用来设计表格实体

D)TEMPLATE用来设计静态表格,TABLE用来设计动态表格
35.SMARTFORM中TABLE的排序事件的触发场合是. ( )

A)循环到排序字段第一次开始时触发开始事件,循环到排序字段结束时

触发结束事件

B)循环到排序字段第一次开始时触发开始事件,循环到表格结束时

触发结束事件

C)当表格开始时触发开始事件,表格结束时触发结束事件

D)循环到排序字段第一次开始时触发开始事件,然后触发结束事件,然后

开始正式循环该排序字段剩余记录
36.在SMARTFORM中显示一个表格,其中有一个栏位为wa_sflight-price,现在里面有三行数据,其值依次分别是10,30,50 ,现在在表格设计的时候在Global Definition中定义一个变量G_TOL,在表格的Main Area中加入一个真假节点,节点的条件为WA_SFLIGHT-PRICE > 10 .然后,在真节点下加一个程序行,内容为G_TOL = wa_sflight-price + 10.假节点下加一个程序行,内容为G_TOL = wa_sflight-price + 20.最后在表格的Footer下加一个表行(在表格最后显示),下加一个文本节点显示这个字段G_TOL,它显示的值应该是. ( )

A)60

B)70

C)140

D)150
37.SAP提供的修改系统标准功能的方案里,哪几种是不需要修改系统标准程序

就可以实现的. ( )

A)Customer Develepment ,Enhancement, Modification

B)Customer Develepment ,Customizing, Modification

C)Customer Develepment ,Customizing, Enhancement

D)Enhancement, Modification,Customizing
38.对于客户定制需求的解决方案,应该遵循哪一种顺序进行为宜. ()

A)先判断能否配置;再判断系统有无类似功能,

有的话先判断能否修改标准程序,再判断能否进行Enhancement;

最后考虑自己开发

B)先判断系统有无类似功能,有的话先判断能否修改标准程序,

再判断能否进行Enhancement;然后判断能否配置;

最后考虑自己开发

C)先判断能否配置;再判断系统有无类似功能,

有的话先判断能否进行Enhancement,再判断能否修改标准程序;

最后考虑自己开发

D)先判断系统有无类似功能,有的话先判断能否进行Enhancement,

再判断能否修改标准程序;然后判断能否配置;

最后考虑自己开发
39.自己定义一个增强项目,加入系统的增强,并在其中激活增强的TCODE应该是. ( )

A)SMOD

B)CMOD

C)SE84

D)SE80
40.在SAP系统标准增强功能里,主要包含了以下哪组功能. ()

A)Table Enhancement/Screen Exit/Menu Exit/Function module Exit

B)Table Enhancement/Structure Exit/Menu Exit/Event Exit

C)Menu Exit/Function module Exit/Field Exit/BAPI Exit

D)Structure Exit/Menu Exit/Table Enhancement/Screen Exit


二 问答题(共1题,20分)

请简述SAP二次开发中REPORT , SCREEN , 数据库更新,SMARTFORM及增强等主要技术的开发方法和主要应用场合

PART II

一:添加字段

向 SAP 表中添加字段的方法是哪两种?

二:修改(Modifications)

在 SAP 系统中是怎样定义"修改"的?它们对更新(upgrade)有怎样的影响?

三:簇表和POOL TABLE 的概念

四:授权对象(Authorization Objects)

什么是授权对象?在 ABAP 程序中使用哪条语句进行授权检查?

五:ABAP 内存(ABAP Memory)交换

在使用 ABAP 内存的程序间进行数据交换时用到的两个语句是什么?

六:锁对象(Lock Object)和 FM(Function Module),激活Lock Object时,产生的 FM 的名字是什么?

七:更新方面的 FM

更新 FM 分为 V1 和 V2,那么首先会执行哪一种更新类型呢?每种类型又是以哪种模式(异步、同步或本地)执行的呢?

八:修改助手(Modification Assistant)

什么是修改助手?

九:功能模块出口(Function Module Exit)

实现功能模块出口时 SAP 应用程序中应使用哪条语句?

十:更改 SAP (Changing SAP)

请列出用户修改 SAP 标准功能的不同方式。

 

Part III 

问答题答案

六:锁对象(Lock Object)和 FM(Function Module),激活Lock Object时,产生的 FM 的名字是什么?

答案:首先要在 ABAP 字典中创建锁对象,然后才能在 ABAP 程序中设锁。创建锁对象时,系统会自动生成两个 FM 来进行锁管理。

用于设锁的 FM 为: ENQUEUE_<锁对象名>。它用于在锁表(Lock Table)中生成一个锁项(Lock Entry)。若设锁不成功的话,就会在 Return 中反映出来。

用于释放锁的 FM 为:DEQUEUE_<锁对象名>。它用于从锁表中删除一个锁项。在 ABAP 程序中,只需使用 "CALL FUNCITION ..." 语句就可以调用它们。

这两个锁 FM 是在 SAP 系统的一个特殊工作进程中执行的,专门进行锁管理。它运行在一个单独的服务器上,而该服务器专门用于维护整个 SAP 系统的主锁表(Central Lock Table)。

有两种锁类型:

1. 共享锁——只读锁,一个用户正在读数据时,阻止其他用户更改该数据。

2. 独占锁——可写锁,一个用户正在修改数据时,阻止其他用户更改该数据。

七:更新方面的 FM

更新 FM 分为 V1 和 V2,那么首先会执行哪一种更新类型呢?每种类型又是以哪种模式(异步、同步或本地)执行的呢?

答案:V1 更新类型比 V2 更新类型的优先级高,因此,V1 比 V2 行执行。V1 的执行模式可以为异步、同步或本地;V2 只能为异步执行。

八:修改助手(Modification Assistant)

什么是修改助手?

答案:修改助手是 4.5 版中引入的一个工具,用于简化更新过程。可以通过 ABAP 编辑器触发修改助手,它会记录对系统进行的修改。修改助手支持通过 ABAP 编辑器、Screen Painter、Menu Painter、文本元素维护、Function Builder 和 ABAP 字典进行的修改。

九:功能模块出口(Function Module Exit)

实现功能模块出口时 SAP 应用程序中应使用哪条语句?

答案:某些 SAP 应用程序中存在功能模块出口,它使用户能够向 SAP 程序中添加一些功能。通过搜索 "CALL CUSTOMER" 可以发现是否存在功能模块出口。

十:更改 SAP (Changing SAP)

请列出用户修改 SAP 标准功能的不同方式。

答案:SAP Standard 可以通过 Personalization、Customizing、Modifications、Enhancements 及自定义 ABAP 程序进行更改。这些方式的示例如下:

Personalization——Personalization 技术包含创建变式、设置/获取参数及活动组(Activity Groups)。

Customizing ——是最常用的使用 SAP 工具(如 R/3 Reference Model and Implementation Guide)更改 SAP Standard 的方式。可以认为 Customizing 是实施 R/3 所必需的,通常由 Functional Team 来执行。

Enhancements——常由开发 Team 执行,包含的活动有:字典增强、Funciton Module Exits、菜单和屏幕出口及 Business Add-ins (BADI)。

自定义 ABAP 程序——可以与 SAP 对象或自定义开发的对象一起工作。

Modifications——不建议对 SAP 对象使用 Modifications。使用 SSCR (SAP Software Change Registration)注册所有对 SAP 对象的手动修改。

一:添加字段

向 SAP 表中添加字段的方法是哪两种?

答案:这两种方法是:Append 结构(Append Structure)和自定义 Include(Customizing Include)。Append 结构是在向表尾添加字段时创建的,自定义 Include 由 SAP 开发人员指定,以使用户可以创建新字段。

二:修改(Modifications)

在 SAP 系统中是怎样定义"修改"的?它们对更新(upgrade)有怎样的影响?

答案:修改是指用户对 SAP 发布的库对象(Repository Object)进行的更改。

必须在更新期间对修改进行评审(Review),来决定是否应该使用新的 SAP 对象,以及将来使用时是否需要进一步修改该对象。

三:簇表和POOL TABLE 的概念

答案:

Pools和Cluster table;他们已经不是各种数据库常规的表了,也不能够被数据库直接访问。只能通过SAP自己的工具来直接访问。

透明表:

每个透明表在数据库中有一个相应的物理表。物理表的名称和数据字典中的逻辑表

定义的名称一致。所有事务和应用数据存贮在透明表中。

结构:

结构在数据库不存在数据记录。结构用于在程序之间或程序与屏幕之间的接口定义。

附加结构:

附加结构定义字段的子集,该字段属于其他表格或结构,但是在修正管理中作为单

独的对象。

存贮表:

存储表可以用来存贮控制数据(例如:屏幕顺序,程序参数或临时数据)。几个存

储表可以组合成一个表库。该表库和数据库中的一物理表库相一致。它包含了各组

合库分派给它的所有记录。

簇KEKEKEY表:

连续的文本如文档之类可以存贮在簇表中。几个簇表可以组合成一个表簇。对这种

表类型,不同表中的几个逻辑行组合到一物理记录。这可以实现一对象接一对象地

存贮或访问,访问簇中的表的一个前提是,至少关键字的一部分必须相符合。几个

簇表存贮在数据库中 一个相应的表里。

四:授权对象(Authorization Objects)

什么是授权对象?在 ABAP 程序中使用哪条语句进行授权检查?

答案:授权对象由一组字段组成,这些字段中的值将被用于进行授权检查。ABAP 程序中使用 AUTHORITY-CHECK 语句根据授权对象进行授权检查。在 AUTHORITY-CHECK 语句中,必须指明授权对象的所有字段,但有一个例外,可以用 DUMMY 关键字来绕过某个字段的检查。

一个授权对象中最多可以定义 10 个字段。

五:ABAP 内存(ABAP Memory)交换

在使用 ABAP 内存的程序间进行数据交换时用到的两个语句是什么?

答案:EXPORT to MEMORY ID 用于将数据复制到 ABAP 内存,IMPORT from MEMORY ID 用于将数据从 ABAP 内存复制到程序中。

在 ABAP 内存间进行交换的数据必须在两个程序中都进行声明,并包含同样的数据声明。

test my signature

posted @ 2009-03-29 11:38 高岭的天空 阅读(988) | 评论 (0)编辑 收藏

2009年3月28日

ABAP interview questions and answers(1)

  1. What is an ABAP data dictionary?- ABAP 4 data dictionary describes the logical structures of the objects used in application development and shows how they are mapped to the underlying relational database in tables/views.
  2. What are domains and data element?- Domains:Domain is the central object for describing the technical characteristics of an attribute of an business objects. It describes the value range of the field. Data Element: It is used to describe the semantic definition of the table fields like description the field. Data element describes how a field can be displayed to end-user.
  3. What is foreign key relationship?- A relationship which can be defined between tables and must be explicitly defined at field level. Foreign keys are used to ensure the consistency of data. Data entered should be checked against existing data to ensure that there are now contradiction. While defining foreign key relationship cardinality has to be specified. Cardinality mentions how many dependent records or how referenced records are possible.

  4. Describe data classes.- Master data: It is the data which is seldomly changed. Transaction data: It is the data which is often changed. Organization data: It is a customizing data which is entered in the system when the system is configured and is then rarely changed. System data:It is the data which R/3 system needs for itself.
  5. What are indexes?- Indexes are described as a copy of a database table reduced to specific fields. This data exists in sorted form. This sorting form ease fast access to the field of the tables. In order that other fields are also read, a pointer to the associated record of the actual table are included in the index. Yhe indexes are activated along with the table and are created automatically with it in the database.
  6. Difference between transparent tables and pooled tables.- Transparent tables: Transparent tables in the dictionary has a one-to-one relation with the table in database. Its structure corresponds to single database field. Table in the database has the same name as in the dictionary. Transparent table holds application data. Pooled tables. Pooled tables in the dictionary has a many-to-one relation with the table in database. Table in the database has the different name as in the dictionary. Pooled table are stored in table pool at the database level.
  7. What is an ABAP/4 Query?- ABAP/4 Query is a powerful tool to generate simple reports without any coding. ABAP/4 Query can generate the following 3 simple reports: Basic List: It is the simple reports. Statistics: Reports with statistical functions like Average, Percentages. Ranked Lists: For analytical reports. - For creating a ABAP/4 Query, programmer has to create user group and a functional group. Functional group can be created using with or without logical database table. Finally, assign user group to functional group. Finally, create a query on the functional group generated.
  8. What is BDC programming?- Transferring of large/external/legacy data into SAP system using Batch Input programming. Batch input is a automatic procedure referred to as BDC(Batch Data Communications).The central component of the transfer is a queue file which receives the data vie a batch input programs and groups associated data into “sessions”.
  9. What are the functional modules used in sequence in BDC?- These are the 3 functional modules which are used in a sequence to perform a data transfer successfully using BDC programming: BDC_OPEN_GROUP - Parameters like Name of the client, sessions and user name are specified in this functional modules. BDC_INSERT - It is used to insert the data for one transaction into a session. BDC_CLOSE_GROUP - This is used to close the batch input session.
  10. What are internal tables?- Internal tables are a standard data type object which exists only during the runtime of the program. They are used to perform table calculations on subsets of database tables and for re-organising the contents of database tables according to users need.
  11. What is ITS? What are the merits of ITS?- ITS is a Internet Transaction Server. ITS forms an interface between HTTP server and R/3 system, which converts screen provided data by the R/3 system into HTML documents and vice-versa. Merits of ITS: A complete web transaction can be developed and tested in R/3 system. All transaction components, including those used by the ITS outside the R/3 system at runtime, can be stored in the R/3 system. The advantage of automatic language processing in the R/3 system can be utilized to language-dependent HTML documents at runtime.
  12. What is DynPro?- DynPro is a Dynamic Programming which is a combination of screen and the associated flow logic Screen is also called as DynPro.
  13. What are screen painter and menu painter?- Screen painter: Screen painter is a tool to design and maintain screen and its elements. It allows user to create GUI screens for the transactions. Attributes, layout, filed attributes and flow logic are the elements of Screen painter. Menu painter: Menu painter is a tool to design the interface components. Status, menu bars, menu lists, F-key settings, functions and titles are the components of Menu painters. Screen painter and menu painter both are the graphical interface of an ABAP/4 applications.
  14. What are the components of SAP scripts?- SAP scripts is a word processing tool of SAP which has the following components: Standard text. It is like a standard normal documents. Layout sets. - Layout set consists of the following components: Windows and pages, Paragraph formats, Character formats. Creating forms in the R/3 system. Every layout set consists of Header, paragraph, and character string. ABAP/4 program.
  15. What is ALV programming in ABAP? When is this grid used in ABAP?- ALV is Application List viewer. Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length. In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output. The report output can contain up to 90 columns in the display with the wide array of display options.
  16. What are the events in ABAP/4 language?- Initialization, At selection-screen, Start-of-selection, end-of-selection, top-of-page, end-of-page, At line-selection, At user-command, At PF, Get, At New, At LAST, AT END, AT FIRST.
  17. What is CTS and what do you know about it?- The Change and Transport System (CTS) is a tool that helps you to organize development projects in the ABAP Workbench and in Customizing, and then transport the changes between the SAP Systems and clients in your system landscape. This documentation provides you with an overview of how to manage changes with the CTS and essential information on setting up your system and client landscape and deciding on a transport strategy. Read and follow this documentation when planning your development project.
  18. What are logical databases? What are the advantages/ dis-advantages of logical databases?- To read data from a database tables we use logical database. A logical database provides read-only access to a group of related tables to an ABAP/4 program. Advantages: i)check functions which check that user input is complete, correct,and plausible. ii)Meaningful data selection. iii)central authorization checks for database accesses. iv)good read access performance while retaining the hierarchical data view determined by the application logic. dis advantages: i)If you donot specify a logical database in the program attributes,the GET events never occur. ii)There is no ENDGET command,so the code block associated with an event ends with the next event statement (such as another GET or an END-OF-SELECTION).
  19. What is a batch input session?- BATCH INPUT SESSION is an intermediate step between internal table and database table. Data along with the action is stored in session ie data for screen fields, to which screen it is passed, program name behind it, and how next screen is processed.
  20. How to upload data using CATT ?- These are the steps to be followed to Upload data through CATT: Creation of the CATT test case & recording the sample data input. Download of the source file template. Modification of the source file. Upload of the data from the source file.
  21. What is Smart Forms?- Smart Forms allows you to create forms using a graphical design tool with robust functionality, color, and more. Additionally, all new forms developed at SAP will be created with the new Smart Form solution.
  22. How can I make a differentiation between dependent and independent data?- Client dependent or independent transfer requirements include client specific or cross client objects in the change requests. Workbench objects like SAPscripts are client specific, some entries in customizing are client independent. If you display the object list for one change request, and then for each object the object attributes, you will find the flag client specific. If one object in the task list has this flag on, then that transport will be client dependent.
  23. What is the difference between macro and subroutine?- Macros can only be used in the program the are defined in and only after the definition are expanded at compilation / generation. Subroutines (FORM) can be called from both the program the are defined in and other programs . A MACRO is more or less an abbreviation for some lines of code that are used more than once or twice. A FORM is a local subroutine (which can be called external). A FUNCTION is (more or less) a subroutine that is called external. Since debugging a MACRO is not really possible, prevent the use of them (I’ve never used them, but seen them in action). If the subroutine is used only local (called internal) use a FORM. If the subroutine is called external (used by more than one program) use a FUNCTION.

posted @ 2009-03-28 12:11 高岭的天空 阅读(521) | 评论 (0)编辑 收藏

Events in an ABAP/4 Report Program

 

There is no mandatory event in a report program. Events are actually used to organize the statements and control the flow of the program. If the program contains no explicitly defined event blocks, all the statements in the program form the entire event block START-OF-SELECTION. ABAP runtime environment automatically introduces a START-OF-SELECTION at the first execution line.

ABAP/4 report programs are event driven programs. Following events are triggered in a report.

LOAD OF PROGRAM. - If propgram is of type 1, M, F, or S; then LOAD-OF-PROGRAM is trigerred first and then INITIALIZATION. The purpose of load of program is to load the program into system memory so that the program can be executed.

INITIALIZATION. - just once.

AT SELECTION-SCREEN OUTPUT. - when there is selection-screen

AT SELECTION-SCREEN. - when user interacts.

START-OF-SELECTION. - when F8.This is the default event in ABAP.

END-OF-SELECTION. - At the end

EVENTS IN A CLASSICAL REPORT:

1. INITIALIZATION: This is triggered when the report is loaded in memory.

2. AT SELECTION-SCREEN OUTPUT: This is triggered when the selection screen is loaded in memory before being displayed.

3. AT SELECTION-SCREEN/<field> : This event is triggered before leaving the selection screen.

4. START-OF-SELECTION: This is the the first and default event for displaying the report. Data retrieval logic is written under this event.

OUTPUT EVENT(5, 6):
5. TOP-OF-PAGE: This event is triggered every time a new page is started in the list.

6. END-OF-PAGE : This event is triggered every time the list data reaches the footer region of the page.

7. END-OF-SELECTION: This event is triggered after the START-OF-SELECTION is completed.
This event is used when there is use of logical data base in the report. It is triggered in type 1 programs once the logical database completes reading all data i.e. all the selection is finished and before the list processor is started. This statement tells the server that all the database reading is completed and no more data reading is going to take place. END-OF-SELECTION is generally used for the summary/results of reports. In an executable program without logical data base, there is no need to implement the event block END-OF-SELECTION.
After a program is executed by the user, the database is locked when it encounters a START-OF-SELECTION statement and the lock is released when an END-OF-SELECTION statement is encountered (to maintain the consistency). Data selection is done between START-OF-SELECTION and END-OF-SELECTION. Now if we don’t write the END-OF-SELECTION statement, the database will remain locked till the programs get terminated. Hence, the performance will be reduced. So it is always good practice to write END-OF-SELECTION statement after finishing the data selection from database.

EVENTS IN AN INTERACTIVE REPORT:

In addition of the above, the following events are possible in case of Interactive Reports.

1. Top of page during line selection : top of page event for secondary list.

2. At line-selection : evey time user dbl-clicks(F2) on the list data.

3. At pF<key> : function key from F5 to F12 to perform interactive action on the list.

4. At user-command.

==================================================

Finally I want to include one point:
If you debug your report program from the Abap editor screen then it triggers from
1.Initialization,
2.At Selection-screen,
3.Start-of Selection,
4.End-of Selection,
5.Top-of-page,
6.End-of-page.

But if you debug from the selection-screen then it triggers from
1.At Selection-Screen,
2.Start-of-selection,
3.Top-of-page,
4.End-of-page.

posted @ 2009-03-28 12:04 高岭的天空 阅读(234) | 评论 (0)编辑 收藏

仅列出标题  
<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

导航

统计

常用链接

留言簿(1)

随笔分类

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜