Abap 005 ABAP Workbench Creating Program

7
8/19/2019 Abap 005 ABAP Workbench Creating Program http://slidepdf.com/reader/full/abap-005-abap-workbench-creating-program 1/7 ABAP Workbench: Creating a program Prepared by Jennifer Kreie New Mexico State University ABAP Workbench: Creating a program This lesson gives an introduction to the ABAP Workbench by creating a simple program and changing some ABAP Editor features. Assumptions and ground rules Before e begin orking through the ABAP lessons! e need to cover some assumptions and ground rules. Already familiar with SAP navigation . This ABAP lesson starts ith the assumption that you are familiar ith navigation in "AP. #ou should complete the "AP $avigation e%ercise no! if you haven&t done so. The ABAP lessons ill give the menu path to a feature and'or the transaction code. #ou should be familiar ith using these already. Naming conventions . Before you begin creating anything you need to kno something about naming conventions in "AP! i.e. the namespace. (evelopers must put a Z or at the beginning of any name hen they create a table! a program! a function! etc.. This naming convention identifies your programs and all their components as ones built beyond the core "AP applications. All developers! not )ust students! follo this convention. By the ay! if you ever ant to use something else as the prefi%! you can register the prefi% ith "AP. *egistering the prefi% prevents other developers from using it. This ay hatever you develop could be transported into any "AP installation ithout having to orry about name conflicts. Naming convention for this co!rse . With only a fe e%ceptions! the names of things you create ill follo the format shon here. The dollar signs +,- ill be replaced by a /letter code assigned by the instructor. This ill often be your first initial and the last three letters of your last name but verify ith the instructor. Z"####" "o! if you ere assigned JK*A as your /letter code! you ould name your program 01)kra1my1program. 2olloing this naming convention not only makes it easier to locate your ob)ects! it also avoids naming conflicts ith e%isting "AP programs and ith other developers orking on their on pro)ects. *emember! Workbench is a multi/user development environment. The programs you create reside in the same repository as those made by other students in this course and! possibly! by other students at other universities. $ser%specific inp!t . Whenever you see te%t beteen to angle brackets 34! you should type in the te%t that applies to you. 2or e%ample! 3lastname4 means you should type your last name! not the te%t 5lastname6. 7f you sa this template for naming a program8 Z"####"&lastname' and your name is Jack Kramer! you ould name the program8 91)kra1kramer. (on)t *!st look at screen shots+ Please note that screen shots e%amples may not reflect the current naming conventions in these lessons. #ou should follo the naming conventions e%plained in the lessons or given to you by your instructor. (on&t mimic screen shots. 7n most cases they are meant as general e%amples. "creen shots have been made at different points in time and are not often retaken hen minor changes in these lessons are made. ,esson -: .n this lesson yo!)ll create a simple program !sing ABAP Workbench while yo! learn some of the Workbench feat!res+ Page : of ;

Transcript of Abap 005 ABAP Workbench Creating Program

Page 1: Abap 005 ABAP Workbench Creating Program

8/19/2019 Abap 005 ABAP Workbench Creating Program

http://slidepdf.com/reader/full/abap-005-abap-workbench-creating-program 1/7

ABAP Workbench: Creating a programPrepared by Jennifer Kreie

New Mexico State University

ABAP Workbench: Creating a program

This lesson gives an introduction to the ABAP Workbench by creating a simple program and changing some ABAP Editor features.

Assumptions and ground rules

Before e begin orking through the ABAP lessons! e need to cover some assumptions and ground rules.

• Already familiar with SAP navigation . This ABAP lesson starts ith the assumption that you are familiarith navigation in "AP. #ou should complete the "AP $avigation e%ercise no ! if you haven&t done so. The

ABAP lessons ill give the menu path to a feature and'or the transaction code. #ou should be familiar ithusing these already.

• Naming conventions . Before you begin creating anything you need to kno something about namingconventions in "AP! i.e. the namespace. (evelopers must put a Z or at the beginning of any name henthey create a table! a program! a function! etc.. This naming convention identifies your programs and alltheir components as ones built beyond the core "AP applications. All developers! not )ust students! follothis convention. By the ay! if you ever ant to use something else as the prefi%! you can register the prefi%

ith "AP. *egistering the prefi% prevents other developers from using it. This ay hatever you developcould be transported into any "AP installation ithout having to orry about name conflicts.

• Naming convention for this co!rse . With only a fe e%ceptions! the names of things you create ill follothe format sho n here. The dollar signs +,- ill be replaced by a /letter code assigned by the instructor.This ill often be your first initial and the last three letters of your last name but verify ith the instructor.

