Beruflich Dokumente
Kultur Dokumente
Prepared by J Kreie
New Mexico State University
ABAP Workbench: More Basics
This lesson assumes you have already created your first program in ABAP. In this lesson you will modify the first
program you created and learn more about ABAP syntax, program structure, and commands. You will also
make your program bilingualshowing text in English or Spanish.
Modify a program
Go to the Object Navigator and open your program in ABAP Editor. In the left navigation pane, you should
see your package and below that, under the Object Name header, you should be able to expand Programs
and see your first program. Double-click on that program and its code appears on the pane on the right. When
you open the program it is not in edit mode. Click the Display <-> Change icon
Page 1 of 9
Copying a program
In the left pane of the Object Navigator, use the context menu
(right-click) for your existing program to select Copy. In the dialog
box change the target program to second_program.
In the next dialog box, click Copy without changing any options.
Page 2 of 9
).
Page 3 of 9
Use the Back button to return to the Text Element screen then back to your program.
Modify your program so that it uses the text
symbols you created. Notice the text-001
and text-002 changes in the WRITE
statement. These are not in quotes in the
program.
Save, check, activate and test your
program. The output is still in English, isnt
it?
To see the effect of text symbols and translations log off of SAP. When you
back in, enter ES as the language.
log
You may not know Spanish but youre familiar enough with SAP to navigate to the Object Navigator in ABAP
Workbench. Open your program and test it. The input screen has a
Spanish title with the variable names the same as before but the output
screen displays the Spanish translation of your program.
Log off and log back in using English. You can enter EN or leave it blank if
thats the default language for your SAP installation.
To test the selecton text, run the program. Youll see the selection text instead of the parameter names.
This is all you would need to do for the English version of your program but you need to create a version in
Spanish.
Create a translation using Goto Translation. Enter ES as the
target language. Enter the Spanish text and save.
Return to the Text Element screen. Save and activate your text
elements. Run your program.
To test your program youll need to log in with Spanish (ES) as
your language.
Though youll do some more translations in the upcoming lessons, in the future you probably wont code the
translation of your programs when you work on a development team. That can be done by a professional
translator after you have completed your work on the project. However, you can see that it is important to
understand text elements so the programs you create in SAP can be made multilingual.
Create a transaction code
The final step in this lesson is to create a transaction code for your
second program. Open the Object Navigator. Open the context menu
(right-click) for your second program. Select Create Transaction.
Page 5 of 9
Save and assign the transaction to your package and transport request.
Page 6 of 9
Exit Object Navigator. Enter your transaction code in the command field of the SAP Easy Access menu.
to
Practice
Practice what you learned in the first
two lessons by completing the
following tasks. Its very important that you continue to use the naming convention for the prefix of anything you
create.
Z_$_<the name you decide to use>
Create a new package and a new transport request. Use these. Do NOT put anything you create in this
practice exercise in the package you are using for the lessons.
Create a program that uses an input screen to gets two integers from the user.
Calculate the sum and product of these two numbers.
Create an output screen that displays the results.
Both the input and output screen should display standard English, not variable names.
Both input and output should be viewable in Spanish, as well.
Page 7 of 9
Terms to Know
chained statement.................................................................................................................................................. 1
data section............................................................................................................................................................ 1
parameter section................................................................................................................................................... 1
selection text........................................................................................................................................................... 3
text elements.......................................................................................................................................................... 2
text symbol............................................................................................................................................................. 2
Page 8 of 9
References
ABAP Basics, Gunther Farber and Julia Kirchner, SAP PRESS/Galileo Press, 2007.
ABAP Objects: An Introduction to Programming SAP Applications, Horst Keller and Sascha Kruger, SAP
PRESS/Pearson Education Limited, 2002.
ABAP predefined dataypes (hyperlink to SAP Help)
Babelfish.yahoo.com (for language translations)