BC400 Lesson: DeveIoping Programs and Organizing DeveIopments
Exercise 1: Organizing DeveIopments
Exercise Objectives AIter completing this exercise, you will be able to: Create packages Assign changes in Repository objects to a change request Business ExampIe You are a developer Ior an airline group and you are given the task oI developing evaluation programs Ior several airline companies. To group the repository objects together logically and also transport them, you must create a package. Task 1: Logon to the training system 1. Log on to the operating system and then to the speciIied training system using the user name the instructor has given you. 2. Enter a new personal password. Task 2: Create Package 1. Create the package ZBC400_##. Assign it to the change request the instructor has given you. 2. Assign all your repository objects in the Iollowing exercises to this package and this change request. Hint: It is best iI you always work with the 2EMHFW 1DYLJDWRU tool. It provides you with an overview oI all Repository objects in your package. From here, you can edit each object directly by selecting it Irom this list. 2006/Q2 2006 SAP AG. All rights reserved. 45
Unit 2: Introduction to the ABAP Workbench BC400 SoIution 1: Organizing DeveIopments Task 1: Logon to the training system 1. Log on to the operating system and then to the speciIied training system using the user name the instructor has given you. a) Carry out this step as usual. 2. Enter a new personal password. a) Carry out this step as usual. Task 2: Create Package 1. Create the package ZBC400_##. Assign it to the change request the instructor has given you. a) Carry out this step as described in the training material. 2. Assign all your repository objects in the Iollowing exercises to this package and this change request. Hint: It is best iI you always work with the 2EMHFW 1DYLJDWRU tool. It provides you with an overview oI all Repository objects in your package. From here, you can edit each object directly by selecting it Irom this list. a) Carry out this step as described in the training material. 46 2006 SAP AG. All rights reserved. 2006/Q2
BC400 Lesson: DeveIoping Programs and Organizing DeveIopments Exercise 2: DeveIoping ABAP Programs Exercise Objectives AIter completing this exercise, you will be able to: Create, edit, save, and process ABAP programs Check ABAP programs Ior correct syntax Test and activate ABAP programs Business ExampIe You need to create an ABAP program that displays inIormation on all existing Ilight departure times in a list. The data is to be read Irom the database table SFLIGHT. Task 1: Create program 1. Create the executable program ZBC400_##_GS_LIST without a 'TOP include. Task 2: Edit program 1. DeIine a work area Ior the data retrieval and data display (name suggestion: waIlight): DATA wa_flight TYPE sflight. 2. Program a loop access to all data records in database table SFLIGHT: SELECT * FROM sflight INTO wa_flight. ... ENDSELECT. 3. For each data record, display the contents oI the Iields carrid, connid, Ildate, seatsocc, and seatsmax in the list: NEW-LINE. WRITE wa_flight-carrid. WRITE ... 4. Check your program Ior syntax errors. Test and activate it. 2006/Q2 2006 SAP AG. All rights reserved. 47
Unit 2: Introduction to the ABAP Workbench BC400 SoIution 2: DeveIoping ABAP Programs Task 1: Create program 1. Create the executable program ZBC400_##_GS_LIST without a 'TOP include. a) Carry out this step as described in the training material. Task 2: Edit program 1. DeIine a work area Ior the data retrieval and data display (name suggestion: waIlight): DATA wa_flight TYPE sflight. a) See source code excerpt in the model solution. 2. Program a loop access to all data records in database table SFLIGHT: SELECT * FROM sflight INTO wa_flight. ... ENDSELECT. a) See source code excerpt in the model solution. 3. For each data record, display the contents oI the Iields carrid, connid, Ildate, seatsocc, and seatsmax in the list: NEW-LINE. WRITE wa_flight-carrid. WRITE ... a) See source code excerpt in the model solution. &RQWLQXHG RQ QH[W SDJH 48 2006 SAP AG. All rights reserved. 2006/Q2
BC400 Lesson: DeveIoping Programs and Organizing DeveIopments 4. Check your program Ior syntax errors. Test and activate it. a) Carry out this step as described in the training material. ResuIt Source code excerpt: SAPBC400WBS_GS_LIST REPORT sapbc400wbs_gs_list. DATA wa_flight TYPE sflight. SELECT * FROM sflight INTO wa_flight. NEW-LINE. WRITE: wa_flight-carrid, wa_flight-connid, wa_flight-fldate, wa_flight-seatsocc, wa_flight-seatsmax. ENDSELECT. 2006/Q2 2006 SAP AG. All rights reserved. 49
Unit 2: Introduction to the ABAP Workbench BC400 50 2006 SAP AG. All rights reserved. 2006/Q2
BC400 Lesson: DeveIoping Programs and Organizing DeveIopments Exercise 3: Creating Transactions Exercise Objectives AIter completing this exercise, you will be able to: Create transactions DeIine transaction codes as personal Iavorites Business ExampIe The users oI your company are to be able to start their ABAP programs as transactions or deIine them as personal Iavorites. Task 1: Create transaction 1. Create transaction code ZBC400_##_GS Ior the executable program ZBC400_##_GS_LIST. Hint: In the transaction deIinition, select 3URJUDP DQG 6HOHFWLRQ 6FUHHQ 5HSRUW 7UDQVDFWLRQ as the start object. 2. Execute your program by entering the new transaction code in the command Iield. Task 2: DeIine Iavorites 1. Add transaction code ZBC400_##_GS to your personal Iavorites. 2. Execute your program by double-clicking the new Iavorite entry. 2006/Q2 2006 SAP AG. All rights reserved. 51
Unit 2: Introduction to the ABAP Workbench BC400 SoIution 3: Creating Transactions Task 1: Create transaction 1. Create transaction code ZBC400_##_GS Ior the executable program ZBC400_##_GS_LIST. Hint: In the transaction deIinition, select 3URJUDP DQG 6HOHFWLRQ 6FUHHQ 5HSRUW 7UDQVDFWLRQ as the start object. a) Carry out this step as described in the training material. 2. Execute your program by entering the new transaction code in the command Iield. a) Carry out this step as usual. Task 2: DeIine Iavorites 1. Add transaction code ZBC400_##_GS to your personal Iavorites. a) Carry out this step as described in the training material. 2. Execute your program by double-clicking the new Iavorite entry. a) Carry out this step as usual. 52 2006 SAP AG. All rights reserved. 2006/Q2