Skip to Content
author's profile photo Former Member
Former Member

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

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jul 28, 2016 at 08:40 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.