06-11-2007 8:24 AM
06-11-2007 8:27 AM
hi,
batch input is nothing but BDC
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 :
BDC is an automatic procedure.
This method is used to transfer large amount of data that is available in electronic medium.
BDC can be used primarily when installing the SAP system and when transferring data from a legacy system (external system).
BDC uses normal transaction codes to transfer data.
Types of BDC :
CLASSICAL BATCH INPUT (Session Method)
CALL TRANSACTION
BATCH INPUT METHOD:
This method is also called as CLASSICAL METHOD.
Features:
Asynchronous processing.
Synchronous Processing in database update.
Transfer data for more than one transaction.
Batch input processing log will be generated.
During processing, no transaction is started until the previous transaction has been written to the database.
CALL TRANSACTION METHOD :
This is another method to transfer data from the legacy system.
Features:
Synchronous processing. The system performs a database commit immediately before and after the CALL TRANSACTION USING statement.
Updating the database can be either synchronous or asynchronous. The program specifies the update type.
Transfer data for a single transaction.
Transfers data for a sequence of dialog screens.
No batch input processing log is generated.
For BDC:
http://myweb.dal.ca/hchinni/sap/bdc_home.htm
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&;
http://www.sap-img.com/abap/learning-bdc-programming.htm
http://www.sapdevelopment.co.uk/bdc/bdchome.htm
http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm
http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html
Check these link:
http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
http://www.sap-img.com/abap/question-about-bdc-program.htm
http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
06-11-2007 8:31 AM
HI,
this is a technique to update the sap database from non-sap database.
non-sap data will be stored to some flat file first and the it will be moved to sap data base.
here is an example which will update the purchase order details from flat file check it.
report ZBH_PURORDER no standard page heading line-size 255.
PARAMETERS:P_FILE LIKE IBIPPARMS-PATH.
DATA FILENAME TYPE STRING.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = sy-cprog
dynpro_number = sy-dynnr
IMPORTING
file_name = P_FILE.
START-OF-SELECTION.
FILENAME = P_FILE.
DATA:BEGIN OF XTAB OCCURS 0,
TYP,
DES(255) TYPE C,
END OF XTAB.
DATA:BEGIN OF ITAB OCCURS 0,
SUPERFIELD LIKE MEPO_TOPLINE-SUPERFIELD,
EKORG LIKE MEPO1222-EKORG,
EKGRP LIKE MEPO1222-EKGRP,
BUKRS LIKE MEPO1222-BUKRS,
END OF ITAB.
DATA:BEGIN OF JTAB OCCURS 0,
N(4) TYPE C,
EMATN LIKE MEPO1211-EMATN,
MENGE(13) TYPE C,
NETPR(13) TYPE C,
NAME1 LIKE MEPO1211-NAME1,
END OF JTAB.
DATA:BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
DATA:DELIMITER VALUE '*'.
DATA A TYPE I.
DATA M(4) TYPE N.
DATA L_FNAM(30) TYPE C.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FILENAME
FILETYPE = 'ASC'
TABLES
DATA_TAB = XTAB.
LOOP AT XTAB.
IF XTAB-TYP = 'H'.
SPLIT XTAB-DES AT DELIMITER INTO ITAB-SUPERFIELD ITAB-EKORG ITAB-EKGRP
ITAB-BUKRS.
JTAB-N = JTAB-N + 1.
APPEND ITAB.
ELSEIF XTAB-TYP = 'I'.
SPLIT XTAB-DES AT DELIMITER INTO JTAB-EMATN JTAB-MENGE JTAB-NETPR
JTAB-NAME1.
APPEND JTAB.
ENDIF.
ENDLOOP.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = 'PORDER'
KEEP = 'X'
USER = SY-UNAME.
LOOP AT ITAB.
A = SY-TABIX.
REFRESH BDCTAB.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'BDC_CURSOR'
'MEPO_TOPLINE-SUPERFIELD'.
perform bdc_field using 'MEPO_TOPLINE-BSART'
'NB'.
perform bdc_field using 'MEPO_TOPLINE-SUPERFIELD'
ITAB-SUPERFIELD.
perform bdc_field using 'MEPO_TOPLINE-BEDAT'
'09.02.2007'.
perform bdc_field using 'DYN_6000-LIST'
' 1'.
perform bdc_field using 'BDC_OKCODE'
'=MEV4000BUTTON'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'MEPO_TOPLINE-BSART'
'NB'.
perform bdc_field using 'MEPO_TOPLINE-SUPERFIELD'
ITAB-SUPERFIELD.
perform bdc_field using 'MEPO_TOPLINE-BEDAT'
'09.02.2007'.
perform bdc_field using 'BDC_CURSOR'
'MEPO1222-EKORG'.
perform bdc_field using 'MEPO1222-EKORG'
ITAB-EKORG.
perform bdc_field using 'MEPO1222-EKGRP'
ITAB-EKGRP.
perform bdc_field using 'MEPO1222-BUKRS'
ITAB-BUKRS.
perform bdc_field using 'DYN_6000-LIST'
' 1'.
perform bdc_field using 'BDC_OKCODE'
'=MEV4001BUTTON'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'MEPO_TOPLINE-BSART'
'NB'.
perform bdc_field using 'MEPO_TOPLINE-SUPERFIELD'
ITAB-SUPERFIELD.
perform bdc_field using 'MEPO_TOPLINE-BEDAT'
'09.02.2007'.
perform bdc_field using 'MEPO1222-EKORG'
ITAB-EKORG.
perform bdc_field using 'MEPO1222-EKGRP'
ITAB-EKGRP.
perform bdc_field using 'MEPO1222-BUKRS'
ITAB-BUKRS.
M = 1.
LOOP AT JTAB.
IF JTAB-N = A.
WRITE:/ JTAB.
CONCATENATE 'MEPO1211-EMATN(' M ')' INTO L_FNAM.
perform bdc_field using 'BDC_CURSOR'
L_FNAM.
perform bdc_field using L_FNAM
JTAB-EMATN.
CONCATENATE 'MEPO1211-MENGE(' M ')' INTO L_FNAM.
perform bdc_field using L_FNAM
JTAB-MENGE.
CONCATENATE 'MEPO1211-NETPR(' M ')' INTO L_FNAM.
perform bdc_field using L_FNAM
JTAB-NETPR.
CONCATENATE 'MEPO1211-NAME1(' M ')' INTO L_FNAM.
perform bdc_field using L_FNAM
JTAB-NAME1.
M = M + 1.
ENDIF.
ENDLOOP.
perform bdc_field using 'DYN_6000-LIST'
' 1'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLMEGUI' '0014'.
perform bdc_field using 'MEPO_TOPLINE-BSART'
'NB'.
perform bdc_field using 'MEPO_TOPLINE-SUPERFIELD'
ITAB-SUPERFIELD.
perform bdc_field using 'MEPO_TOPLINE-BEDAT'
'09.02.2007'.
perform bdc_field using 'MEPO1222-EKORG'
ITAB-EKORG.
perform bdc_field using 'MEPO1222-EKGRP'
ITAB-EKGRP.
perform bdc_field using 'MEPO1222-BUKRS'
ITAB-BUKRS.
perform bdc_field using 'DYN_6000-LIST'
' 1'.
perform bdc_field using 'BDC_CURSOR'
'MEPO1319-MATKL'.
perform bdc_field using 'MEPO1319-SPINF'
'X'.
perform bdc_field using 'BDC_OKCODE'
'=MESAVE'.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'ME21N'
TABLES
DYNPROTAB = BDCTAB.
ENDLOOP.
CALL FUNCTION 'BDC_CLOSE_GROUP'.
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDCTAB.
BDCTAB-PROGRAM = PROGRAM.
BDCTAB-DYNPRO = DYNPRO.
BDCTAB-DYNBEGIN = 'X'.
APPEND BDCTAB.
ENDFORM.
FORM BDC_FIELD USING FNAM FVAL.
CLEAR BDCTAB.
BDCTAB-FNAM = FNAM.
BDCTAB-FVAL = FVAL.
APPEND BDCTAB.
ENDFORM.
FLAT FILE:
H1171611000001*1000
ICPU116000*1000
ILEY BOARD1010000*1000
IMOUSE66000*1000
H1171711000001*1000
ICPU580000*1000
H1171701000001*1000
IMOUSE33000*1000
ILEY BOARD1010000*1000
reward if helpful.
rgds,
bharat.
06-11-2007 8:31 AM
hi,
Advantages offered by BATCH INPUT method:
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.
Prerequisite for Data Transfer Program
Writing a Data Transfer Program involves following prerequisites:
Analyzing data from local file
Analyzing transaction
Analyzing transaction involves following steps:
The transaction code, if you do not already know it.
Which fields require input i.e., mandatory.
Which fields can you allow to default to standard values.
The names, types, and lengths of the fields that are used by a transaction.
Screen number and Name of module pool program behind a particular transaction.
To analyze a transaction::
Start the transaction by menu or by entering the transaction code in the command box.
(You can determine the transaction name by choosing System Status.)
Step through the transaction, entering the data will be required for processing your batch input data.
On each screen, note the program name and screen (dynpro) number.
(dynpro = dyn + pro. Dyn = screen, pro = number)
Display these by choosing System Status. The relevant fields are Program (dynpro) and Dynpro number. If pop-up windows occur during execution, you can get the program name and screen number by pressing F1 on any field or button on the screen.
The technical info pop-up shows not only the field information but also the program and screen.
For each field, check box, and radio button on each screen, press F1 (help) and then choose Technical Info.
Note the following information:
- The field name for batch input, which youll find in its own box.
- The length and data type of the field. You can display this information by double clicking on the Data Element field.
Find out the identification code for each function (button or menu) that you must execute to process the batch-input data (or to go to new screen).
Place the cursor on the button or menu entry while holding down the left mouse button. Then press F1.
In the pop-up window that follows, choose Technical info and note the code that is shown in the Function field.
You can also run any function that is assigned to a function key by way of the function key number. To display the list of available function keys, click on the right mouse button. Note the key number that is assigned to the functions you want to run.