Skip to Content
0
Apr 11, 2013 at 07:16 AM

MIR4 Tcode User Exit Calling twice

293 Views

Hello Experts ,

Actually I am just puting 1 validation in my MIR4 tcode that it's posting date should be greater than the SES posting date & PO document Date.

I am writing my code in :

User Exit LMR1M005 with include ZXM08U30

if sy-tcode = 'MIR7' or sy-tcode = 'MIRO' or sy-tcode = 'MIR4'.

data : v_lifnr type lifnr,

v_mblnr type mblnr,

v_budat type budat,

v_bsart type esart.

data : v_bedat type ebdat.

data : gwa_drseg like line of ti_drseg,

gwa_drseg1 like line of ti_drseg,

flag type char1,

check like flag,

c_budat like gwa_drseg1-budat,

post_date like c_budat.

loop at ti_drseg into gwa_drseg1 .

select single bedat

into v_bedat

from ekko

where ebeln = gwa_drseg1-ebeln.

if sy-subrc = 0 and v_bedat gt gwa_drseg1-budat.

clear sy-ucomm.

message : 'POSTING DATE IS WRONG' type 'E'.

leave list-processing.

endif

if i_rbkpv-budat lt gwa_drseg1-bedat.

clear sy-ucomm.

message : 'POSTING DATE IS WRONG' type 'E'.

leave list-processing.

endif.

endloop.

endif.

Now i am just Changing my Document type in Detail Tab & Chaging the posting date according to validation .

So first time when my above exits calling it's woking fi9 . But don;t know after some process again my above exits is calling & at this time

i am not getting posting date at run time.. & whatever the data i am geting is the old one..not the same as on scrren.

So Please can anybody tell me that why the above exit is calling twice ..& what could be the possible solution for that.