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: 

Can anybody send sample BDC program for MM01 with DATAFILE

Former Member
0 Kudos
130

Hi friends,

Can anybody send sample BDC program for MM01 with DATA/FLAT file .(For many views MM01).

Kindly send with data file.

Kindly send with data file.

Kindly send with data file.

Thanks in advance

abaper

1 ACCEPTED SOLUTION

Former Member
0 Kudos
77

Hi,

I given the BDC program in the below, if it is not match with ur requirement.

Do following steps:

1. go to transaction SHDB and do Recording of transaction MM01

2. Save the recording

3. Create Program using recording in the same transaction of SHDB.

4. Read input file and modify the field mapping.

Hope these steps will help you.

start-of-selection.

perform open_dataset using dataset.

perform open_group.

do.

read dataset dataset into record.

if sy-subrc <> 0. exit. endif.

perform bdc_dynpro using 'SAPLMGMM' '0060'.

perform bdc_field using 'BDC_CURSOR'

'RMMG1-AENNR'.

perform bdc_field using 'BDC_OKCODE'

'AUSW'.

perform bdc_field using 'RMMG1-MBRSH'

record-MBRSH_001.

perform bdc_field using 'RMMG1-MTART'

record-MTART_002.

perform bdc_field using 'RMMG1-AENNR'

record-AENNR_003.

perform bdc_field using 'RMMG1-MATNR'

record-MATNR_004.

perform bdc_dynpro using 'SAPLMGMM' '0070'.

perform bdc_field using 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(15)'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'MSICHTAUSW-KZSEL(01)'

record-KZSEL_01_005.

perform bdc_field using 'MSICHTAUSW-KZSEL(02)'

record-KZSEL_02_006.

perform bdc_field using 'MSICHTAUSW-KZSEL(03)'

record-KZSEL_03_007.

perform bdc_field using 'MSICHTAUSW-KZSEL(04)'

record-KZSEL_04_008.

perform bdc_field using 'MSICHTAUSW-KZSEL(05)'

record-KZSEL_05_009.

perform bdc_field using 'MSICHTAUSW-KZSEL(06)'

record-KZSEL_06_010.

perform bdc_field using 'MSICHTAUSW-KZSEL(08)'

record-KZSEL_08_011.

perform bdc_field using 'MSICHTAUSW-KZSEL(09)'

record-KZSEL_09_012.

perform bdc_field using 'MSICHTAUSW-KZSEL(12)'

record-KZSEL_12_013.

perform bdc_field using 'MSICHTAUSW-KZSEL(13)'

record-KZSEL_13_014.

perform bdc_field using 'MSICHTAUSW-KZSEL(14)'

record-KZSEL_14_015.

perform bdc_field using 'MSICHTAUSW-KZSEL(15)'

record-KZSEL_15_016.

perform bdc_dynpro using 'SAPLMGMM' '0070'.

perform bdc_field using 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(01)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_dynpro using 'SAPLMGMM' '0080'.

perform bdc_field using 'BDC_CURSOR'

'RMMG1-VKORG'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'RMMG1-WERKS'

record-WERKS_017.

perform bdc_field using 'RMMG1-LGORT'

record-LGORT_018.

perform bdc_field using 'RMMG1-VKORG'

record-VKORG_019.

perform bdc_field using 'RMMG1-VTWEG'

record-VTWEG_020.

perform bdc_dynpro using 'SAPLMGMM' '4004'.

perform bdc_field using 'BDC_OKCODE'

'=SP02'.

perform bdc_field using 'MAKT-MAKTX'

record-MAKTX_021.

perform bdc_field using 'MARA-MEINS'

record-MEINS_022.

perform bdc_field using 'MARA-MATKL'

record-MATKL_023.

perform bdc_field using 'MARA-MTPOS_MARA'

record-MTPOS_MARA_024.

perform bdc_field using 'BDC_CURSOR'

'MARA-GEWEI'.

perform bdc_field using 'MARA-BRGEW'

record-BRGEW_025.

perform bdc_field using 'MARA-GEWEI'

record-GEWEI_026.

perform bdc_field using 'MARA-NTGEW'

record-NTGEW_027.

perform bdc_dynpro using 'SAPLMGMM' '4004'.

perform bdc_field using 'BDC_OKCODE'

'=SP03'.

perform bdc_field using 'BDC_CURSOR'

'MAKT-MAKTX'.

perform bdc_field using 'MAKT-MAKTX'

record-MAKTX_028.

perform bdc_dynpro using 'SAPLCLCA' '0602'.

perform bdc_field using 'BDC_CURSOR'

'RMCLF-KLART'.

perform bdc_field using 'BDC_OKCODE'

'ENTE'.

perform bdc_field using 'RMCLF-KLART'

record-KLART_029.

perform bdc_dynpro using 'SAPLCLFM' '0500'.

perform bdc_field using 'BDC_CURSOR'

'RMCLF-STATU(01)'.

perform bdc_field using 'BDC_OKCODE'

'=NEUZ'.

perform bdc_field using 'RMCLF-CLASS(01)'

record-CLASS_01_030.

perform bdc_field using 'RMCLF-STATU(01)'

record-STATU_01_031.

perform bdc_dynpro using 'SAPLCLFM' '0500'.

perform bdc_field using 'BDC_CURSOR'

'RMCLF-PAGPOS'.

perform bdc_field using 'BDC_OKCODE'

'=ENDE'.

perform bdc_field using 'RMCLF-PAGPOS'

record-PAGPOS_032.

perform bdc_dynpro using 'SAPLSPO1' '0300'.

