Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BDC: MM02 Field: MARC-MMSTA "No Change" Problem

Former Member
0 Kudos

Dear All,

i have done a BDC Program for T-Code MM02 to change field MARC-MMSTA. Everything is gonna fine except message meaasge M3 810- No Changes Made. So, it does not change the value of field

MARC-MMSTA. i do not know the reason why. The source is as foellows. Thanx in advance.

************************************************************************

  • Table Declaration

************************************************************************

************************************************************************

  • Data Declaration

************************************************************************

DATA: BEGIN OF RECORD OCCURS 0,

MATNR(18), "Material Number

WERKS(04), "Plant

MMSTA(02), "Plant-sp.matl status

END OF RECORD.

**Declare Internal Table for BDC Import

DATA : IT_BTCI TYPE STANDARD TABLE OF BDCDATA WITH HEADER LINE.

**Declare few variables

DATA : LV_MTART LIKE MARA-MTART,

LV_CNT(2) TYPE C, " it's a count

LV_DYTXT(30) TYPE C,

LV_KZSEL(30) TYPE C.

************************************************************************

  • Selection Declartion

************************************************************************

PARAMETERS: P_FILE LIKE RLGRAP-FILENAME.

************************************************************************

  • Validation For Selection Screen

************************************************************************

*AT SELECTION-SCREEN.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

PERFORM GET_FILENAME USING P_FILE.

************************************************************************

  • Begin Main Process

************************************************************************

START-OF-SELECTION.

PERFORM MAIN_PROCESS.

END-OF-SELECTION.

*SET PF-STATUS 'MAIN'.

&----


*& Form MAIN_PROCESS

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM MAIN_PROCESS .

PERFORM UPLOAD_SOURCE_DATA_FROM_PC USING P_FILE.

LOOP AT RECORD.

PERFORM INITIAL_SCREEN.

PERFORM SECOND_SCREEN.

PERFORM THIRD_SCREEN.

PERFORM FOURTH_SCREEN.

PERFORM FIFTH_SCREEN.

CALL TRANSACTION 'MM02' USING IT_BTCI

MODE 'A' UPDATE 'S'.

COMMIT WORK AND WAIT.

  • PERFORM BDC_TRANSACTION USING 'MM02'.

Refresh IT_BTCI.

ENDLOOP.

ENDFORM. " MAIN_PROCESS

&----


*& Form UPLOAD_SOURCE_DATA_FROM_PC

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM UPLOAD_SOURCE_DATA_FROM_PC USING P_FILE.

CALL FUNCTION 'WS_UPLOAD'

EXPORTING

FILENAME = P_FILE

FILETYPE = 'DAT'

TABLES

DATA_TAB = RECORD.

ENDFORM. " UPLOAD_SOURCE_DATA_FROM_PC

&----


*& Form INITIAL_SCREEN

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM INITIAL_SCREEN .

PERFORM BDC_DYNPRO USING 'SAPLMGMM' '0060'.

PERFORM BDC_FIELD USING 'BDC_CURSOR' 'RMMG1-MATNR'.

PERFORM BDC_FIELD USING 'BDC_OKCODE' '/00'.

PERFORM BDC_FIELD USING 'RMMG1-MATNR' RECORD-MATNR.

ENDFORM. " INITIAL_SCREEN

&----


*& Form SECOND_SCREEN

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM SECOND_SCREEN .

PERFORM BDC_DYNPRO USING 'SAPLMGMM' '0070'.

PERFORM BDC_FIELD USING 'BDC_CURSOR' 'MSICHTAUSW-DYTXT(01)'.

PERFORM BDC_FIELD USING 'BDC_OKCODE' '=ENTR'.

PERFORM BDC_FIELD USING 'MSICHTAUSW-KZSEL(01)' 'X'.

ENDFORM. " SECOND_SCREEN

&----


*& Form THIRD_SCREEN

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM THIRD_SCREEN .

PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4004'.

PERFORM BDC_FIELD USING 'BDC_OKCODE' '=SP26'.

