Application Development and Automation 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: 
Read only

Regarding email from invoice

Former Member
0 Likes
830

Hi All,

I need to send email notification to customer when ever invoice is created. As per business requirement, very limited data needs to be send (not as per print output) and also the detail should be in message body (not in attachment). For testing i have created stand alone program which takes invoice number and send email.

Can anyone help how to automate the process. Where should i give program sending email.

Thanks

1 ACCEPTED SOLUTION
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
797

It needs to be added to the output configuration, ask an SD consultant. The program will also need to have certain format - use any existing output program as an example.

3 REPLIES 3
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
798

It needs to be added to the output configuration, ask an SD consultant. The program will also need to have certain format - use any existing output program as an example.

Read only

0 Likes
797

Dear Jelena,

The output type is configured now and i attached my custom program to send email to this output type. Email is being send when invoice is created using vf01.

However in case of vf04, the output type is failing, i checked the code and found out that nast-objky is not getting populated.

*---------------------------------------------------------------------*

*       FORM ENTRY

*---------------------------------------------------------------------*

FORM entry USING return_code us_screen.

  DATA: lf_retcode TYPE sy-subrc.

  IF nast-objky IS INITIAL.

    MESSAGE 'Invoice number not found'(001) TYPE 'S'.

  ELSEIF v_vbeln IS INITIAL.

    v_vbeln = nast-objky.

  ENDIF.

Am i missing anything here.

Thanks

Read only

0 Likes
797

I'm not sure why the field would be blank... Are other NAST fields filled in? Is other output also failing or is it just this one? If one thing is working and the other isn't then in general we try to check for the differences between those things.

As a side note - it's not quite feasible to display messages in the output processing (it runs in its own process), so instead use FM NAST_PROTOCOL_UPDATE and update the protocol with any messages.