FORM mb1c_bdc .
REFRESH : gt_bdcmsgcoll, bdcdata.
READ TABLE gt_upload INDEX 1.
PERFORM bdc_dynpro USING 'SAPMM07M' '0400'.
PERFORM bdc_field USING 'BDC_OKCODE' '=NPE'.
PERFORM bdc_field USING 'RM07M-BWARTWA' gt_upload-bwartwa.
PERFORM bdc_field USING 'RM07M-WERKS' gt_upload-werks.
PERFORM bdc_field USING 'RM07M-LGORT' gt_upload-lgort.
PERFORM bdc_field USING 'XFULL' 'X'.
PERFORM bdc_field USING 'RM07M-WVERS2' 'X'.
LOOP AT gt_upload.
IF sy-tabix = 1.
PERFORM bdc_dynpro USING 'SAPMM07M' '0410'.
PERFORM bdc_field USING 'BDC_OKCODE' 'NPE'.
PERFORM bdc_field USING 'MSEG-MATNR' gt_upload-matnr.
PERFORM bdc_field USING 'MSEG-ERFMG' gt_upload-erfmg.
PERFORM bdc_field USING 'MSEG-CHARG' gt_upload-charg.
PERFORM bdc_field USING 'MSEG-WERKS' gt_upload-werks.
PERFORM bdc_field USING 'MSEG-LGORT' gt_upload-lgort.
* PERFORM bdc_field USING 'DKACB-FMORE' 'X'.
PERFORM bdc_dynpro USING 'SAPMM07M' '0410'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'MSEG-MATNR' gt_upload-matnr.
PERFORM bdc_field USING 'MSEG-ERFMG' gt_upload-erfmg.
PERFORM bdc_field USING 'MSEG-CHARG' gt_upload-charg.
PERFORM bdc_field USING 'MSEG-WERKS' gt_upload-werks.
PERFORM bdc_field USING 'MSEG-LGORT' gt_upload-lgort.
ELSE.
PERFORM bdc_dynpro USING 'SAPMM07M' '0410'.
PERFORM bdc_field USING 'BDC_OKCODE' '=NPE'.
PERFORM bdc_field USING 'MSEG-MATNR' gt_upload-matnr.
PERFORM bdc_field USING 'MSEG-ERFMG' gt_upload-erfmg.
PERFORM bdc_field USING 'MSEG-CHARG' gt_upload-charg.
PERFORM bdc_field USING 'MSEG-WERKS' gt_upload-werks.
PERFORM bdc_field USING 'MSEG-LGORT' gt_upload-lgort.
* PERFORM bdc_field USING 'DKACB-FMORE' 'X'.
PERFORM bdc_dynpro USING 'SAPMM07M' '0410'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
PERFORM bdc_field USING 'MSEG-MATNR' gt_upload-matnr.
PERFORM bdc_field USING 'MSEG-ERFMG' gt_upload-erfmg.
PERFORM bdc_field USING 'MSEG-CHARG' gt_upload-charg.
PERFORM bdc_field USING 'MSEG-WERKS' gt_upload-werks.
PERFORM bdc_field USING 'MSEG-LGORT' gt_upload-lgort.
ENDIF.
AT LAST.
PERFORM bdc_dynpro USING 'SAPMM07M' '0410'.
PERFORM bdc_field USING 'BDC_OKCODE' '=BU'.
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_OKCODE' '=ENTE'.
ENDAT.
ENDLOOP.
CALL TRANSACTION 'MB1C' USING bdcdata
MESSAGES INTO gt_bdcmsgcoll
OPTIONS FROM ctu_params.
이렇게 썼고, 엑셀을 불러와 첫번째 creat를하면
초기화면->세부사항으로 신규품목0001제목과 okcode->신규품목0001->
세부사항0002 와 okcode-> 신규품목0002로 나와야하지만 0002/0002 가 연달아나오고
다음으로 신규품목0003이 나오는데... 여기서도 마찬가지로 그다음은 0003/0003이 나옵니다
제가 어느부분에서 잘못했는지 정말 답이 안나오네요!!?
roof를 잘못쓴건지 확실이 모르겠네요...
허접한 질문이지만 고수님들의 많은 답변 부탁드립니다...꾸벅...