BDC & File Handling
BDC & File Handling
BDC & File Handling
Objective:
Definition :
Batch Data Communication (BDC) is the process of
transferring data from one SAP System to another SAP
system or from a non-SAP system to SAP System.
Features :
Types of BDC :
CALL TRANSACTION
Asynchronous processing.
Queue file
Batch
Batch input
input function
function
SAP
SAP R/3
R/3
Customer
data
Flight
connections
Reservation
data
Call Transaction
USING BDCDATA
MODE 'M' UPDATE 'U'
MESSAGES INTO MESSTAB.
Steps Involved
Direct Input
To enhance the batch input procedure, the system offers the
direct input technique, especially for transferring large
amounts of data.
No sessions are created
Stores the data directly into SAP tables
It does not process screens.
The system calls a number of function modules for
necessary data checks.
In case of errors, restart mechanism is available
Application
RFBIBL00
FI
RMDATIND MM
RVAFSS00
SD
RAALTD11
AM
RKEVEXT0 CO-PA
<transaction code>
<transaction
code>
USING
<BDC
table>
USING
<BDC
table>
MODE
mode>mode>
MODE <display
<display
UPDATE
<update
mode>
UPDATE
<update
mode>
MESSAGES INTO
<messtab>
MESSAGES
INTO
<messtab>
<display
<display mode>:
mode>:
<display
mode>:
AA
EE
NN
Display allall
Display
Display only
if there
are errors
Display
only
if there
are errors
Display nothing
Display
nothing
<update
<update mode>:
mode>:
<update
mode>:
SS
Do not
processing
until until
Do
notcontinue
continue
processing
update has
finished
(synchronous)
update
has
finished
(synchronous)
AA
Continue processing
immediately
Continue
processing
immediately
Session
Batch
input
Return
Return code
code
No
No
CALL
CALL TRANSACTION
TRANSACTION
Yes
Yes
Database
Update
Error logging
Synchronous
Yes
Asynchronous/Synchronous
No
Processing
Processing
Time-delayed
Time-delayed
Immediately
Immediately
Transactions
Only One
Error Log
Will be created
Will not be
created
READ DATASET
A S
TRANSFER
UPLOAD
P S
DOWNLOAD
OPEN DATASET
CLOSE DATASET
DELETE DATASET
READ DATASET
TRANSFER
OPEN DATASET
Opens the specified file. If you do not use any additions,
the file is opened for reading in binary mode. It returns
SY-SUBRC = 0 if the file is opened successfully.
Otherwise SY-SUBRC = 8.
Syntax
OPEN DATASET <dsn> [Additions].
Additions:
1.
2.
3.
4.
5.
6.
7.
8.
9.
FILTER f.
CLOSE DATASET
Closes the specified file.
Syntax
CLOSE DATASET <dsn>.
DELETE DATASET
Deletes the file specified file. If it deletes the file
successfully it returns SY-SUBRC = 0. Otherwise returns SYSUBRC = 4. The possible reasons for failing are:
TRANSFER statement
Used to write a record into a file.
Syntax
TRANSFER f TO dsn.
Transfers the data object f to a sequential file whose name
is specified in dsn. dsn can be a field or a literal. You must
already have opened the file. . If the specified file is not
already open, TRANSFER attempts to open the file FOR
OUTPUT IN BINARY MODE. If this is not possible, a runtime
error occurs.f can be a field, a string, or a structure.
CODEPAGE
Only for download in DOS
FILENAME
The name of the file that is to be generated on the
presentation server( if necessary with predefined path
name). If the path doesnt exist or the file cannot be opened,
an exception will be raised.
FILE_WRITE_ERROR
the file.
INVALID_FILE_SIZE
either zero
size.
FILENAME
Name of the file
FILETYPE
The source file type. Valid values are:
BIN : Binary files.
ASC: ASCII files, text files with end-of-line markers.
DAT: The file is loaded line by line into the transferred
table.
Tabs in the file mean a change of field.
Summary
Exercise:
Write a batch input program for transaction MM01 using
following data from a local file.Length of the each field is
also given.
Material
Material Basic Data1
Of
type
Group
Measure
(1)
(4)
(1)
(3)
BOH
KG
Basic Data2
(1)
Description
(40)
Material1
Unit
START-OF-SELECTION.
*Uploading data from the local file C:\Vendor1.txt
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = 'C:\MARA.TXT '
FILETYPE = 'DAT'
TABLES
DATA_TAB = RECORD.
Thank You