cancel
Showing results for 
Search instead for 
Did you mean: 

Attach copy of purchase order when it's changed in ME22N

chris_mowl
Active Participant
0 Kudos

When a change is made to a Purchase order, ME22N, a copy of the print version of the po is saved under the Attachment List in the po Services for Objects area.  This only works when we use the standard SAP processing routine, SAPFM06P, set up in the NACE transaction. 

We copied and modified this program and the copy of the po doesn't attach when we use the custom program. We found that the update is done in a call to FM RV_MESSAGE_UPDATE.  I have debugged the code and I can't find a difference between using the SAP program as a processing routine and using our custom version.  The update, as I mention in an answer below, is done in Include MM06EF0B_BUCHEN, FORM BUCHEN. 

So, any ideas as to why this won't work when using a custom processing routine? 

Points will be awarded and eternal gratitude given.  🙂 

Thanks!  

chris_mowl_0-1715976144026.png

Thank you for any help. 

 

Ryan-Crosby
Active Contributor
0 Kudos
Most likely triggered via a BADI implementation for definition 'ME_PROCESS_PO_CUST' when a PO is changed.

Accepted Solutions (1)

Accepted Solutions (1)

chris_mowl
Active Participant
0 Kudos

After several days of research, I think the answer is that a document will only be created in the Attachment list in ME22N / ME23N if you are using a SAPScript form. The function module ME_PRINT_PO has a parameter, IX_FONAM, that is defined like TNAPR-FONAM, which is char 16 for SAPScript forms and not SMARTForms.  Hopefully, I will be able to get an official response from SAP confirming that is the case.

Answers (2)

Answers (2)

chris_mowl
Active Participant
0 Kudos

The code where the attachment occurs is in Include MM06EF0B_BUCHEN in SAPLMEPO.  In Form BUCHEN, there is a function module, ME_MESSAGES_UPDATE, that adds a copy of a PDF of the purchase order to the attachment list when a change is made, in this case it was ME22N.

Points to my coworker for finding it. 

Hope this helps someone else someday.   

chris_mowl
Active Participant
0 Kudos
As of 6/19/2024, this is still an issue. The document won't attach when using a custom program in NACE transaction.
thilakan_t
Participant
0 Kudos

Check is there any output type / workflow triggered when saving the PO. that must generate and attach the form output to the PO. If not, there must be an enhancement.