Skip to Content

Batch Classification characteristics detail validation during MIGO POST in S/4 Hana

Hello Friends,

Need your help on following issues -

(might it may old issue. But not able to find proper scn link, if you have please send).

1. Is there anyway to get batch classification Characteristic detial before MIGO posting.I tried some User exit / BAdi/function module in hana system. But not able get proper solution.

i did RND following exit :

exit_SAPMM07M_004 , EXIT_SAPLV01Z_014, MB_CHECK_LINE_BADI,MB_MIGO_BADI.

in IF_EX_MB_MIGO_BADI~POST_DOCUMENT :

METHOD if_ex_mb_migo_badi~post_document.

DATA: ls_xmseg TYPE mseg,
lt_mcha TYPE mcha,
lt_char TYPE STANDARD TABLE OF clbatch,
lt_mseg_new TYPE STANDARD TABLE OF mseg.

CONSTANTS:lc_ean TYPE mara-ean11 VALUE 'EAN'.

lt_mseg_new = it_mseg.

SORT lt_mseg_new BY matnr.

loop AT lt_mseg_new INTO ls_xmseg.
CALL FUNCTION 'VB_BATCH_GET_DETAIL'
EXPORTING
matnr = ls_xmseg-matnr
charg = ls_xmseg-charg
get_classification = abap_true
READ_FROM_BUFFER = abap_true
TABLES
char_of_batch = lt_char
EXCEPTIONS
no_material = 1
no_batch = 2
no_plant = 3
material_not_found = 4
plant_not_found = 5
no_authority = 6
batch_not_exist = 7
lock_on_batch = 8
OTHERS = 9.

IF lt_char IS INITIAL.

MESSAGE TEXT-001 TYPE 'E'.

ENDIF.

ENDLOOP.

ENDMETHOD.

As above Code i tried, it will success if Batch no was created. But during MIGO Positing Batch No. was just generated . Will store in data base after Migo post.

Could you guid how to validated MRP value with PO condition price value. At list if get all Characterstic detail any way. I would have got my solution.

Please suggest

Best Regards,

Bhagaban Pradhan.

screen1.jpg (79.2 kB)
screen2.jpg (36.3 kB)
screen4.jpg (49.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 26, 2017 at 05:40 AM

    Hi,

    I m sorry to updated that issue has been resolve.

    solution :

    BADI : CACL_VALUE_CHANGE

    Method : MODIFY_INPUT


    DATA : lv_mrp TYPE prcd_elements-kwert.
    IF i_characteristic_id EQ 'MRP'.
    ASSIGN ('(SAPLMIGO)GOITEM-EBELN') TO FIELD-SYMBOL(<fs_ebeln>). "PO NO
    ASSIGN ('(SAPLMIGO)GOITEM-EBELP') TO FIELD-SYMBOL(<fs_ebelp>). "LINE ITEM
    ASSIGN ('(SAPLMIGO)GOITEM-EKORG') TO FIELD-SYMBOL(<fs_ekorg>). "LINE ITEM

    IF <fs_ebeln> IS ASSIGNED AND <fs_ebelp> IS ASSIGNED.
    IF <fs_ebeln> IS NOT INITIAL.
    SELECT SINGLE knumv
    FROM ekko
    WHERE ebeln = @<fs_ebeln>
    INTO @DATA(lv_knumv).

    SELECT SINGLE kbetr
    FROM prcd_elements
    WHERE knumv = @lv_knumv
    AND kposn = @<fs_ebelp>
    AND kschl = 'ZMRP'
    INTO @DATA(lv_kbetr).

    IF <fs_ekorg> IS ASSIGNED.
    SELECT SINGLE zvalue
    FROM zgent_constants
    WHERE zprgname = 'ZBADI_CACL_VALUE_CHG'
    AND zfldname = 'EKORG'
    AND zvalue = @<fs_ekorg>
    AND zactv = 'X'
    INTO @DATA(lv_ekorg).
    IF <fs_ekorg> IS NOT INITIAL.
    lv_mrp = c_atwrt.
    IF lv_ekorg IS INITIAL.
    IF lv_kbetr NE c_atwrt.
    MESSAGE 'MRP Characterstic Value not match with PO contiontion value' TYPE 'E'.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDIF.

    Add comment
    10|10000 characters needed characters exceeded