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: 

Mail should be sent only once when Billing Document is Displayed

sabirshah1
Participant
0 Kudos
351

Hi ,

I have created a ZDriver Program to send email Billing Document to customer when the Billing Document is Displayed , But Here my billing Document is sent evrytime when I click on print preview tab of Biling Document .

SO , here I want to send Billing Document only once when I display the billing document very first , After that PDF attachment should not be sent to customer no matter how many times we display the particular Billing Document .

Is there any flag or condition I can use to resolve this .

1 ACCEPTED SOLUTION

sab125
Participant
0 Kudos
251

Hello,

If you want to send the email only for the first time you display the billing document, you have to make a select in NAST Table

- KAPPL = 'V3'

- OBJKY = Billing document (with leading zeros)

- KSCHL ( your message type to display Billing Document, check NACE Transaction)

If you have a entry then skip the send mail processing in your ZDriver

Else, send process the ZDriver to send email.



Hope that helps

With Regards


Saber

8 REPLIES 8

SimoneMilesi
Active Contributor
0 Kudos
251

Hi Sabir,

how did you set your message condition? Did you set up any Output Control requirment in VOFM?

0 Kudos
251

Simon ,

No Idea about VOFM , Our Functional has done all the setting , by setting in VOFM can we achieve the above functionality ??

sab125
Participant
0 Kudos
252

Hello,

If you want to send the email only for the first time you display the billing document, you have to make a select in NAST Table

- KAPPL = 'V3'

- OBJKY = Billing document (with leading zeros)

- KSCHL ( your message type to display Billing Document, check NACE Transaction)

If you have a entry then skip the send mail processing in your ZDriver

Else, send process the ZDriver to send email.



Hope that helps

With Regards


Saber

SimoneMilesi
Active Contributor
0 Kudos
251

It can be done, but it should be better to NOT create the new message via VOFM imho.

Otherwise you'll have to set all the messages as green/red even if not true.

0 Kudos
251

Yes indeed.

The Status of Message Type Processing should considered. (NAST-VSTAT = 1 )

0Not processed
1Successfully processed
2Incorrectly processed

This is a workaround solution,

The best practise says to handle it in VOFM ( or NACE ) via customizing

0 Kudos
251

By Using VOFM would I be able to display the Billing Document any number of times without sending the email to customer ?

and does this process is applicable for VF31 as well ?

Or I should used  The method u said

Message was edited by: Sabir Shah

SimoneMilesi
Active Contributor
0 Kudos
251

Both are working solutions Sabir

0 Kudos
251

Hi ,

As I create the Billing Document it the values of the value of all these fields updated in NAST table

- KAPPL = 'V3'

- OBJKY = Billing document (with leading zeros)

- KSCHL ( your message type to display Billing Document, check NACE Transaction)

and when I run select query I get the entry so Im not able to send the email first time only

Moreover value of VSTAT  remains '0' no matter how many times I display the Billing DOcument

See the code as NAST values are copied into TEMP_NAST and IF I make changes in VSTAT in my ZPROGRAM  then the changes are not reflected coz of TEMP_NAST .