Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Difference between Batch input and Direct Input

Former Member
0 Likes
4,432

Hi please tell me the difference between Batch Input and Direct Input in BDC?

6 REPLIES 6
Read only

former_member404244
Active Contributor
0 Likes
2,310

Hi,

welcome to SDN

chek this link..

reward points if u find useful.

http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm

Regards,

Nagaraj

Read only

Former Member
0 Likes
2,310

<b>DIRECT INPUT</b>

About Direct Input

In contrast to batch input, this technique does not create sessions, but stores the data directly. It does not simulate the online transaction. 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. Direct input checks the data thoroughly and then updates the database directly.

You can start a Direct Input program in two ways;

Start the program directly

This is the quickest way to see if the program works with your flat file. This option is possible with all direct input programs. If the program ends abnormally, you will not have any logs telling you what has or has not been posted. To minimize the chance of this happening, always use the check file option for the first run with your flat file. This allows you to detect format errors before transfer.

Starting the program via the DI administration transaction

This transaction restarts the processing, if the data transfer program aborts. Since DI document are immediately posted into the SAP D/B, the restart option prevents the duplicate document posting that occurs during a program restart (i.e., without adjusting your flat file).

Direct input is usually done for standard data like material master, FI accounting document, SD sales order and Classification for which SAP has provided standard programs.

First time you work with the Direct Input administration program, you will need to do some preparation before you can transfer data:

- Create variant

- Define job

- Start job

- Restart job

Common batch input errors

- The batch input BDCDATA structure tries to assign values to fields which do not exist in the current transaction screen.

- The screen in the BDCDATA structure does not match the right sequence, or an intermediate screen is missing.

- On exceptional occasions, the logic flow of batch input session does not exactly match that of manual online processing. Testing the sessions online can discover by this.

- The BDCDATA structure contains fields, which are longer than the actual definition.

- Authorization problems.

<b>Advantages offered by BATCH INPUT method:</b>

1. Can process large data volumes in batch.

2. Can be planned and submitted in the background.

3. No manual interaction is required when data is transferred.

4. Data integrity is maintained as whatever data is transferred to the table is through transaction. Hence batch input data is submitted to all the checks and validations.

To implement one of the supported data transfers, you must often write the program that exports the data from your non-SAP system. This program, known as a “data transfer” program must map the data from the external system into the data structure required by the SAP batch input program.

The batch input program must build all of the input to execute the SAP transaction.

Two main steps are required:

• To build an internal table containing every screen and every field to be filled in during the execution of an SAP transaction.

• To pass the table to SAP for processing.

refer :

Read only

Former Member
0 Likes
2,310

hi

good

Call Transaction:

Speed.

Synchronous process.

SYnc. and Async both update possible.

Error handling thro Message structure BDCMSGCOLL.

Single Transaction.

Batch Input Session:

Slow.

Asynchronous process.

SYnc. update possible.

Error log is created in the SM35.

Multiple Transaction possible.

Direct Input.

Without calling the screens but all the validations should be done and only for master datas upload.

Direct Input method:

1. Only for error free datas and also master data

updation.

2. It will directly updates the database table. No

screens involved.

3. Transaction BMVO or Program RBMVSHOW has been

used.

BDC(Batch Input Session):

1. Screens will be called programmatically.

2. First sessions will be created then we'll run the seesions in SM35 transaction.

3.Synchronous database update. After the processing the session only database update will occur.

reward point if helpful.

thanks

mrutyun^

Read only

Former Member
0 Likes
2,310

hi aparna,

<b>DIRECT INPUT</b>

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. DIRECT INPUT CHECKS THE DATA THOROUGHLY AND THEN UPDATES THE DATABASE DIRECTLY.

TO MAINTAIN AND STRAT THESE PROGRAMS, USE PGM RBMVSHOW OR THE TRANSACTION BMVO.

<b>BATCH INPUT</b>

TYPES – SESSION METHOD, CALL TRANSACTION, DIRECT INPUT.

