You are on page 1of 88

0

SAP AG 1999
Principles of the TA Recorder
Recording function in the LSMW
Using the TA Recorder
Principles of batch input and call transaction
Integrating TA Recorder programs into the D!W"
#ontents$
The Transaction Recorder$ TA Recorder
SAP AG BC420 12-1

0%&
SAP AG 1999
Use the recording function in the LSMW to create
a batch input session from the data in the e'ternal
s(stem
Use the TA recorder to create (our o)n data
transfer programs
Anal(*e programs that )or+ )ith the batch input
or call transaction
Integrate the TA recorder programs into the
D!W"
At the conclusion of this unit (ou )ill be able to$
The TA Recorder$ Unit ,b-ecti.es
SAP AG BC420 12-2

0%/
SAP AG 1999
#ourse ,.er.ie) Diagram
Daten0bernahme
D Wor+bench
LSM Wor+bench
Principles of Standard
Data Tansfer
D
i
r
e
c
t

I
n
p
u
t
"API
T
A

R
e
c
o
r
d
e
r
#ourse ,.er.ie)
"
a
t
c
h

I
n
p
u
t
#
a
l
l

T
r
a
n
s
a
c
t
i
o
n
/
1DI
"asics
2
3
4
5 60
6
60
7
66
64
66
66
6&
6
&
6&6&
6/
SAP AG BC420 12-3

0%4
SAP AG 1999
The TA Recorder
Principles of Recording
Principles of Recording
Recording )ith the LSMW
Recording )ith the LSMW
Using the TA Recorder
Using the TA Recorder
Principles of "I and #T
Principles of "I and #T
Integrating the TA Recorder into the D!W"
Integrating the TA Recorder into the D!W"
SAP AG BC420 12-4

0%2
SAP AG 1999
,.er.ie) of Transaction Recorder
Flat SAP
Structure
SAP Record
Layout
Structure
SAP IDoc
Structure
"API
If the SAP standard program does not provide the functions you need for data transfer, you can use
the transaction record.
Note: For data transfer, the transaction (TA) recorder reuires a !f"at fi"e#, that is, a fi"e $ithout any
hierarchy or su%structures.
SAP AG BC420 12-5

0%8
SAP AG 2001
Uses of the TA Recorder
Flat SAP
Structure
"atch
Input
#all
Transaction
The TA &ecorder ena%"es you to transfer data into &'( using %atch input or ca"" transaction.
The TA &ecorder can on"y $or) $ith a f"at structure. Fi"es $ith different record structures (for
e*amp"e, header structure) cannot %e used.
The TA &ecorder is used in the +S,- to create recordings of transactions. .atch input sessions can
%e created from the recordings.
The TA &ecorder can itse"f e*ecute a data transfer from the recording using %atch input or ca""
transaction.
SAP AG BC420 12-6

0%3
SAP AG 1999
The Recording
. . .
Recording
Screen
9ield .alue
9ield name
Module pool
Transaction
Screen
111
Screen
106
Screen
130
The TA &ecorder can record transactions. The recorder must %e activated %efore the transaction is
processed. Then you can run the transaction as though you $ere processing it on"ine.
After the transaction has finished, the recording $i"" contain a"" the screen num%ers, fie"d names,
fie"d va"ues and the associated modu"e poo" and transaction code.
SAP AG BC420 12-7

0%5
SAP AG 1999
#hanging #ustomer Data$ Initial Screen
Vendor
Company code
Z-88-10000
Screen
106
Genera da!a
9ield #ontents
B"C#C$%S&% $S'#ZAV
B"C#&(C&"' )00
%*02"-($++% ,-88-10000
%*02"-"0110 -
%*02"-"0130 -
$S'#ZAV -
9ield :ame

Transaction 9D0&
Addre..
In the a%ove e*amp"e the transaction Change customer F/01 is recorded.
In addition to the screen fie"ds, the fie"ds ./2324&S5& and ./235625/7 are a"so
automatica""y recorded.
Note:
You must change the field values for all the fields required later for the transfer. For the
recording a change can simply mean overriting one single character in a field ith the
same character.
!f fields are to "e filled using S#$%&#$ parameters' the value must also "e changed.
(ith online transactions screen sequences may appear that are different than in the
recording.
SAP AG BC420 12-8

0%7
SAP AG 1999
#hanging #ustomer Data$ Address
#ustomer ;!55!60000
+ame
Searc/ !erm
Addre..
Screen
111
9ield #ontents
B"C#&(C&"' 0$P"A
B"C#S$BSC% SAP1SZA1 0300A""%'SS
B"C#S$BSC% SAP1SZA1 0301C&$2222
B"C#C$%S&% A""%1#"A3A-4&$S'#+$51
A""%1#"A3A-S3%''3 Garden S!ree!
A""%1#"A3A-4&$S'#+$51 02105
6 6
9ield :ame
If there is a su%screen on the screens, this is automatica""y recorded. In the recording the fie"d
./23S4.S2&77N containing the name of the su%screen appears.
-ith customer master data the address is a su%screen area. The centra" address management is
integrated here. A"" the address input fie"ds are disp"ayed on one su%screen.
2entra" address management is on"y used, if you specifica""y se"ect this option on the initia" screen.
SAP AG BC420 12-9

0%60
SAP AG 1999
Results of the Recording
Recording


SAPM90&D 0608

"D#<#URS,R R90&D!=U::R
"D#<,=#,D1 >00
R90&D!=U::R *!55!60000
R90&D!D0660
US1<;A?

SAPM90&D 0666

"D#<,=#,D1 @UPDA
"D#<SU"S#R SAPLS;A6 0/00ADDR1SS
"D#<SU"S#R SAPLS;A6 0/06#,U:TRA<S#R11:
"D#<#URS,R S;A6<D0600!T1L<:UM"1R
ADDR6<DATA!STR11T /4 Barden Street
ADDR6<DATA!P,ST<#,D1 0&602
ADDR6<DATA!#ITA6 "oston
S;A6<D0600!T1L<:UM"1 863!825!7755
The resu"t of the recording is a "ist of a"" the fie"ds and fie"d va"ues that $ere changed in the
recording.
SAP AG BC420 12-10

0%66
SAP AG 1999
Special Recording 9ields
9unction code triggered on
this screen
9ield name )here cursor
)as last positioned on the
screen
C7.!omer
Company code
Z-88-10000
Genera da!a
"D#<,=#,D1
"D#<#URS,R
/uring a recording, the fo""o$ing additiona" fie"ds are automatica""y recorded.
The BDC_OKCODE fie"d contains the function code triggered on the screen.
The BDC_CURSOR fie"d contains the fie"d name of the "ast fie"d the cursor $as positioned in
%efore e*iting the screen.
SAP AG BC420 12-11

0%6&
SAP AG 1999
Determining the 9ield :ame
Technical info
Screen field
R90&D! =U::R
C7.!omer
Company code
Z-88-10000
Genera da!a
96
help
6
6
6
6
S!a!7.
Program SAPM90&D
Screen number 608
The information recorded in the TA recorder can a"so %e disp"ayed on"ine for each transaction.
To find out the current modu"e poo" name and the screen num%er choose System Status from the
menu.
To determine the fie"d name p"ace the cursor on a fie"d and se"ect F8 he"p. The name of the screen
fie"d can %e found under technical information.
SAP AG BC420 12-12

0%6/
SAP AG 1999
Subscreens
C7.!omer Z-88-10000
+ame
+ame
ADDR6<DATA!:AM16
"D#<SU"S#R
Information$
5od7e poo name
Screen n7m8er
S78.creen name
Some screens contain su%screen areas.
To determine the fie"d name, p"ace the cursor on the fie"d and choose F1. The name of the screen
fie"d is specified under Technical info.
SAP AG BC420 12-13

0%64
SAP AG 2001
Tabstrips
$.er Roberts
1'ample$ User Profile ! Defaults
S!ar! men7
*"5+
1o9on an97a9e
"'
&7!p7! de:;ce
Pr!1
222
Parame!er. Defaults
"D#<SU"S#R
USD19AULTS!SPLD
The ta%strip e"ement sho$n is used on the aintain User !rofile (5$n data) screen.
4nder the ta%strip tit"e Defaults, the user can set various va"ues, such as the defau"t printer.
The user profi"e are user9dependent settings (as the name imp"ies).
SAP AG BC420 12-14

0%62
SAP AG 1999
Step Loops and Table #ontrols
1'ample$ "an+ Details
C7.!omer
#ntr( "an+ +e( Account
"' 08154711
222
123456789
Z-00-12345
"an+ Details
"' 00708155 546344536
Ban< da!a
222
=:"=!"A:=:C06)
=:"=!"A:=:C0&)
Step "oops and ta%"e contro"s are treated identica""y for the recording.
The fie"d names of the fie"ds "isted are the same for every ro$.
7ach ro$ contains a customer:s %an) detai"s. The fie"ds must %e accessed using an inde* (this is
specified as an addition to the fie"d name, for e*amp"e, 6N.69.AN6N(1). The inde* must match
the ro$ num%er.
5n"y the visi%"e fie"ds on a screen can %e fi""ed $ith data. If some fie"ds are on"y visi%"e after paging,
the paging must %e recorded as $e"". This means that for the recording you must e*ecute a"" the steps
in the on"ine transaction.
For e*amp"e !age "o#n $ou"d %e e*ecuted using the function code !'1(#. (Paging icons)
Paging to the end of a "ist: !'1;#.
Page up: !'11#.
<o to first page : !'18#.
SAP AG BC420 12-15

0%68
SAP AG 2001
Recording Buidelines
Test the transaction before recording
Start the recording
#hange field .alues onl( for fields
rele.ant to the recording
As of 4%8# all filled fields are recorded
Transaction must be properl( e'ited
CSA?1D
Use of scroll bars cannot be recorded
Specia" recording notes:
F8, F; and your o$n F8 and F; he"p (P&527SS 5N =7+P9&7>47ST, P&527SS 5N ?A+479
&7>47ST) are not recorded. This a"so app"ies to a"" commands under the System and $el%
menus. ?a"ues for defau"t variants ( @ transaction variants) are not inc"uded.
7rror and $arning dia"ogs are not recorded. 5n"y the 56 code and the fie"d contents reuired for
further processing on the current screen are recorded.
Note: /uring recording, the data entered is $ritten to the data%ase
SAP AG BC420 12-16

0%63
SAP AG 2001
1n-o( SAP #ontrols and Data Transfer
SAP Picture #ontrol
SAP ETML ?ie)er #ontrol
SAP Te't 1dit #ontrol
AL? Brid #ontrol
SAP Tree #ontrol
222
"ranch 6
"ranch &
%%%
Root
These and other controls do not support batch input$
Root
"ranch &
"ranch &6
%%%%%
%%%%%
The ne$ !7nAoy SAP contro"s# deve"oped for &e"ease ;.B do not support %atch input or ca""
transaction.
=o$ever, ta%"e contro"s and ta%strips do support %atch input.
SAP AG BC420 12-17

0%65
SAP AG 1999
The Transaction Recorder
Principles
Principles
Recording )ith the LSMW
Recording )ith the LSMW
Principles of "atch Input and #all Transaction
Principles of "atch Input and #all Transaction
Integrating the TA Program into the D!W"
Integrating the TA Program into the D!W"
Using the TA Recorder
Using the TA Recorder
SAP AG BC420 12-18

