We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE:[sap-dev] MM01 Not Working in Background Mode

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from vhietha_darwis on Mar 6 at 2:07 AM
Stefan....
No, I have not try to use BDC_insert and yes they from the same MARA-MTART
Here I copy paste some of my code, if you don't mind please take a look:

REPORT ZTN_MM01_C NO STANDARD PAGE HEADING LINE-SIZE 255.

INCLUDE ZSDUPLCEK.
INCLUDE ZHRU_TOP.

TABLES: MARA, MAKT.
RANGES : R_MATNR FOR MARA-MATNR.
CONSTANTS : C_COL_SIZE_A TYPE P VALUE 240, " Report width
C_COL_A1 TYPE P VALUE 40, " column 1
C_COL_A2 TYPE P VALUE 30, " column 2
C_COL_A3 TYPE P VALUE 200. " column 3

DATA: LD_PWDSTATE TYPE XUPWDSTATE VALUE '9'.
*** Generated data section with specific formatting - DO NOT CHANGE ***
DATA: BEGIN OF RECORD OCCURS 0,
* data element: MATNR
MATNR_001(040),
* data element: MBRSH
MBRSH_002(001),
* data element: MTART
MTART_003(004),
* data element: XFELD
KZSEL_09_004(001),
* data element: XFELD
KZSEL_12_005(001),
* data element: XFELD
KZSEL_13_006(001),
* data element: XFELD
KZSEL_14_007(001),
* data element: XFELD
KZSEL_15_008(001),
* data element: XFELD
KZSEL_17_009(001),
* data element: XFELD
KZSEL_01_010(001),
* data element: XFELD
KZSEL_02_011(001),
* data element: XFELD
KZSEL_06_012(001),
* data element: XFELD
KZSEL_07_013(001),
* data element: XFELD
KZSEL_08_014(001),
* data element: XFELD
KZSEL_09_015(001),
* data element: WERKS_D
WERKS_016(004),
* data element: MAKTX
MAKTX_017(040),
* data element: EKGRP
EKGRP_018(003),
* data element: XCHPF
XCHPF_019(001),
* data element: MAKTX
MAKTX_020(040),
* data element: EKGRP
EKGRP_021(003),
* data element: DISMM
DISMM_022(002),
* data element: DISPO
DISPO_023(003),
* data element: DISLS
DISLS_024(002),
* data element: MAKTX
MAKTX_025(040),
* data element: BESKZ
BESKZ_026(001),
* data element: FHORI
FHORI_027(003),
* data element: MAKTX
MAKTX_028(040),
* data element: PERKZ
PERKZ_029(001),
* data element: STRGR
STRGR_030(002),
* data element: MTVFP
MTVFP_031(002),
* data element: STDPD
STDPD_032(040),
* data element: ATBEZ
MNAME_01_033(030),
* data element: ATBEZ
MNAME_02_034(030),
* data element: ATBEZ
MNAME_03_035(030),
* data element: ATBEZ
MNAME_04_036(030),
* data element: ATBEZ
MNAME_05_037(030),
* data element: ATWRT
MWERT_01_038(030),
* data element: ATWRT
MWERT_02_039(030),
* data element: ATWRT
MWERT_03_040(030),
* data element: ATWRT
MWERT_04_041(030),
* data element: ATWRT
MWERT_05_042(030),
* data element: MAKTX
MAKTX_043(040),
* data element: PERKZ
PERKZ_044(001),
* data element: STRGR
STRGR_045(002),
* data element: MTVFP
MTVFP_046(002),
* data element: STDPD
STDPD_047(040),
* data element: MAKTX
MAKTX_048(040),
* data element: UMREN
UMREN_02_049(006),
* data element: LRMEI
MEINH_02_050(003),
* data element: UMREZ
UMREZ_02_051(006),
* data element: MAKTX
MAKTX_052(040),
* data element: MAKTX
MAKTX_053(040),
* data element: KZWSO
KZWSM_054(001),
* data element: ATNAM
ATNAM_01_055(030),
* data element: ATWRT_WS
ATWRT_01_056(030),
* data element: LRMEI_WS
WSMEI_01_057(003),
* data element: MAKTX
MAKTX_058(040),
* data element: MAKTX
MAKTX_059(040),
* data element: PERKZ
PERKZ_060(001),
* data element: STRGR
STRGR_061(002),
* data element: MTVFP
MTVFP_062(002),
* data element: STDPD
STDPD_063(040),
* data element: MAKTX
MAKTX_064(040),
* data element: ALTSL
ALTSL_065(001),
* data element: AHDIS
AHDIS_066(001),
* data element: MAKTX
MAKTX_067(040),
* data element: FRTME
FRTME_068(003),
* data element: FEVOR
FEVOR_069(003),
* data element: UEETK
UEETK_070(001),
* data element: MAKTX
MAKTX_071(040),
* data element: DATTP
IPRKZ_072(001),
* data element: MAKTX
MAKTX_073(040),
* data element: PRCTR
PRCTR_074(010),
* data element: MAKTX
MAKTX_075(040),
* data element: BKLAS
BKLAS_076(004),
* data element: VPRSV
VPRSV_077(001),
* data element: PEINH
PEINH_078(006),
* data element: STPRS
STPRS_079(015),
* data element: MAKTX
MAKTX_080(040),
* data element: MAKTX
MAKTX_081(040),
* data element: CK_EKALREL
EKALR_082(001),
* data element: HKMAT
HKMAT_083(001),
* data element: PRCTR
PRCTR_084(010),
* data element: CK_LOSGR
LOSGR_085(017),
* data element: MAKTX
MAKTX_086(040),
* data element: BKLAS
BKLAS_087(004),
* data element: VPRSV
VPRSV_088(001),
* data element: PEINH
PEINH_089(006),
* data element: STPRS
STPRS_090(015),
MSGTX LIKE MESSAGE-MSGTX,
END OF RECORD,
T_REPORT LIKE RECORD OCCURS 0 WITH HEADER LINE.

