7.10_ data interfaces exercises.doc

Upload: jyotsana-sharma

Post on 04-Jun-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    1/20

    SAP R/3 Release 4.7Data Interfaces: Exercises 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" #ein t$e Data Interfaces exercises% !o" m"st create a ne& Pac'ae an( ane& )$ane 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 thisif 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 ,XXDin the Package field (where XX is the last two digits of your logon id). lick on the displaypush$utton, and create the new Package, calling it soething like *ata +nterfaces Package for

    your nae-.

    -TE: $en !o" clic' t$e save #"tton0 (o not "se !o"r previo"s )$ane Re*"est.+nstead, when the hange !e"uest /uery %creen appears, click on the )reate Re*"estpush$utton, enter a short description, such as *ata +nterfaces hange !e"uest for yournae-, 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 progras in the*ata +nterfaces section of the course are stored in this Package.

    March 2005

    Page 1

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    2/20

    SAP R/3 Release 4.7Data Interfaces: Exercises SAP Development ABAP Trainin

    )$apter 1

    The purpose of these exercises is for you to create soe $ackground 2o$s and to evaluate$ackground 2o$ logs.

    Before proceeding with the exercises for this chapter, change your user defaults (3%yste - 1serprofile - 4wn data5 enu path, then the 3*efaults5 index ta$) so that you will not printiediately.

    Exercise 1

    +n this exercise, you will create a $ackground 2o$ with one 2o$ step. 1se the *efine Background6o$ function (3%yste - %ervices - 6o$s - *efine 2o$5 enu path or transaction 3%7895) to

    create the following $ackground 2o$:

    Background 6o$: BPxx64B; (where xx is the last two digits of your logon id)6o$ %tep >'?0;

    This $ackground 2o$ should $e scheduled to start iediately.

    fter the $ackground 2o$ has copleted, analy@e the 2o$ log and spool list using the 6o$4verview function (3%yste - %ervices - 6o$s - 6o$ overview5 enu path or transaction3%78A5). +f there is no spool list, you pro$a$ly forgot to turn off the print iediately and the listwas sent to the printer.

    *id the $ackground 2o$ execute successfully +f not, why

    March 2005

    Page 2

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    3/20

    SAP R/3 Release 4.7Data Interfaces: Exercises SAP Development ABAP Trainin

    Exercise 2

    +n this exercise, you will create a $ackground 2o$ with one 2o$ step. 1se the *efine Background6o$ function (3%yste - %ervices - 6o$s - *efine 2o$5 enu path or transaction 3%7895) tocreate the following $ackground 2o$:

    Background 6o$: BPxx64BC (where xx is the last two digits of your logon id)6o$ %tep >'?0;

    This $ackground 2o$ should $e scheduled to start at in ? inutes.

    fter the $ackground 2o$ has copleted, analy@e the 2o$ log and spool list.

    *id the $ackground 2o$ execute successfully +f not, why

    March 2005

    Page 3

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    4/20

    SAP R/3 Release 4.7Data Interfaces: Exercises 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! proram ,AP1564to 8BA)9xx(where xx is the last two digitsof your logon id). Because this progra has a selection screen, you will need to create a variantfor it. #xecute your 3DBExx5 progra and create the variant 3F!+GTxx5 (where xx is thelast two digits of your logon id) with a valid =ear. (=ou can do with your other progras alsowhich has selection screen)

    1se the *efine Background 6o$ function (3%yste - %ervices - 6o$s - *efine 2o$5 enu pathor transaction 3%7895) to create the following $ackground 2o$:

    Background 6o$: BPxx64B8 (where xx is the last two digits of your logon id)

    6o$ %tep

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    5/20

    SAP R/3 Release 4.7Data Interfaces: Exercises SAP Development ABAP Trainin

    Exercise 4

    +n this exercise, you will create a $ackground 2o$ with two 2o$ steps. 1se the *efine Background6o$ function (3%yste - %ervices - 6o$s - *efine 2o$5 enu path or transaction 3%7895) tocreate the following $ackground 2o$: (=ou can take any C of your valid progras to do theexercise)

    Background 6o$: BPxx64BH (where xx is the last two digits of your logon id)6o$ %tep >'?0;6o$ %tep >;'0H

    This $ackground 2o$ should $e scheduled to start iediately.

    fter the $ackground 2o$ has copleted, analy@e the 2o$ log and spool list.

    *id the $ackground 2o$ execute successfully +f not, why

    March 2005

    Page 5

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    6/20

    SAP R/3 Release 4.7Data Interfaces: Exercises SAP Development ABAP Trainin

    Exercise

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

    +n this exercise, you will write an BP progra that creates a $ackground 2o$ with one 2o$ step.1se the function odules 364B04P#G5, 364B0%1B7+T5, and 364B0J4%#5 to create thefollowing $ackground 2o$:

    Background 6o$: BPxx64B? (where xx is the last two digits of your logon id)6o$ %tep >'?0;

    This $ackground 2o$ should $e scheduled to start iediately.

    fter the $ackground 2o$ has copleted, analy@e the 2o$ log and spool list.

    *id the $ackground 2o$ execute successfully +f not, why

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

    March 2005

    Page 6

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    7/20

    SAP R/3 Release 4.7Data Interfaces: Exercises 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 applicationserver.

    Exercise 1

    Progra Gae:=*+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 BP progra to create a se"uential file on the applicationserver. 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*G1747PG= J+E# =F#G*4!I47PG=

    TM!41P J+E# =F#G*4!ITM!41PG7# J+E# =F#G*4!IG7#%4!T J+E# =F#G*4!I%4!T+T= J+E# =F#G*4!I+T=D+P4*# J+E# =F#G*4!ID+P4*#41GT!= J+E# =F#G*4!I41GT!=!#M+4G J+E# =F#G*4!I!#M+4GJGM J+E# =F#G*4!IJGM

    The data for this file should $e extracted fro the =F#G*4! ta$le. #xaine the structure ofthis ta$le. Gotice that one of the key fields is 31G7#5. =ou should use this key field to extract

    only those records for your user nae. +n other words, the 3%#J#T5 stateent should $ecoded as follows:

    %#J#T N K!47 DF#G*4! WO#!# 1G7# %=I1G7#.

    The =F#G*4! ta$le is notone of %Ps aster vendor ta$les. We created this ta$le for thepurpose of your BP exercises (notice that it starts with a 3=5). %oe of %Ps aster vendorta$les include JK;, JKB;, and JK;.

    March 2005

    Page 7

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    8/20

    SAP R/3 Release 4.7Data Interfaces: Exercises SAP Development ABAP Trainin

    Exercise 2

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

    +n this exercise, you will write an BP progra to read data fro the se"uential file created inthe previous exaple and to create a list with this inforation. =ou can choose the layout ofyour list.

    !ee$er that the learning point for this exercise is to $e a$le to read a se"uential file on theapplication server, notto $e a$le to create a nice looking report. +n other words, do not spendtie foratting the report.

    The file created in the previous exaple is used in future exercises. When you execute thisprogra to read the file, ake sure that the contents of your file are correct:

    Recor( ;1 Recor( ;2 Recor( ;3 Recor( ;4 Recor( ;

    ro"p '''; '''; '''; '''; ''';

    -ame Fendor''; Fendor''C Fendor''8 Fendor''H Fendor''?

    Sort Term BP BP BP BP BP

    )it! Philadelphia Boston 7iai hicago Jondon

    8ip co(e ;Q;'8 'C;;9 88;H8 9'9'; %W; &*J

    )o"ntr! 1% 1% 1% 1% MB

    Reion P 7 KJ +J J4

    ?an"ae # # # # #

    where xx is the last two digits of your logon id

    March 2005

    Page 8

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    9/20

    SAP R/3 Release 4.7Data Interfaces: Exercises SAP Development ABAP Trainin

    Exercise 3

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

    +n this exercise, you will write an BP progra to create a se"uential file on the applicationserver. 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!G7# J+E# EG;IG7#;%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 paraeters on the selection screen. =ou can use anydefaults for these paraeters.

    #ach tie this progra is executed, a new record should $e added to the file. +n other words,the file should $e extended, not reIcreated, each tie the progra is executed.

    #xecute the progra several ties to populate the file with ultiple records.

    March 2005

    Page 9

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    10/20

    SAP R/3 Release 4.7Data Interfaces: Exercises SAP Development ABAP Trainin

    Exercise 4

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

    +n this exercise, you will write an BP progra to read data fro the se"uential file created inthe previous exaple and to create a list with this inforation. =ou can choose the layout ofyour list.

    !ee$er that the learning point for this exercise is to $e a$le to read a se"uential file on theapplication server, notto $e a$le to create a nice looking report. +n other words, do not spendtie foratting the report.

    March 2005

    Page 10

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    11/20

    SAP R/3 Release 4.7Data Interfaces: Exercises 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 onthe presentationserver.

    Exercise 1

    Progra Gae:=*+xx8I; (where xx is the last two digits of your logon id)Kile: c:Rfile8xx

    +n this exercise, you will write an BP progra to create a file on the presentation server. Thisse"uential file should $e structured in lines (or records). =ou should create this file in the saeanner 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*G1747PG= J+E# =F#G*4!I47PG=

    TM!41P J+E# =F#G*4!ITM!41PG7# J+E# =F#G*4!IG7#%4!T J+E# =F#G*4!I%4!T+T= J+E# =F#G*4!I+T=D+P4*# J+E# =F#G*4!ID+P4*#41GT!= J+E# =F#G*4!I41GT!=!#M+4G J+E# =F#G*4!I!#M+4GJGM J+E# =F#G*4!IJGM

    The data for this file should $e extracted fro the =F#G*4! ta$le. #xaine the structure ofthis ta$le. Gotice that one of the key fields is 31G7#5. =ou should use this key field to extractonly those records for your user nae. +n other words, the 3%#J#T5 stateent should $ecoded as follows:

    %#J#T N K!47 =F#G*4! WO#!# 1G7# %=I1G7#.

    fter you execute this progra, ake sure the file exists on your hard drive.

    March 2005

    Page 11

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    12/20

    SAP R/3 Release 4.7Data Interfaces: Exercises SAP Development ABAP Trainin

    Exercise 2

    Progra Gae:=*+xx8IC (where xx is the last two digits of your logon id)Kile: c:Rfile8xx

    +n this exercise, you will write an BP progra to read data fro the file created in theprevious exaple and to create a list with this inforation. =ou can choose the layout of yourlist.

    !ee$er that the learning point for this exercise is to $e a$le to read a se"uential file on thepresentation server, notto $e a$le to create a nice looking report. +n other words, do not spendtie foratting the report.

    March 2005

    Page 12

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    13/20

    SAP R/3 Release 4.7Data Interfaces: Exercises SAP Development ABAP Trainin

    )$apter 4

    The purpose of these exercises is for you to learn how to research a transaction and how to fillthe B* ta$le with the appropriate inforation. =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 vendortransaction using the 3ccounting - Kinancial accounting - ccounts paya$le - 7aster records -reate5 enu path fro the initial %P screen (transaction 3%'''5 will take you to the initial %Pscreen). Kill in the B* ta$le on the next page with this transactions inforation.

    To research the transaction, you will have to fill in the appropriate fields in order to proceed inthe transaction. 1se the following ta$le as your guideline to fill the fields:

    @iel( DescriptionEnter t$is val"e &$enresearc$in t$e transaction

    Fendor BPxxInnn N

    opany code '''; (these are @eroes, not the letter 345)

    ccount group ''';

    Gae Fendor

    %earch ter G17

    ity 7iai

    Postal code 88;H8

    ountry 1%

    !egion KJJanguage #G

    =When you enter a vendor nu$er, use the following convention: G17xxInnn (where xx is thelast two digits of your logon id and nnn is a uni"ue nu$er each tie you go through thetransaction).

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

    March 2005

    Page 13

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    14/20

    SAP R/3 Release 4.7Data Interfaces: Exercises SAP Development ABAP Trainin

    reate Fendor Transaction ode: 0000000000

    PR>RA D,-PR D,-BE>I- @-A @

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    15/20

    SAP R/3 Release 4.7Data Interfaces: Exercises SAP Development ABAP Trainin

    Exercise 2

    Progra Gae:=*+xxHIC (where xx is the last two digits of your logon id)

    +n this exercise, you will write an BP progra to fill the B* ta$le with the values fro youranswer to the previous exercise. ,o" s$o"l( "se t$e t&os"#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 cancreate 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*0TB.N code to write out contents of B* ta$le

    March 2005

    Page 15

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    16/20

    SAP R/3 Release 4.7Data Interfaces: Exercises SAP Development ABAP Trainin

    )$apters C

    The purpose of these exercises is for you to learn how to perfor $atch input $y creating a $atchinput session with the contents of the B* ta$le. +n order to test the success of your B*progras, you will have to process the $atch input session (see chapter 9).

    Exercise 1

    Progra Gae:=*+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 ,DIxx42 proram to create proram

    ,DIxx1.

    +n this exercise, you will use the inforation fro the file you created in #xercise ; of hapter C(.Lfile;xx). This file contains new vendor inforation. =ou should read in the contents of thefile, 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, thesevalues should $e coing fro the file, not the hardIcoded values fro the previous exaple.

    fter executing this B* progra, you ust process the $atch input session to ake sure yourprogra is correct. To process the $atch input session, use the 3%yste - %ervices - Batchinput - #dit5 enu path (or transaction 3%78?5). The $est processing ode for testing is the3foreground5Iprocessing processing ode so you can step through each screen to ensure thatthe proper values are $eing entered into the appropriate fields. hapter 9 contains inforation

    on processing $atch input sessions.

    Gote: 4nce you successfully process the $atch input session, you will have inserted five newvendors into the %P syste. +f you attept to process another session, you will encountererrors $ecause you will $e trying to insert vendors that already exist. +n this case, you can 2ustchange the vendor nu$ers online while you are processing the $atch input session in the3foreground5 or 3display errors only5 processing ode.

    Exercise 2

    Progra Gae:=*+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 thisprogra to work correctly, you ust have successfully copleted the previous exercise. +nother words, you ust have successfully processed the previous $atch input session to insertfive vendors into the syste.hange the existing vendors nae, sort and country in the custo ta$le =F#G*4! and thenwrite a progra to download those in the application server file .LfileHxx. The Kile will $e createdin the directory *+!0%P1%#!%.The layout for each record of the file is:

    March 2005

    Page 16

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    17/20

    SAP R/3 Release 4.7Data Interfaces: Exercises SAP Development ABAP Trainin

    F#G*G17(;9) T=P# G7#(8') T=P# %4!T(C') T=P# 41GT!=(8) T=P#

    !esearch the hange Fendor transaction (3KE'C5) to deterine how to fill the B* ta$le. =oushould enter an existing vendor on the first screen and check the address check $ox. 4n thesecond screen, you should fill in values for the 3Gae5, 3%ort5, and 3ountry5 fields.

    PR>RA D,-PR D,-BE>I- @-A @

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    18/20

    SAP R/3 Release 4.7Data Interfaces: Exercises 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:3JJ T!G%T+4G 1%+GM5 and 3JJ *+J4M5.

    Exercise 1

    Progra Gae:=*+xxAI; (where xx is the last two digits of your logon id)Kile: .Lfile?xx

    +n this exercise, you will perfor $atch input to change existing vendors. +nstead of creating a$atch input session, you will use the 3JJ T!G%T+4G 1%+GM5 $atch input ethod.

    ,o" s$o"l( cop! !o"r ,DIxx2 proram to create proram ,DIxx71.

    #dit the progra to use the 3JJ T!G%T+4G 1%+GM5 ethod instead of creating a $atchinput session. lso, ake sure that you are reading in the new file .Lfile?xx. hange theexisting vendors nae, sort and country in the custo ta$le =F#G*4! and then write aprogra to download those in the application server file .Lfile?xx.The layout for each record ofthis file is identical to the one in the previous exercise:

    F#G*G17(;9) T=P# G7#(8') T=P# %4!T(C') T=P# 41GT!=(8) T=P#

    s each record is processed with 3JJ T!G%T+4G 1%+GM5, this progra should generatea report indicating the success or failure of the update.

    To test this $atch input ethod, use the 3display all5 ode of the 3JJ T!G%T+4G 1%+GM5stateent so you can step through each screen to ensure that the proper values are $eingentered into the appropriate fields.

    Bonus: Oow would you create an error file with the unsuccessful records (do not code)

    March 2005

    Page 18

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    19/20

    SAP R/3 Release 4.7Data Interfaces: Exercises SAP Development ABAP Trainin

    Exercise 2

    Oow would the previous progra change if you were using the 3JJ *+J4M5 ethod insteadof the 3JJ T!G%T+4G 1%+GM5 $atch input ethod (assue that the dialog odule isnaed 3D0*+J4M0KE'C5)

    Do not co(e t$is )A?? DIA?> proram.

    March 2005

    Page 19

  • 8/14/2019 7.10_ Data Interfaces Exercises.doc

    20/20

    SAP R/3 Release 4.7Data Interfaces: Exercises SAP Development ABAP Trainin

    )$apter

    The purpose of this exercise if for you to learn how to identify function codes associated withpush$uttons on the screen and function codes associated with enu paths.

    Exercise 1

    Mo to the initial screen of the BP #ditor (transaction 3%#8&5).

    (;) What is the function code associated with the *isplay push$utton on the screen

    (C) What is the function code associated with the 31tilities - %plit screen editor5 enu path

    March 2005