Posting date should not be less than PO document date. (MIRO).
When you run MIRO this (LMR1M001) program trigger for date
validation
Exit name LMR1M001 and function module name EXIT_SAPLMRMP_010 and include program name is ZXM08U16.
Exit name LMR1M001 and function module name EXIT_SAPLMRMP_010 and include program name is ZXM08U16.
Business scenario is when user enter posting date should not be less the PO
documents date.
One Badi found for MIRO INVOICE_UPDATE
but here i develop the scenario customer exit.
TYPES : BEGIN OF ty_ekko,
ebeln TYPE ebeln,
bedat TYPE bedat,
END OF ty_ekko.
DATA : lt_ekko TYPE STANDARD TABLE OF ty_ekko,
ls_ekko TYPE ty_ekko.
READ TABLE e_tdrseg INDEX 1.
SELECT SINGLE ebeln bedat
FROM ekko
INTO ls_ekko
WHERE ebeln = e_tdrseg-ebeln.
READ TABLE lt_ekko INTO ls_ekko INDEX 1.
IF e_trbkpv-bldat < ls_ekko-bedat.
PERFORM folge_gleichsetzen(saplv00f).
sy-ucomm = 'ENT1'.
MESSAGE 'Invoice Date Should Not Be Less Than PO Doc. Date' TYPE 'E'.
SET SCREEN syst-dynnr.
LEAVE SCREEN.
ENDIF.
IF e_trbkpv-budat < ls_ekko-bedat.
PERFORM folge_gleichsetzen(saplv00f).
sy-ucomm = 'ENT1'.
MESSAGE 'Posting Date Should Not Be Less Than po Doc. Date' TYPE 'E'.
SET SCREEN syst-dynnr.
LEAVE SCREEN.
ENDIF.
TYPES : BEGIN OF ty_ekko,
ebeln TYPE ebeln,
bedat TYPE bedat,
END OF ty_ekko.
DATA : lt_ekko TYPE STANDARD TABLE OF ty_ekko,
ls_ekko TYPE ty_ekko.
READ TABLE e_tdrseg INDEX 1.
SELECT SINGLE ebeln bedat
FROM ekko
INTO ls_ekko
WHERE ebeln = e_tdrseg-ebeln.
READ TABLE lt_ekko INTO ls_ekko INDEX 1.
IF e_trbkpv-bldat < ls_ekko-bedat.
PERFORM folge_gleichsetzen(saplv00f).
sy-ucomm = 'ENT1'.
MESSAGE 'Invoice Date Should Not Be Less Than PO Doc. Date' TYPE 'E'.
SET SCREEN syst-dynnr.
LEAVE SCREEN.
ENDIF.
IF e_trbkpv-budat < ls_ekko-bedat.
PERFORM folge_gleichsetzen(saplv00f).
sy-ucomm = 'ENT1'.
MESSAGE 'Posting Date Should Not Be Less Than po Doc. Date' TYPE 'E'.
SET SCREEN syst-dynnr.
LEAVE SCREEN.
ENDIF.
No comments:
Post a Comment