*** End generated data section ***
DATA: BEGIN OF T_MARA OCCURS 0,
MATNR LIKE RMMG1-MATNR,
MBRSH LIKE RMMG1-MBRSH,
MTART LIKE RMMG1-MTART,
KZSEL_09 LIKE MSICHTAUSW-KZSEL,
KZSEL_12 LIKE MSICHTAUSW-KZSEL,
KZSEL_13 LIKE MSICHTAUSW-KZSEL,
KZSEL_14 LIKE MSICHTAUSW-KZSEL,
KZSEL_15 LIKE MSICHTAUSW-KZSEL,
KZSEL_17 LIKE MSICHTAUSW-KZSEL,
KZSEL_01 LIKE MSICHTAUSW-KZSEL,
KZSEL_02 LIKE MSICHTAUSW-KZSEL,
KZSEL_06 LIKE MSICHTAUSW-KZSEL,
KZSEL_07 LIKE MSICHTAUSW-KZSEL,
KZSEL_08 LIKE MSICHTAUSW-KZSEL,
* KZSEL_09 LIKE MSICHTAUSW-KZSEL,
WERKS LIKE RMMG1-WERKS,
MAKTX LIKE MAKT-MAKTX,
EKGRP LIKE MARC-EKGRP,
XCHPF LIKE MARA-XCHPF,
* MAKTX LIKE MAKT-MAKTX,
* EKGRP LIKE MARC-EKGRP,
DISMM LIKE MARC-DISMM,
DISPO LIKE MARC-DISPO,
DISLS LIKE MARC-DISLS,
* MAKTX LIKE MAKT-MAKTX,
BESKZ LIKE MARC-BESKZ,
FHORI LIKE MARC-FHORI,
* MAKTX LIKE MAKT-MAKTX,
PERKZ LIKE MARC-PERKZ,
STRGR LIKE MARC-STRGR,
MTVFP LIKE MARC-MTVFP,
STDPD LIKE MARC-STDPD,
MNAME_01 LIKE RCTMS-MNAME(01),
MNAME_02 LIKE RCTMS-MNAME(02),
MNAME_03 LIKE RCTMS-MNAME(03),
MNAME_04 LIKE RCTMS-MNAME(04),
MNAME_05 LIKE RCTMS-MNAME(05),
MWERT_01 LIKE RCTMS-MWERT(01),
MWERT_02 LIKE RCTMS-MWERT(02),
MWERT_03 LIKE RCTMS-MWERT(03),
MWERT_04 LIKE RCTMS-MWERT(04),
MWERT_05 LIKE RCTMS-MWERT(05),
* MAKTX LIKE MAKT-MAKTX,
* PERKZ LIKE MARC-PERKZ,
* STRGR LIKE MARC-STRGR,
* MTVFP LIKE MARC-MTVFP,
* STDPD LIKE MARC-STDPD,
* MAKTX LIKE MAKT-MAKTX,
UMREN_02 LIKE SMEINH-UMREN,
MEINH_02 LIKE SMEINH-MEINH,
UMREZ_02 LIKE SMEINH-UMREZ,
* MAKTX LIKE MAKT-MAKTX,
* MAKTX LIKE MAKT-MAKTX,
KZWSM LIKE MARA-KZWSM,
ATNAM_01 LIKE SMEINH_WS-ATNAM,
ATWRT_01 LIKE SMEINH_WS-ATWRT,
WSMEI_01 LIKE SMEINH_WS-WSMEI,
* MAKTX LIKE MAKT-MAKTX,
* MAKTX LIKE MAKT-MAKTX,
* PERKZ LIKE MARC-PERKZ,
* STRGR LIKE MARC-STRGR,
* MTVFP LIKE MARC-MTVFP,
* STDPD LIKE MARC-STDPD,
* MAKTX LIKE MAKT-MAKTX,
ALTSL LIKE MARC-ALTSL,
AHDIS LIKE MARC-AHDIS,
* MAKTX LIKE MAKT-MAKTX,
FRTME LIKE MARC-FRTME,
FEVOR LIKE MARC-FEVOR,
UEETK LIKE MARC-UEETK,
* MAKTX LIKE MAKT-MAKTX,
IPRKZ LIKE MARA-IPRKZ,
* MAKTX LIKE MAKT-MAKTX,
PRCTR LIKE MARC-PRCTR,
* MAKTX LIKE MAKT-MAKTX,
BKLAS LIKE MBEW-BKLAS,
VPRSV LIKE MBEW-VPRSV,
PEINH LIKE MBEW-PEINH,
STPRS LIKE MBEW-STPRS,
* MAKTX LIKE MAKT-MAKTX,
* MAKTX LIKE MAKT-MAKTX,
EKALR LIKE MBEW-EKALR,
HKMAT LIKE MBEW-HKMAT,
* PRCTR LIKE MARC-PRCTR,
LOSGR LIKE MARC-LOSGR,
* MAKTX LIKE MAKT-MAKTX,
* BKLAS LIKE MBEW-BKLAS,
* VPRSV LIKE MBEW-VPRSV,
* PEINH LIKE MBEW-PEINH,
* STPRS LIKE MBEW-STPRS,
END OF T_MARA,
T_MARAA LIKE T_MARA OCCURS 0 WITH HEADER LINE.
*
*DATA: BEGIN OF t_knkk OCCURS 0,
* kunnr LIKE knkk-kunnr,
* klimk LIKE knkk-klimk,
* ctlpc LIKE knkk-ctlpc,
* cashc LIKE knkk-cashc,
* END OF t_knkk.