TO SAVE DATA IN THE BDCTAB, USE THE FIELDNAME ‘BDC_OKCODE’ AND FIELD VALUE OF ‘/11’.

BDCDATA

THIS IS A STRUCTURE WHICH CONTAINS THE FOLLOWING FIELDS.

PROGRAM – NAME OF TH MOD PROG ASSOCIATED WITH THE SCREEN. SET ONLY FOR THE FIRST RECORD OF THE SCREEN.

DYNPRO – SCREEN NUMBER. ALSO SET ONLY FOR FIRST RECORD.

DYNBEGIN – INDICATES THE FIRST RECORD OF THE SCREEN. SET ‘X’ FOR FIRST RECORD OTHERWISE ‘ ‘.

FNAM – FIELD NAME.

FVAL – VALUE FOR THE FIELD NAMED IN FNAM.

THE FIRST STEP IN BDC IS TO UPLOAD DATA FROM THE FLAT FILE OR SEQUENTIAL FILE TO THIS BDCTABLE.

SESSION METHOD

WE USE 3 FUNCTION MODULES IN THIS SESSION METHOD.

1) BDC_OPEN_GROUP

USER NAME: USER NAME

GROUP: NAME OF THE SESSION

LOCK DATE: THE DATE ON WHICH YOU WANT TO PROCESS THE SESSION.

KEEP: THIS PARAMETER IS PASSED AS ‘X’ WHEN YOU WANT TO RETAIN SESSION AFTER PROCESSING IT OR ‘ ‘ TO DELETE IT AFTER PROCESSING.

THIS CREATES A SESSION

2) BDC_INSERT

TCODE: TRANSACTION NAME

DYNPROTAB: BDC DATA

THIS CREATES A SEESION AND DATA IS TRANSFERRED O SESSION.

3) BDC_CLOSE_GROUP – THIS CLOSES THE BDC GROUP.

ONLY ONE SESSION CAN BE CREATED USING BDC_OPEN_GROUP. BUT MULTIPLE TRANSACTIONS CAN BE PROCESSED USING BDC_INSERT.

CALL TRANSACTION

CALL TRANSACTION <TCODE> USING <BDCTAB>

MODE <A/N/E>

UPDATE <S/A>

MESSAGES INTO <MSGTAB>.

A – ALL SCREEN MODE. ALL THE SCREEN OF THE TRANSACTION ARE DISPLAYED.

N – NO SCREEN MODE. NO SCREEN IS DISPLAYED WHEN YOU EXECUTE THE TRANSACTION.

E – ERROR SCREEN. IF THE SCREEN HAS ERROR RECORD, THEN THAT SCREEN WILL BE DISPLAYED.

S - IF YOU CHANGE DATA OF ONE TABLE THEN ALL THE RELATED TABLES GETS UPDATED. AND SY-SUBRC IS RETURNED I.E., SY-SUBRC IS RETURNED FOR ONCE AND ALL.

