SAP details:     Events  -  News -   Training  -  World wide sites  -  Sap Labs   -   SAP Magazine  -   SAP Screen saver -   Stock Price

BATCH INPUT Object   (for ver 4X)


1.    What is the use of Batch Input object  ?

Batch Input is a SAP functionality that allows automating input of data via SAP transactions, commonly known as BDC  (Batch Data Commands). BDC works in the following ways: 

  • the transaction is called directly within the calling program

  • the scenario is included in a session that could be launched afterwards.

In most companies, programs that handle Batch Input are duplicating the functions that builds this scenario, creates the session or calls the transactions.

Therefore, create a custome  Abap Object, eg. Z_BATCHINPUT.  This object should have all the needed functions and makes some basic checks (e.g. that the program is not creating two sessions at the same time). The main advantages of using an object are : 

  • Code is no more duplicated throughout all of the BI programs

  •  Way to submit the sessions becomes standardized.

The object class Z_BATCHINPUT should be created (and/or transported) into all target systems. It uses basically all the datatypes available for the BDC functions. It calls the following functions : 

·         BDC_OPEN_GROUP : Opens a session group

·         BDC_CLOSE_GROUP : Closes a session

·         BDC_INSERT : Insert a BDC scenario in the session

·         The ABAP statement "CALL TRANSACTION" is also called to run directly a transaction from its BDC table.

It runs the program RSBDCSUB in order to launch automatically the session. The session management is done through the transaction code SM35.

The object itself is maintanable through the transaction SE24.

Function of the object Z_BATCHINPUT

The above object should allow to handle three kinds of Batch Input behaviour : 

  1. Building a BDC table and calling a transaction

  2. Building a session and a set of BDC scenarios and keeping the session available in SM35,

  3. Building a session and lauching the transaction right after closing the session.

 To achieve these operations, the object Z_BATCHINPUT should  offer a set of methods :

Method

Description

Parameters

OPEN_SESSION

Opens a session

SUBRC (Return Code – 0 OK)

SESSIONNAME (Session to be created)

CLOSE_SESSION

Closes a session

None

RESET_BDCDATA

Resets the BDC Internal Table...

None. Normally, for internal purpose…

BDC_DYNPRO

Handles a new screen

PROGNAME (Name of the program)

DYNPRONR (Screen Number)

BDC_FIELD

Puts a value on the screen

FIELDNAME (Name of the field)

FIELDVALUE (Value to be passed)

CONSTRUCTOR

Constructor - Initializes NO_DATA

NODATA (No data character). The constructor is called automatically when the object is created.

RUN_SESSION

Launches a session with RSBDCBTC

None

CALL_TRANSACTION

Calls a transaction with the current BDC Data

MODE (Display Mode)

UPDATE (Update Mode)

TCODE (Transaction to be called)

BDC_INSERT

Inserts the BDC scenario in the session

TCODE (Transaction to be called)

To complete the different scenarii explained above, some sequences should be followed :

1)      Building a BDC table and calling a transaction :

  • the object batch input should be created (CREATE OBJECT => method CONSTRUCTOR)

  • the method RESET_BDCDATA could be called (if the object has already been used)

  • several methods BDC_DYNPRO and BDC_FIELD could be called…

  • then, at the last, the method CALL_TRANSACTION should be called.

2) Building a session and a set of BDC scenarios and keeping the session available in SM35 :

  • the object batch input should be created (CREATE OBJECT => method CONSTRUCTOR)

  • the method RESET_BDCDATA could be called (if the object has already been used),

  • several methods BDC_DYNPRO and BDC_FIELD could be called…

  • then, at the last, the method BDC_INSERT should be called.

  • At the end, the method CLOSE_SESSION MUST be called.

3) Building a session and lauching the transaction right after closing the session.

  • The previous steps should be followed (the ones explained for the session),

  • At the end, the method RUN_SESSION should be called (after the CLOSE_SESSION).

 Path

The Batch Input is described in the Help-On-Line (4.5B) under the following items :

R/3 Library -> BC Basis Components -> ABAP Workbench (BC-DWB) -> BC Basis Programming Interfaces -> Data Transfer

R/3 Library -> BC Basis Components -> Kernel Components (BC-KRN)  -> BC System Service -> Managing Batch Input Sessions 



 

 
 
 









   
 
PlanetSAP.com

Home     Post a article   Suggestion   Contact  

Disclaimer    Copyright; 1998-2001 Softron Systems, Inc. All rights reserved.