Sie sind auf Seite 1von 20

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

The following exercises are designed to help you understand: Background processing Working with files (either on the application server or the presentation server) Batch input process. Before !o" #e in t$e Data Interfaces exercises% !o" m"st create a ne& Pac'a e an( a ne& )$an e Re*"est% so !o"r &or' is store( as it mi $t #e on a client pro+ect . To do this, find the sheet used for your first Package and hange !e"uest #xercise and use this if you need it to help you through the a$$reviated instructions $elow: reate a new Package, $y going to the !epository Browser (transaction %#&'), and typing ,XXD in the Package field (where XX is the last two digits of your logon id). lick on the display push$utton, and create the new Package, calling it so(ething like )*ata +nterfaces Package for ,your na(e-.. -.TE: /$en !o" clic' t$e save #"tton0 (o not "se !o"r previo"s )$an e Re*"est. +nstead, when the hange !e"uest /uery %creen appears, click on the )reate Re*"est push$utton, enter a short description, such as )*ata +nterfaces hange !e"uest for ,your na(e-., and save. Write down the nu($er of your change re"uest here: 0000000000000000000000000000 1se the green arrow to go $ack to your new Package, and ensure that all you progra(s in the *ata +nterfaces section of the course are stored in this Package.

Page 1

March 2005

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

)$apter 1 The purpose of these exercises is for you to create so(e $ackground 2o$s and to evaluate $ackground 2o$ logs. Before proceeding with the exercises for this chapter, change your user defaults (3%yste( - 1ser profile - 4wn data5 (enu path, then the 3*efaults5 index ta$) so that you will not print i((ediately. Exercise 1 +n this exercise, you will create a $ackground 2o$ with one 2o$ step. 1se the )*efine Background 6o$. function (3%yste( - %ervices - 6o$s - *efine 2o$5 (enu path or transaction 3%7895) to create the following $ackground 2o$: Background 6o$: 6o$ %tep <;: :B:Pxx64B; =:P>>'?0; (where )xx. is the last two digits of your logon id)

This $ackground 2o$ should $e scheduled to start i((ediately. :fter the $ackground 2o$ has co(pleted, analy@e the 2o$ log and spool list using the )6o$ 4verview. function (3%yste( - %ervices - 6o$s - 6o$ overview5 (enu path or transaction 3%78A5). +f there is no spool list, you pro$a$ly forgot to turn off the print i((ediately and the list was sent to the printer. *id the $ackground 2o$ execute successfullyB +f not, whyB

Page 2

March 2005

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

Exercise 2 +n this exercise, you will create a $ackground 2o$ with one 2o$ step. 1se the )*efine Background 6o$. function (3%yste( - %ervices - 6o$s - *efine 2o$5 (enu path or transaction 3%7895) to create the following $ackground 2o$: Background 6o$: 6o$ %tep <;: :B:Pxx64BC =:P>>'?0; (where )xx. is the last two digits of your logon id)

This $ackground 2o$ should $e scheduled to start at in ? (inutes. :fter the $ackground 2o$ has co(pleted, analy@e the 2o$ log and spool list. *id the $ackground 2o$ execute successfullyB +f not, whyB

Page 3

March 2005

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

Exercise 3 +n this exercise, you will create a $ackground 2o$ with one 2o$ step. Before creating the $ackground 2o$, cop! pro ram 3,AP4415647 to 38BA)9xx7 (where )xx. is the last two digits of your logon id). Because this progra( has a selection screen, you will need to create a variant for it. #xecute your 3DB: Exx5 progra( and create the variant 3F:!+:GTxx5 (where )xx. is the last two digits of your logon id) with a valid =ear. (=ou can do with your other progra(s also which has selection screen) 1se the )*efine Background 6o$. function (3%yste( - %ervices - 6o$s - *efine 2o$5 (enu path or transaction 3%7895) to create the following $ackground 2o$: Background 6o$: :B:Pxx64B8 6o$ %tep <;: DB: Exx Fariant: F:!+:GTxx (where )xx. is the last two digits of your logon id)

This $ackground 2o$ should $e scheduled to start i((ediately. :fter the $ackground 2o$ has co(pleted, analy@e the 2o$ log and spool list. *id the $ackground 2o$ execute successfullyB +f not, whyB

Page 4

March 2005

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

Exercise 4 +n this exercise, you will create a $ackground 2o$ with two 2o$ steps. 1se the )*efine Background 6o$. function (3%yste( - %ervices - 6o$s - *efine 2o$5 (enu path or transaction 3%7895) to create the following $ackground 2o$: (=ou can take any C of your valid progra(s to do the exercise) Background 6o$: 6o$ %tep <;: 6o$ %tep <C: :B:Pxx64BH =:P>>'?0; =:P>>;'0H (where )xx. is the last two digits of your logon id)

This $ackground 2o$ should $e scheduled to start i((ediately. :fter the $ackground 2o$ has co(pleted, analy@e the 2o$ log and spool list. *id the $ackground 2o$ execute successfullyB +f not, whyB

Page 5

March 2005

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

Exercise : Progra( Ga(e: =*+xx;I? (where )xx. is the last two digits of your logon id)

+n this exercise, you will write an :B:P progra( that creates a $ackground 2o$ with one 2o$ step. 1se the function (odules 364B04P#G5, 364B0%1B7+T5, and 364B0 J4%#5 to create the following $ackground 2o$: Background 6o$: 6o$ %tep <;: :B:Pxx64B? =:P>>'?0; (where )xx. is the last two digits of your logon id)

This $ackground 2o$ should $e scheduled to start i((ediately. :fter the $ackground 2o$ has co(pleted, analy@e the 2o$ log and spool list. *id the $ackground 2o$ execute successfullyB +f not, whyB

:fter finishing the exercises for this chapter, you can 3turn on5 your print i((ediately function again if you want (3%yste( - 1ser profile - 4wn data5 (enu path, then the 3*efaults5 index ta$).

Page 6

March 2005

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

)$apter 2 The purpose of these exercises is for you to learn how to process (i.e. create and read) se"uential files on the application server. Exercise 1 Progra( Ga(e: =*+xxCI; (where )xx. is the last two digits of your logon id) Kile: .L file;xx (the file will $e created under *+!0%:P1%#!%) +n this exercise, you will write an :B:P progra( to create a se"uential file on the application server. This se"uential file should $e structured in lines (or records). The layout for each record of the file is: F#G*G17 J+E# =F#G*4!IF#G*G17 47P:G= J+E# =F#G*4!I 47P:G= : TM!41P J+E# =F#G*4!I: TM!41P G:7# J+E# =F#G*4!IG:7# %4!T J+E# =F#G*4!I%4!T +T= J+E# =F#G*4!I +T= D+P 4*# J+E# =F#G*4!ID+P 4*# 41GT!= J+E# =F#G*4!I 41GT!= !#M+4G J+E# =F#G*4!I!#M+4G J:GM J+E# =F#G*4!IJ:GM The data for this file should $e extracted fro( the =F#G*4! ta$le. #xa(ine the structure of this ta$le. Gotice that one of the key fields is 31G:7#5. =ou should use this key field to extract only those records for your user na(e. +n other words, the 3%#J# T5 state(ent should $e coded as follows: %#J# T N K!47 DF#G*4! WO#!# 1G:7# P %=I1G:7#. The =F#G*4! ta$le is not one of %:P.s (aster vendor ta$les. We created this ta$le for the purpose of your :B:P exercises (notice that it starts with a 3=5). %o(e of %:P.s (aster vendor ta$les include JK:;, JKB;, and JK ;.

Page 7

March 2005

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

Exercise 2 Progra( Ga(e: =*+xxCIC Kile: .L file;xx (where )xx. is the last two digits of your logon id) (the file will $e kept under *+!0%:P1%#!%)

+n this exercise, you will write an :B:P progra( to read data fro( the se"uential file created in the previous exa(ple and to create a list with this infor(ation. =ou can choose the layout of your list. !e(e($er that the learning point for this exercise is to $e a$le to read a se"uential file on the application server, not to $e a$le to create a nice looking report. +n other words, do not spend ti(e for(atting the report. The file created in the previous exa(ple is used in future exercises. When you execute this progra( to read the file, (ake sure that the contents of your file are correct: Recor( ;1 Recor( ;2 <en(or -"m#er = :B:PxxI''; :B:PxxI''C )ompan! )o(e '''; '''; Acco"nt >ro"p '''; '''; -ame Fendor''; Fendor''C Sort Term :B:P :B:P )it! Philadelphia Boston 8ip co(e ;Q;'8 'C;;9 )o"ntr! 1% 1% Re ion P: 7: ?an "a e # # where )xx. is the last two digits of your logon id Recor( ;3 :B:PxxI''8 '''; '''; Fendor''8 :B:P 7ia(i 88;H8 1% KJ # Recor( ;4 :B:PxxI''H '''; '''; Fendor''H :B:P hicago 9'9'; 1% +J # Recor( ;: :B:PxxI''? '''; '''; Fendor''? :B:P Jondon %W; &*J MB J4 #

Page 8

March 2005

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

Exercise 3 Progra( Ga(e: =*+xxCI8 Kile: .LfileCxx (where )xx. is the last two digits of your logon id)

+n this exercise, you will write an :B:P progra( to create a se"uential file on the application server. This se"uential file should $e structured in lines (or records). The layout for each record of the file is: 1%TG17 J+E# EG:;IE1GG! G:7# J+E# EG:;IG:7#; %T!##T J+E# EG:;I%T!:% PO4G# J+E# EG:;IT#JK; K:> J+E# EG:;IT#JK> The data for this file should $e entered as para(eters on the selection screen. =ou can use any defaults for these para(eters. #ach ti(e this progra( is executed, a new record should $e added to the file. +n other words, the file should $e extended, not reIcreated, each ti(e the progra( is executed. #xecute the progra( several ti(es to populate the file with (ultiple records.

Page 9

March 2005

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

Exercise 4 Progra( Ga(e: =*+xxCIH Kile: .LfileCxx (where )xx. is the last two digits of your logon id)

+n this exercise, you will write an :B:P progra( to read data fro( the se"uential file created in the previous exa(ple and to create a list with this infor(ation. =ou can choose the layout of your list. !e(e($er that the learning point for this exercise is to $e a$le to read a se"uential file on the application server, not to $e a$le to create a nice looking report. +n other words, do not spend ti(e for(atting the report.

Page 10

March 2005

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

)$apter 3 The purpose of these exercises is for you to learn how to process (i.e. create and read) files on the presentation server. Exercise 1 Progra( Ga(e: =*+xx8I; Kile: c:Rfile8xx (where )xx. is the last two digits of your logon id)

+n this exercise, you will write an :B:P progra( to create a file on the presentation server. This se"uential file should $e structured in lines (or records). =ou should create this file in the sa(e (anner that you created the file for #xercise ; in hapter C. The only difference in the two files is the location. This one is on the presentation server, not the application server. The layout for each record of the file is: F#G*G17 J+E# =F#G*4!IF#G*G17 47P:G= J+E# =F#G*4!I 47P:G= : TM!41P J+E# =F#G*4!I: TM!41P G:7# J+E# =F#G*4!IG:7# %4!T J+E# =F#G*4!I%4!T +T= J+E# =F#G*4!I +T= D+P 4*# J+E# =F#G*4!ID+P 4*# 41GT!= J+E# =F#G*4!I 41GT!= !#M+4G J+E# =F#G*4!I!#M+4G J:GM J+E# =F#G*4!IJ:GM The data for this file should $e extracted fro( the =F#G*4! ta$le. #xa(ine the structure of this ta$le. Gotice that one of the key fields is 31G:7#5. =ou should use this key field to extract only those records for your user na(e. +n other words, the 3%#J# T5 state(ent should $e coded as follows: %#J# T N K!47 =F#G*4! WO#!# 1G:7# P %=I1G:7#. :fter you execute this progra(, (ake sure the file exists on your hard drive.

Page 11

March 2005

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

Exercise 2 Progra( Ga(e: =*+xx8IC Kile: c:Rfile8xx (where )xx. is the last two digits of your logon id)

+n this exercise, you will write an :B:P progra( to read data fro( the file created in the previous exa(ple and to create a list with this infor(ation. =ou can choose the layout of your list. !e(e($er that the learning point for this exercise is to $e a$le to read a se"uential file on the presentation server, not to $e a$le to create a nice looking report. +n other words, do not spend ti(e for(atting the report.

Page 12

March 2005

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

)$apter 4 The purpose of these exercises is for you to learn how to research a transaction and how to fill the B* ta$le with the appropriate infor(ation. =ou will $uild upon these exercises in chapter ? to actually perfor( $atch input. Exercise 1 !esearch the ) reate Fendor. transaction (Transaction KE';). =ou can access this vendor transaction using the 3:ccounting - Kinancial accounting - :ccounts paya$le - 7aster records reate5 (enu path fro( the initial %:P screen (transaction 3%'''5 will take you to the initial %:P screen). Kill in the B* ta$le on the next page with this transaction.s infor(ation. To research the transaction, you will have to fill in the appropriate fields in order to proceed in the transaction. 1se the following ta$le as your guideline to fill the fields: Enter t$is val"e &$en @iel( Description researc$in t$e transaction Fendor :B:PxxInnn N o(pany code '''; (these are @eroes, not the letter 345) :ccount group '''; Ga(e Fendor %earch ter( G17 ity 7ia(i Postal code 88;H8 ountry 1% !egion KJ Janguage #G = When you enter a vendor nu($er, use the following convention: G17xxInnn (where )xx. is the last two digits of your logon id and )nnn. is a uni"ue nu($er each ti(e you go through the transaction).

:t the end of the transaction, you should save the new vendor record. *o not forget to indicate this action in the B* ta$le on the next page.

Page 13

March 2005

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

) reate Fendor. Transaction PR.>RAA

ode: 0000000000 D,-BE>I@-AA @<A? =

D,-PR.

= 6ust use the values fro( the previous page for KF:J. 1lti(ately, these values will $e co(ing fro( the se"uential file you created in #xercise ; of hapter C.

Page 14

March 2005

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

Exercise 2 Progra( Ga(e: =*+xxHIC (where )xx. is the last two digits of your logon id)

+n this exercise, you will write an :B:P progra( to fill the B* ta$le with the values fro( your answer to the previous exercise. ,o" s$o"l( "se t$e t&oBs"#ro"tine met$o( to fill t$e BD) ta#le. This progra( will only fill the B* ta$le. To (ake sure that you are filling it correctly, you can create a list with the contents of the B* ta$le. =our (ain progra( (i.e. %T:!TI4KI%#J# T+4G event) should look as follows: %T:!TI4KI%#J# T+4G. P#!K4!7 K+JJ0B* 0T:B. N code to write out contents of B*

ta$le

Page 15

March 2005

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

)$apters : B C The purpose of these exercises is for you to learn how to perfor( $atch input $y creating a $atch input session with the contents of the B* ta$le. +n order to test the success of your B* progra(s, you will have to process the $atch input session (see chapter 9). Exercise 1 Progra( Ga(e: =*+xx?I; (where )xx. is the last two digits of your logon id) Batch +nput %ession: %#%%+4G;Ixx +n this exercise, you are going to code a B* progra( (i.e. create a $atch input session) $y $uilding on your last progra(. ,o" s$o"l( cop! !o"r ,DIxx4B2 pro ram to create pro ram ,DIxx:B1. +n this exercise, you will use the infor(ation fro( the file you created in #xercise ; of hapter C ().Lfile;xx.). This file contains new vendor infor(ation. =ou should read in the contents of the file, fill the B* ta$le for each record, and create a $atch input session. *o not forget to change the values $eing entered into the B* ta$le. +n this exercise, these values should $e co(ing fro( the file, not the hardIcoded values fro( the previous exa(ple. :fter executing this B* progra(, you (ust process the $atch input session to (ake sure your progra( is correct. To process the $atch input session, use the 3%yste( - %ervices - Batch input - #dit5 (enu path (or transaction 3%78?5). The $est processing (ode for testing is the 3foreground5Iprocessing processing (ode so you can step through each screen to ensure that the proper values are $eing entered into the appropriate fields. hapter 9 contains infor(ation on processing $atch input sessions. Gote: 4nce you successfully process the $atch input session, you will have inserted five new vendors into the %:P syste(. +f you atte(pt to process another session, you will encounter errors $ecause you will $e trying to insert vendors that already exist. +n this case, you can 2ust change the vendor nu($ers online while you are processing the $atch input session in the 3foreground5 or 3display errors only5 processing (ode. Exercise 2 Progra( Ga(e: =*+xx?IC (where )xx. is the last two digits of your logon id) Kile: .L fileHxx Batch +nput %ession: %#%%+4GCIxx +n this exercise, you will create a $atch input session to change existing vendors. Kor this progra( to work correctly, you (ust have successfully co(pleted the previous exercise. +n other words, you (ust have successfully processed the previous $atch input session to insert five vendors into the syste(. hange the existing vendors na(e, sort and country in the custo( ta$le =F#G*4! and then write a progra( to download those in the application server file ).LfileHxx.. The Kile will $e created in the directory *+!0%:P1%#!%. The layout for each record of the file is:
March 2005

Page 16

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

F#G*G17(;9) T=P# G:7#(8') T=P# %4!T(C') T=P# 41GT!=(8) T=P# !esearch the ) hange Fendor. transaction (3KE'C5) to deter(ine how to fill the B* ta$le. =ou should enter an existing vendor on the first screen and check the address check $ox. 4n the second screen, you should fill in values for the 3Ga(e5, 3%ort5, and 3 ountry5 fields. PR.>RAA D,-PR. D,-BE>I@-AA @<A?

:fter researching the ) hange Fendor. transaction, code the B* progra(. =ou should read in the contents of the file ).LfileHxx., fill the B* ta$le for each record, and create a $atch input session. :fter executing this B* progra(, you (ust process the $atch input session to (ake sure your progra( is correct. To process the $atch input session, use the 3%yste( - %ervices - Batch input - #dit5 (enu path (or transaction 3%78?5). The $est processing (ode for testing is the 3foreground5Iprocessing processing (ode so you can step through each screen to ensure that the proper values are $eing entered into the appropriate fields. hapter 9 contains infor(ation on processing $atch input sessions.

Page 17

March 2005

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

)$apter 7 The purpose of these exercises is for you to learn how to use the other two $atch input (ethods: 3 :JJ T!:G%: T+4G 1%+GM5 and 3 :JJ *+:J4M5. Exercise 1 Progra( Ga(e: =*+xxAI; Kile: .Lfile?xx (where )xx. is the last two digits of your logon id)

+n this exercise, you will perfor( $atch input to change existing vendors. +nstead of creating a $atch input session, you will use the 3 :JJ T!:G%: T+4G 1%+GM5 $atch input (ethod. ,o" s$o"l( cop! !o"r ,DIxx:B2 pro ram to create pro ram ,DIxx7B1. #dit the progra( to use the 3 :JJ T!:G%: T+4G 1%+GM5 (ethod instead of creating a $atch input session. :lso, (ake sure that you are reading in the new file ).Lfile?xx.. hange the existing vendors na(e, sort and country in the custo( ta$le =F#G*4! and then write a progra( to download those in the application server file ).Lfile?xx..The layout for each record of this file is identical to the one in the previous exercise: F#G*G17(;9) T=P# G:7#(8') T=P# %4!T(C') T=P# 41GT!=(8) T=P# :s each record is processed with 3 :JJ T!:G%: T+4G 1%+GM5, this progra( should generate a report indicating the success or failure of the update. To test this $atch input (ethod, use the 3display all5 (ode of the 3 :JJ T!:G%: T+4G 1%+GM5 state(ent so you can step through each screen to ensure that the proper values are $eing entered into the appropriate fields. Bonus: Oow would you create an error file with the unsuccessful recordsB (do not code)

Page 18

March 2005

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

Exercise 2 Oow would the previous progra( change if you were using the 3 :JJ *+:J4M5 (ethod instead of the 3 :JJ T!:G%: T+4G 1%+GM5 $atch input (ethod (assu(e that the dialog (odule is na(ed 3D0*+:J4M0KE'C5)B Do not co(e t$is 3)A?? DIA?.>7 pro ram.

Page 19

March 2005

Data Interfaces: Exercises

SAP R/3 Release 4.7 SAP Development ABAP Trainin

)$apter D The purpose of this exercise if for you to learn how to identify function codes associated with push$uttons on the screen and function codes associated with (enu paths. Exercise 1 Mo to the initial screen of the :B:P #ditor (transaction 3%#8&5). (;) What is the function code associated with the )*isplay. push$utton on the screenB (C) What is the function code associated with the 31tilities - %plit screen editor5 (enu pathB

Page 20

March 2005

Das könnte Ihnen auch gefallen