A - WHEN YOU CHANGE DATA OF ONE TABLE, THE SY-SUBRC IS RETURNED. AND THEN UPDATING OF OTHER AFFECTED TABLES TAKES PLACE. SO IF SYSTEM FAILS TO UPDATE OTHER TABLES, STILL SY-SUBRC RETURNED IS 0 (I.E., WHEN FIRST TABLE GETS UPDATED

WHEN YOU UPDATE DATABASE TABLE, OPERATION IS EITHER SUCCESSFUL OR UNSUCCESSFUL OR OPERATION IS SUCCESSFUL WITH SOME WARNING. THESE MESSAGES ARE STORED IN INTERNAL TABLE, WHICH YOU SPECIFY ALONG WITH MESSAGE STATEMENT. THIS INTERNAL TABLE SHOULD BE DECLARED LIKE BDCMSGCOLL, A STRUCTURE AVAILABLE IN ABAP/4. IT CONTAINS THE FOLLOWING FIELDS: TCODE, DYNAME, DYNUMB, MSGTYP, MSGID.

DIFFERENCE BETWEEN SESSION AND CALL TRANSACTION

SESSION METHOD CALL TRANSACTION

1. DATA IS NOT UPDATED IN DATABASE TABLE UNLESS SESSION IS PROCESSED. IMMEDIATE UPDATION IN DATABASE TABLE.

2. NO SY-SUBRC IS RETURNED. SY-SUBRC IS RETURNED.

3. ERROR LOG IS CREATED FOR ERROR RECORDS. ERRORS NEED TO BE HANDLED EXPLICITLY

4. UPDATION IN DATABASE TABLE IS ALWAYS SYNCHRONOUS

UPDATION IN DATABASE TABLE CAN BE SYNCHRONOUS OR ASYNCHRONOUS.

5. ASYNCHRONOUS PROCESSING SYNCHRONOUS PROCESSING

6. TRANSFERS DATA FOR SINGLE TRANSACTIONS TRANSFERS DATA FOR MULTIPLE TRANSACTIONS

ERROR HANDLING IN CALL TRANSACTION

1) CREATE AN INTERNAL TABLE SIMILAR TO THE STRUCTURE OF YOUR LOCAL FILE.

2) CREATE BDCTAB LIKE BDCDATA.

3) CREATE BDCMSG LIKE BDCMSGCOLL.

4) CREATE AN INTERNAL TABLE SIMILAR TO THE 1ST INTERNAL TABLE.

5) UPLOAD FN UPLOADS DATA FROM THE LOCAL FILE TO THE ITAB.

6) LOOP AT ITAB.

POPULATE BDCTAB TABLE.

CALL TRANSACTION STATEMENT.

PERFORM CHECK.

REFRESH BDCTAB.

ENDLOOP.

7) FORM CHECK.

IF SY_SUBRC <> 0.

CALL FUNCTION FORMAT_MESSAGE.

APPEND ITAB2.

ENDFORM.

TRANSACTION FOR RECORDING – SHDB.

MAX TIME ALLOWED FOR ONLINE EXECUTION – 300 SECONDS.

<b>

Pls reward if helpful.</b>

Read only

Former Member
0 Likes
2,310

Hi,

Batch input is a standard technique for transferring large sets of data into the SAP System. The transaction flow is simulated and the data is transferred as if it were entered online. The advantage of this is that all relevant checks of the transaction are executed, thereby ensuring that the data is consistent.

The batch input process is divided into two steps:

1. The data transfer program creates a batch input session that contains all the relevant data.

2. The batch input session is processed and the data it contains is transferred into the SAP System.

The Data Transfer Workbench only executes step 1.

The majority of SAP standard data transfer programs use the batch input technique. The data transfer program creates a batch input session which is processed later. Batch input sessions can be processed in various ways:

In the foreground

In the background

During processing, with error display

You should process batch input sessions in the foreground or using the error display if you want to test the data transfer. If you want to execute the data transfer or test its performance, process the sessions in the background.

Direct input (DINP)

With direct input, data from the data transfer file undergoes the same checks as with the online transaction and is then transferred directly into the SAP System. The database is updated directly with the transferred data.

Regards,

JLN

Read only

Former Member
0 Likes
2,310

Hi Aparna,

Batch Input (BI):--

- The Transaction is simulated & the data is transferred as if it had been executed online. Its slow process since its calling the screens. It mentions the error clearly.

- Error Log created automatically.

- Batch input session can’t be created in Parallel.

- BI procedure, data is always posted synchronously.

Direct Input:

Direct Input programs work exactly similar to Batch Input programs. But the only difference is, instead of processing screens they validate fields and directly load the data into tables using standard function modules in place of online Transaction screens. For this reason, DI programs are much faster than the BDC counterpart and so ideally suited for loading large volume data.

<b> Reward points if found useful.</b>

Regards,

Radhika Dasharatha.

Message was edited by:

Premraj Cheguri