SELECTION-SCREEN BEGIN OF BLOCK BLOCK1 WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
PARAMETERS: CTUMODE LIKE CTU_PARAMS-DISMODE DEFAULT 'N',
"A: show all dynpros
"E: show dynpro on error only
"N: do not display dynpro

WORK_DIR LIKE RLGRAP-FILENAME OBLIGATORY MODIF ID WRK MEMORY ID DIR DEFAULT 'C:\ZTN_MM01.XLS',
*FILENM LIKE rlgrap-filename MEMORY ID dir. "M01
NOHEADER AS CHECKBOX DEFAULT 'X'.


* rlgrap-filename OBLIGATORY MEMORY ID dir
SELECTION-SCREEN END OF BLOCK BLOCK1.
INCLUDE ZHRU_F01.
INCLUDE ZBDCRECX3.
*INCLUDE ZBDCRECXX.

* Get directory structure at value-request
AT SELECTION-SCREEN ON VALUE-REQUEST FOR WORK_DIR.

PERFORM SUB_FILE_F4.

INITIALIZATION.
SET TITLEBAR 'ZHEAD' WITH 'Upload Material'.



* Start Program
START-OF-SELECTION.
* PERFORM f_check_otorisasi1 .


PERFORM SUB_GET_DATA USING 1.
IF DATA_TAB[] IS NOT INITIAL.
DATA: D_ENDDA(10),
D_BEGDA(10),
D_MATNR(18) TYPE C,
DD_MATNR(40).
CLEAR: RECORD, T_REPORT, T_MARA.
REFRESH: RECORD, T_REPORT, T_MARA.
LOOP AT DATA_TAB.
D_MATNR = DATA_TAB-VALUE_0001.
IF D_MATNR IN S_MATNR .
RECORD-MATNR_001 = DATA_TAB-VALUE_0001.
RECORD-MBRSH_002 = DATA_TAB-VALUE_0002.
RECORD-MTART_003 = DATA_TAB-VALUE_0003.
RECORD-KZSEL_09_004 = 'X'.
RECORD-KZSEL_12_005 = 'X'.
RECORD-KZSEL_13_006 = 'X'.
RECORD-KZSEL_14_007 = 'X'.
RECORD-KZSEL_15_008 = 'X'.
RECORD-KZSEL_17_009 = 'X'.
RECORD-KZSEL_01_010 = 'X'.
RECORD-KZSEL_02_011 = 'X'.
RECORD-KZSEL_06_012 = 'X'.
RECORD-KZSEL_07_013 = 'X'.
RECORD-KZSEL_08_014 = 'X'.
RECORD-KZSEL_09_015 = 'X'.
RECORD-WERKS_016 = DATA_TAB-VALUE_0019.
RECORD-MAKTX_017 = DATA_TAB-VALUE_0004.
RECORD-EKGRP_018 = '101'.
RECORD-XCHPF_019 = 'X'.
RECORD-MAKTX_020 = DATA_TAB-VALUE_0004.
RECORD-EKGRP_021 = '101'.
RECORD-DISMM_022 = 'PD'.
IF RECORD-WERKS_016 = '1100'.
RECORD-DISPO_023 = '101'.
ELSEIF RECORD-WERKS_016 = '1200'.
RECORD-DISPO_023 = '102'.
ELSEIF RECORD-WERKS_016 = '1300'.
RECORD-DISPO_023 = '103'.
ELSEIF RECORD-WERKS_016 = '1400'.
RECORD-DISPO_023 = '104'.
ELSE.
RECORD-DISPO_023 = '105'.
ENDIF.
RECORD-DISLS_024 = 'EX'.
RECORD-MAKTX_025 = DATA_TAB-VALUE_0004.
RECORD-BESKZ_026 = 'X'.
RECORD-FHORI_027 = '000'.
RECORD-MAKTX_028 = DATA_TAB-VALUE_0004.
RECORD-PERKZ_029 = 'M'.
RECORD-STRGR_030 = '26'.
RECORD-MTVFP_031 = '02'.
RECORD-STDPD_032 = DATA_TAB-VALUE_0001.
RECORD-MNAME_01_033 = DATA_TAB-VALUE_0013.
RECORD-MNAME_02_034 = DATA_TAB-VALUE_0014.
RECORD-MNAME_03_035 = DATA_TAB-VALUE_0015.
RECORD-MNAME_04_036 = DATA_TAB-VALUE_0020.
RECORD-MNAME_05_037 = DATA_TAB-VALUE_0021.
RECORD-MWERT_01_038 = DATA_TAB-VALUE_0016.
RECORD-MWERT_02_039 = DATA_TAB-VALUE_0017.
RECORD-MWERT_03_040 = DATA_TAB-VALUE_0018.
REPLACE ',' WITH '.' INTO DATA_TAB-VALUE_0022.
RECORD-MWERT_04_041 = DATA_TAB-VALUE_0022 / 100.
REPLACE '.' WITH ',' INTO RECORD-MWERT_04_041.
CONDENSE RECORD-MWERT_04_041 NO-GAPS.
RECORD-MWERT_05_042 = DATA_TAB-VALUE_0023.
RECORD-MAKTX_043 = DATA_TAB-VALUE_0004.
RECORD-PERKZ_044 = 'M'.
RECORD-STRGR_045 = '26'.
RECORD-MTVFP_046 = '02'.
RECORD-STDPD_047 = DATA_TAB-VALUE_0001.
RECORD-MAKTX_048 = DATA_TAB-VALUE_0004.
RECORD-UMREN_02_049 = '100'.
RECORD-MEINH_02_050 = 'M'.
RECORD-UMREZ_02_051 = DATA_TAB-VALUE_0022.
RECORD-MAKTX_052 = DATA_TAB-VALUE_0004.
RECORD-MAKTX_053 = DATA_TAB-VALUE_0004.
RECORD-KZWSM_054 = 'B'.
RECORD-ATNAM_01_055 = DATA_TAB-VALUE_0021.
* REPLACE ',' WITH '.' INTO DATA_TAB-VALUE_0022.
RECORD-ATWRT_01_056 = DATA_TAB-VALUE_0023.
RECORD-WSMEI_01_057 = 'PCS'.
RECORD-MAKTX_058 = DATA_TAB-VALUE_0004.
RECORD-MAKTX_059 = DATA_TAB-VALUE_0004.
RECORD-PERKZ_060 = 'M'.
RECORD-STRGR_061 = '26'.
RECORD-MTVFP_062 = '02'.
RECORD-STDPD_063 = DATA_TAB-VALUE_0001.
RECORD-MAKTX_064 = DATA_TAB-VALUE_0004.
RECORD-ALTSL_065 = '2'.
RECORD-AHDIS_066 = '1'.
RECORD-MAKTX_067 = DATA_TAB-VALUE_0004.
RECORD-FRTME_068 = 'PCS'.
RECORD-FEVOR_069 = '001'.
RECORD-UEETK_070 = 'X'.
RECORD-MAKTX_071 = DATA_TAB-VALUE_0004.
RECORD-IPRKZ_072 = 'D'.
RECORD-MAKTX_073 = DATA_TAB-VALUE_0004.
RECORD-PRCTR_074 = DATA_TAB-VALUE_0019.
RECORD-MAKTX_075 = DATA_TAB-VALUE_0004.
IF DATA_TAB-VALUE_0003 = 'ZSFG'.
RECORD-BKLAS_076 = '4000'.
ELSEIF DATA_TAB-VALUE_0003 = 'ZFGD'.
RECORD-BKLAS_076 = '4100'.
ELSE.
RECORD-BKLAS_076 = '1000'.
ENDIF.
RECORD-VPRSV_077 = 'S'.
RECORD-PEINH_078 = '1'.
RECORD-STPRS_079 = DATA_TAB-VALUE_0024.
RECORD-MAKTX_080 = DATA_TAB-VALUE_0004.
RECORD-MAKTX_081 = DATA_TAB-VALUE_0004.
RECORD-EKALR_082 = 'X'.
RECORD-HKMAT_083 = 'X'.
RECORD-PRCTR_084 = DATA_TAB-VALUE_0019.
RECORD-LOSGR_085 = '1'.
RECORD-MAKTX_086 = DATA_TAB-VALUE_0004.
IF DATA_TAB-VALUE_0003 = 'ZSFG'.
RECORD-BKLAS_087 = '4000'.
ELSEIF DATA_TAB-VALUE_0003 = 'ZFGD'.
RECORD-BKLAS_087 = '4100'.
ELSE.
RECORD-BKLAS_087 = '1000'.
ENDIF.
RECORD-VPRSV_088 = 'S'.
RECORD-PEINH_089 = '1'.
RECORD-STPRS_090 = DATA_TAB-VALUE_0024.
COLLECT RECORD.
T_MARA-MATNR = D_MATNR.
COLLECT T_MARA.
ENDIF.
ENDLOOP.
ENDIF.
DATA: D_IDX LIKE SY-TABIX.
LOOP AT RECORD.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '0060'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RMMG1-MTART'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'RMMG1-MATNR'
RECORD-MATNR_001.
PERFORM BDC_FIELD USING 'RMMG1-MBRSH'
RECORD-MBRSH_002.
PERFORM BDC_FIELD USING 'RMMG1-MTART'
RECORD-MTART_003.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '0070'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(17)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=P+'.
PERFORM BDC_FIELD USING 'MSICHTAUSW-KZSEL(09)'
RECORD-KZSEL_09_004.
PERFORM BDC_FIELD USING 'MSICHTAUSW-KZSEL(12)'
RECORD-KZSEL_12_005.
PERFORM BDC_FIELD USING 'MSICHTAUSW-KZSEL(13)'
RECORD-KZSEL_13_006.
PERFORM BDC_FIELD USING 'MSICHTAUSW-KZSEL(14)'
RECORD-KZSEL_14_007.
PERFORM BDC_FIELD USING 'MSICHTAUSW-KZSEL(15)'
RECORD-KZSEL_15_008.
PERFORM BDC_FIELD USING 'MSICHTAUSW-KZSEL(17)'
RECORD-KZSEL_17_009.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '0070'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(09)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
PERFORM BDC_FIELD USING 'MSICHTAUSW-KZSEL(01)'
RECORD-KZSEL_01_010.
PERFORM BDC_FIELD USING 'MSICHTAUSW-KZSEL(02)'
RECORD-KZSEL_02_011.
PERFORM BDC_FIELD USING 'MSICHTAUSW-KZSEL(06)'
RECORD-KZSEL_06_012.
PERFORM BDC_FIELD USING 'MSICHTAUSW-KZSEL(07)'
RECORD-KZSEL_07_013.
PERFORM BDC_FIELD USING 'MSICHTAUSW-KZSEL(08)'
RECORD-KZSEL_08_014.
PERFORM BDC_FIELD USING 'MSICHTAUSW-KZSEL(09)'
RECORD-KZSEL_09_015.
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'
RECORD-WERKS_016.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX_017.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MARA-XCHPF'.
PERFORM BDC_FIELD USING 'MARC-EKGRP'
RECORD-EKGRP_018.
PERFORM BDC_FIELD USING 'MARA-XCHPF'
RECORD-XCHPF_019.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX_020.
PERFORM BDC_FIELD USING 'MARC-EKGRP'
RECORD-EKGRP_021.
PERFORM BDC_FIELD USING 'MARC-DISMM'
RECORD-DISMM_022.
PERFORM BDC_FIELD USING 'MARC-DISPO'
RECORD-DISPO_023.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MARC-DISLS'.
PERFORM BDC_FIELD USING 'MARC-DISLS'
RECORD-DISLS_024.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX_025.
PERFORM BDC_FIELD USING 'MARC-BESKZ'
RECORD-BESKZ_026.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MARC-FHORI'.
PERFORM BDC_FIELD USING 'MARC-FHORI'
RECORD-FHORI_027.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=PB19'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX_028.
PERFORM BDC_FIELD USING 'MARC-PERKZ'
RECORD-PERKZ_029.
PERFORM BDC_FIELD USING 'MARC-STRGR'
RECORD-STRGR_030.
PERFORM BDC_FIELD USING 'MARC-MTVFP'
RECORD-MTVFP_031.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MARC-STDPD'.
PERFORM BDC_FIELD USING 'MARC-STDPD'
RECORD-STDPD_032.
PERFORM BDC_DYNPRO USING 'SAPLCEI0' '0109'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RCTMS-MWERT(05)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BACK'.
PERFORM BDC_FIELD USING 'RCTMS-MNAME(01)'
RECORD-MNAME_01_033.
PERFORM BDC_FIELD USING 'RCTMS-MNAME(02)'
RECORD-MNAME_02_034.
PERFORM BDC_FIELD USING 'RCTMS-MNAME(03)'
RECORD-MNAME_03_035.
PERFORM BDC_FIELD USING 'RCTMS-MNAME(04)'
RECORD-MNAME_04_036.
PERFORM BDC_FIELD USING 'RCTMS-MNAME(05)'
RECORD-MNAME_05_037.
PERFORM BDC_FIELD USING 'RCTMS-MWERT(01)'
RECORD-MWERT_01_038.
PERFORM BDC_FIELD USING 'RCTMS-MWERT(02)'
RECORD-MWERT_02_039.
PERFORM BDC_FIELD USING 'RCTMS-MWERT(03)'
RECORD-MWERT_03_040.
PERFORM BDC_FIELD USING 'RCTMS-MWERT(04)'
RECORD-MWERT_04_041.
PERFORM BDC_FIELD USING 'RCTMS-MWERT(05)'
RECORD-MWERT_05_042.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ZU01'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MAKT-MAKTX'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX_043.
PERFORM BDC_FIELD USING 'MARC-PERKZ'
RECORD-PERKZ_044.
PERFORM BDC_FIELD USING 'MARC-STRGR'
RECORD-STRGR_045.
PERFORM BDC_FIELD USING 'MARC-MTVFP'
RECORD-MTVFP_046.
PERFORM BDC_FIELD USING 'MARC-STDPD'
RECORD-STDPD_047.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4300'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ZU02'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4300'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX_048.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'SMEINH-UMREZ(02)'.
PERFORM BDC_FIELD USING 'SMEINH-UMREN(02)'
RECORD-UMREN_02_049.
PERFORM BDC_FIELD USING 'SMEINH-MEINH(02)'
RECORD-MEINH_02_050.
PERFORM BDC_FIELD USING 'SMEINH-UMREZ(02)'
RECORD-UMREZ_02_051.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4300'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ZU09'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MAKT-MAKTX'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX_052.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4300'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX_053.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'SMEINH_WS-WSMEI(01)'.
PERFORM BDC_FIELD USING 'MARA-KZWSM'
RECORD-KZWSM_054.
PERFORM BDC_FIELD USING 'SMEINH_WS-ATNAM(01)'
RECORD-ATNAM_01_055.
PERFORM BDC_FIELD USING 'SMEINH_WS-ATWRT(01)'
RECORD-ATWRT_01_056.
PERFORM BDC_FIELD USING 'SMEINH_WS-WSMEI(01)'
RECORD-WSMEI_01_057.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4300'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=MAIN'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX_058.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'SMEINH_WS-ATNAM(02)'.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=SP15'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MAKT-MAKTX'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX_059.
PERFORM BDC_FIELD USING 'MARC-PERKZ'
RECORD-PERKZ_060.
PERFORM BDC_FIELD USING 'MARC-STRGR'
RECORD-STRGR_061.
PERFORM BDC_FIELD USING 'MARC-MTVFP'
RECORD-MTVFP_062.
PERFORM BDC_FIELD USING 'MARC-STDPD'
RECORD-STDPD_063.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX_064.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MARC-AHDIS'.
PERFORM BDC_FIELD USING 'MARC-ALTSL'
RECORD-ALTSL_065.
PERFORM BDC_FIELD USING 'MARC-AHDIS'
RECORD-AHDIS_066.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX_067.
PERFORM BDC_FIELD USING 'MARC-FRTME'
RECORD-FRTME_068.
PERFORM BDC_FIELD USING 'MARC-FEVOR'
RECORD-FEVOR_069.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MARC-UEETK'.
PERFORM BDC_FIELD USING 'MARC-UEETK'
RECORD-UEETK_070.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MAKT-MAKTX'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX_071.
PERFORM BDC_FIELD USING 'MARA-IPRKZ'
RECORD-IPRKZ_072.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX_073.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MARC-PRCTR'.
PERFORM BDC_FIELD USING 'MARC-PRCTR'
RECORD-PRCTR_074.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX_075.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MBEW-STPRS'.
PERFORM BDC_FIELD USING 'MBEW-BKLAS'
RECORD-BKLAS_076.
PERFORM BDC_FIELD USING 'MBEW-VPRSV'
RECORD-VPRSV_077.
PERFORM BDC_FIELD USING 'MBEW-PEINH'
RECORD-PEINH_078.
PERFORM BDC_FIELD USING 'MBEW-STPRS'
RECORD-STPRS_079.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MAKT-MAKTX'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX_080.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX_081.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MBEW-HKMAT'.
PERFORM BDC_FIELD USING 'MBEW-EKALR'
RECORD-EKALR_082.
PERFORM BDC_FIELD USING 'MBEW-HKMAT'
RECORD-HKMAT_083.
PERFORM BDC_FIELD USING 'MARC-PRCTR'
RECORD-PRCTR_084.
PERFORM BDC_FIELD USING 'MARC-LOSGR'
RECORD-LOSGR_085.
PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'MAKT-MAKTX'.
PERFORM BDC_FIELD USING 'MAKT-MAKTX'
RECORD-MAKTX_086.
PERFORM BDC_FIELD USING 'MBEW-BKLAS'
RECORD-BKLAS_087.
PERFORM BDC_FIELD USING 'MBEW-VPRSV'
RECORD-VPRSV_088.
PERFORM BDC_FIELD USING 'MBEW-PEINH'
RECORD-PEINH_089.
PERFORM BDC_FIELD USING 'MBEW-STPRS'
RECORD-STPRS_090.
PERFORM BDC_DYNPRO USING 'SAPLSPO1' '0300'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=YES'.
PERFORM BDC_TRANSACTION USING 'MM01'.
IF MESSTAB[] IS INITIAL.
COLLECT T_REPORT.
ENDIF.
* MODIFY record INDEX d_idx TRANSPORTING msgtx.
ENDLOOP.

