Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

warning info when run MIGO for purchase order

Former Member
0 Kudos

Dear everyone:

When i use the MIGO to receipt the purchase order ,i want that the system can give my one warning infomation only if the field of "posting date "(in MIGO screen) is less than the field of create date of the <b>purchase order</b>.

I want to use the user exits "EXIT_SAPLMIGO_001" ,but it looks that it does not works.

so, any advice to me anyone?


Developer Advocate
Developer Advocate
0 Kudos

If you want this when the user presses the save button, try using this user exit.



Function Module





Rich Heilman

0 Kudos


Thanks for you so soon reply.

yes, i test this Enhancement and write some code in the

function,but it seems that it does not work yet.

can you give me some code ?example ,how to get the purchase order info(create date) and the posting date is gotten from the running structure?(gohead ?goitem? in the main program of MIGO sapmigo)

0 Kudos

I assume that you have activated the exit and it is being fired. Now you need to get some data. MSEG is being pass in this user exit so we really need to get the PO data which you can select directly from EKKO and EKPO. The PO number is passed thru the MSEG structure.


Now you can get the PO creation date from EKKO.

What posting date are you referring to, the material document posting date? If so, we can try to get this out of memory.


Rich Heilman

0 Kudos

You can pull the posting date out of memory by using the following code.

field-symbols: <fs> type mkpf.
data: field(30) type c.

field = '(SAPMM07M)mkpf'.

assign (field) to <fs>.
check sy-subrc  = 0.

check not <b><fs>-budat</b> is initial.


Rich Heilman

0 Kudos

Dear Rico:

i follow your advice to get it ,but failed:(.

my code like this:( in inlude :ZXQSMU06)


*& Include ZXQSMU06 *


data: zebeln like mseg-ebeln.

data: zeindt like eket-eindt.

tables: eket.

zebeln = S7_TAB_MSEG-EBELN.

select single * from eket where ebeln = zebeln.

zEINDT = eket-eindt.

field-symbols: <fs> type mkpf.

data: field(30) type c.

field = '(SAPMM07M)mkpf'.

assign (field) to <fs>.

check sy-subrc = 0.

check not <fs>-budat is initial.

if zeindt <> <fs>-budat.

message 'info' type 'I'.



is it correct?

0 Kudos

Everything looks ok to me except for your message line, add the following message line for testing.

<b>if zeindt <> <fs>-budat.
message I001(00) with 'This is the information message'.

Put a break-point somewhere in this code and see if you can see where it is failing. Make sure that the assignment is happening, double-click on <FS> after the assign, you should see the data from MKPF in there.


Rich Heilman

0 Kudos

Yes ,i put one break-point in my code ,but when i run MIGO ,the bread-point does not work!can i find somewhere in its main program to put one break-point?

0 Kudos

sorry, i find that exits works well in MB01 ,but not MIGO!

as i known ,the MIGO maybe use another user exits--> EXIT_SAPLMIGO_001?

IN (EXIT_SAPLMIGO_001) i could not find the PO number and the posting date through any structure.

0 Kudos


Did you solve your problem finally? It looks like I have similar issue. My user wants to put some restrictions on posting date for goods receipt. It should depend on fiscal year (FY) of document delivery date. There are 2 rules for this. One should works only if the current month is September.

If FY of delivery date < current FY then posting date = 8/31/prior FY.

Else. Posting date = current date.

The second rule should work only if current month is August.

If FY of delivery date > current FY then Error message “Cannot post…”

During the rest of the year they want to have standard MIGO.

I don't know which user-exit to use in my case or BADi may be??

Please respond.