Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How dequeue material?

Good morning experts,

i need to use the bapi BAPI_MATERIAL_SAVEDATA to change Costing 2 data.

I would like to DEQUEUE if the material is locked, what is the function?

i tried the functions below but the material still locked.

CALL FUNCTION 'ENQUEUE_EMMARAE'

EXPORTING

MODE_MARA = 'E'

MANDT = SY-MANDT

MATNR = IN_TB_COSTING-matnr

    • X_MATNR = ' '

    • _SCOPE = '3'

    • _SYNCHRON = ' '

    • _COLLECT = ' '

EXCEPTIONS

FOREIGN_LOCK = 1

SYSTEM_FAILURE = 2

OTHERS = 3

.

IF SY-SUBRC <> 0.

CALL FUNCTION 'DEQUEUE_EMMARAE'

EXPORTING

MODE_MARA = 'E'

MANDT = SY-MANDT

MATNR = IN_TB_COSTING-matnr.

ENDIF.

CALL FUNCTION 'ENQUEUE_EMMARCE'

EXPORTING

MODE_MARC = 'E'

MANDT = SY-MANDT

MATNR = IN_TB_COSTING-matnr

WERKS = IN_TB_COSTING-werks

    • X_MATNR = ' '

    • X_WERKS = ' '

    • _SCOPE = '3'

    • _SYNCHRON = ' '

    • _COLLECT = ' '

EXCEPTIONS

FOREIGN_LOCK = 1

SYSTEM_FAILURE = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

CALL FUNCTION 'DEQUEUE_EMMARCE'

EXPORTING

MODE_MARC = 'E'

MANDT = SY-MANDT

MATNR = IN_TB_COSTING-matnr

WERKS = IN_TB_COSTING-werks.

ENDIF.

CALL FUNCTION 'ENQUEUE_EMMBEWE'

EXPORTING

MODE_MBEW = 'E'

MANDT = SY-MANDT

MATNR = IN_TB_COSTING-matnr

BWKEY = IN_TB_COSTING-werks

  • BWTAR =

  • X_MATNR = ' '

  • X_BWKEY = ' '

  • X_BWTAR = ' '

  • _SCOPE = '3'

  • _SYNCHRON = ' '

  • _COLLECT = ' '

EXCEPTIONS

FOREIGN_LOCK = 1

SYSTEM_FAILURE = 2

OTHERS = 3

.

IF SY-SUBRC <> 0.

CALL FUNCTION 'DEQUEUE_EMMBEWE'

EXPORTING

MODE_MBEW = 'E'

MANDT = SY-MANDT

MATNR = IN_TB_COSTING-matnr

BWKEY = IN_TB_COSTING-werks.

thanks

Tags:
Not what you were looking for? View more on this topic or Ask a question