perform bdc_field using 'BDC_OKCODE'

'=YES'.

perform bdc_transaction using 'MM01'.

enddo.

perform close_group.

1 REPLY 1

Former Member
0 Kudos
78

Hi,

I given the BDC program in the below, if it is not match with ur requirement.

Do following steps:

1. go to transaction SHDB and do Recording of transaction MM01

2. Save the recording

3. Create Program using recording in the same transaction of SHDB.

4. Read input file and modify the field mapping.

Hope these steps will help you.

start-of-selection.

perform open_dataset using dataset.

perform open_group.

do.

read dataset dataset into record.

if sy-subrc <> 0. exit. endif.

perform bdc_dynpro using 'SAPLMGMM' '0060'.

perform bdc_field using 'BDC_CURSOR'

'RMMG1-AENNR'.

perform bdc_field using 'BDC_OKCODE'

'AUSW'.

perform bdc_field using 'RMMG1-MBRSH'

record-MBRSH_001.

perform bdc_field using 'RMMG1-MTART'

record-MTART_002.

perform bdc_field using 'RMMG1-AENNR'

record-AENNR_003.

perform bdc_field using 'RMMG1-MATNR'

record-MATNR_004.

perform bdc_dynpro using 'SAPLMGMM' '0070'.

perform bdc_field using 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(15)'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'MSICHTAUSW-KZSEL(01)'

record-KZSEL_01_005.

perform bdc_field using 'MSICHTAUSW-KZSEL(02)'

record-KZSEL_02_006.

perform bdc_field using 'MSICHTAUSW-KZSEL(03)'

record-KZSEL_03_007.

perform bdc_field using 'MSICHTAUSW-KZSEL(04)'

record-KZSEL_04_008.

perform bdc_field using 'MSICHTAUSW-KZSEL(05)'

record-KZSEL_05_009.

perform bdc_field using 'MSICHTAUSW-KZSEL(06)'

record-KZSEL_06_010.

perform bdc_field using 'MSICHTAUSW-KZSEL(08)'

record-KZSEL_08_011.

perform bdc_field using 'MSICHTAUSW-KZSEL(09)'

record-KZSEL_09_012.

perform bdc_field using 'MSICHTAUSW-KZSEL(12)'

record-KZSEL_12_013.

perform bdc_field using 'MSICHTAUSW-KZSEL(13)'

record-KZSEL_13_014.

perform bdc_field using 'MSICHTAUSW-KZSEL(14)'

record-KZSEL_14_015.

perform bdc_field using 'MSICHTAUSW-KZSEL(15)'

record-KZSEL_15_016.

perform bdc_dynpro using 'SAPLMGMM' '0070'.

perform bdc_field using 'BDC_CURSOR'

'MSICHTAUSW-DYTXT(01)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_dynpro using 'SAPLMGMM' '0080'.

perform bdc_field using 'BDC_CURSOR'

'RMMG1-VKORG'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'RMMG1-WERKS'

record-WERKS_017.

perform bdc_field using 'RMMG1-LGORT'

record-LGORT_018.

perform bdc_field using 'RMMG1-VKORG'

record-VKORG_019.

perform bdc_field using 'RMMG1-VTWEG'

record-VTWEG_020.

perform bdc_dynpro using 'SAPLMGMM' '4004'.

perform bdc_field using 'BDC_OKCODE'

'=SP02'.

perform bdc_field using 'MAKT-MAKTX'

record-MAKTX_021.

perform bdc_field using 'MARA-MEINS'

record-MEINS_022.

perform bdc_field using 'MARA-MATKL'

record-MATKL_023.

perform bdc_field using 'MARA-MTPOS_MARA'

record-MTPOS_MARA_024.

perform bdc_field using 'BDC_CURSOR'

'MARA-GEWEI'.

perform bdc_field using 'MARA-BRGEW'

record-BRGEW_025.

perform bdc_field using 'MARA-GEWEI'

record-GEWEI_026.

perform bdc_field using 'MARA-NTGEW'

record-NTGEW_027.

perform bdc_dynpro using 'SAPLMGMM' '4004'.

perform bdc_field using 'BDC_OKCODE'

'=SP03'.

perform bdc_field using 'BDC_CURSOR'

'MAKT-MAKTX'.

perform bdc_field using 'MAKT-MAKTX'

record-MAKTX_028.

perform bdc_dynpro using 'SAPLCLCA' '0602'.

perform bdc_field using 'BDC_CURSOR'

'RMCLF-KLART'.

perform bdc_field using 'BDC_OKCODE'

'ENTE'.

perform bdc_field using 'RMCLF-KLART'

record-KLART_029.

perform bdc_dynpro using 'SAPLCLFM' '0500'.

perform bdc_field using 'BDC_CURSOR'

'RMCLF-STATU(01)'.

perform bdc_field using 'BDC_OKCODE'

'=NEUZ'.

perform bdc_field using 'RMCLF-CLASS(01)'

record-CLASS_01_030.

perform bdc_field using 'RMCLF-STATU(01)'

record-STATU_01_031.

perform bdc_dynpro using 'SAPLCLFM' '0500'.

perform bdc_field using 'BDC_CURSOR'

'RMCLF-PAGPOS'.

perform bdc_field using 'BDC_OKCODE'

'=ENDE'.

perform bdc_field using 'RMCLF-PAGPOS'

record-PAGPOS_032.

perform bdc_dynpro using 'SAPLSPO1' '0300'.

perform bdc_field using 'BDC_OKCODE'

'=YES'.

perform bdc_transaction using 'MM01'.

enddo.

perform close_group.