Skip to Content
0

MB_MIGO_BADI

Jun 12, 2017 at 09:18 AM

81

avatar image

I have a requirement that I have to check the P.O Document Date With MIGO Posting Date. If the user is doing the MIGO with goods receipt along with PO number in MIGO then user needs to enter posting date after that then it has to check with P.O document date. If the posting date in MIGO Is = And > than P.O Document It Is Ok Else It has to throw an error. Is there any BADI

I am getting PO details from LINE MODIFY and posting date from STATUS_AND_HEADER

method

How can i do the same ???

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Shyam Kumar Jun 13, 2017 at 04:27 AM
0

Hi Ravi,

SAP has provided this function in order to allow back postings of stock but if you want to put a validation for this then you can use BADI: MB_MIGO_BADI~POST_DOCUMENT to fulfill your requirement.

Share
10 |10000 characters needed characters left characters exceeded
Jürgen L
Jun 12, 2017 at 09:33 AM
0

What problem do you want to solve with that coding? You are only forcing your users to use more workarounds.

Why should a receiver change a defaulted date to a date in the past which would be even earlier than the PO date?

Assumed answer in case he is not just evil and wants to harm your SAP implementation : Because he had really received the goods on that date but could not post the receipt because someone missed to create a PO in the system.

So you are actually forcing him to enter the receipt with a wrong date, while the error was with the purchase order.

Do you think that is the right approach to force people to enter wrong dates?

Share
10 |10000 characters needed characters left characters exceeded
Ravi G Jun 12, 2017 at 09:45 AM
0

Why should a receiver change a defaulted date to a date in the past which would be even earlier than the PO date? - user is currently doing this mainly this issue arises in month ends or year ends so our functional team recommended to put a lock

Show 1 Share
10 |10000 characters needed characters left characters exceeded

This is not an answer to "WHY" this is just an answer to a not asked quesion "WHEN"

Please have the situation clearly analyzed before wasting time in developments that harm the work of the wrong people

0
Ravi G Mar 08 at 06:16 AM
0

Achieved by using below code

DATA : gwa_mseg TYPE mseg.
DATA : lt_bedat TYPE TABLE OF ekko,
lt_bedat1 TYPE TABLE OF ekko,
wa_bedat TYPE ekko,
wa_bedat1 TYPE ekko.
DATA : lv_msg TYPE char300,
lv_msg1 TYPE char300.

* break hhpl_abap.
*
SELECT ebeln bedat
FROM ekko
INTO CORRESPONDING FIELDS OF TABLE lt_bedat
FOR ALL ENTRIES IN it_mseg
WHERE ebeln = it_mseg-ebeln.

SORT : lt_bedat BY ebeln.

LOOP AT it_mseg INTO gwa_mseg.

CLEAR : wa_bedat.
READ TABLE lt_bedat INTO wa_bedat WITH KEY ebeln = gwa_mseg-ebeln
BINARY SEARCH.
IF sy-subrc = 0.
IF is_mkpf-budat < wa_bedat-bedat.

CONCATENATE 'GRN Date Should be Greater than or Equal to PO Date for' gwa_mseg-ebeln
INTO lv_msg SEPARATED BY space.

MESSAGE : lv_msg TYPE 'E' DISPLAY LIKE 'A'.
ENDIF.

Share
10 |10000 characters needed characters left characters exceeded