09-25-2007 4:06 PM
09-25-2007 4:10 PM
<b>bdcdata</b> holds the information of Program, Screen, Field and value for all components of a transaction...You can use <b>SHDB</b> to record BDC...
Greetings,
Blag.
09-25-2007 4:26 PM
hi
in abap any program exicutes by abap processer, abap processor exicuts the program sequentially step by step.
the internal table which you declare using bdcdata structure, you are going to fill by all the data with corresponding application field names and transaction code of corresponding application and the sequence of operations i.e enter '/00' save '/upda' etc..
when you are processing a record the bdcdata structure helps to abap processor to exicute all the process sequentially.
<b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada Galindo
12-14-2007 6:52 AM
Hi,
A BDC(Batch data communication) is a technique used for uploading the legacy data from an excel sheet or a text file in to SAP system.
The data present in a non-SAP system or legacy system is structured according to SAP database structure format and the file is provided to the BDC program for uploading the data into SAP system.
In the BDC program , we use the BDCDATA structure to hold the details of the SAP transaction to which we are trying to upload the data.
The structure of BDCDATA is
PROGRAM - Program name of the transaction's current screen
DYNPRO - Screen number of the transaction
DYNBEGIN - begin of the Screen number
FNAM - screen field name
FVAL - Value to be uploaded in to screen field
To upload data into the trascation screen,all the above details are necessary.
In BDC Call transaction method,
We use BDCDATA in the call transaction statement
as follows :
Example: CALL TRANSACTION 'LT01' USING
bdc_data MODE 'A'
UPDATE 'S'
MESSAGES INTO messtab.
Here bdc_data is ,
DATA : bdc_data LIKE bdcdata OCCURS 0 WITH HEADER LINE.
Message was edited by:
P Sreenivasulu
12-14-2007 7:02 AM
Hi,
Using the Data Transfer Data Structure
If you want to write data to a batch input session or to process the data using CALL TRANSACTION USINGor CALL DIALOG, you must prepare an internal table <bdc_tab>. This internal table must be structured according to ABAP Dictionary structure BDCDATA. The internal table <bdc_tab> stores the data that is to be entered into SAP System and the actions that are necessary to process the data. You can think of the table as storing the script that the SAP system is to follow in processing batch input data.
The graphic below shows how to declare the internal table <bdc_tab> in your ABAP program and the fields contained in the structure BDCDATA.
Process flow
...
1. Declare internal table <bdc_tab>.
2. Initialize the internal table before you call each new transaction.
3. At the beginning of each new screen, you must maintain the module pool name <program>, the screen number <dynpro> and a flag:
<bdc_tab>-PROGRAM = <program>.
<bdc_tab>-DYNPRO = <dynpro>.
<bdc_tab>-DYNBEGIN = 'X'.
APPEND <bdc_tab>.
4. For each field to which you want to assign values, insert an entry in the internal table. Specify the technical field name <fnam> and the field content <fval>:
<bdc_tab>-FNAM = <fnam>.
<bdc_tab>-FVAL = <fval>.
APPEND <bdc_tab>.
If the field is in a step loop or a table control, you must also specify the lines in which the input is to be entered. The field name extension displays the line number:
<bdc_tab>-FNAM = 'fieldx(5)'.
5. If you want to position the cursor on a particular field, enter the cursor position by filling field FNAM with the value BDC_CURSOR, and transferring into the field FVAL the technical name <tname> of the field where the cursor should be:
<bdc_tab>-FNAM = 'BDC_CURSOR'.
<bdc_tab>-FVAL = <tname>.
APPEND <bdc_tab>.
If you want to position the cursor on a field in a step loop or table control, you must also specify the lines in which the input is to be entered. The field name extension displays the line number:
<bdc_tab>-FVAL = 'fieldx(5)'.
6. Now specify which action is to be executed in this screen. You must determine the triggered function code <fcode> and assign this with the field FVAL. Note that the character '/' should always be placed before the function key number. The character '=' must be placed before all other function codes.
Assign value BDC_OKCODE to the field FNAM:
<bdc_tab>-FNAM = BDC_OKCODE.
<bdc_tab>-FVAL = <fcode>.
APPEND <bdc_tab>.
7. Execute steps 3 to 6 for each additional screen in the transaction.
8. After the last screen in the transaction, internal table <bdc_tab> is filled with all of the values required. You can now use this table to create an entry in a batch input session or to call the commands CALL TRANSACTION or CALL DIALOG.
The transaction to which a BDCDATA structure refers is identified separately. If your program writes data to a batch input session, then the transaction is specified in the call to the BDC_INSERT function module. This function module writes a BDCDATA structure out to the session. If your program processes data with CALL TRANSACTION USING, then the transaction is specified directly in this statement.
The following table shows what the contents of a BDCDATA structure might look like. This BDCDATA structure would add a line to a report in Transaction SE38, the ABAP Editor:
BDCDATA Structure for Adding a Line to a Report (Transaction SE38)
PROGRAM
DYNPRO
DYNBEGIN
FNAM
FVAL
SAPMS38M
0100
X
RS38M-PROGRAMM
<Name>
RS38M-FUNC_EDIT
X
BDC_OKCODE
=CHAP (Change function code)
SAPMSEDT
2310
X
RSTXP-TDLINECOM(1)
B-
SAPMSEDT
2310
X
BDC_CURSOR
RSTXP-TDLINECOM(1)
RSTXP-TDLINE(1)
BDC Test Text
BDC_OKCODE
/11 (Save function key)
SAPMSEDT
2310
X
BDC_OKCODE
/3 (Back function key)
SAPMS38M
0100
X
BDC_OKCODE
/15 (Quit function key)