BDC PROBLEM
Hi,
I am working with 4.0b there i m running a bdc for change the Material static group. I want its value should be 1 thats why i hard coded it in the bdc. when we run bdc it takes all values perfectly but not appending into material master(mm03).
plz help me codes are given below-
***********************
report ZBDC_MIS no standard page heading.
INCLUDE BDCRECXX.
DATA: BEGIN OF ITAB OCCURS 0,
MATNR LIKE RMMG1-MATNR,
WERKS LIKE RMMG1-WERKS,
VKORG LIKE RMMG1-VKORG,
VTWEG LIKE RMMG1-VTWEG,
* versg like MVKE-VERSG
END OF ITAB.
start-of-selection.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = 'IBM'
FILENAME = 'C:\MIS.TXT'
FILETYPE = 'DAT'
TABLES
DATA_TAB = ITAB
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
GUI_REFUSE_FILETRANSFER = 8
OTHERS = 9.
PERFORM OPEN_GROUP.
LOOP AT ITAB.
CLEAR BDCDATA.
REFRESH BDCDATA.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'RMMG1-MATNR'
ITAB-MATNR.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-KZSEL(01)'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(05)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0080'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-VTWEG'.
perform bdc_field using 'RMMG1-WERKS'
ITAB-WERKS.
perform bdc_field using 'RMMG1-VKORG'
ITAB-VKORG.
perform bdc_field using 'RMMG1-VTWEG'
ITAB-VTWEG.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_SUBSCR'
'SAPLMGMM'
& ' 2000TABFRA1'.
perform bdc_field using 'BDC_SUBSCR'
'SAPLMGD1'
& ' 1004SUB1'.
perform bdc_field using 'BDC_SUBSCR'
'SAPLMGD1'
& ' 2157SUB2'.
perform bdc_field using 'BDC_CURSOR'
'MVKE-VERSG'.
perform bdc_field using 'MVKE-VERSG'
'1'.
perform bdc_field using 'BDC_SUBSCR'
'SAPLMGD1'
& ' 2156SUB3'.
perform bdc_field using 'BDC_SUBSCR'
'SAPLMGD1'
& ' 2155SUB4'.
perform bdc_field using 'BDC_SUBSCR'
'SAPLMGD1'
& ' 0001SUB5'.
perform bdc_field using 'BDC_SUBSCR'
'SAPLMGD1'
& ' 0001SUB6'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
PERFORM BDC_TRANSACTION USING 'MM02'.
ENDLOOP.
perform close_group.
***********************
plz can any body suggenst me why it s not working.
thannks,
Hi guest,
You forgot to write what kind of error message do you get when running the BDC. I see a potential problems when in screen 70 (select Views Popup) you select the first and the fifth line of the offered views. The problem is, you cannot be certain which views these are for any single material. The usual order is Basic 1,2, Classification, Sales 1,2 etc. but if for instance you expect 'Classification' and it was not maintained for the material, the view Sales 2 which you expect at fifth position will unexpectedly jump to the forth. In order to know where your views are you need to get the internal number of view using functions ANZGSTATUS_SETZEN and SCHNITTMENGE and a bit of abracadabra i cannot remeber exactly.
Try running your BDC in visible mode and see which views get selected.
Regards HB
Have a look at these links:
/forums/viewtopic.php?t=17756
/forums/viewtopic.php?t=30151
/forums/viewtopic.php?t=6134
Further searching using MM0 and VIEWS provides hundreds of posts.
Regards
R
_________________
Regards
R
Abap KC
SFMDR