‎2007 Apr 19 11:30 AM
‎2007 Apr 19 11:33 AM
hi
batch input method means BDC session method.
check this code
the function modules like this
&----
*& Form CALL_BDC_CLOSE_GROUP
&----
text
----
--> p1 text
<-- p2 text
----
FORM call_bdc_close_group.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
not_open = 1
queue_error = 2.
IF sy-subrc NE 0.
WRITE: /5 'BDC CLOSE GROUP FAILED, return code = ', sy-subrc.
EXIT.
ENDIF.
ENDFORM. " CALL_BDC_CLOSE_GROUP
&----
*& Form CALL_BDC_INSERT
&----
text
----
-->P_0545 text
----
FORM call_bdc_insert USING v_tran_code.
DATA: xmode VALUE 'E'.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = v_tran_code
TABLES
dynprotab = bdcdata
EXCEPTIONS
internal_error = 1
not_open = 2
queue_error = 3.
IF sy-subrc NE 0.
WRITE: /5 'BDC insert GROUP FAILED, return code = ', sy-subrc.
EXIT.
ENDIF.
ENDFORM. " CALL_BDC_INSERT
&----
*& Form display_data
&----
text
----
--> p1 text
<-- p2 text
----
FORM display_data.
WRITE:/ 'Press','''Upload''',
'to create session with the following records'.
regards
praveen
‎2007 Apr 19 11:33 AM
Hai,
You can have a lot of inforamation from below links and data:
Check these Links out
BDC does a CALL TRANSACTION. So each and every case (document, master data,...) is committed to the database on commit. The commit occurs after completion of the transaction.
Direct input will commit the data to the database when the commit is requested explicitly.
During BDC and direct input relevant DB tables are locked, they can not be updated by other processes. After commit they are unlocked.
Thus a program using direct input must care for intermittent commits to avoid an overflow of the lock tables. For master data, a lock table overflow may occur for more than (roughly) 2000 cases.
Although direct input does not do any screen input, the same routines are passed as BDC with (simulated) screen input
There is no diff between Direct input and BDC because Direct input is one of the methods in BDC to transfer external data into SAP system.
In BDC you can transfer data into SAP system using 3 methods,
1.session
2.call transaction.
3.Direct input.
Hope this helps you.
Reward points if it helps you.
Regds,
Rama chary.Pammi
‎2007 Apr 19 11:40 AM
Hi,
Check this info.
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.
Once you have program name, screen number, field name (screen field name), you can start writing DATA TRANSFER program.
Declaring internal table
First Integral Table similar to structure like local file.
Declaring internal table like BDCDATA
The data from internal table is not transferred directly to database table, it has to go through transaction. You need to pass data to particular screen and to particular screen-field. Data is passed to transaction in particular format, hence there is a need for batch input structure.
The batch input structure stores the data that is to be entered into SAP system and the actions that are necessary to process the data. The batch input structure is used by all of the batch input methods. You can use the same structure for all types of batch input, regardless of whether you are creating a session in the batch input queue or using CALL TRANSACTION.
This structure is BDCDATA, which can contain the batch input data for only a single run of a transaction. The typical processing loop in a program is as follows:
Create a BDCDATA structure
Write the structure out to a session or process it with CALL TRANSACTION USING; and then
Create a BDCDATA structure for the next transaction that is to be processed.
Within a BDCDATA structure, organize the data of screens in a transaction. Each screen that is processed in the course of a transaction must be identified with a BDCDATA record. This record uses the Program, Dynpro, and Dynbegin fields of the structure.
The screen identifier record is followed by a separate BDCDATA record for each value, to be entered into a field. These records use the FNAM and FVAL fields of the BDCDATA structure. Values to be entered in a field can be any of the following:
Data that is entered into screen fields.
Function codes that are entered into the command field. Such function codes execute functions in a transaction, such as Save or Enter.
The BDCDATA structure contains the following fields:
PROGRAM: Name of module pool program associated with the screen. Set this field only for the first record for the screen.
DYNPRO: Screen Number. Set this field only in the first record for the screen.
DYNBEGIN: Indicates the first record for the screen. Set this field to X, only for the first record for the screen. (Reset to (blank) for all other records.)
FNAM: Field Name. The FNAM field is not case-sensitive.
FVAL: Value for the field named in FNAM. The FVAL field is case-sensitive. Values assigned to this field are always padded on the right, if they are less than 132 characters. Values must be in character format.
Transferring data from local file to internal table
Data is uploaded to internal table by UPLOAD of WS_UPLOAD function.
Population of BDCDATA
For each record of internal table, you need to populate Internal table, which is similar to BDCDATA structure.
All these five initial steps are necessary for any type of BDC interface.
DATA TRANSFER program can call SESSION METHOD or CALL TRANSACTION. The initial steps for both the methods are same.
First step for both the methods is to upload the data to internal table. From Internal Table, the data is transferred to database table by two ways i.e., Session method and Call transaction.
Hope this resolves your query.
Reward all the helpful answers.
Regards