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.
cancel
Showing results for 
Search instead for 
Did you mean: 

Output type for Sales Order for sending mail

Guneet20
Explorer
0 Kudos

Hi

I am working on developing a program for a custom output type which is to be triggered while creating a SO if any Line item has reason of rejection. The Output type should trigger sending of emails with details of items rejected. Issues I am facing are:

1) Custom Output type has been created, Nace Config done with Entry Subroutine which has been created in the program and activated for External Medium 5. In VA01, whenever any item is rejected, the Output Type is getting triggered but program is not getting executed (Break point not hit ). The Processing log shows nothing although the status is green. If we got to VA02/03 and select ISSUE Output TO, then the BP is hit. What could be possible reasons for this or am I missing some steps here?

2) My second issue is I  need to fill in the mail the details of items rejected etc. While creating a SO, this information is not yet available in tables. How can I get this info in my program from items?

This is one priority issue I am working on, so any help is appreciated.

1 ACCEPTED SOLUTION

ipravir
Active Contributor
0 Kudos

Hi Guneet,

Since output type program are based on the Output type and those only triggered based on the Output type Selection either through VA02 or VA03 based on Issue Output.

As per your requirement, you have to call you program logic through User Exit, you can check the MV45AFZZ user exit.

And in this user exit you will get all on running information of the process in respective internal table.

So your mail sending process you can write inside the user Exit.

Regards.

Praveer.

5 REPLIES 5

ipravir
Active Contributor
0 Kudos

Hi Guneet,

Since output type program are based on the Output type and those only triggered based on the Output type Selection either through VA02 or VA03 based on Issue Output.

As per your requirement, you have to call you program logic through User Exit, you can check the MV45AFZZ user exit.

And in this user exit you will get all on running information of the process in respective internal table.

So your mail sending process you can write inside the user Exit.

Regards.

Praveer.

0 Kudos

Hi Praveer

Thanks for ur reply. how can I make sure that the mail is being sent from va01 and va02 both and the output type has to be triggered and updated from both?

ipravir
Active Contributor
0 Kudos

Hi Gunnet,

You can write your program inside the USEREXIT_SAVE_DOCUMENT routine,

there you have to check your condition, and is the condition is true, then you can write the logic to send the mail.

Note: Since your are in between the process and the all information's are not stored in DB tables, so provide user to save the Output information (Smartforms) in local system, do not display the Print Preview.

Regards.

Praveer.

Former Member
0 Kudos

Hii Guneet

if possible try to write one perform which will be executed on your condition and call new o/p type and its execution

hope it will work

Regards

Gaurav

Guneet20
Explorer
0 Kudos

Hi All

Thanks for ur inputs. I have solved this issue and closing this thread. Providin details on what I did for anyone else working on similar issues.

--> My issue was I had to trigger custom output type when ever a line item is rejected in a SO while creating or saving. The output type should trigger a mail to sold to party kunnr email id with details of items rejected.

--> Issue I was I had created the Custom Program for Custom Output type but my breakpoint was not getting triggered for me to check how to write code. I followed Praveer's suggestion and wrote code in the exit to send mails. But this sol was not feasible when doing Issue Output To from VA02. Also, I could not set the output type status if green or red based on any error from the exit.

--> I found that changing of returncode value in my program was changing the status of the ouput type - red or green if 0 or 1. So it became clear the program was getting called but the BP was not getting triggered. SO I enabled system debugger and update debugger and my prog was called.

--> Even when creating SO, the output prog was called after the SO had been created, so I could take Object key from NAST table and fetch details I required from VBAP/VBPA and send mails from output prog only.

Hope my analysis and details help others also.