0%67
SAP AG 1999
Session
generator
Recording Using the LSMW
-ith the +S,- you can create your o$n recordings.
The +S,- uses the standard TA recorder here, yet eva"uates the recording itse"f. The information
from the recording is used to create %atch input sessions.
The created %atch input session can %e processed as usua" $ith the %atch input monitor.
Note: As $ith the standard procedure it is eua""y important that the data is converted.
SAP AG BC420 12-19

0%&0
SAP AG 1999
#reating Recording
Adm;n;.!ra!;on
%ecord;n9
Go!o
:ame of recording
Description
,)ner
:ame of
transaction
Start recording:
<o into the +S,- and se"ect the menu path &oto '(Recor"ings. An overvie$ of a"" previous"y
created recordings for your proAect are disp"ayed. To start a ne$ recording se"ect Create.
To create a recording, you must define the name, the description and the o$ner.
7nter the name of the transaction you $ant to record.
7*ecute the transaction and comp"ete it proper"y.
Note: &ecordings are assigned to on"y one proAect 9 so the name of the recording must %e uniue.
SAP AG BC420 12-20

0%&6
SAP AG 1999
#hanging #ustomer Data$ Initial Screen
9ield #ontents
B"C#C$%S&% $S'#ZAV
B"C#&(C&"' )00
%*02"-($++% ,-88-10000
%*02"-"0110 -
%*02"-"0130 -
$S'#ZAV -
9ield :ame
C7.!omer
Company code
Z-88-10000
Genera da!a
C7.!omer
Z-88-10000
+ame
9ield #ontents
B"C#&(C&"' 0$P"A
B"C#S$BSC% SAP1SZA1 0300A""%'SS
B"C#S$BSC% SAP1SZA1 0301C&$2222
B"C#C$%S&% SZA1#"0100-3'1#+$5B'
A""%1#"A3A-S3%''3 Garden S!ree!
A""%1#"A3A-4&$S'#+$51 34
A""%1#"A3A-P&S3#C&"'1 02105
6 6
9ield :ame
Screen
111
Screen
106
In the a%ove e*amp"e the transaction Change customer F/01 is recorded.
Note:
You must ma)e some modification to the field values for all the fields you ant to capture
for the data transfer. For the purposes of recording a change can simply mean overriting
one single character in a field ith the same character.
#ven if fields are to "e filled using S#$%&#$ parameters' the values must still "e changed on
the screen in order to capture them.
(ith online transactions screen sequences may appear that are different than in the
recording.
SAP AG BC420 12-21

0%&&
SAP AG 1999
Results



Recording
Recording R1#<6 Demo<6

9D0& #hange customer CaccountingD

SAPM90&D 0608

"D#<#URS,R R90&D!=U::R
"D#<,=#,D1 >00
R90&D!=U::R *!55!60000
R90&D!D0660
US1<;A?

SAPM90&D 0666

"D#<,=#,D1 @UPDA
"D#<SU"S#R SAPLS;A6
"D#<SU"S#R SAPLS;A6
"D#<#URS,R S;A6<D0600!T1L<:UM"1
ADDR6<DATA!STR11T /4 Barden Street
ADDR6<DATA!P,ST<#,D1 0&602
ADDR6<DATA!#ITA6 "oston
S;A6<D0600!T1L<:UM"1 863!825!7755
The resu"ts of the recording using the +S,- are disp"ayed in a tree structure.
After the recording has finished, you can edit it. Cou can de"ete fie"ds or add ne$ ones.
SAP AG BC420 12-22

0%&/
SAP AG 1999
Assigning 9ield :ames
Recording R1#6 Demo<6


"D#<,=#,D1 @UPDA
"D#<SU"S#R SAPLS;A6
"D#<SU"S#R SAPLS;A6
"D#<#URS,R S;A6<D0600!T1L%%%%
ADDR6<DATA!:AM16 Lisa Eofmeister
ADDR6<DATA!P,ST<#,D1 0&602
ADDR6<DATA!#ITA6 "oston
:ame
+ame
"e.cr;p!;on
"e=a7! :a7e
A""%1#"A3A-+A5'1
A""%1#"A3A-+A5'1
C7.!omer name
1;.a 4o=me;.!er
Screen =;ed
#ustomer name
double clic+
Cou can assign names for each recorded fie"d. The specia" fie"ds (./235625/7, ./2324&S5&
and ./23S4.S2&77N) are not inc"uded here. Cou can choose the fie"d names. -hen the %atch
input session is created, the contents of these fie"ds are assigned to the target fie"ds specified in the
"eft co"umn.
Functions:
/efau"t: Assigns to the fie"d names of the under"ying target fie"d and its fie"d description.
&eset: /e"etes fie"d name and fie"d description.
/ou%"e c"ic): 7dits fie"d name, fie"d description and defau"t va"ue.
Note: Cou can use fie"d names more than once. =o$ever, the fie"d name is on"y avai"a%"e once in the
fie"d mapping. For this reason it is not practica" to use fie"d names more than once.
For a"" those fie"ds for $hich you do not assign a name, the defau"t va"ue is used $hen the %atch
input session is created. These defau"t va"ues can %e seen as constants. This is especia""y usefu" for
chec) %o*es (for e*amp"e, ,,08, vie$ se"ection).
The +S,- supports automatic fie"d mapping. Source fie"ds and target fie"ds can %e assigned to each
other automatica""y. The fie"ds are assigned to the corresponding fie"ds of the same name. Therefore
the fie"d names of the source structure shou"d %e given the same or simi"ar names as the fie"d names
in the target structure.
SAP AG BC420 12-23

