DirectorySoftwareBlog Details for "Free Download SAP ABAP Books,Projects,Reports And"

Free Download SAP ABAP Books,Projects,Reports And

Free Download SAP ABAP Books,Projects,Reports And
ABAP ABAP report Interactive Report ALV grid ALV list IDOC User Exit RFC Smartform sapscript ABAP Performance Remote Function Module RFC Function Module Modularization techniques ABAP tools ALV report Generator ABAP Interview Questions BDC BAPI ALE
Articles: 1, 2

Articles

SAP ABAP Code For Copying fields
2008-02-13 08:42:00
*&----------------------------------- ----------------------------------**& Chapter 7: Copying fields*&----------------------------- ----------------------------------------* REPORT CHAP0701.* move fieldsDATA: NAME(25), COUNTER TYPE I.DATA: SOURCE LIKE NAME, TARGET LIKE SOURCE.MOVE: 'Edison' TO NAME, 17 TO COUNTER.MOVE SOURCE TO TARGET.* Using the compute command (keyword can be omitted)COMPUTE TARGET = SOURCE.TARGET = SOURCE.* Concatenating compute commandsDATA: PHONE_1 LIKE SOURCE, PHONE_2 LIKE PHONE_1, PHONE_3 LIKE PHONE_2, PHONE_4 LIKE PHONE_3.PHONE_4 = PHONE_3 = PHONE_2 = PHONE_1 = SOURCE.
More About: Code , Fields
SAP ABAP Code Using system fields Declarations
2008-02-13 08:15:00
*&----------------------------------- ----------------------------------**& Chapter 4: Using system fields*&----------------------------- ----------------------------------------* REPORT CHAP0409.WRITE: / 'Current date', SY-DATUM, / 'Current table index', SY-TABIX, / 'Loop counter', SY-INDEX, / 'System return code', SY-SUBRC.
More About: Code , Fields
SAP ABAP Code For Complex Non-Elementary Types and Data Objects
2008-02-13 08:15:00
*&----------------------------------- ----------------------------------**& Chapter 4: Complex Non-Elementary Types and Data Objects *&---------------------------- ----------------------------------------- *REPORT CHAP0408.* Nested recordsTYPES: BEGIN OF ADDRESS, CITY(25), STREET(30), END OF ADDRESS, BEGIN OF PERSON, NAME(25), ADDRESS TYPE ADDRESS, END OF PERSON.DATA RECEIVER TYPE PERSON.RECEIVER-NAME = 'Smith'.RECEIVER-ADDRESS-CITY = 'Big City'.RECEIVER-ADDRESS-STREET = 'Main street'.* Nested internal tablesTYPES: BEGIN OF PHONE_FAX_NUMBERS, COUNTRY_CODE(3) TYPE N, AREA_CODE(3) TYPE N, NUMBER(10) TYPE N, END OF PHONE_FAX_NUMBERS, BEGIN OF EMPLOYEE, NAME(25), PHONE TYPE PHONE_FAX_NUMBERS OCCURS 10, FAX TYPE PHONE_FAX_NUMBERS OCCURS 5, END OF EMPLOYEE.DATA EMPLOYEES TYPE EMPLOYEE OCCURS 100.
More About: Code
SAP ABAP Code For Records and internal tables Declarations
2008-02-13 08:15:00
*&----------------------------------- ----------------------------------**& Chapter 4: Records and internal tables*&----------------------------- ----------------------------------------* REPORT CHAP0407.* Records (or structures) consist of a fixed number of componentsDATA: BEGIN OF CUSTOMER, ID(8) TYPE N, NAME(25), TELEPHONE(12), END OF CUSTOMER.* Working with the different components and the structure itselfDATA VENDOR LIKE CUSTOMER.CUSTOMER-ID = '87654321'.CUSTOMER-NAME = 'Edison'.CUSTOMER-TELEPHONE = '111-111-1111'.MOVE CUSTOMER TO VENDOR.WRITE / VENDOR-NAME.* Defining an internal table each entry having the structure of* the record customerDATA ALL_CUSTOMERS LIKE CUSTOMER OCCURS 100.* Using a reference to a non-elementary type.TYPES: BEGIN OF PERSONAL_DATA, NAME(25), CITY(25), STREET(30), END OF PERSONAL_DATA.DATA PEOPLE TYPE PERSONAL_DATA OCCURS 300.* Internal table with a header line, which is used as a default re...
More About: Tables , Code
SAP ABAP Code Hexadecimal (or binary) data
2008-02-13 08:14:00
*&----------------------------------- ----------------------------------**& Chapter 4: Hexadecimal (or binary) data **&---------------------------------- -----------------------------------*REPOR T CHAP0406.* Hexadecimal (or binary) data is stored in fields of type x.* A type x field of length n contains 2n digits* and its output length is also equal to 2n.* For example, the bit stream 1111000010001001 can be defined as* follows (remind that 1111 = F, 0000 = 0, 1000 = 8, 1001 = 9):DATA XSTRING(2) TYPE X VALUE 'F089'.
More About: Data , Code
SAP ABAP Code Date and time Declaration
2008-02-13 08:14:00
*&----------------------------------- ----------------------------------**& Chapter 4: Date and time*&------------------------------- --------------------------------------*RE PORT CHAP0405.* Date fields are type d with the fixed length 8 and the internal* representation YYYYMMDD (year, month, and day).* The initial value of a date field is 00000000.DATA TODAY TYPE D.* The write command formats dates according to personal settings of* the end user.TODAY = SY-DATUM.WRITE (10) TODAY.* Using date fields to perform computationsDATA ULTIMO TYPE D.* Set variable to first day of current month.ULTIMO = SY-DATUM.ULTIMO+6(2) = '01'.* Set variable to last day of previous month.SUBTRACT 1 FROM ULTIMO.WRITE / ULTIMO.* Time fields are type t with the fixed length 6* and the format HHMMSS (hours, minutes, and seconds)DATA MY_TIME TYPE T.WRITE /(8) MY_TIME.
More About: Declaration , Code
SAP ABAP Code For Character types
2008-02-13 08:13:00
*&----------------------------------- ----------------------------------**& Chapter 4: Character types*&------------------------------ ---------------------------------------*R EPORT CHAP0403.* Type c is the default type when no type is specified.* Initial value is space, if it is not specified explicitly.DATA: NAME(25) TYPE C, CITY(25), FLAG, SINGLE_CHARACTER VALUE 'A'.* If the field and the initial value have different lengths, the* initial value is either truncated or padded with blanks on the right:DATA LANGUAGE(2) VALUE 'ABAP/4'.WRITE / LANGUAGE.* Maximum length 64KBDATA MAX_CHARACTER_FIELD(65535).* Variables of type n (numeric texts) contain strings of digitsDATA CUSTOMER_ID(8) TYPE N VALUE '87654321'.* The default length for a field of type n is 1,* and the default initial value is a string of zerosDATA ZIP_CODE(5) TYPE N.WRITE / ZIP_CODE.* Type n fields pad the left side with zeroesCUSTOMER_ID = '1234'.WRITE / CUSTOMER_ID.
More About: Code , Types
SAP ABAP Code For Numbers Declaration
2008-02-13 08:13:00
*&----------------------------------- ----------------------------------**& Chapter 4: Numbers *&---------------------------- ----------------------------------------- *REPORT CHAP0404.* Fields of type i (integer) are mainly used for countingDATA: CUSTOMER_NUMBER TYPE I, LOOP_COUNTER TYPE I.* Integers have a fixed length of 4 bytes.* The initial value is zero, if it is not specified explicitly.DATA WORD_LENGTH TYPE I VALUE 17.* Packed numbers (type p) are a way to store numbers internally* in a compressed form. Therefore, they cover a wide range of possible* values can be used for all kinds of computations.DATA NUMBER_OF_MOSQUITOES TYPE P.* Decimal handling is supported for packed numbersDATA AIRBAG_PRICE TYPE P DECIMALS 2 VALUE '333.22'.WRITE / AIRBAG_PRICE.* Default length of type p fields is 8, and the maximum length is 16,* which can represent numbers of up to 31 digits plus the signDATA: PACKED_NORMAL TYPE P, PACKED_16(16) TYPE P.* Floating point numbers (type...
More About: Declaration , Code
SAP ABAP Code For Types, data, constants
2008-02-13 08:12:00
*&----------------------------------- ----------------------------------**& Chapter 4: Types , data, constants*&-------------------------- ----------------------------------------- --*REPORT CHAP0402.* Type flag defines an abstract typeTYPES FLAG TYPE C.* Field address_flag will allocate space in main memory at runtimeDATA ADDRESS_FLAG TYPE FLAG VALUE 'X'.* Constants are defined like fields and cannot be changedCONSTANTS: COMPANY_NAME(3) TYPE C VALUE 'SAP', MAX_COUNTER TYPE I VALUE 9999.* Using constants to define initial valuesDATA COUNTER TYPE I VALUE MAX_COUNTER.
More About: Data , Code
SAP ABAP Code For Three approaches to define data objects
2008-02-13 08:12:00
*&----------------------------------- ----------------------------------**& Chapter 4: Three approaches to define data objects*&---------------------------- ----------------------------------------- *REPORT CHAP0401.* 1. Elementary typesDATA: CUSTOMER_NAME_1(25) TYPE C, VENDOR_NAME_1(25) TYPE C.* 2. Reference to an existing fieldDATA: CUSTOMER_NAME_2(25) TYPE C, VENDOR_NAME_2 LIKE CUSTOMER_NAME_2.* 3. Reference to a non-elementary typeTYPES T_NAME(25) TYPE C.DATA: CUSTOMER_NAME_3 TYPE T_NAME, VENDOR_NAME_3 TYPE T_NAME.
More About: Data , Code , Objects , Define
SAP ABAP Code For The Syntax of ABAP/4 Programs
2008-02-13 08:11:00
*&----------------------------------- ----------------------------------**& Chapter 3: The Syntax of ABAP/4 Programs *&--------------------------- ----------------------------------------- -** Declaration of the program nameREPORT CHAP0301.* Displaying the words 'Customer list' on the screenWRITE / 'Customer list'.* Using an addition of the write commandWRITE AT /10 'Customer list'.* Using single quotation marks within the text of a literalWRITE / 'Customer''s Name'.* Here is a comment with an asterisk in the first columnWRITE / 'Ms O''Connor'. "This is a comment at the end of the line* A field of type character and length 40DATA TARGET_STRING(40) TYPE C.* Statements may extend over several lines* (e.g., copying fields using the move command):MOVE 'Source string' TO TARGET_STRING.WRITE / TARGET_STRING.* Combining StatementsWRITE: / 'Customer list', 'Bookings'.
More About: Code
SAP ABAP Code For Designing a report
2008-02-13 08:11:00
*&----------------------------------- ----------------------------------**& Chapter 1: Designing a report **&---------------------------------- -----------------------------------*REPOR T CHAP0104.* Declaration of a work area for a Dictionary tableTABLES CUSTOMERS.* Internal table used as snapshot of the database tableDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE.* Definition of input fields on the report's selection screenSELECT-OPTIONS SNAME FOR CUSTOMERS-NAME.* Reading the entries of the database table into an internal tableSELECT * FROM CUSTOMERS INTO TABLE ALL_CUSTOMERS WHERE NAME IN SNAME.* Displaying each line of an internal tableLOOP AT ALL_CUSTOMERS. WRITE: / ALL_CUSTOMERS-NAME.ENDLOOP.
More About: Report , Code
SAP ABAP Code For Working with database tables and internal tables
2008-02-13 08:11:00
*&----------------------------------- ----------------------------------**& Chapter 1: Working with database tables and internal tables **&---------------------------------- -----------------------------------*REPOR T CHAP0103.* Declaration of a work area for a Dictionary tableTABLES CUSTOMERS.* Internal table used as snapshot of the database tableDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE.* Reading the entries of the database table into an internal tableSELECT * FROM CUSTOMERS INTO TABLE ALL_CUSTOMERS.* Displaying each line of an internal tableLOOP AT ALL_CUSTOMERS. WRITE: / ALL_CUSTOMERS-NAME.ENDLOOP.
More About: Tables , Code , Database
SAP ABAP Code For subroutine of a single program
2008-02-13 08:10:00
*&----------------------------------- ----------------------------------**& Chapter 1: A Few Simple Examples **&---------------------------------- -----------------------------------*REPOR T CHAP0102.* Copying the content of one data object to anotherDATA: SOURCE(10) TYPE C, TARGET LIKE SOURCE.MOVE SOURCE TO TARGET.* Displaying the contents of fieldsWRITE 'ABAP/4 is easy.'.NEW-LINE.WRITE 'This text is displayed on a new line.'.WRITE / 'After the symbol /, text also appears on a new line.'.* Standard control structures (conditions and loops)IF SOURCE = TARGET. WRITE / 'Fields source and target have the same content'.ELSE. WRITE / 'Fields source and target do not have the same content'.ENDIF.DO 3 TIMES. WRITE / SY-INDEX.ENDDO.* Local subroutine of a single programDATA: A1 TYPE I, A2 TYPE I.PERFORM CALC USING A1 CHANGING A2.WRITE / A2.FORM CALC USING F1 LIKE A1 CHANGING F2 LIKE A2. F2 = F1 + ( F2 * ...
More About: Code , Program , Single
SAP ABAP Code For How to define types and data objects
2008-02-13 08:09:00
*&----------------------------------- ----------------------------------**& Chapter 1: How to define types and data objects **&---------------------------------- -----------------------------------*REPOR T CHAP0101.* Elementary type character, length 20DATA CUSTOMER_NAME(25) TYPE C.* Non-elementary typeTYPES T_NAME(25) TYPE C.DATA NEW_CUSTOMER_NAME TYPE T_NAME.* Reference to a data objectDATA VENDOR_NAME LIKE CUSTOMER_NAME.* RecordDATA: BEGIN OF BOOKING, ID(4) TYPE C, FLIGHT_DATE TYPE D, NAME LIKE CUSTOMER_NAME, END OF BOOKING.* Internal tableDATA BOOKING_TABLE LIKE BOOKING OCCURS 100.
More About: Data , Code , Objects , Types , Define
Working with the Tools
2008-02-11 21:36:00
You can reach all the Workbench tools from the initial screen of the ABAP Workbench. In addition to the standard System and Help menus the top level of the Workbench offers the following menus: Menu Explanation Overview Provides tools that help you survey the objects in your system. You use the functions in this menu to locate objects by application, type, or development class. Development Contains tools that you use for creating SAP applications. The tools that appear in the toolbar also appear in this menu. Test Contains tools that let you test a completed program. Utilities Contains tools related to but not directly required by the development process.When you select a tool, for example, the Editor, the system displays its initial screen. The initial screen of each tool is a selection screen:On the selection screen, you can either choose an existing development object or create a new object. In addition to selecting an object, you can choose on the...
More About: Tools , Working
Tool Integration and Working Methods
2008-02-11 21:36:00
The tools in the Workbench are integrated. For example, when you are working on a program, the Editor will also recognize objects created using other tools. This integration also means if you double-click an object to select it, the Workbench automatically launches the tool that was used to create the object.SAP has developed the Repository Browser to help you to organize your application development in this integrated environment. The Repository Browser provides a context that makes it easier for you to trace the relationships between objects in a program. Rather than working with tools and recalling development objects, you work with objects and allow the Workbench to launch the appropriate tool for an object.We recommend that you use the Repository Browser to develop your applications. For this reason, this documentation is written from the perspective of a Repository Browser user.
More About: Integration , Tool , Methods , Working
Development in a Team Environment
2008-02-11 21:35:00
ABAP allows you to divide work on large projects among several programmers. Consider an accounting application project with an accounts payable module and an accounts receivable module. The ABAP environment helps you to create a work area in the system for the project. You can then assign tasks to each programmer and follow their work as it progresses.The tool you use for tracking development projects is called the Workbench Organizer. The Organizer tracks changes to existing SAP development objects and the creation of new objects. If you create a new object, the Organizer asks you for a development class when you try to Save the object:The Organizer uses the development class to determine whether a change request is required. A change request records the changes made to one or more development objects. The $TMP development class contains local objects. Local objects are not transported and so the Organizer does not monitor them.If you specify a non-local development class, the syst...
More About: Environment , Development , Team
Development Objects and Development Classes
2008-02-11 21:35:00
When you work with the Workbench, you work with development objects and development classes.Development objects are the individual parts of an ABAP application. Some examples of development objects are programs like reports, transactions, and function modules. Program components such as events, screens, menus, and function modules are also development objects. Finally, objects that programs can share are development objects as well. These shareable objects include database fields, field definitions, and program messages. A development class is a container for objects that logically belong together; for example, all of the objects in an application. A development class is also a type of development object. An example of a development class might be General Ledger Accounting .When you create a new object or change an existing object, the system asks you to assign the object to a development class. Storage of Development Objects The SAP system stores development objects in the R...
More About: Classes
Introduction to the Workbench Tools
2008-02-11 21:34:00
The ABAP Workbench is SAP's graphical programming environment. It allows you to create new ABAP client/server applications, working as a team, and to change existing SAP applications. Programmers can use the Workbench to:Write ABAP code. Design dialogs with a graphical editor. Create menus with a menu editor. Debug an application. Test an application for efficiency. Use predefined functions. Control access to objects under development. Create new or access predefined database information. The Major Workbench Tools If you have not already done so, log on to the R/3 system. Then, choose Tools ® ABAP Workbench from the menu bar. The ABAP Workbench screen appears. The Workbench tools you will work with most often appear in the toolbar: Tool Function Repository Browser Used to display and edit hierarchical lists of development objects. Dictionary Used to define and save data definitions You can also store documentation, help information, data relationsh...
More About: Introduction
BC - ABAP Workbench Tools
2008-02-11 21:32:00
Information and Navigation ABAP Editor Screen Painter Menu Painter Function Builder SQL Trace Runtime Analysis ABAP Debugger
More About: Tools , Workbench
Generating Ranked Lists
2008-02-07 21:08:00
We can explain the definition of a ranked list by means of a simple example. Suppose you want to find out the 10 flights which have the most free seats.To define this list, you create a query R1 via the functional area FLBU. From the functional groups Flight connections and Flights, you choose the fields Airline carrier ID, Flight connection ID, Flight date, Free seats and Total of current bookings. Then, you call the Ranked list function to branch to the definition of a ranked list.First, you must assign a title to the ranked list. This is necessary, since one query can contain several ranked lists. You can then specify how many entries (i.e. output lines) you want the ranked list to have. The proposed value here is always 10.Subsequently, you must define which fields are to be output and in what order. To do this, enter sequence numbers in the first column. You select one of these fields as the ranked list criterion. In our example, it is the field Free seats. The ranked list crit...
More About: Lists
Changing Queries
2008-02-07 21:08:00
To change an existing query, proceed as follows:Choose the component Maintain Queries. On the initial screen, choose a user group and enter the query name. The query you specify must already exist in the user group. Choose Change. This takes you to the Title, Format screen. You then proceed as described above. If you want to know who created the query or who last made changes, choose Extras ® Status info...
More About: Changing
Maintaining Queries in the Human Resources Application (HR)
2008-02-07 21:08:00
When you create queries via functional areas which use logical databases from the Human Resources (HR) application (for example PNP or PCH), you should be aware of certain special features on the List Line Output Options screen. The following sections explain these features:
More About: Human Resources , Application
Line Groups
2008-02-07 21:07:00
On the List Line Output Options screen, you can group different lines together to form line groups. Lines which belong to a common line group are always output together as a block.Suppose a person has several addresses. Usually, the name of the person is output on the first line. The second line contains the house number and street, and the third line displays the postal code and the city. By grouping lines two and three together to form a line group, you ensure that that they are always treated as a block and output at the same time. Otherwise, for a person with more than one address, you would get a list with all the streets and then all the cities. The example below shows the formatting of an address list in the application HR:With HR queries, you must also remember that the output in the column Ref. on this screen always refers to line groups. Thus, if you want to output lines only under certain conditions, you must define line groups.The assignment of lines to line groups must...
More About: Groups
What are Ranked Lists?
2008-02-07 21:07:00
The previous section discussed statistics where number values (sales figures, for example) are summed for particular key terms (for, for example, an airline carrier or a flight). The result is displayed in a table and thus returns an overview of the distribution of numeric values across the individual key terms.Ranked lists are special types of statistics. Here, numeric values are also summed for key terms and displayed in a table. However, sorting is always by a numeric value known as the ranked list criterion. Additionally, only a certain number of items are output. This makes ranked lists suitable for analyzing questions such as: "What are the 10 flight connections with the highest sales?"When you choose a numeric value as the only sort criterion in a statistic, the result is practically a ranked list. With statistics, however, you cannot restrict the number of items to be output.
More About: Lists
Error Analysis with Conversion Errors
2008-02-07 21:06:00
Using quantity fields can sometimes result in conversion errors, since quantities are not easy to convert from one to the other.At the end of the query list, there is an overview of all the conversions which have been performed. In the case of conversion errors, the table also indicates in which statistic and in which field the error occurred. Other possible causes of error are:no exchange rate found (with currency amounts)unknown unit (with quantities)dimension (with quantities, no conversion possible) In the statistic itself, values which cause a conversion error are highlighted.
More About: Analysis , Errors , Error , Conversion
Evaluations According to a Company?s Organizational Structure
2008-02-07 21:06:00
To generate evaluations of HR master data according to a company?s organizational structure in the HR Planning area, you must use a functional area of the database PCH. This contains info types from HR master data and HR Planning, for example 0001 - 0007 and 1000 - 1002.To clarify the structure, the HR Planning application area includes additional fields for the info type Object name. These fields use periods to show the object levels.If you want to create a query which generates an address list of all employees in each organizational unit, you choose the relevant fields and make assignments as follows:In order to make the list easier to read, you are recommended not to output lines 2,3 and 4 until column 15.When you execute the query, you see the selection screen for HR Planning. You do this using an evaluation path which analyzes related persons; such a path is supplied by SAP. You specify all the other parameters as you would for normal HR Planning reports.The query then produces...
More About: Company , Structure , Accord
Defining Headers in Statistics
2008-02-07 21:05:00
On the Statistic Header screen, you can define your own headers for the statistic. To do this, you choose Next screen to go to the next screen in the sequence.In general terms, maintaining headers for statictics is exactly the same as for basic lists (see Changing Headers).The maintenance screen shows the basic structure of the statistic. It contains the header lines followed by the line structure and then the footer lines.Fixed header lines depend on the structure of the query. These header lines can accept input on the screen and you can maintain them simply by entering your own values. The Edit menu contains functions which allow you to insert or delete lines. Statistics generally have at least one fixed header line which contains the statistic title.You can define fixed header lines and footer lines so that when you generate the query list, they can receive current values of certain fields (see ).You maintain column headers field by field. If you do not want to use the header ...
Sorting Statistics
2008-02-07 21:05:00
You can sort statistics both independently of each other and independently of a basic list defined in the same query. You can also generate sub-totals for sort criteria.The following example defines a statistic showing sales figures for each airline carrier and flight connection. It outputs a sub-total for each airline carrier.This generates the following list:As already shown, apart from the overall total at the end of the statistic, you can output sub-totals lines by selecting the field Su on the Statistic Structure screen. When the sort criterion changes, a sub-totals line is generated for it, provided that the following three conditions are satisfied:Sub-totals lines are only possible for fields by which you are sorting.Preceding fields in the statistic must also be sorted fields and the sort sequence must be in ascending order.None of the subsequent fields in the statistic may have a smaller sort number. The next example demonstrates how you can use local fields with calculati...
More About: Statistics , Sorting
More articles from this author:
1, 2
40965 blogs in the directory.
Statistics resets every week.


Contact | About
© Blog Toplist 2008 - SEO by FeWorks
eXTReMe Tracker