Abap Part Iii: Lesson 01: Batch Data Communication
Abap Part Iii: Lesson 01: Batch Data Communication
Abap Part Iii: Lesson 01: Batch Data Communication
Data is transferred from an external system into the SAP R/3 System
Data Transfer is used when,
▪ Transfer data from an external system into an R/3 System as it is installed.
▪ Transfer data regularly from an external system into an R/3 System.
SAP applications support the data transfer of numerous SAP business
objects
The data transfer program specifies the data format definition that is
necessary to import the data into the R/3 System.
Once the data has been exported it can be imported into the system
using a generated data transfer program.
The system picks the data from Database using ABAP/4 program and
feeds it to an SAP system using the corresponding transaction screen by
screen
Using BDC the data can be transferred both at once and periodically
depending on the users’ requirement.
SAP
SAP
Non-SAP
▪ Inbound.
• Data transfer from External System into SAP
SAP
SAP
Non-SAP
There are three ways to transfer the data into SAP from any external
system.
▪ SESSION METHOD
▪ CALL TRANSACTION
▪ DIRECT INPUT.
Direct Inputs are standard programs to post the data into SAP.
Analyzing Transaction
▪ Presentation Server
▪ Application Server
If the flat file resides on the presentation server the function module
GUI_UPLOAD is used.
▪ Filename
▪ FileType
▪ Has_field_seperator
▪ Data_tab
▪ READ DATASET <dsn> INTO <f> [LENGTH <len>] for Reading Data from Files
Loop this internal table and employ any of the below mentioned methods
of data transfer
▪ CALL TRANSACTION
▪ SESSION METHOD
▪ DIRECT INPUT
The entire batch input process takes place inline in the program.
– Where
<tcode> : Transaction code.
<bdc_tab> : Internal table of structure BDCDATA.
<mode> : Display mode.
<update>: Update mode.
<BDCMSGCOLL_TAB> : Internal table of structure BDCMSGCOLL.
After the BDC table has been built, it has to be submitted for SAP
Processing
▪ ‘A’ - stands for ‘Display all’. All screens and the data that goes in them appear
when we run the program.
▪ ‘N’ - stands for ‘No display’. All screens are processed invisibly, regardless of
whether there are errors or not. Control returns to the program as soon as
transaction processing is finished.
▪ ‘E’ - stands for ‘Display errors only’. The transaction goes into display mode as
soon as an error in one of the screens is detected. The errors can then be
corrected .
▪ A’ - ‘Asynchronous updating’.
• The called transaction does not wait for any updates it produces, to be
completed.
• Results in faster execution of the data transfer program.
• ’Asynchronous processing’ is NOT recommended for processing any larger
amount of data because the called transaction receives no completion
message from the update module in asynchronous updating.
• The calling data transfer program, in turn, cannot determine whether a called
transaction ended with a successful update of the database or not.
▪ The called transaction waits for any updates that it produces to be completed.
▪ Execution is slower than with asynchronous updating because called
transactions wait for updating to be completed.
▪ The called transaction will return any update error message that occurs to the
program.
▪ If the data is updated locally, the update of the database will not be processed
in a separate process, but in the process of the calling program.
In Call transaction there is no such log file available and error record is
lost unless handled.
The second way of data transfer is by submitting the BDC session to the
system for batch processing.
It’s placed into the SAP batch queue for later processing.
There is a transaction as SM35 which allows the user to view the results
of a batch job that has been processed by the system.
The data that a session enters into transaction screens is subject to the
same consistency checking as in normal interactive operation.
There are three functional modules to be called from BDC Program for
submitting the transactions for processing
Asynchronous processing
The batch input program must not open a session until it has closed the
preceding session.
▪ A session must be closed before another session is open from the same
program.
▪ A new call to BDC_OPEN_GROUP with the same session name creates a new
session with the same name.
▪ Repeat from the Step 2, for each transaction, when multiple transactions has
to be processed through the same Session.
▪ Automatically
▪ Explicitly
RSBDCSUB checks for and starts any batch input sessions that has not
yet been run.
If there are batch input scheduled to run regularly, separate jobs can
be scheduled for each of the scheduled data transfers.
The start time for the RSBDCSUB job can be set according to the batch
input schedule.
Session name
Usually, the system will run batch input sessions automatically. However,
it can also be started manually for the following reasons:
To start the session, mark the session and choose PROCESS from the
toolbar
Choose how to run a session and with what logging and display options
Run Modes
▪ Process/foreground:
• Transactions that contain errors can be corrected and step through transactions that
have not yet been executed.
▪ Background:
• This mode is used to schedule a session for immediate processing in the background
processing facility.
▪ The batch input system keeps a detailed log of each session that is
processed.
▪ The log contains not only progress messages from the batch input
system itself, but also error messages from the transactions that are
processed.
▪ A session log is kept only if the session was generated with the KEEP
option or if the session is aborted or contains an error.
Sessions in the session queue are sorted by date and time of generation
and are grouped in different lists according to their status.
Possible statuses are as follows:
▪ New:
• Session was created and recorded but not yet processed.
▪ Incorrect :
• Held in the session queue because of errors in transactions (Errors in sessions)
• A session can be restarted to correct the erroneous transactions with one of the
interactive execution modes offered by the batch input system.
▪ Processed:
• It refers to all those sessions that have been successfully run.
• The log generated can be displayed by the session.
• All completed sessions generate a log.
• A completed session cannot be run a second time.
• Note:
• Only sessions that were generated with the KEEP option are held in the queue
after processing.
• Other sessions are deleted after they are successfully completed.
▪ In processing:
• This status is seen only if the queue is displayed while a session is being run.
▪ In Background:
• This status appears only if the Session is processed in the Background Mode
▪ Being Created:
• This status is seen only if the queue is displayed while a session is being generated
▪ Locked:
• Status when the session is locked
The direct input program used for material master records is RMDATIND.
▪ It performs the following functions:
• Creating material master records MM01
• Changing material master records MM02
To enhance the batch input procedure, the system offers the direct input
technique, especially for transferring large amounts of data.
In contrast to batch input, this technique does not create sessions, but
stores the data directly.
It does not process screens.
To enter the data into the corresponding database tables directly, the
system calls a number of function modules that execute any necessary
checks.
In case of errors, the direct input technique provides a restart
mechanism.
However, to be able to activate the restart mechanism, direct input
programs must be executed in the background only.
To maintain and start these programs, use program RBMVSHOW or
Transaction BMV0.