PERFORM BDC_FIELD USING 'MARA-GEWEI' 'G'.

ENDFORM. "THIRD_SCREEN

&----


*& Form FOURTH_SCREEN

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM FOURTH_SCREEN .

PERFORM BDC_DYNPRO USING 'SAPLMGMM' '0081'.

PERFORM BDC_FIELD USING 'BDC_CURSOR' 'RMMG1-WERKS'.

PERFORM BDC_FIELD USING 'BDC_OKCODE' '=ENTR'.

PERFORM BDC_FIELD USING 'RMMG1-WERKS' RECORD-WERKS.

ENDFORM. "FOURTH_SCREEN

&----


*& Form FIFTH_SCREEN

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM FIFTH_SCREEN .

PERFORM BDC_DYNPRO USING 'SAPLMGMM' '4000'.

PERFORM BDC_FIELD USING 'BDC_OKCODE' '=BU'.

PERFORM BDC_FIELD USING 'BDC_CURSOR' 'MARC-MMSTA'.

PERFORM BDC_FIELD USING 'MARC-MMSTA' RECORD-MMSTA.

ENDFORM. "FIFTH_SCREEN

&----


*& Form GET_FILENAME

&----


  • text

----


  • -->P_P_FILE text

----


FORM GET_FILENAME USING P_FILE.

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

DEF_FILENAME = SPACE

MASK = ',.,..'

MODE = 'O'

IMPORTING

FILENAME = P_FILE

EXCEPTIONS

INV_WINSYS = 1

NO_BATCH = 2

SELECTION_CANCEL = 3

SELECTION_ERROR = 4

OTHERS = 5.

ENDFORM. " GET_FILENAME

----


  • Start new screen - BDC_DYNPRO

----


FORM BDC_DYNPRO USING PROGRAM DYNPRO.

CLEAR IT_BTCI.

IT_BTCI-PROGRAM = PROGRAM.

IT_BTCI-DYNPRO = DYNPRO.

IT_BTCI-DYNBEGIN = 'X'.

APPEND IT_BTCI.

ENDFORM. "BDC_DYNPRO

----


  • Insert field - BDC_FIELD

----


FORM BDC_FIELD USING FNAM FVAL.

  • IF FVAL <> NODATA.

CLEAR IT_BTCI.

IT_BTCI-FNAM = FNAM.

IT_BTCI-FVAL = FVAL.

APPEND IT_BTCI.

  • ENDIF.

ENDFORM. "BDC_FIELD

----


  • Start new transaction according to parameters *

----


FORM BDC_TRANSACTION USING TCODE.

DATA: L_MSTRING(480).

DATA: L_SUBRC LIKE SY-SUBRC.

  • batch input session

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = TCODE

TABLES

DYNPROTAB = IT_BTCI.

REFRESH IT_BTCI.

ENDFORM. "BDC_TRANSACTION

6 REPLIES 6

Former Member
0 Kudos

Hi Derak,

I know it's been a while but was this ever resolved?  I'm running into the same issue now using LSMW with direct input.

Thanks,

Tamara

JL23
Active Contributor
0 Kudos

some must really love to make things extremely complicated and love to code and test and transport. Why not just using MM17?

0 Kudos

I've tried several different things.  I don't want to code.  I've used MM17 to update MARC-MMSTA and it states that all the records have changed but when you go and look in the MARC table the field didn't change.  Same goes with an LSMW with direct input program RMDATIND.

JL23
Active Contributor
0 Kudos

Ever looked into the log?

0 Kudos

Of course! It states everything updated successfully.

JL23
Active Contributor
0 Kudos

this message is the surface only, the final message.  The application log in MM17 has hundreds more messages. And beside of that it can be that the field is not assigned to a field group, it can be that the maintenance status that is assigned to the MMSTA field forces the system to create other views with mandatory fields for which you have no data submitted.

It can be a side effect because of Z-fields added to the standard structure.

And it can be that you have a bug in a standard program and not yet implemented the fix.

And probably x other reasons.

review some OSS notes  like 1801358 , 44410, 2331391, 1771137, 308291