cancel
Showing results for 
Search instead for 
Did you mean: 

Questions on invoice sent by email as PDF

Former Member
0 Kudos

Hello,

I have set up my invoice output to be sent to an external address by email as a PDF. This works fine but I have 3 questions:

1. How can I dynamically generate an email subject ? Right now I can enter a fix subject but I would like it to be dynamic such as ex.: Invoice # xxxxxxxxxx sent by <cie name>.

2. The invoice is a PDF found as an attachment to the email. How can I have text, besides the subject, in the email body ? Where do we set up that in the system ?

3. I want to create a report that would show if the output was properly generated for the invoice and what's the status in sost. I can't find a link between the entry in table NAST and the entry in SOST. How can I link my output from NAST with the status in SOST in a report ?

Thanks in advance for the help.

Accepted Solutions (1)

Accepted Solutions (1)

jason_barton
Active Participant
0 Kudos

Richard, think there may be no link of NAST and SOST, see following post ...

[;

Thanks,

Jay

Answers (3)

Answers (3)

jack_graus2
Active Contributor
0 Kudos

Hi, on question 3, we had a simular request and solved it by storing the 'mail request number' in the application log.

The 'mail request number' (SO_REC_NO) is returned by the smartfrom function module in SYST-MSGID, MSGNO,...

The print application log can (think it should) be updated by calling function module 'NAST_PROTOCOL_UPDATE' after the call to the smartfrom function module.

CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
    EXPORTING
      MSG_ARBGB = SYST-MSGID
      MSG_NR    = SYST-MSGNO
      MSG_TY    = SYST-MSGTY
      MSG_V1    = SYST-MSGV1
      MSG_V2    = SYST-MSGV2
      MSG_V3    = SYST-MSGV3
      MSG_V4    = SYST-MSGV4

After that via field NAST-CMFPNR (Error management number) the application log can be retrieved. Application log messages are in table CMFP where field APLID = 'WFMC' (Output control) and NR = NAST-CMFPNR.

The mail request number is stored in the log under CMFP-ARBGB = 'SSFCOMPOSER' and MSGNR = '024' in MSGV1. MSGV1 holds SO_REC_NO that is the key or index to tables SOST, SOSC, SOOD

Regards Jack

Former Member
0 Kudos

Hi Jason,

Thanks I saw your post explaining how to add text to the email's body and I will try it.

Do you have a solution to have a dynamic email subject ? I saw posts were we have to enter in the condition records a variable such as &VBRK-VBELN& but this has to be fed somewhere in the code.

For the between NAST and SOST, I might have found something but it all depends on the dynamic email subject. If I can plug the invoice number in the email subject, then I can do a search between NAST object # and the Doc. Title field in SOST. That wouldn't be the most efficient search but it's better than nothing.

Let me know about the subject,

Cheers, Richard.

jason_barton
Active Participant
0 Kudos

Richard,

Think I read your note right, you need to check V/40 and focus on "Mail title and texts". For example, for our email output type and the language EN, we have --> Invoice No. &VBRK-VBELN&, &VBAK-PSPNR&. Let me know if you need more.

Thanks,

Jay

jason_barton
Active Participant
0 Kudos

Some details in this post may help ...

[http://forumsa.sdn.sap.com/click.jspa?searchID=-1&messageID=8027666]

Let me know if you need anything further. Basically doing everything you describe currrenly in a our PROD system.

Thanks,

Jay

jason_barton
Active Participant
0 Kudos

Also, still searching, but so far can't seem to get any kind of connection between NAST and SOST (or SOOS). I am not certain that there is a connection that can be made, but if I do find I will post. Interested to hear if you find a connection as well.

Thanks,

Jay