Z"####"

"o! if you ere assigned JK*A as your /letter code! you ould name your program 01)kra1my1program.

2ollo ing this naming convention not only makes it easier to locate your ob)ects! it also avoids namingconflicts ith e%isting "AP programs and ith other developers orking on their o n pro)ects. *emember!

Workbench is a multi/user development environment. The programs you create reside in the samerepository as those made by other students in this course and! possibly! by other students at otheruniversities.

• $ser%specific inp!t . Whenever you see te%t bet een to angle brackets 34! you should type in the te%t thatapplies to you. 2or e%ample! 3lastname4 means you should type your last name! not the te%t 5lastname6.

7f you sa this template for naming a program8

Z"####"&lastname'

and your name is Jack Kramer! you ould name the program8 91)kra1kramer.

(on)t *!st look at screen shots+ Please note that screen shots e%amples may not reflect the currentnaming conventions in these lessons. #ou should follo the naming conventions e%plained in the lessons or given to you by your instructor. (on&t mimic screen shots. 7n most cases they are meant as generale%amples. "creen shots have been made at different points in time and are not often retaken hen minorchanges in these lessons are made.

,esson -: .n this lesson yo!)ll create a simple program !sing ABAP Workbench while yo! learn some of the Workbench feat!res+

Page : of ;

Page 2: Abap 005 ABAP Workbench Creating Program

8/19/2019 Abap 005 ABAP Workbench Creating Program

http://slidepdf.com/reader/full/abap-005-abap-workbench-creating-program 2/7

ABAP Workbench is a development environment that provides a frame ork for large/scale development ithmany developers orking on a pro)ect. Whatever programs you create in the Workbench must adhere to certainconventions in order for them to run in the production environment and ABAP Workbench does a great deal toensure this adherence to rules and conventions.

The se<uence of development has at least three steps before programs are put into use.

:. Write the programs in the development environment .=. Transport this set of programs into a testing environment .>. Transport the tested set of programs into the prod!ction environment here the programs you

developed ill be used in the orkplace.

Before you get started ith your first program you ill have to lay some ground ork for organi9ing the programsyou create. ?et&s say e ere going to start a development pro)ect. As a pro)ect manager! 7 could create atransport re<uest and give you and other developers access to it. #ou create a package +formerly called adevelopment class in ABAP Workbench- that ill contain the many components that make up your ork on thispro)ect. When your pro)ect is complete and ready for testing the transport re<uest is released by the pro)ectmanager hich allo s the package you created and perhaps others from other developers to be transported toanother "AP environment! in this case the testing environment.

2or the purposes of this lesson! you ill create a transport re<uest! even though this ould likely be done bysomeone else in your development team at ork.

@reate a re<uest.

pen ABAP Workbench. This can be found in the "AP menustructure under /ools0ABAP Workbench01verview01b*ectNavigator +"E C-. 7n the list of categories in the upper left of thescreen! 2epository Browser is automatically highlighted. @hangethis.

"elect /ransport 1rgani3er . "elect the te%t that says 5Dodifiable

*e<uests 6 ith a right/click and use this conte%t menu to selectCreate .

7n the dialog bo% that appears! leave the *e<uesttype as is and type in a short description8 3,,,,4

ABAP Practice. @lick the checkmark and you have are<uest.

The re<uest is identified by an "AP/generated number. #ou can copy this or rite it do n but "AP ill usuallykeep track of this re<uest and sho this re<uest 7( for things youcreate later on. Also! if you need to find your re<uest! you caneasily use "AP&s search to locate your re<uest.

@reate a package +formerly a 5development class6-

7n the b)ect $avigator! highlight 2epository Browser then typethe name of your ne package8 Z"####"ABAP"practice and hitenter.

Page 3: Abap 005 ABAP Workbench Creating Program

8/19/2019 Abap 005 ABAP Workbench Creating Program

http://slidepdf.com/reader/full/abap-005-abap-workbench-creating-program 3/7

ABAP Workbench: Creating a programPrepared by Jennifer Kreie

New Mexico State University

When prompted hether to create this package! click #es.

Enter te%t in the "hort (escription field. ?eave the default values for the "oft are @omponent and Transport?ayer then click the 5sheet6 in the lo er right corner to create the package.

#ou are asked for the transport re<uest toattach this package to. 7f your ne ly createdtransport re<uest 7( doesn&t appear automatically! click inside the 2e4!est bo%and hit 2 to get a list of your transportre<uests +there should only be one at thispoint-. (ouble/click the re<uest. With there<uest 7( sho ing no ! click the checkmark.

@reate a program