0%&4
SAP AG 2001
Adding>remo.ing screen fields
Repeating recording
9or identical field names the name and description are
assigned automaticall(
1diting Recording
%*02"-($++%
(+A1-A+%'"
(+A1-+A5'1
(+A1-S&%31
(+A1-+A5'2
(+A1-S3%AS
C7.!omer acco7n! n7m8er
3;!e
+ame 1
Sor! =;ed
+ame 2
S!ree!
Selection of all
a.ailable screen
fields
Cou can "ater add ne$ screen fie"ds if you need to. 6eep in mind that fie"ds shou"d on"y %e added in
p"aces $here they are a"so provided on the screen, other$ise you $i"" get an error $hen the .I
session is processed.
After saving, you $i"" get the message !The data has %een saved successfu""y!. No$ the recordings
are avai"a%"e for the o%Aect attri%utes.
If you repeat the recording, you can record a ne$ screen seuence $ith ne$ fie"ds. Provided that the
fie"d names (e.g. 6NA89NA,78) are identica", the names and descriptions are automatica""y
assigned.
SAP AG BC420 12-24

0%&2
SAP AG 1999
,b-ect T(pe and Import Method$ Recording
Standard "atch Input > Direct Input
"atch Input Recording
"API
IDoc
&8>ec! !ype ) ;mpor! me!/od
Ba!c/ ;np7! record;n9
%ecord;n9 %ec1
The recording is no$ avai"a%"e $ith the o%Aect attri%utes.
Ne*t, you create a proAect or su%9proAect in the +S,- and specify ' process the data transfer.
Cou e*ecute the data transfer as in the standard system
/efine the source fie"ds and structures
/efine the fie"d mapping
&ead and convert the data
2reate and import a %atch input session
SAP AG BC420 12-25

0%&8
SAP AG 1999
The Transaction Recorder
Principles
Principles
Recording )ith the LSMW
Recording )ith the LSMW
Principles of "atch Input and #all Transaction
Principles of "atch Input and #all Transaction
Integrating the TA Program into the D!W"
Integrating the TA Program into the D!W"
Using the TA Recorder
Using the TA Recorder
SAP AG BC420 12-26

0%&3
SAP AG 1999
Transaction Recorder
Online
Transaction
Recording
Transfer Program
#T
Included in the Batch Input Monitor
Cou use the transaction recorder to record transactions, and then use the transaction recording to
generate a transfer program. The program a""o$s you to transfer data using either %atch input or ca""
transaction.
SAP AG BC420 12-27

0%&5
SAP AG 1999
#hanging #ustomer Data$ Initial Screen
9ield #ontents
B"C#C$%S&% $S'#ZAV
B"C#&(C&"' )00
%*02"-($++% Z-88-10000
%*02"-"0110 -
%*02"-"0130 -
$S'#ZAV -
9ield :ame
C7.!omer
Company code
Z-88-10000
Genera da!a
C7.!omer
Z-88-10000
+ame
9ield #ontents
B"C#&(C&"' 0$P"A
B"C#S$BSC% SAP1SZA1 0300A""%'SS
B"C#S$BSC% SAP1SZA1 0301C&$2222
B"C#C$%S&% SZA1#"0100-3'1#+$5B'
A""%1#"A3A-S3%''3 Garden S!ree!
A""%1#"A3A-4&$S'#+$51 34
A""%1#"A3A-P&S3#C&"'1 02105
6 6
9ield :ame
Screen
111
Screen
106
In the a%ove e*amp"e the transaction Change customer F/01 is recorded.
SAP AG BC420 12-28

0%&7
SAP AG 2001
#hange Debitor$ Pa(ment Transactions C6D
Ban< de!a;.
Screen
10
9ield #ontent
B"C#C$%S&% (+B(-BA+(+?01@
B"C#&(C&"' 0BA+(
(+B(-BA+(S?01@ "'
(+B(-BA+(1?01@ 12345679
(+B(-BA+(+?01@ 22222222
Debitor ;!55!60000
9ield :ame
Inde'
SAP AG BC420 12-29

0%/0
SAP AG 1999
#hanging #ustomer Data$ Pa(ment Transactions C&D
Addre..
"an+ countr( US
"an+ code 6&/42837
Ban< de!a;.
#ustomer ;!55!60000
9ield #ontents
9ield :ame
B"C#C$%S&% (+A1-(+%ZA
B"C#&(C&"' 0$P"A
(+B(--'Z'%?01@ -
Screen
10
Screen
100
SAPLBA!"
9ield #ontents
B"C#C$%S&% B+(A-BA+(A
B"C#&(C&"' 0'+3%
B+(A-BA+(A +a!;ona Ban<
9ield :ame
In different transactions the modu"e poo" may change. This is the case $ith, for e*amp"e, customer
master data. The TA recorder records modu"e poo" changes automatica""y.
SAP AG BC420 12-30

0%/6
SAP AG 1999
Eierarch( Displa( of the Recording



*"02#"'5&
*"02
SAP5*02" 0106
B"C#C$%S&% %*02"-"0130
B"C#&(C&"' )00
%*02"-($++% ,-88-10000
%*02"-"0110 -
%*02"-"0130 -
SAP5*02" 0111
B"C#&(C&"' 0VA
B"C#C$%S&% A""%1#"A3A-4&$S'#+$51
A""%1#"A3A-S3%''3 Garden S!ree!
6
Recording
-ith the TA recorder the resu"ts are a"so a "ist in a hierarchy disp"ay. =o$ever, you cannot assign
your o$n fie"d names as you can in the +S,-.
SAP AG BC420 12-31

0%/&
SAP AG 1999
Recording ,.er.ie)
Recording
Transfer program
9unction module
#ontains onl( the data
from the recording
Test data
Test
#reate
#reate
#reate
#reate
1dit
#hange recording
Process recording
Cou can edit the recording as needed.
The recording can %e tested and e*ecuted again. The screens are run through in the same $ay as in
the recording.
The recording can then %e used to create:
.atch input sessions
Test data
/ata transfer programs $ith %atch input or ca"" transaction
Function modu"es
SAP AG BC420 12-32

0%//
SAP AG 1999
1 3 *"02 BS
2 SAP5*02" 106 -
3 B"C#C$%S&% $S'#ZAV
4 B"C#&(C&"' )00
5 %*02"-($++% ,-88-10000
6 %*02"-"0110 -
7 %*02"-"0130 -
8 $S'#ZAV -
9 SAP5*02" 111 -
10 B"C#&(C&"' 0VA
11 B"C#C$%S&% A""%1#"A3A-4&$S'#+$51
12 A""%1#"A3A-S3%''3 Garden S!ree!
Program Screen St% 9ield :ame 9ield ?alue
Recording 1ditor
Recording
Add > delete lines
9ormat chec+
Import > e'port of recording
In the editor you can add or de"ete "ines. Cou can a"so change the contents of individua" "ines.
-ith the function Chec) you can specify $hether the edited version of the recording sti"" has the
correct synta*.
Cou can a"so e*port ' import recordings to ' from a seuentia" fi"e.
After editing save the recording changes.
SAP AG BC420 12-33

0%/4
SAP AG 1999
Recording Se.eral Transaction Runs
Recording
F @
Directl( after the first recordingG or
In the displa( mode of the recording
In this step, you can record additiona" transactions and add additiona" transaction runs to the
recording.
Cou can record the additiona" transactions direct"y after a recording or in the edit screen of a
recording.
SAP AG BC420 12-34

0%/2
SAP AG 1999
1ditor$ Importing and 1'porting Recordings
6 T 9D0& "S
& SAPM90&D 608
/ "D#<#URS,R
4
2
8 SAPM90&D 666
60
66
Program Screen St% 9ield name 9ield .alue
c6B!empB
"A3
*;e name
"a!a =orma!
c6B!empB
"A3
*;e name
"a!a =orma!
1'port
Import
Presentation Ser.er
If the editor functions in the systems do not provide a"" the functions you need, you can do$n"oad the
recording to your presentation server using the E*%ort function and then edit the recording using a
P2 editor.
Cou use the Import function to import the data %ac) into the &'( System. ,a)e sure the fi"e is sti"" in
the correct format.
SAP AG BC420 12-35

0%/8
SAP AG 1999
Processing the Recording
Recording
Process )ith #ALL TRA:SA#TI,:
Parame!er.
Proce.. mode
$pda!e mode
CA33 mode
"e=a7! .;,e
Con!2 a=!er comm;!
+o! a BC .e..;on
'nd6 +o! a BC mode
A
A
#T
The recording can %e e*ecuted direct"y. The data from the recording is used and the transaction is
processed $ith ca"" transaction.
2a"" transaction provides a range of options for ca""ing app"ication transactions, $hich are discussed
on the fo""o$ing t$o pages..
SAP AG BC420 12-36

0%/3
SAP AG 1999
Process mode
Update mode
#ATT mode
Processing Recording )ith #T 6
A
1
:
Displa( all screens
Displa( errors onl(
:o displa(
L
S
A
Local
S(nchronous
As(nchronous
:
A
:o #ATT
#ATT )ithout indi.idual screen control
#ATT )ith indi.idual screen control
Processing mode:
=ere you can specify the processing mode 9 it is the same as the processing mode for %atch input.
4pdate mode:
=ere you can specify the update mode. For more information see the unit ca"" transaction.
2ATT mode:
=ere you can ma)e specia" settings, if you $ant to test the recording under 2ATT conditions (on"y
necessary for 2ATT runs). Specia" functions are ca""ed in the 2ATT too" for each screen at the end of
P.5 and at the start of PAI .
SAP AG BC420 12-37

0%/5
SAP AG 1999
Default si*e
#ont% after commit
:ot a "I session
1nd$ :ot a "I mode
Processing Recording )ith #T &
The screen standard si*e is used for the
processing
#ommit )or+ does not end the processing
:o "I mode is acti.e% The transaction )ill run
through as in online
"I mode is selected% ,nce the data in the "D#
table is processedG the "I mode is set to inacti.e%
Standard siDe:
If you se"ect this, the screens are processed in the standard siDe in the foreground (in foreground or
disp"ay errors on"y). Note: the standard siDe is a"$ays used for %ac)ground processing.
Further after commit:
The first commit $or) in a transaction does not "ead to the end of the recording.
Note: A %atch input transaction is ended $ith the first commit $or).
No .I mode:
The system fie"d SC9.INPT is not set (SC9.INPT E F F). So transactions are run through as in on"ine.
7nd: No .I mode:
5n"y use if you choose the processing mode 7 (disp"ay errors on"y). Then the transaction is
processed in the %ac)ground in %atch input mode and if there is an error the screens run through in
the foreground.
SAP AG BC420 12-38

0%/7
SAP AG 1999
"I Mode
"atch input
mode
,nline
Some transactions beha.e differentl( in batch input mode
than in online Cbatch input capabilit(D
"atch input mode sets the s(stem field SA!"I:PT @ HI
Not every transaction can run the same on"ine and in %atch input mode. The transaction must decide
itse"f $hether it is ca""ed on"ine or in %atch input mode.
The system sets the system fie"d SC9.INPT E FGF if the %atch input mode is active (this a"so app"ies
to ca"" transaction). From this system fie"d the transaction can identify $hether to run on"ine or in
%atch input mode.
SAP AG BC420 12-39

0%40
SAP AG 1999
#reating a Session 9rom the Recording
Recording
,nl( contains the data
from the recording
Se..;on name *"02#"'5&
A7!/or;,a!;on %&B'%3S
(eep .e..;on
1oc< da!e

1021022000
Cou can create a %atch input session direct"y from the recording that you can then process using the
%atch input monitor.
SAP AG BC420 12-40

0%46
SAP AG 1999
#reating Test Data
Test Data
Recording
B!ran.B!ran.pBBC420#"A3A *;e name
The file onl( contains the data from the recording%
R>/
Application Ser.er
Structure
Cou can create a fi"e from the recordingH the fi"e $i"" contain a"" the fie"ds from the recording. The
fie"ds are added to the fi"e $ith the "ength you specified in the definition.
The fie"d order corresponds to the order in the recording overvie$. Technica" fie"ds
(./235625/7, ./2324&S5&, and so on) are inc"uded.
The data can on"y %e stored on the app"ication server. If you do not specify a path, the fi"e is stored in
the I$or)# directory of the app"ication server.
If the specified test fi"e a"ready e*ists, the ne$ data record is added to this fi"e.
SAP AG BC420 12-41

0%4&
SAP AG 1999
*;ed con!en!.
#reating a Program
Recording
ZBC420#"'5& Pro9ram name
Transfer Program
3e.! da!a
%ead =rom =;e
3ran.=er =rom record;n9
#reate
9ile name
Test data
B!ran.B!ran.pBBC420#"A3A
Cou can generate a program from the recording.
In the fo""o$ing dia"og %o*, enter a program name. In addition, you can choose the type and method
for fi""ing the maintained fie"d contents from the recorded screens:
4se the va"ues used for the recording. If you reuire f"e*i%"e data transfer, you $i"" have to modify
this program "ater.
ParameteriDe the input va"ues and read these va"ues from a fi"e. A data structure is created for
parameteriDationH the data records are read from an e*terna" fi"e into this data structure. The
program assumes the fi"e $as tai"ored to this data structure.
If you have decided to parameteriDe the input va"ues, you shou"d a"so create a test fi"e during
generation. To do this, se"ect the chec)%o* and enter a name for the fi"e.
The attri%ute maintenance screen of the A.AP editor appears. ,aintain the attri%utes and save the
program.
SAP AG BC420 12-42

0%4/
SAP AG 1999
Program 9unctions
Online
transaction
Transfer program
#T
:o
error
1rror
,ption 6
,ption &
Flat SAP
structure
Monitor
Cou have no$ generated a data transfer program for importing data into the &'( System. The
program can e*ecute the data transfer using %atch input or ca"" transaction.
If you choose option 1 and there is an error, the data record is p"aced into a %atch input session.
SAP AG BC420 12-43

0%44
SAP AG 1999
Benerating 9unction Modules
Recording
Z#crea!e#de8;!or *7nc!;on mod7e
*7nc!;on 9ro7p
S/or! !eD!
ZBC420
Crea!e c7.!omer
9unction module
,nl( one data record can be processed at a time
In the ne*t dia"og %o* you can generate a function modu"e, a function group and short te*t from the
recording. The function modu"e is automatica""y created in the function group.
SAP AG BC420 12-44

0%42
SAP AG 1999
9unction of 9unction Modules
Online
transaction
#T
:o
error
1rror
,ption 6 ,ption &
9unction module
Import
Parameter
1'port
parameter
Tables
M1SSTA"
Monitor
S$B%C
Import interface:
The import interface consists of a technica" part and the fie"ds from the recording. (A parameter is
created for each input fie"d of the recorded transactions).
7*port interface:
Simp"y consists of the parameter S4.&2. The function modu"e $i"" return a va"ue in the system
fie"d SC9S4.&2 after ca""ing ca"" transaction. This return va"ue is set to Dero, if the data record has
%een correct"y processed. (5n"y app"ies to 2T)
If a session is created, you $i"" %e notified $hether the data record cou"d %e p"aced into the session.
Ta%"e interface:
This is used on"y if the function modu"e $or)s $ith ca"" transaction. The ta%"e contains a"" the
system messages.
SAP AG BC420 12-45

0%48
SAP AG 1999
Import Interface of 9unction Module
$
Technical
fields
Data
fields
BI session or CALL TRANSACTION
Processin# $ode
%pdate $ode
!a$e o& BI session 'i& (T% initial)
Bac*#round user 'i& (T% initial)
Delete session a&ter processin#
Loc* date o& session
!ODATA indicator
#TU
M,D1
UPDAT1
BR,UP
US1R
=11P
E,LDDAT1
:,DATA
Cou can use parameter 2T4 to specify $hether the function modu"e creates a %atch input session
(2T4 E F F), or updates the data record direct"y using ca"" transaction (2T4 E FGF)
The other parameters are fi""ed as for a %atch input session header.
Note: 7very time the function modu"e is ca""ed, a %atch input session is created.
If the session is to contain severa" transactions, proceed as fo""o$s:
<enerate the transaction severa" times. This can %e achieved %y recording the transaction again. The
function modu"e interface $i"" then contain more than one transaction. -hen the function modu"e is
ca""ed, severa" transactions can %e generated for each session.
SAP AG BC420 12-46

0%43
SAP AG 1999
The Transaction Recorder
Principles
Principles
Recording )ith the LSMW
Recording )ith the LSMW
Principles of "atch Input and #all Transaction
Principles of "atch Input and #all Transaction
Integrating the TA Program into the D!W"
Integrating the TA Program into the D!W"
Using the TA Recorder
Using the TA Recorder
SAP AG BC420 12-47

0%45
SAP AG 1999
Benerated Program
9unction modules
"D#<,P1:<BR,UP
"D#<I:S1RT
"D#<#L,S1<BR,UP
A"AP Program

Define structure of
data in seJuential
file
Define "D#
table
,pen seJuential file
,pen "I session
Read data record
CseJuential fileD
9ill "D# table
9ill "I session >
#ALL TRA:SA#TI,:
Last data record K
#lose "I session
#lose seJuential file
The generated program has the structure disp"ayed a%ove. It uses the standard function modu"es for
creating %atch input sessions.
SAP AG BC420 12-48

0%47
SAP AG 1999
Structure of the Benerated Program
Benerated part
Define "D#
table

,pen seJuential file
,pen "I session
Read data record
9ill "D# table
9ill "I session >
#ALL TRA:SA#TI,:
Last data recordK
#lose "I session
#lose seJuential file
Include "D#R1#6
Define file
structure
,P1:<DATAS1T
,P1:<BR,UP
"D#<DA:PR,
"D#<9I1LD
"D#<TRA:SA#TI,:
#L,S1<BR,UP
#L,S1<DATAS1T
The generated program consists of t$o parts 9 a generated part and the inc"ude ./2&72G8. The
inc"ude is provided in the standard system.
The inc"ude contains the definition of the reuired ./2 ta%"e and a further seven su%routines. These
su%routines e*ecute the fo""o$ing functions:
5pen and c"ose fi"e
5pen and c"ose session
Fi"" ./2 ta%"e
Fi"" session
The generated part is the main program and ca""s the re"evant su%routines. A structure is a"so
generated in the generated part to read the e*terna" data into the fi"e.
See the Appendi* for more information on the ./2&72G8 program.
SAP AG BC420 12-49

0%20
SAP AG 1999
Structure of "D# Table
PR,BRAM DA:PR, DA:"1BI: 9:AM 9?AL
PR,BRAM PR,BRAM DA:PR, DA:PR, DA:"1BI: DA:"1BI: 9:AM 9:AM 9?AL 9?AL
SAPM90&D 0602
R90&D!=U::R ;!600000
R90&D!"U=RS 0006
R90&D!=T,=D =U:A
SAPM90&D 0660
=:A6!:AM16 Smith
=:A6!PSTL; 87000
=:A6!LA:D6 US
=:A6!SPRAS 1:
SAPM90&D 06&0
=:A6!ST#1B US6&/428357
"D#DATA
PR,BRAM
DA:PR,
DA:"1BI:
9:AM
9?AL
#EAR
:UM#
#EAR
#EAR
#EAR
40
4
6
6/&
6/&
"D# Module pool
"D# Screen number
"D# Start of screen
"D# 9ield name
"D# 9ield contents
9ield :ame T(pe Length Short Te't
A"AP Dictionar(
The ./2 ta%"e has the same structure as in a standard transfer.
SAP AG BC420 12-50

0%26
SAP AG 1999
Read Structure
Recording
DATA: BEGIN OF record,

* data element: BUKRS
bukr!""#$""%&,
* data element: KTOKD
ktokd!""'$""%&,
* data element: NA(E#!G)
name#!""*$"*+&,
* data element: SORT,
ortl!""%$"#"&,
:
:
END OF record-
record
Automaticall( generated
from recording
The structure of the fi"e is automatica""y generated and is a"$ays defined $ith the name &725&/.
The generated structure a"$ays has the same "ayout. 7ach fie"d is defined %y t$o generated ro$s.
The first ro$ is a"$ays a comment ro$ containing the te*t !J data e"ement:# and the data e"ement of
the screen fie"d from the recording. In the ne*t ro$, the fie"d itse"f is defined $ith the name of the
data e"ement fo""o$ed %y a three9digit position num%er, $hich specifies the "ocation in the structure.
The "ength of the fie"d is set %y the "ength of the data e"ement. If a fie"d is not defined through a data
e"ement, the system uses the "ength of the screen fie"d.
SAP AG BC420 12-51

0%2&
SAP AG 1999
,pening and #losing the 9ile
,P1:<DATAS1T
#L,S1<DATAS1T
FOR( o.en!dataet USING .!dataet-
O)EN DATASET .!dataet IN TE/T (ODE-
IF S01SUBR2 34 "-
5RITE: 6 te7t1e"", S01SUBR2-
STO)-
ENDIF-
ENDFOR(-
FOR( cloe!dataet USING .!dataet-
2,OSE DATASET .!dataet-
ENDFOR(-
Include
"D#R1#6
The su%routine 5P7N3/ATAS7T opens the seuentia" fi"e.
The su%routine 2+5S73/ATAS7T c"oses the seuentia" fi"e.
SAP AG BC420 12-52

0%2/
SAP AG 1999
9unction Modules for "I Program
#lient
Session name
Eold date
=eep%%% session
"D# user name
RecordK
#LI1:T
BR,UP
E,LDDAT1
=11P
US1R
R1#,RD
"D#<,P1:<BR,UP
"D#<,P1:<BR,UP
Transaction code
"D# table
T#,D1
DA:PR,TA"
"D#<I:S1RT
"D#<I:S1RT
"D#<#L,S1<BR,UP
"D#<#L,S1<BR,UP
,pen "I
session
,pen "I
session
Insert data for
transactions
Insert data for
transactions
#lose "I
session
#lose "I
session
The fo""o$ing function modu"es are provided for creating %atch input sessions (function group
S./2):
./235P7N3<&54P
2reates a ne$ session and contains genera" data for the $ho"e session.
./23INS7&T
Inserts a"" the data for a transaction into the session. The transferred interna" ta%"e $ith the
structure ./2/ATA must contain a"" the data reuired for fu""y processing the transaction.
./232+5S73<&54P
2"oses the session after a"" the data has %een inserted. As soon as the session has %een c"osed, it
can %e processed.
The interna" ta%"e $ith the structure ./2/ATA can on"y contain %atch input data for one sing"e
transaction run. So the individua" transactions are inserted into the %atch input session in a "oop,
using severa" ./23INS7&T ca""s.
SAP AG BC420 12-53

0%24
SAP AG 2001
9unction Module "D#<,P1:<BR,UP
#ALL 9U:#TI,: I"D#<,P1:<BR,UPI
#ALL 9U:#TI,: I"D#<,P1:<BR,UPI
1P,RTI:B
#LI1:T @ LclientM
BR,UP @ Lsession nameM
E,LDDAT1 @ Lloc+ dateM
=11P @ Ldelete flagM
US1R @ Lbdc user nameM
R1#,RD @ LrecordingM
IMP,RTI:B
NID @ Linternal session +e(M
1#1PTI,:S
%%%%%%%%%%%%
%%%%%%%%%%%%
1P,RTI:B
#LI1:T @ LclientM
BR,UP @ Lsession nameM
E,LDDAT1 @ Lloc+ dateM
=11P @ Ldelete flagM
US1R @ Lbdc user nameM
R1#,RD @ LrecordingM
IMP,RTI:B
NID @ Linternal session +e(M
1#1PTI,:S
%%%%%%%%%%%%
%%%%%%%%%%%%
-ith the function modu"e ./235P7N3<&54P you can open a %atch input session.
The fo""o$ing parameters are mandatory:
2+I7NT (c"ient)
<&54P (session name)
4S7& (user name)
Note: The 4S7& must a"$ays %e specified. This user name is reuired for processing the session
in %atch mode.
The fo""o$ing parameters are optiona":
=5+//AT7 specifies the ear"iest date on $hich the session can %e started
677P f"ag specifies $hether session shou"d %e de"eted after it has %een successfu""y processed. The
677P f"ag is ignored if the session contains errors.
677P E K K means de"ete the session after processing (defau"t va"ue), H
677P E KGK means do not de"ete session.
&725&/ E KGK a""o$s you to create a recording instead of a .I session.
If >I/ is specified the function modu"e returns the interna" session )ey. This is needed to %e a%"e to
differentiate sessions that have the same name.
-ith 7G27PTI5NS you get various return va"ues that can %e ueried $ith SC9S4.&2.
Note: In on"ine mode the on"ine user is used for the authoriDation chec)s regard"ess of the user
name specified.
SAP AG BC420 12-54

0%22
SAP AG 1999
Subprogram ,P1:<BR,UP
,P1:<BR,UP
FOR( o.en!8rou.-
IF e9on : ;/;-
:
2A,, FUN2TION ;BD2!O)EN!GROU);
E/)ORTING 2,IENT : <1mandt
GROU) : 8rou.
USER : uer
KEE) : kee.
=O,DDATE : >olddate-
:
ENDIF-
ENDFOR(-

Include
"D#R1#6
The su%program 5P7N3<&54P opens the %atch input session.
SAP AG BC420 12-55

0%28
SAP AG 1999
9unction Module "D#<I:S1RT
#ALL 9U:#TI,: I"D#<I:S1RTI
#ALL 9U:#TI,: I"D#<I:S1RTI
IMP,RT
T#,D1 @ LTransaction codeM
P,ST<L,#AL @ LUpdate locall( M
PRI:TI:B @ Lprint listM
TA"L1S DA:PR,TA" @ Lbdc<tableM
1#1PTI,:S
%%%%%%%%%%%%
%%%%%%%%%%%%
IMP,RT
T#,D1 @ LTransaction codeM
P,ST<L,#AL @ LUpdate locall( M
PRI:TI:B @ Lprint listM
TA"L1S DA:PR,TA" @ Lbdc<tableM
1#1PTI,:S
%%%%%%%%%%%%
%%%%%%%%%%%%
-ith the function modu"e ./23INS7&T you can add transaction data to the session.
Cou need an interna" ./2 ta%"e to transfer the data.
The fo""o$ing parameters are mandatory:
T25/7 Transaction code
/CNP&5TA. ./2 ta%"e
The fo""o$ing parameters are optiona":
P5ST3+52A+ E KGK activates "oca" updating. This means that the data to %e updated is )ept in the
app"ication server and updated in the "ast step of the transaction. This does not invo"ve the update
process. (For more information see course .2;8;, Programming /ata%ase 4pdates.)
P&INTIN< E KGK 9 "ists processed in .I $i"" %e printed immediate"y.
-ith 7G27PTI5NS you get various return va"ues that can %e ueried $ith SC9S4.&2.
SAP AG BC420 12-56

0%23
SAP AG 1999
Subprogram "D#<TRA:SA#TI,:
"D#<TRA:SA#TI,:
FOR( BD2!TRANSA2TION USING tcode-
IF e9on : ;/;-
2A,, FUN2TION ;BD2!INSERT;
E/)ORTING T2ODE : tcode
TAB,ES D0N)ROTAB : bdcdata-

E,SE-
ENDIF-
ENDFOR(-

#T
Include
"D#R1#6
The su%program ./23T&ANSA2TI5N moves the fi""ed ./2 ta%"e either to a %atch input session
or uses ca"" transaction to import the data into the system. 5n the se"ection screen, you can specify
$hether you $ant to create a session or you $ant to use ca"" transaction to process the data direct"y.
The S7SSI5N fie"d is then set according to your se"ection.
SAP AG BC420 12-57

0%25
SAP AG 1999
9unction Module "D#<#L,S1<BR,UP
#ALL 9U:#TI,: I"D#<#L,S1<BR,UPI
1#1PTI,:S
:,T<,P1: @ 6
NU1U1<1RR,R @ &
-ith the function modu"e ./232+5S73<&54P you can c"ose a %atch input session.
In 7G27PTI5NS you get various return va"ues that can %e ueried $ith SC9S4.&2.
SAP AG BC420 12-58

0%27
SAP AG 1999
Subprogram #L,S1<BR,UP
FOR( cloe!8rou.-
IF e9on : ;/;-
?cloe batc> 9n.ut 8rou.
2A,, FUN2TION ;BD2!2,OSE!GROU);-
:
E,SE-
IF e!8rou.!o.ened : ;/;-
2A,, FUN2TION ;BD2!2,OSE!GROU);-
:
ENDIF-
ENDIF-
ENDFOR(-
#L,S1<BR,UP
#lose session
#lose error session
Include
"D#R1#6
The su%program 2+5S73<&54P c"oses the %atch input session. The su%program differentiates
%et$een a !norma"# .I session (S7SSI5N E FG:) and a session opened $hen ca"" transaction
encountered an error (73<&54P35P7N7/ E FG:).
SAP AG BC420 12-59

0%80
SAP AG 1999
Subprograms "D#<DA:PR,G "D#<9I1LD
"D#<DA:PR,
"D#<9I1LD
FOR( bdc!@9eld USING @nam @Aal-
IF @Aal 34 nodata-
2,EAR bdcdata-
bdcdata1@nam : @nam-
bdcdata1@Aal : @Aal-
A))END bdcdata-
ENDIF-
ENDFOR(-
FOR( bdc!d<n.ro USING .ro8ram d<n.ro-
2,EAR bdcdata-
Bdcdata1.ro8ram : .ro8ram-
Bdcdata1d<n.ro : d<n.ro-
Bdcdata1d<nbe89n : ;/;-
A))END bdcdata-
ENDFOR(-
Include
"D#R1#6
The inc"ude ./2&72GG contains t$o su%programs ./23/CNP&5 and ./23FI7+/.
Su%program ./23/CNP&5 fi""s the ./2 ta%"e $ith program names and screen num%ers.
Su%program ./23FI7+/ fi""s the ./2 ta%"e $ith fie"d names and va"ues.
7ach su%program creates an entry in the ./2 ta%"e.
SAP AG BC420 12-60

0%86
SAP AG 1999
9illing the "D# Table
.er@orm bdc!d<n.ro u9n8 ;SA)(F"'D; ;"#"+;-

.er@orm bdc!@9eld u9n8 ;BD2!2URSOR; ;RF"'D1BUKRS;-
.er@orm bdc!@9eld u9n8 ;BD2!OK2ODE; ;6"";-
.er@orm bdc!@9eld u9n8 ;RF"'D1BUKRS; record1BUKRS!""#-
.er@orm bdc!@9eld u9n8 ;RF"'D1KTOKD; record1KTOKD!""'-


.er@orm bdc!d<n.ro u9n8 ;SA)(F"'D; ;"##";-
.er@orm bdc!@9eld u9n8 ;BD2!2URSOR; ;KNA#1S)RAS;-
.er@orm bdc!@9eld u9n8 ;BD2!OK2ODE; ;6"";-
.er@orm bdc!@9eld u9n8 ;KNA#1NA(E#; record1NA(E#!""*-
.er@orm bdc!@9eld u9n8 ;KNA#1SORT,; record1SORT,!""%-
:
Recording
Benerated automaticall(
from the recording
)ERFOR( bdc!d<n.ro USING ;SA)(F"'D; ;"#"+;-

)ERFOR( bdc!@9eld USING ;BD2!2URSOR; ;RF"'D1BUKRS;-
)ERFOR( bdc!@9eld USING ;BD2!OK2ODE; ;6"";-
)ERFOR( bdc!@9eld USING ;RF"'D1BUKRS; record1BUKRS!""#-
)ERFOR( bdc!@9eld USING ;RF"'D1KTOKD; record1KTOKD!""'-


)ERFOR( bdc!d<n.ro USING ;SA)(F"'D; ;"##";-
)ERFOR( bdc!@9eld USING ;BD2!2URSOR; ;KNA#1S)RAS;-
)ERFOR( bdc!@9eld USING ;BD2!OK2ODE; ;6"";-
)ERFOR( bdc!@9eld USING ;KNA#1NA(E#; record1NA(E#!""*-
)ERFOR( bdc!@9eld USING ;KNA#1SORT,; record1SORT,!""%-
---
The ./2 ta%"e is fi""ed $ith data from the recording. The su%routines ./23/CNP&5 and
./23FI7+/ are used for this.
The su%routines are ca""ed in the reuired structure or seuence.
SAP AG BC420 12-61

0%8&
SAP AG 1999
,.er.ie)
SAP
Database
SeJuential
9ile
SAP
Database
#ALL TRA:SA#TI,: #ALL TRA:SA#TI,:
SeJuential
9ile
"AT#E I:PUT "AT#E I:PUT
"D# Table "D# Table "D# Table "D# Table
"I Monitor
#T
In contrast to %atch input, you can use ca"" transaction to direct"y pass data to the dia"og interface,
$ithout using a %atch input session. Cou use an interna" ta%"e (./2 ta%"e, same structure and "ayout
as %atch input) to temporari"y store your screen data. Then you ca"" the desired transaction in your
program.
Note: 5n average, the 2a"" Transaction method is 8 to ( times faster than using .atch Input.
SAP AG BC420 12-62

0%8/
SAP AG 1999
#all Transaction Program$ 1'ample
RE)ORT a.bc%'"bdcd!c!deb9!ct'-

)ARA(ETERS:
d9mode DEFAU,T ;A;,
u.dmode DEFAU,T ;S;-
:
FOR( call!tranact9on-
2A,, TRANSA2TION ;FD"';
USING bdcdata
(ODE d9mode
U)DATE u.dmode-

IF <1ubrc NE "-
5RITE: 6 ---

ENDIF-
ENDFOR(-
Screen
*00
Screen
100
Screen
...
An additiona" system ro"" area is added for the ca""ed transaction. The system uses this area for
processing the individua" screens in the transactionH the data from the ta%"e is added here. After the
transaction is processed, the second ro"" area is re"easedH the system continues processing in the first
ro"" area.
Notes:
In contrast to %atch input, there is no error "ogging (error sessions) here. For processing the ca""ed
transaction, the system uses the authoriDations of the user that ca""ed the transaction. The ./2 ta%"e
can on"y ho"d data for one transaction run at a time. .efore another transaction is ca""ed and its data
can %e added, you must e*ecute a &7F&7S= for the ./2 ta%"e.
SAP AG BC420 12-63

0%84
SAP AG 1999
#ALL TRA:SA#TI,: C6D
RE)ORT 777-
:
2A,, TRANSA2TION ;FD"';
USING bdcdata
(ODE ;E;-
:
Default for M,D1 is A
2A,, TRANSA2TION 3tranact9oncode4
B USING 3bdc1table4 C
B (ODE D A E E E N F C-
-ith the parameter ,5/7 you can se"ect a specific disp"ay mode for processing the transaction. The
fo""o$ing three modes are avai"a%"e:
A (/isp"ay a"")
If you e*ecute the program, a"" the screens and a"" their data are disp"ayed. This is the defau"t va"ue
for the ,5/7 in 2A++ T&ANSA2TI5N.
N (/isp"ay nothing)
The screens are not disp"ayed at a"", regard"ess of $hether any of them contained errors. As soon as
the transaction has %een fu""y processed, contro" is returned to your program. (The va"ue of the
parameter 4P/AT7 determines $hether data%ase updates are e*ecuted or not).
7 (/isp"ay errors on"y)
As soon as an error occurs in a screen, the transaction is s$itched to disp"ay mode so that you can
correct the errors.
These disp"ay modes are the same as those in the %atch input session processing.
SAP AG BC420 12-64

0%82
SAP AG 1999
RE)ORT 777-
:
2A,, TRANSA2TION FD"'
USING BD2DATA
U)DATE ;,;-
:
#ALL TRA:SA#TI,: C&D
RE)ORT 777-
:
2A,, TRANSA2TION ;FD"';
USING bdcdata
U)DATE ;,;-
:
2A,, TRANSA2TION 3tranact9oncode4
B USING 3bdc1table4 C
B (ODE D A E E E N F C
B U)DATE D A E , E S F C -
Default for UPDAT1 is A
-ith the parameter 4P/AT7 you can contro" ho$ data%ase updates arising from a transaction are
carried out. There are three options:
A (asynchronous updating) The ca""ed transaction does not $ait unti" the data%ase has %een
updated, it simp"y for$ard the updates to the SAP update service. This usua""y speeds up the 2T
program. This processing mode is N5T recommended for "arge data sets as the ca""ed transaction
does not receive a comp"etion message from the update modu"e.
The ca""ing 2T program therefore cannot te"" if the transaction has %een successfu""y comp"eted. Cou
shou"d use the updating administration function (transaction S,8() to determine $hether updating
$as terminated ear"y. The error ana"ysis 'correction functions for are "ess he"pfu" than $ith
synchronous updating.
S (synchronous updating) -ith synchronous updating the ca""ed transaction $aits unti" a"" the
updates have %een comp"eted. So processing is s"o$er than $ith synchronous updating. The ca""ed
transaction can ho$ever report any updating errors to the program, $hich ma)es error
ana"ysis'correction easier.
+ (local updating) $ith "oca" updating the data%ase is not updated in a separate process , it is
updated in the ca""erFs process (see app"ication he"p documentation for the A.AP )ey$ord S7T
4P/AT7 TAS6 +52A+)
SAP AG BC420 12-65

0%88
SAP AG 1999
#ALL TRA:SA#TI,: C/D
RE)ORT 777-
DATA: m!tab T0)E TAB,E OF bdcm8coll-
:
2A,, TRANSA2TION ;FD"';
USING bdcdata
(ESSAGES INTO m!tab-
:
2A,, TRANSA2TION 3tranact9oncode4
B USING 3bdc1table4 C
B (ODE D A E E E N F C
B U)DATE D A E , E S F C
B (ESSAGES INTO 3metab4 C -
,7SSA<7S specifies that a"" system messages that are output during the e*ecution of a 2A++
T&ANSA2TI5N are $ritten to the interna" ta%"e L,7SSTA.@. The interna" ta%"e must have the
structure ./2,S<25++.
4n"i)e the c"assica" %atch input processing $ith sessions 2A++ T&ANSA2TI5N does not offer any
specia" processing procedures for transactions containing errors. There are no restart functions for
transactions that contain errors or that cause updating terminations.
SAP AG BC420 12-66

0%83
SAP AG 1999
#ALL TRA:SA#TI,: C4D
RE)ORT 777-
DATA: m<!o.t T0)E ctu!.aram-
2A,, TRANSA2TION FD"'
USING BD2DATA
O)TIONS FRO( m<!o.t-
:
2A,, TRANSA2TION 3tranact9oncode4
B USING 3bdc1table4 C
B (ODE D A E E E N F C
B U)DATE D A E , E S F C
B (ESSAGES INTO 3metab4 C
B O)TIONS FRO( o.t C -
RE)ORT 777-
DATA: m<!o.t T0)E ctu!.aram-
2A,, TRANSA2TION ;FD"';
USING bdcdata
O)TIONS FRO( m<!o.t-
:
The addition 5PTI5NS ena%"es the ca"" transaction statement to %e contro""ed through a structure.
The structure must have the dictionary type 2T43PA&A,S.
The addition 5PTI5NS F&5, must not %e com%ined either $ith the addition ,5/7 or $ith
4P/AT7. ,ore information on the ne*t s"ide.
SAP AG BC420 12-67

0%85
SAP AG 1999
Structure #TU<PARAMS
DISM,D1 Proce..;n9 mode ?anao9o7. !o add;!;on 5&"'@
UPDM,D1 $pda!e mode ?anao9o7. !o add;!;on $P"A3'@
#ATTM,D1 CA33 mode ?CA33 con!ro@
D19SI;1 *orce. de=a7! E;ndoE .;,e d7r;n9 proce..;n9
RA#,MMIT +o eD;! a! C&55C3 A&%(
:,"I:PT +o! a. 8a!c/ ;np7! .e..;onF !/a! ;.F SG-BC+P3 0 SPAC'
:,"I1:D +o! a. 8a!c/ ;np7! .e..;on a=!er end o= B"C da!a
The components are defined as fo""o$s:
The components /7FSIM7 , &A25,,IT, N5.INPT, and N5.I7N/ can have the fo""o$ing
va"ues: KGK E Ces or K K E No
If the addition 5PTI5NS F&5, is not specified, the fo""o$ing settings app"y to the contro"
parameters:
/IS,5/7 from addition ,5/7
4P/,5/7 from addition 4P/AT7
2ATT,5/7 2ATT not active
/7FSIM7 /o not not use defau"t $indo$s siDe
&A25,,IT Successfu" e*it at 25,,IT -5&6
N5.INPT .atch input session active (SC9.INPT E G)
N5.I7N/ .atch input session sti"" active after end of ./2 data
SAP AG BC420 12-68

0%87
SAP AG 1999

SA!MSBID Message ID
SA!MSBTA Message T(pe C1GIGWGSGAD
SA!MSB:, Message :umber
SA!MSB?6 Message ?ariable 6
SA!MSB?& Message ?ariable &
SA!MSB?/ Message ?ariable /
SA!MSB?4 Message ?ariable 4

SA!MSBID Message ID
SA!MSBTA Message T(pe C1GIGWGSGAD
SA!MSB:, Message :umber
SA!MSB?6 Message ?ariable 6
SA!MSB?& Message ?ariable &
SA!MSB?/ Message ?ariable /
SA!MSB?4 Message ?ariable 4
Return code$
S(stem fields$
?alue Meaning
0 Successful
L 6000 1rror in transaction
M 6000 1rror in processing call transaction
see also the s(stem fields specified
?alue Meaning
0 Successful
L 6000 1rror in transaction
M 6000 1rror in processing call transaction
see also the s(stem fields specified
9ield name Meaning
9ield name 9ield name Meaning Meaning
Return #ode and S(stem 9ields
The return code is used to specify $hether the ca""ed transaction $as processed successfu""y. In
addition, severa" system fie"ds are fi""ed: The num%er, I/, type, and varia%"es of the dia"og message
output %y the ca""ed transaction. Cou need this information to output the message te*t.
SAP AG BC420 12-69

0%30
SAP AG 1999
Benerated Program of the TA Recorder
REFRES= (ESSTAB-
2A,, TRANSA2TION tcode USING bdcdata
(ODE ctumode
U)DATE cu.date
(ESSAGES INTO metab-
,OO) AT metab-
:
END,OO)-
IF l!ubrc 34 " AND e!8rou. 34 S)A2E-
IF e!8rou.!o.enend : ; ;-
2A,, FUN2TION ;BD2!O)EN!GROU);
E/)ORTING ---------
---------
E!8rou.!o.ened : ;/;-
ENDIF-
2A,, FUN2TION ;BD2!INSERT;
E/)ORTING T2ODE : tcode
TAB,ES D0N)ROTAB : bdcdata-
ENDIF-
:
REFRES= bdcdata-
Message table output
,pen error session
Insert data record that
has errors into error
session
If you have se"ected ca"" transaction on the se"ection screen, the generated program runs as fo""o$s:
The on"ine transaction is ca""ed $ith ca"" transaction and passed to ta%"e ./2/ATA. A"" the
messages arising during the ca"" transaction are put in the interna" ta%"e ,7SSTA..
,7SSTA. is output as a "ist.
If you have specified an error session ( 73<&54P L@ SPA27) on the se"ection screen, and the
ca"" transaction comes across an error (+3S4.&2 L@ 0), the error session is opened. The error
session is ho$ever on"y opened once. Then the data record is p"aced in the session.
A"" the other data records that have errors $ith ca"" transaction are p"aced in the same session.
SAP AG BC420 12-70

0%36
SAP AG 1999
The Transaction Recorder
Principles
Principles
Recording )ith the LSMW
Recording )ith the LSMW
Principles of "atch Input and #all Transaction
Principles of "atch Input and #all Transaction
Integrating the TA Program into the D!W"
Integrating the TA Program into the D!W"
Using the TA Recorder
Using the TA Recorder
SAP AG BC420 12-71

0%3&
SAP AG 1999
Integrating into the D!W"
Transfer program
A"AP Dictionar(
Integrate
SDA0
SDA6
SDA&
SDA/
Cou can integrate the generated program into the /G9-.. The structure of the fi"e must %e created
in the A.AP /ictionary. The ta%"es SG/A0, SG/A8, SG/A1 and SG/A( $i"" %e fi""ed.
SAP AG BC420 12-72

0%3/
SAP AG 1999
DW" Release 4%2
Go!o
"--AB %eea.e 425
"a!a !ran.=er o8>ec!
Int% customer data transfer ob-ect
%ecord =;ed.
'Dec7!e da!a !ran.=er
'd;! Go!o
The &unction &or inte#ratin#
TA recorder pro#ra$s is
i$ple$ented in the
D+,-B in Release ./0
The recorder can %e integrated as of &e"ease ;.N and it is provided in the /G9-. &e"ease ;.N.
<ot to the /G9-. &e"ease ;.N. 5n the initia" screen you can integrate programs %y choosing &oto
'( +nt. customer "ata transfer o,-ect.
SAP AG BC420 12-73

0%34
SAP AG 1999
#reating Program as D ,b-ect
C7.!omer !ran.=er o8>ec!
&8>ec! !ype
S/or! !eD! =or "- o8>ec!
"a!a !ran.=er pro9ram
S!r7c!7re name
9900
(+A1
C/an9e c7.!omer
Z#"'B#C4A+G'
Z#"'B
#ustomer transfer ob-ect
:umber bet)een 7000 and 7777
,b-ect t(pe
Assignment to ",R ob-ect
Short te't for D ob-ect
Short description
Data transfer program
:ame of generated program
Structure name
A structure Cstructure la(outD )ith this name is created in
the A"AP Dictionar(
For &e"ease ;.N, transfer o%Aects $ere not organiDed %y .5& o%Aects %ut %y a /G num%er (00089
OOOO). The num%er range O0009OOOO is reserved for customers.
To create a connection to the ne$ /G 9-., you must assign the program to a .5& o%Aect.
2reate a short te*t for the /G o%Aect. This te*t $i"" appear in the method se"ection "ist.
Specify the program to %e inc"uded.
Specify a name for the structure to %e created in the A.AP /ictionary.
Note: $he generated program appears under program type +!N, and not under program type
-#,..
SAP AG BC420 12-74

0%32
SAP AG 1999
Ad.antages
Automatic program registration in the D!W" in
Release 4%8
Aou can use all the functions defined for
standard ob-ects
1'ception$ The (reate &ile 1ith data
function
If you inc"uded the o%Aect in the &e"ease ;.N $or)%ench, it is automatica""y avai"a%"e in the &e"ease
;.B $or)%ench.
A"" the $or)%ench functions are avai"a%"e for your o%Aect e*cept for Create files #ith transfer "ata.
SAP AG BC420 12-75

0%38
SAP AG 1999
Aou are no) able to$
The Transaction Recorder$ Unit Summar(
Use the recording function in the LSMW to create
a batch input session )ith the data from the
e'ternal s(stem
Use the TA Recorder to create (our o)n data
transfer program
Anal(*e programs that )or+ )ith batch input or
call transaction
Integrate the TA Recorder programs into the
D!W"
SAP AG BC420 12-76

#/ercise 1
0nit: $1 -ecorder
$opic: 2reating 3e"tors
$ransaction -ecorder #/ercise 1
2reating de%tors $ith e*terna" num%er assignment.
/e%tor num%ers: M9PP980008 to M9PP980080
Address data for de%tors $ith e*terna" num%er assignment is to
%e transferred using program &F.I/700.
,ro4ect: F!566
Su"pro4ect: 3#+566
-un : 3#+5#7566
$as)s: 81,566' 9.1566' 8S2566
9oad program: -F+!3#00
8 In the fo""o$ing e*ercises e*isting data is to %e changed. Therefore these de%tors $ith
e*terna" num%er assignment have to first %e created.
898 4nder su%proAect /7.9PP create run /7.97G9PP $ith the name De,tors #ith
e*ternal num,ers.
SAP AG BC420 12-77

891 2reate the fo""o$ing three tas)s. The tas)s map the fo""o$ing process steps:
convert data' create +! session and process +! session.
89198 In run /7.97G9PP create the fo""o$ing tas):
9 Tas): ,AP9PP
9 Name: 2onvert data
9 Tas) type: ,AP
9 Program type: +S,-
Se"ect the fo""o$ing +S,- o%Aect:
+S,- proAect: .2;109PP
+S,- su%proAect: /7.I9PP
+S,- o%Aect: .I9PP97GT
89191 In run /7.97G9PP create the fo""o$ing tas):
9 Tas): +5A9PP
9 Name: 2reate .I session
' Tas) type: +5A
9 Program type: .INP
Se"ect program &F.I/700 $ith the variant
.I97G9PP.
8919( In run /7.97G9PP create the fo""o$ing tas):
9 Tas): ,S29PP
9 Name: Process .I session
' Tas) type: ,S2
9 Program type: &7P5
Se"ect program &S./2S4. $ith the variant
S4.97G9PP.
Note that you have to correct the seuence of the tas)s: 2onvert data'
create +! session and process +! session.
4se the %uttons '
89( Start the run
The de%tors $i"" %e created $ith e*terna" num%er assignments.
89; 2hec) in transaction F/0( that the de%tors M9PP980008 to M9PP980080 have %een
created.
SAP AG BC420 12-78

#/ercise *
0nit: $ransaction -ecorder
$opic: -ecording function in the 9S8(
2reate a recording using the +S,-
<enerate a %atch input session
2hange the de%tor address data in the &'( System
Name of the recording: 3#+!:66
Name of the file: +2;*05665+!F!9#
8 2reate the recording /7.I3PP using the +S,-. &ecord the transaction F/01 (2hange
de%tor).
898 .efore you create the recording, first test the transaction on"ineQ
For the recording use de%tor M9PP980008. 5n the initia" screen of the F/01,
maintain the fo""o$ing fie"ds on"y:
/e%tor: /e%tor M9PP980008
2ompany code: 0008
Address data: se"ect
Note: $he data record must "e saved hile recording
891 ,aintain the names and the descriptions for the fo""o$ing fie"ds:
Name, city, street, posta" code and te"ephone num%er.
/e"ete a"" other fie"ds in screen 880 from the recording (e.g. S5&T+, +AN/8,
SP&AS).
4se the same technica" names as sho$n in the ta%"e %e"o$ (automatic fie"d
mapping).
SAP AG BC420 12-79

1 2reate the su%proAect /7.I9PP and the ne$ o%Aect TA3PP in your proAect .2;109PP.
,aintain the o%Aect attri%utes and se"ect the item %atch input recording. Se"ect your
recording /7.I3PP.
2reate the source structure address.
2reate the source fie"ds according to the ta%"e %e"o$. 5r copy them from proAect .2;109
S37N, su%proAect /7.I900, o%Aect TA900.
198 Fi"e setup: The data from the "egacy system are disp"ayed in the fo""o$ing ta%"e:
Fie"d name Fie"d type Fie"d "ength /escription
N5 2 8B /e%tor num%er
NA,7 2 (N Name
ST&77T 2 (N Street
2ITC 2 (N 2ity'P"ace of residence
MIP 2 80 Posta" code
T7+ 2 8B Te"ephone num%er
191 ,aintain the fie"d mapping. 4se the automatic fie"d mapping (via menu item:
7*tras)
19( Specify the fi"es. 5n"y maintain the fi"e name of the source fi"e.
Name of the fi"e .2;109PP9.IFI+7
2odepage: 8800
19; Import the data and convert them. /isp"ay the data in each caseQ
19N 2reate a %atch input session
19B &un the %atch input session.
SAP AG BC420 12-80

#/ercise 3
0nit: $ransaction -ecorder
$opic: -ecording ith the $1 -ecorder
<enerate a recording using the TA recorder.
Test the recording.
2hange the address data of de%tors in the &'( system
Name recording: $1:3#+!:66
Name of the file: +2;*05665+!F!9#
8 2reate the recording TA3/7.I3PP using the transaction recorder. &ecord the
transaction F/01 (change de%tor).
898 4se de%tor M9PP980008 for the recording. 5n the F/01 initia" screen, on"y
maintain the fo""o$ing fie"ds:
/e%tor: /e%tor M9PP980008
2ompany 2ode: 0008
Address data: se"ect
Note: $he data record must "e saved hen recording
/e"ete a"" fie"ds that do not e*ist in the source fi"e .2;109PP9.IFI+7 from screen
880 in the recording (e.g. 6NA89S5&T+, 6NA89+AN/8, 6ANNQ9SP&AS).
Note: /o not de"ete fie"ds &F01/9.46&S and &F01/9/0880.
Save the recording no$.
1 S$itch to the recordings overvie$.
198 Process the recording $ith the processing mode !A! (disp"ay a"").
191 Process the recording $ith the processing mode RN! (no disp"ay).
19( If the recording has %een tested and no error has occurred, generate a .I session
and run it using the .I monitor. If an error shou"d occur, generate the recording
againQ
SAP AG BC420 12-81

( From the recording, generate the program M.2;103/7.I3PP in your deve"opment c"ass
.2;109PP. Se"ect the fo""o$ing:
&ead fie"d contents from fi"e
2reate test data in the fi"e .2;103de%i3test3PP.t*t
(98 Save this program and e*ecute it. <enerate one .I session each and process it.
2arry out the same steps again using the ca"" transaction.
; The generated program shou"d no$ %e changed so that fi"e .2;109PP9.IFI+7 can %e
read and processed.
;98 2hange the defau"t va"ue of the fi"e name (parameter dataset) in .2;109PP9
.IFI+7.
;91 2hange the structure definition. /e"ete the company code fie"d and the address
data chec)%o* from the structure
;9( 2hange the su%9routine ca"" perform %dc3fie"d for the company code (K&F01/9
.46&SK) so that the va"ue 0008 is transferred.
;9; 2hange the su%9routine ca"" perform %dc3fie"d for the address data chec)%o*
(K&F01/9/0880K) so that the va"ue G is transferred.
;9N Start the program again and read the data from the fi"e .2;109PP9.IFI+7 $ith
de%tor data. <enerate a .I session $ith it and run it.
SAP AG BC420 12-82

0%33 Include "D#R1#6
***INCLUDE BDCRECX1.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS SESSION RADIOBUTTON GROUP CTU. "create sessi!
SELECTION-SCREEN COMMENT "#$%& TEXT-S%' FOR FIELD SESSION.
se(ecti!-scree! )siti! *+.
PARAMETERS CTU RADIOBUTTON GROUP CTU. "ca(( tra!sacti!
SELECTION-SCREEN COMMENT *,#$%& TEXT-S%, FOR FIELD CTU.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT "#$%& TEXT-S%1 FOR FIELD GROUP.
se(ecti!-scree! )siti! $+.
PARAMETERS GROUP#1$&. "-r.) !a/e 0 sessi!
SELECTION-SCREEN COMMENT *,#$%& TEXT-S%+ FOR FIELD CTUMODE.
se(ecti!-scree! )siti! '%.
PARAMETERS CTUMODE LI1E CTU2PARAMS-DISMODE DEFAULT 3N3.
"A4 s56 a(( 78!)rs
"E4 s56 78!)r ! errr !(8
"N4 7 !t 7is)(a8 78!)r
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT "#$%& TEXT-S%$ FOR FIELD USER.
se(ecti!-scree! )siti! $+.
PARAMETERS4 USER#1$& DEFAULT S9-UNAME. ".ser 0r sessi! i! :atc5
SELECTION-SCREEN COMMENT *,#$%& TEXT-S%; FOR FIELD CUPDATE.
se(ecti!-scree! )siti! '%.
PARAMETERS CUPDATE LI1E CTU2PARAMS-UPDMODE DEFAULT 3L3.
"S4 s8!c5r!.s(8
"A4 as8!c5r!.s(8
"L4 (ca(
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT "#$%& TEXT-S%" FOR FIELD 1EEP.
se(ecti!-scree! )siti! $+.
PARAMETERS4 1EEP AS C<EC1BOX. "3 3 = 7e(ete sessi! i0 0i!is5e7
"3X3 = >ee) sessi! i0 0i!is5e7
SELECTION-SCREEN COMMENT *,#$%& TEXT-S%? FOR FIELD E2GROUP.
SAP AG BC420 12-83

se(ecti!-scree! )siti! '%.
)ara/eters E2GROUP#1$&. "-r.) !a/e 0 errr-sessi!
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT "#$%& TEXT-S%* FOR FIELD <OLDDATE.
se(ecti!-scree! )siti! $+.
PARAMETERS4 <OLDDATE LI1E S9-DATUM.
SELECTION-SCREEN COMMENT +1#1'& TEXT-S%$ FOR FIELD E2USER.
se(ecti!-scree! )siti! '%.
PARAMETERS4 E2USER#1$& DEFAULT S9-UNAME. ".ser 0r errr-sessi!
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT +1#1'& TEXT-S%" FOR FIELD E21EEP.
se(ecti!-scree! )siti! '%.
PARAMETERS4 E21EEP AS C<EC1BOX. "3 3 = 7e(ete sessi! i0 0i!is5e7
"3X3 = >ee) sessi! i0 0i!is5e7
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT +1#1'& TEXT-S%* FOR FIELD E2<DATE.
se(ecti!-scree! )siti! '%.
PARAMETERS4 E2<DATE LI1E S9-DATUM.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN S1IP.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1#""& TEXT-S1% FOR FIELD NODATA.
PARAMETERS4 NODATA DEFAULT 3@3 LOAER CASE. "!7ata
SELECTION-SCREEN END OF LINE.
*----------------------------------------------------------------------*
* Batc5i!).t7ata 0 si!-(e tra!sacti!
DATA4 BDCDATA LI1E BDCDATA OCCURS % AIT< <EADER LINE.
* /essa-es 0 ca(( tra!sacti!
DATA4 MESSTAB LI1E BDCMSGCOLL OCCURS % AIT< <EADER LINE.
* errr sessi! )e!e7 #3 3 r 3X3&
DATA4 E2GROUP2OPENED.
* /essa-e teBts
TABLES4 T1%%.
SAP AG BC420 12-84

*----------------------------------------------------------------------*
* at se(ecti! scree! *
*----------------------------------------------------------------------*
AT SELECTION-SCREEN.
* -r.) a!7 .ser /.st :e 0i((e7 0r create sessi!
IF SESSION = 3X3 AND
GROUP = SPACE OR USER = SPACE.
MESSAGE E;1"#MS&.
ENDIF.
*----------------------------------------------------------------------*
* )e! 7ataset *
*----------------------------------------------------------------------*
FORM OPEN2DATASET USING P2DATASET.
OPEN DATASET P2DATASET IN TEXT MODE.
IF S9-SUBRC CD %.
ARITE4 @ TEXT-E%%E S9-SUBRC.
STOP.
ENDIF.
ENDFORM.
*----------------------------------------------------------------------*
* c(se 7ataset *
*----------------------------------------------------------------------*
FORM CLOSE2DATASET USING P2DATASET.
CLOSE DATASET P2DATASET.
ENDFORM.
*----------------------------------------------------------------------*
* create :atc5i!).t sessi! *
* #!t 0r ca(( tra!sacti! .si!-...& *
*----------------------------------------------------------------------*
FORM OPEN2GROUP.
IF SESSION = 3X3.
S1IP.
ARITE4 @#$%& 3Create -r.)3#I%1&E GROUP.
S1IP.
* )e! :atc5i!).t -r.)
CALL FUNCTION 3BDC2OPEN2GROUP3
EXPORTING CLIENT = S9-MANDT
SAP AG BC420 12-85

GROUP = GROUP
USER = USER
1EEP = 1EEP
<OLDDATE = <OLDDATE.
ARITE4 @#"%& 3BDC2OPEN2GROUP3#I%$&E
#1$& 3ret.r!c7e43#I%+&E
S9-SUBRC.
ENDIF.
ENDFORM.
*----------------------------------------------------------------------*
* e!7 :atc5i!).t sessi! *
* #ca(( tra!sacti! .si!-...4 errr sessi!& *
*----------------------------------------------------------------------*
FORM CLOSE2GROUP.
IF SESSION = 3X3.
* c(se :atc5i!).t -r.)
CALL FUNCTION 3BDC2CLOSE2GROUP3.
ARITE4 @#"%& 3BDC2CLOSE2GROUP3#I%*&E
#1$& 3ret.r!c7e43#I%+&E
S9-SUBRC.
ELSE.
IF E2GROUP2OPENED = 3X3.
CALL FUNCTION 3BDC2CLOSE2GROUP3.
ARITE4 @.
ARITE4 @#"%& 3Fe5(er/a))e 6.r7e erFe.-t3#I%;&.
ENDIF.
ENDIF.
ENDFORM.
*----------------------------------------------------------------------*
* Start !e6 tra!sacti! accr7i!- t )ara/eters *
*----------------------------------------------------------------------*
FORM BDC2TRANSACTION USING TCODE.
DATA4 L2MSTRING#*,%&.
DATA4 L2SUBRC LI1E S9-SUBRC.
* :atc5 i!).t sessi!
IF SESSION = 3X3.
CALL FUNCTION 3BDC2INSERT3
EXPORTING TCODE = TCODE
TABLES D9NPROTAB = BDCDATA.
ARITE4 @ 3BDC2INSERT3#I%"&E
SAP AG BC420 12-86

TCODEE
3ret.r!c7e43#I%+&E
S9-SUBRCE
3RECORD43E
S9-INDEX.
* ca(( tra!sacti! .si!-
ELSE.
REFRES< MESSTAB.
CALL TRANSACTION TCODE USING BDCDATA
MODE CTUMODE
UPDATE CUPDATE
MESSAGES INTO MESSTAB.
L2SUBRC = S9-SUBRC.
ARITE4 @ 3CALL2TRANSACTION3E
TCODEE
3ret.r!c7e43#I%+&E
L2SUBRCE
3RECORD43E
S9-INDEX.
LOOP AT MESSTAB.
SELECT SINGLE * FROM T1%% A<ERE SPRSL = MESSTAB-MSGSPRA
AND ARBGB = MESSTAB-MSGID
AND MSGNR = MESSTAB-MSGNR.
IF S9-SUBRC = %.
L2MSTRING = T1%%-TEXT.
IF L2MSTRING CS 3G13.
REPLACE 3G13 AIT< MESSTAB-MSGH1 INTO L2MSTRING.
REPLACE 3G$3 AIT< MESSTAB-MSGH$ INTO L2MSTRING.
REPLACE 3G"3 AIT< MESSTAB-MSGH" INTO L2MSTRING.
REPLACE 3G*3 AIT< MESSTAB-MSGH* INTO L2MSTRING.
ELSE.
REPLACE 3G3 AIT< MESSTAB-MSGH1 INTO L2MSTRING.
REPLACE 3G3 AIT< MESSTAB-MSGH$ INTO L2MSTRING.
REPLACE 3G3 AIT< MESSTAB-MSGH" INTO L2MSTRING.
REPLACE 3G3 AIT< MESSTAB-MSGH* INTO L2MSTRING.
ENDIF.
CONDENSE L2MSTRING.
ARITE4 @ MESSTAB-MSGT9PE L2MSTRING#$+%&.
ELSE.
ARITE4 @ MESSTAB.
ENDIF.
ENDLOOP.
SAP AG BC420 12-87

S1IP.
** ErFe.-e! 0e5(er/a))e ************************************************
IF L2SUBRC CD % AND E2GROUP CD SPACE.
IF E2GROUP2OPENED = 3 3.
CALL FUNCTION 3BDC2OPEN2GROUP3
EXPORTING CLIENT = S9-MANDT
GROUP = E2GROUP
USER = E2USER
1EEP = E21EEP
<OLDDATE = E2<DATE.
E2GROUP2OPENED = 3X3.
ENDIF.
CALL FUNCTION 3BDC2INSERT3
EXPORTING TCODE = TCODE
TABLES D9NPROTAB = BDCDATA.
ENDIF.
ENDIF.
REFRES< BDCDATA.
ENDFORM.
*----------------------------------------------------------------------*
* Start !e6 scree! *
*----------------------------------------------------------------------*
FORM BDC2D9NPRO USING PROGRAM D9NPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGRAM.
BDCDATA-D9NPRO = D9NPRO.
BDCDATA-D9NBEGIN = 3X3.
APPEND BDCDATA.
ENDFORM.
*----------------------------------------------------------------------*
* I!sert 0ie(7 *
*----------------------------------------------------------------------*
FORM BDC2FIELD USING FNAM FHAL.
IF FHAL CD NODATA.
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FHAL = FHAL.
APPEND BDCDATA.
ENDIF.
ENDFORM.
SAP AG BC420 12-88

You might also like