Application Development 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: 

bdc tutorials

Former Member
0 Kudos

hi al

i want to start BDC

wat are the necessary steps which shud i follow to create bdc

i hav just this knowledge that it is used to upload data from flat file to

sap database

so friends can u give me the full explanation of bdc

and some tutorials for bdc

i need tutorials by exmaple

like bdc for mm01

and for mm02

thanx for any kind of help

1 ACCEPTED SOLUTION
6 REPLIES 6

Former Member
0 Kudos

Hi

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.

Differences between Call Transaction and Sessions Method:

Session method.

1) synchronous processing.

2) can tranfer large amount of data.

3) processing is slower.

4) error log is created

5) data is not updated until session is processed.

6) generally used for back ground jobs.

7) at atime we can update to more than one screens.

Call transaction.

1) asynchronous processing

2) can transfer small amount of data

3) processing is faster.

4) errors need to be handled explicitly

5) data is updated automatically

6) for background n fore ground jobs.

7) at atime we can update to a single screen.

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/

http://www.planetsap.com/bdc_main_page.htm

Regards

Anji

0 Kudos

can somebody give me a small example of a bdc program step by step

0 Kudos

Former Member
0 Kudos

Give the t-code shdb in the command field.

Click the new recording button.

Give a name to the recording and the t-code you want to record.

E.g.:

Recording : ZMAT_UPLOAD

Transaction code : MM01

When you click save, it takes you to t-code (MM01) you would like to do recording for upload.

Record carefully. Fill in the details you want to upload. In this case I have entered the material no, industry sector, material type, material description and basic unit of measure.

Then the Transaction recorder – edit recording ZMAT_UPLOAD screen is displayed. You can edit your recording or just save it and click back button.

Select your recording and click create program button.

Enter the program name say ZMAT_UPLOAD.Select the transfer from recording option. Save it.Give the program title, type as executable program and click source code button at the bottom.

The following piece of code is generated automatically.

report ZMAT_UPLOAD

no standard page heading line-size 255.

include bdcrecx1.

start-of-selection.

perform open_group.

perform bdc_dynpro using 'SAPLMGMM' '0060'.

perform bdc_field using 'BDC_CURSOR'

'RMMG1-MATNR'.

perform bdc_field using 'BDC_OKCODE'

'=AUSW'.

perform bdc_field using 'RMMG1-MATNR'

'MYMATERIAL10'.

perform bdc_field using 'RMMG1-MBRSH'

'P'.

perform bdc_field using 'RMMG1-MTART'

'ZOH'.

perform bdc_dynpro using 'SAPLMGMM' '0070'.

perform bdc_field using 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(01)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'MSICHTAUSW-KZSEL(01)'

'X'.

perform bdc_dynpro using 'SAPLMGMM' '4004'.

perform bdc_field using 'BDC_OKCODE'

'=BU'.

perform bdc_field using 'MAKT-MAKTX'

'MY MATERIAL10'.

perform bdc_field using 'BDC_CURSOR'

'MARA-MEINS'.

perform bdc_field using 'MARA-MEINS'

'G'.

perform bdc_field using 'MARA-MTPOS_MARA'

'NORM'.

perform bdc_transaction using 'MM01'.

Perform close_group.

From the above code it is clear that recording has been created using matnr = mymaterial10 , industry sector = p , material type = zoh , description = my material10 , basic unit of measure = g. For our case I have assumed industry sector and material type to be constant and have not included in flat file.

The bold lines in the below code are the changes made to the sap generated program , to upload our data.

report ZMAT_UPLOAD

no standard page heading line-size 255.

types declaration..........................................................................

<b>types : begin of t_mat,

matnr(20),

desc(50),

uom(5),

end of t_mat.</b>

internal table and workarea declaration.......................................

<b>data : i_mat type table of t_mat.

data : wa_mat type t_mat.</b>

include bdcrecx1.

start-of-selection.

moving the flat file content to internal table................................

<b>CALL FUNCTION 'UPLOAD'

EXPORTING

FILETYPE = 'DAT'

TABLES

data_tab = i_mat

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.</b>

perform open_group.

<b>loop at i_mat into wa_mat.</b>

perform bdc_dynpro using 'SAPLMGMM' '0060'.

perform bdc_field using 'BDC_CURSOR'

'RMMG1-MATNR'.

perform bdc_field using 'BDC_OKCODE'

'=AUSW'.

perform bdc_field using 'RMMG1-MATNR'

<b>wa_mat-matnr.</b>

perform bdc_field using 'RMMG1-MBRSH'

'P'.

perform bdc_field using 'RMMG1-MTART'

'ZOH'.

perform bdc_dynpro using 'SAPLMGMM' '0070'.

perform bdc_field using 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(01)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'MSICHTAUSW-KZSEL(01)'

'X'.

perform bdc_dynpro using 'SAPLMGMM' '4004'.

perform bdc_field using 'BDC_OKCODE'

'=BU'.

perform bdc_field using 'MAKT-MAKTX'

<b>wa_mat-desc.</b>

perform bdc_field using 'BDC_CURSOR'

'MARA-MEINS'.

perform bdc_field using 'MARA-MEINS'

<b>wa_mat-uom</b>.

perform bdc_field using 'MARA-MTPOS_MARA'

'NORM'.

perform bdc_transaction using 'MM01'.

endloop.

Perform close_group.

Run this program, and create a session.

Then go to SM35, select the name of the session and process.

The data will be uploaded..

<b>Hope this is helpful, Do reward.</b>

0 Kudos

thanx all for ur kind support