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

Former Member
0 Kudos

hello,

how to create a BDC ? What is the purpose of creating one. can anyone share any sample BDC's. is a BDC different from a normal ABAP program.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

If u want to call a transaction and goto a particular screen as soon as u call the transaction, u can record the flow in BDC.

That is u have to goto SHDB transaction for recording and then specify the transaction code then pass the values and once u reach the screen, press save button and press back.

Code will get automatically generated.

Then u can copy and paste the part of the code that is needed.

A sample code for calling MM03 transaction from an ALV. When u click on the MATNR of the ALV grid this will call transaction. U can perform this


Declare a messtab
DATA: i_bdcdata TYPE STANDARD TABLE OF bdcdata,
* Internal table to hold BDC messages
i_messtab TYPE STANDARD TABLE OF bdcmsgcoll

* Work area to hold bdcdata value
DATA: w_bdcdata TYPE bdcdata,
* Work area to hold BDC messages
w_messtab TYPE bdcmsgcoll.
CONSTANTS : c_e type bdcmsgcoll-msgtyp value 'E', "E
c_a type bdcmsgcoll-msgtyp value 'A', "A
nodata type c value '/'. "/
perform f1000_bdc_mm03 using lv_matnr lv_werks.
FORM f1000_bdc_mm03 USING P_LV_MATNR
P_LV_WERKS.

perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMMG1-MATNR'
p_lv_matnr.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(15)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(15)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0080'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-WERKS'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-WERKS'
p_lv_werks.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=ZU01'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_dynpro using 'SAPLMGMM' '4300'.
perform bdc_field using 'BDC_OKCODE'
'=ZU08'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_dynpro using 'SAPLMGMM' '4110'.
perform bdc_field using 'BDC_OKCODE'
'=GESV'.
*perform bdc_field using 'BDC_CURSOR'
* 'RMMG1-MATNR'.
call transaction 'MM03' using i_bdcdata MODE 'N'MESSAGES INTO i_messtab.

Hope this helps u.

Kindly reward points and mark the thread as closed by clicking the blue star.

11 REPLIES 11

Former Member
0 Kudos

BDC's are to update / create the the standard transaction.

Sameple program will be send shortly.

Former Member
0 Kudos

Hi Ravi;

A good place to start is transaction SHDB. That will walk you through the recording and show you the output from all the screens.

The difference between that an a normal ABAP program is that the BDC program will take you through a series of screens to enter data into the system as it should, rather than update tables directly.

Check out this example:

http://www.sapgenie.com/abap/bdc.htm

Cheers,

John

Former Member
0 Kudos

If you want to post a transaction data like sale order or invoice or to any transaction, it will be difficult to post the user one by one if he has couple of orders to create. So, users will put that data in a text file.

So BDC program will upload that data and then post that data by calling that transaction. By this method we can post any no. of sales orders. for this we need to record the transaction flow and populate the fields and we will call that tranaction multiple times.

Cheers,

Satya

Former Member
0 Kudos

Ravi,

BDC are used for follwoing scenarios mostly:

1. Mass Upload of Data

2. allowed to do some activity repeatedly for large amout of data where User Interaction becomes Hectic.

<b> Major use would be for DATA TRANSFER!!!!!

It allows us to automate some transaction for which we have data.</b>

Following documents would give u some brief idea on <b>Batch Data communication</b> :

http://help.sap.com/saphelp_erp2005/helpdata/en/fa/097119543b11d1898e0000e8322d00/frameset.htm

Thanks

Kam

Note: Dont forget to allot points, if link document was useful.

Message was edited by: Kam

0 Kudos

thanks all.

0 Kudos

Ravi,

Allot points for helped SDN members!!!

cheers

kam

0 Kudos

kam,

i allotted pts to all a long time back, i assigned 6 for u. do let me know if it doesn't show up but it shows up for me.

confirm this so that i can assign it again.

thanks

0 Kudos

Ravi,

Thanks for assigning the points for all Persons who help u.

Cheers,

Kam

0 Kudos

Hi,

Step 1:First go to SHDB transaction.

Step 2:Give the name of the transaction you want to record and enter some name for recording.

Step 3:Fill the required fields while recording.

Step 4:After the recording is completed,replace the value by the variable or anything related to that in your program.

Check this link.You can find lot of information about BDC with examples.

http://www.sap-img.com/abap.htm

Kindly reward points if it helps you.

0 Kudos

many thanks judith and jayanthi.

jayanthi -- i wanted to assign more but i had only 10 and 2 left. sorry abt that. thanks again all.

Former Member
0 Kudos

Hi,

If u want to call a transaction and goto a particular screen as soon as u call the transaction, u can record the flow in BDC.

That is u have to goto SHDB transaction for recording and then specify the transaction code then pass the values and once u reach the screen, press save button and press back.

Code will get automatically generated.

Then u can copy and paste the part of the code that is needed.

A sample code for calling MM03 transaction from an ALV. When u click on the MATNR of the ALV grid this will call transaction. U can perform this


Declare a messtab
DATA: i_bdcdata TYPE STANDARD TABLE OF bdcdata,
* Internal table to hold BDC messages
i_messtab TYPE STANDARD TABLE OF bdcmsgcoll

* Work area to hold bdcdata value
DATA: w_bdcdata TYPE bdcdata,
* Work area to hold BDC messages
w_messtab TYPE bdcmsgcoll.
CONSTANTS : c_e type bdcmsgcoll-msgtyp value 'E', "E
c_a type bdcmsgcoll-msgtyp value 'A', "A
nodata type c value '/'. "/
perform f1000_bdc_mm03 using lv_matnr lv_werks.
FORM f1000_bdc_mm03 USING P_LV_MATNR
P_LV_WERKS.

perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMMG1-MATNR'
p_lv_matnr.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(15)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(15)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0080'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-WERKS'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-WERKS'
p_lv_werks.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'=ZU01'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_dynpro using 'SAPLMGMM' '4300'.
perform bdc_field using 'BDC_OKCODE'
'=ZU08'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_dynpro using 'SAPLMGMM' '4110'.
perform bdc_field using 'BDC_OKCODE'
'=GESV'.
*perform bdc_field using 'BDC_CURSOR'
* 'RMMG1-MATNR'.
call transaction 'MM03' using i_bdcdata MODE 'N'MESSAGES INTO i_messtab.

Hope this helps u.

Kindly reward points and mark the thread as closed by clicking the blue star.