END-OF-SELECTION.
CHECK NOT RECORD[] IS INITIAL.




Thanks in advance.
Vita D

---------------Original Message---------------
From: vhietha_darwis
Sent: Tuesday, March 04, 2014 4:34 AM
Subject: MM01 Not Working in Background Mode

Dear experts,

Hi All, I wrote some BDC program for material(MM01). We have 4 steps for imputing new pipe material. First we use MM01 which is work on Basic data1, basic data2, classification. The second step is using CU41, nest is the third step using MM01(purchasing, MRP1, MRP2, MRP3, MRP4, Work Scheduling, General Plan Data/Storage 1, General Plan Data/Storage 2, Accounting 1, Accounting 2, Cost Estimate 1, Costing 2) and the last one using also MM01 for Sales Org Data 1, Sales Org Data 2, Sales : General/Plan data.

So using SHDB I'm capturing every step of it and make 4 BDC program. The first program working fine, the second one sometimes its working fine sometimes it cannot work, and the third also the fourth only working in the first line.
But all the BDC program will work fine if I using foreground mode(A). It goes very smooth with this mode.
Can anyone help me to solve this?
Thank you in advance.

Vita D

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2014 Ziff Davis, Inc. and message author.
Ziff Davis, Inc. 28 E 28th Street New York, NY 10016
vhietha_darwis  

Programmer/Developer - Software
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Earn Recognition for Your Contributions at Toolbox for IT. Gain Points for Community Achievements

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language