Você está na página 1de 4

Exercise 2: ABAP Editor

In the exercise you will go directly to the ABAP Editor rather than use the Object
Navigator.
Once in the Editor, you will copy a program, correct errors in the code, merge new
code into it, print it, download it, make further changes and then upload it.
1.
At the SAP Easy Access menu, expand the hierarchy tree to display the ABAP
Editor.

2.

Double-click on the ABAP Editor to open this tool.

SAP UA Conference Hong Kong 3-7th July 2012

Page

3.

Copy program Yxx001 to program yxx20a where xx is your assigned identifier,


e.g. 01
To perform the copy, use the Copy button
found on the Application toolbar of the ABAP Editor:
Initial Screen. Select Local Object as the Development Class.

4.

Edit program yxx20a. Correct the report name on the report statement by
replacing Yxx001 with the correct program name.

5.

Insert a new line after line 1. Type the appropriate tables statement on that
line.

6.

Get help for the tables statement.


Put your cursor on the TABLES statement and press F1.

7.

Return from Help back to your program.


Press the Back button

on the Standard toolbar.

8.

Type the following code before the first write statement:


if sy-dbcnt > 0.
write: / sy-dbcnt, records found.
endif.

9.

Automatically fix the program indentation by pressing


Application toolbar.

SAP UA Conference Hong Kong 3-7th July 2012

on the

Page

10.

Check your program.


Press the Check button

11.

on the Application toolbar.

Use a function key to save your program, and another function key to execute
it.
Press F11 to save.
Press F8 to execute.

12.

Save the list output to a file on your external storage media by choosing the
menu path: List >> Save/Send >> File. Use unconverted format.

13.

Display your downloaded output using Notepad.

14.

Close Notepad and return to SAP and your ABAP code.


Press the Back button.

15.

Download your program to the file: a:\yxx20a.txt.


Choose menu path: Utilities >> More utilities >> Upload/Download >> Download.
The Transfer to a Local File screen is displayed.
Type a:\ yxx20a.txt in the File Name field.
Press the Save button.

16.

Edit your downloaded program using Notepad. Add a full-line comment after
the report statement with your name in it.
Insert a new line after the report statement: * Created by <Your Name>

17.

Type the following comment at the end of the first select statement:
read all records from table spfli.

18.

Exit Notepad saving your modified program to disk.

19.

Upload the modified program on your disk, replacing program yxx20a.


Return to your ABAP Editor: Change Report yxxxx20a screen.
Choose menu path: Utilities >> More utilities >> Upload/Download >> Upload.
The Import from a Local File screen is displayed.
In the File Name field, type a:\ yxx20a.txt.
Press the Open button.

20.

Save the uploaded program.


Press the Save button.

SAP UA Conference Hong Kong 3-7th July 2012

Page

21.

Print your program (Note: This may not be available in your Lab).
Press the Print button on the Standard toolbar.
The Print Parameters screen is displayed.
Ensure the Print Immed. check box is checked and Output Device is set to your campus computer room.
Press the Continue button.
Your output is sent to the printer, and you are returned to the ABAP Editor: Change Report screen.

22.

Run the program.


Choose menu path: Program >> Test >> Direct processing.
The list output is displayed.

23.

Return to editing program yxx20a and select the last three lines as a block.

24.

Comment out the block using the menu path: Utilities >> Block/buffer >>
Insert comment *

25.

Select the last three lines as a block.

26.

Remove the comments using the menu path: Utilities >> Block/buffer >>
Delete comment *

27.

Save your program and log out of SAP.

SAP UA Conference Hong Kong 3-7th July 2012

Page

Você também pode gostar