‎2006 Dec 19 5:58 AM
hello all
can any body give me an sample bdc program for upload to material masters
‎2006 Dec 19 6:28 AM
Hi vamsi,
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.
‎2006 Dec 19 6:31 AM
hi,
here are the links which will have some smaple programs
http://www.sap-img.com/abap/program-loads-the-material-assignment-of-routings.htm
http://www.guidancetech.com/people/holland/sap/abap/yusermod.htm
http://www.guidancetech.com/people/holland/sap/abap/zutbdcer.htm
http://www.sap-img.com/abap/learning-bdc-programming.htm
regards,
pankaj singh
‎2006 Dec 19 11:28 AM
Dear Vamshi,
Please refer to the following link.
http://www.sap-img.com/abap/upload-material-master-finish-goods.htm
It's a good example to start with.
Regards,
Abir
***********************************
Don't forget to award points *