MM02要处理的事务码
源代码:
*include bdcrecx1.
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
* messages of call transaction
DATA: MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
* error session opened (' ' or 'X')
TYPES :BEGIN OF TYP_01,
MATNR TYPE MAKT-MATNR,
MAKTX TYPE MAKT-MAKTX,
END OF TYP_01.
DATA GT_01 TYPE STANDARD TABLE OF TYP_01.
DATA GS_01 TYPE TYP_01.
start-of-selection.
GS_01-MATNR = '1527'.
GS_01-MAKTX = '大白兔'.
APPEND GS_01 TO GT_01.
LOOP AT GT_01 INTO GS_01.
if sy-subrc <> 0. exit. endif.
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'
GS_01-MATNR.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(03)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(02)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(03)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(06)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MSICHTAUSW-KZSEL(03)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(04)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(05)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(06)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=SCHL'.
perform bdc_dynpro using 'SAPLMGMM' '0080'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-LGORT'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-WERKS'
'2010'.
perform bdc_field using 'RMMG1-LGORT'
'3000'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
GS_01-MAKTX.
perform bdc_field using 'MARA-MEINS'
'PC'.
perform bdc_field using 'MARA-MATKL'
'0001'.
perform bdc_field using 'MARA-MTPOS_MARA'
'NORM'.
*perform bdc_transaction using 'MM02'.
REFRESH MESSTAB.
CALL TRANSACTION 'MM02' USING BDCDATA
MODE 'A'
UPDATE 'A'
MESSAGES INTO MESSTAB.
ENDLOOP.
FORM BDC_DYNPRO USING PROGRAM