on 06-12-2017 10:18 AM
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 ???
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
104 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.