Folgende Benutzer bedankten sich beim Autor ralf.wenzel für den Beitrag:
Stegemann90
Code: Alles auswählen.
*************DECLARATIONS******************
include bdcrecx1.
DATA: BEGIN OF BDC_DATA OCCURS 0.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDC_DATA.
DATA: BEGIN OF ITAB OCCURS 0,
MATNR LIKE RMMG1-MATNR,
KDMAT LIKE MV10A-KDMAT,
MAKTX LIKE MAKT-MAKTX,
VTTX1 LIKE RSTXT-TXLINE,
VTTX2 LIKE RSTXT-TXLINE,
MEINH LIKE MARA-MEINS,
KUNNR LIKE MV10A-KUNNR,
WERK LIKE RMMG1-WERKS,
VKORG LIKE RMMG1-VKORG,
VTWEG LIKE RMMG1-VTWEG,
SPART LIKE MARA-SPART,
POSTY LIKE MARA-MTPOS_MARA,
TAXKM LIKE MG03STEUER-TAXKM,
KTGRM LIKE MVKE-KTGRM,
END OF ITAB.
*************INITIALIZATIONS***************
start-of-selection.
CLEAR BDC_DATA.
REFRESH BDC_DATA.
*************UPLOAD*******************
PERFORM DATEN_LADEN USING
'C:\Datenmigration\uploadmm01.txt'.
***CALL TRANSACTION****
perform open_group.
LOOP AT ITAB.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
usw. usw...
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
perform bdc_transaction using 'VK11'.
ENDLOOP.
perform close_group.
********************FORMS******************
FORM DATEN_LADEN USING DATEI.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = DATEI
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = ITAB
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHOITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17.
ENDFORM.
Folgende Benutzer bedankten sich beim Autor ralf.wenzel für den Beitrag:
Stegemann90