$o you have a package that ill hold all the things you build and this package is assigned to a transportre<uest. As you create programs and other things throughout the lessons ABAP Workbench ill prompt you forthe package and transport re<uest assignments for the things you create. Without further instruction! you shouldkno to use the ones you created here.

Fnder the 1b*ect Name section the package name should belisted. *ight click this to get the conte%t menu. "elect Create Program . $ame this program8 01,,,,1:st1program anduncheck With /1P 7$@? 7f you forget to uncheck this! you&ll geta line of ABAP code in your program that isn&t relevant.

The ne%t dialog bo% asks for an access key. The first time you create a program! you are re<uired to enter anAccess 5ey+ #ou on&t have to enter this key again but enter it no . +Get this key from your instructor.-

Page > of ;

Page 4: Abap 005 ABAP Workbench Creating Program

8/19/2019 Abap 005 ABAP Workbench Creating Program

http://slidepdf.com/reader/full/abap-005-abap-workbench-creating-program 4/7

7n the ne%t dialog bo%! you enter the title of your program. 7t doesn&thave to match the e%ample sho n.Enter hat you like but keep inmind that this title ill be the firstline sho n hen your programgenerates output. Fpdate status toTest Program and click 5"ave.6

Assign the program to your package and transport re<uest inthe follo ing dialog bo%es.

7n the ABAP Editor on the right side of the computer screen! you see the start of your program +see e%amplebelo -. A comment header section has been created and the e%ecutable statement 5*EP *T 6 has beenadded. Everything you code ill go belo the *EP *T statement.

#our program screen may not look like the e%ample sho n. Thee%ample screen has the ABAP Editor set to display ne editor features +line numbering! e%pandable'collapsible codesegments! etc.-. To turn these features on! select the $tilitiesmenu and Settings . "elect 6ront%7nd 7ditor 8new9 and click the checkmark in the lo er right corner.

Page 5: Abap 005 ABAP Workbench Creating Program

8/19/2019 Abap 005 ABAP Workbench Creating Program

http://slidepdf.com/reader/full/abap-005-abap-workbench-creating-program 5/7

ABAP Workbench: Creating a programPrepared by Jennifer Kreie

New Mexico State University

Enter a fe simple W*7TE statements. The first line rites some te%t. The second W*7TE statement adds areturn +ne line- by using the for ard slash follo ed by some te%t. The third line rites your user 7( hich isheld in a system variablecalled sy/uname.

$otice that each statementends ith a period. Thee%ample here also sho s in/line comments.

"ave! check! activate

There are three things you ill do repeatedly hile riting a program8 save! check! and activate. Fse the

diskette icon to save the program . @lick the check icon to have Workbench check your program for

synta% errors. 7f there are any! correct them. @lick this icon to activate your program.

"ince you&re in a multi/user development environment the activation process is important. While you areorking on somethingHrevising or building a ne program! function! etc.Hit is 5inactive6 and no one else sees

see it. When you activate hat you have built! other people using ABAP Workbench can see it.

The test icon ill e%ecute your program. Try it. #our output should besimilar to hat you see here.

*eturn to ABAP Editor by clicking the Back button.

Pretty Printer

7n the ABAP Editor on the same ro as the check and activateicons! there is a 5Pretty Printer6 button. We ill use this toformat the code! putting ABAP commands in capital letters andindenting here it is appropriate. 2irst! e have to check thesettings for Pretty Printer. Fse the menu path8 $tilities Settings . @lick the Pretty Printer tab and change the settings tothe ones sho n here. @heck Indent ! convert uppercase/lowercase ! and Uppercase .

@lick the checkmark to save settings.

Test Pretty Printer by clicking the button."ee the change in the code formattingI

ABAP commands are sho n are capitali9edeven if you had typed them in lo ercase.

Page of ;

Page 6: Abap 005 ABAP Workbench Creating Program

8/19/2019 Abap 005 ABAP Workbench Creating Program

http://slidepdf.com/reader/full/abap-005-abap-workbench-creating-program 6/7

/erms to 5now

access key.............................................................................................................................................................. >activate...................................................................................................................................................................development class.................................................................................................................................................. =development environment.............................................................................................................................. .... :! =namespace............................................................................................................................................................. :package.................................................................................................................................................................. =Pretty Printer...........................................................................................................................................................production environment...................................................................................................................................... :! =testing environment................................................................................................................................................ =transport re<uest............................................................................................................................................... ..... =

Page 7: Abap 005 ABAP Workbench Creating Program

8/19/2019 Abap 005 ABAP Workbench Creating Program

http://slidepdf.com/reader/full/abap-005-abap-workbench-creating-program 7/7