Skip to Content

incorrect batch quantity in migo

Hi All,

I am confirming a material with 2 batches in mfbf.

1 batch with 1 quantity and second batch with 4 quantity.

But when i am backflushing material by MF70, in material document consumption quantity in unit entry is not updating correctly.

what can be the issue please guide.

Also we have implemented the BADI VB_BD_SELECTION for batch transfer.

in that batch we have written below code

LOOP AT it_mchb_key INTO ls_mchb_key.



*   Get Characteristic

    lv_object = ls_mchb_key-matnr.

    CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'

      EXPORTING

        classtype          = lc_batch

        object             = lv_object

        objecttable        = 'MARA'

      TABLES

        t_class            = lt_class

        t_objectdata       = lt_objectdata

      EXCEPTIONS

        no_classification  = 1

        no_classtypes      = 2

        invalid_class_type = 3

        OTHERS             = 4.



    IF sy-subrc = 0.



*     Check batch with characteristic BATCH_COLOR_DETERMINATION_RULE

      READ TABLE lt_objectdata INTO ls_objectdata

      WITH KEY atnam = lc_color.



      IF ls_objectdata-ausp1 = lc_value.

        lv_text = '(SAPLBARM)RM61B-ACHARG'.

        ASSIGN (lv_text) TO <lv_batch>.

        IF <lv_batch> IS ASSIGNED

        AND NOT <lv_batch> IS INITIAL.

*         Get Batch from Material declared (via transaction MFBF)

          ls_mchb_key-charg = <lv_batch>.

          e_badi_executed = 'X'.

        ELSE.

*         Get Batch from Document log header (via transaction MF70)

          UNASSIGN <lv_batch>.

          lv_text = '(RMSERI70)BLPK-ACHARG'.

          ASSIGN (lv_text) TO <lv_batch>.

          IF <lv_batch> IS ASSIGNED

          AND NOT <lv_batch> IS INITIAL.

            ls_mchb_key-charg = <lv_batch>.

            e_badi_executed = 'X'.

          ENDIF.

          UNASSIGN <lv_batch>.

        ENDIF.

      ENDIF.

    ENDIF.



*   Fill Results

    IF NOT e_badi_executed IS INITIAL.

      ls_mcha_key-matnr = ls_mchb_key-matnr.

      ls_mcha_key-werks = ls_mchb_key-werks.

      ls_mcha_key-charg = ls_mchb_key-charg.

      APPEND ls_mcha_key TO et_mcha_key.

    ENDIF.



  ENDLOOP.
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers