cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to Use Custom Email Addresses from a Z-Table for Invoice Output in OPD?

t_jungesblut75
Participant
0 Kudos
367

Hi SAP Community,

I’m working on an output scenario where the recipient email address for invoice output should be determined from a custom Z-table. This table contains (among other things) an email address for each possible invoice recipient.

To make this work, I’ve extended the relevant CDS view (C_BILLINGDOCUMENTOMPARAMDET) using a custom field that reads the email address from the Z-table. In the OPD (Output Parameter Determination), I’m able to select this custom field and assign it to the email recipient parameter.

The issue: although the CDS view field is correctly filled with the email address, the invoice output is still generated without any recipient email address. My suspicion is that the output is being generated before the CDS field is populated, meaning the value is not yet available when the output is triggered.

Is there a supported way to fetch recipient email addresses from a Z-table for invoice output?

Is it possible to delay or control the timing of output generation to ensure the email field is populated beforehand?

Or is there a completely different (preferred) method for managing custom recipient email addresses?

 

(I’m aware of the possible expression "Add email recipients from custom logic" in the Public Cloud version of OPD, but unfortunately this is not available in our Private Cloud environment.)

Any insights or best practices would be greatly appreciated!

Thanks in advance

View Entire Topic
Lakshmipathi
SAP Champion
SAP Champion
0 Kudos

Even though the field is visible in OPD, it must be explicitly mapped to the email recipient parameter (EmailRecipient).  Double-check that the parameter type is correctly set to EmailRecipient and not just used as a condition. The CDS extension might not be correctly propagated to the output runtime.

Ensure that the field is:

    • Marked as output-relevant.
    • Included in the output determination logic (not just visible in OPD).

The email channel must be active and correctly configured in the Output Management settings. Check

    • Communication arrangement
    • Output type configuration
    • Assigned form template and channel

SAP may silently ignore the email if it doesn't pass internal validation. Ensure, the email address is:

    • In correct format (e.g., user@example.com)
    • Not null or blank
    • Not containing extra spaces or invalid characters

Use the “Simulate Output Determination” app to test the output scenario.  This helps verify whether the email address is being picked up and passed to the output runtime.

t_jungesblut75
Participant
0 Kudos
Hi thanks for the answer. We previously changed the entry for the email recipient in the OPD to my adress. The result of looking it up in the cds-view would have been the same adress in our testing environment. That worked as intended. I received an email according to the settings in opd. So we changed it back to grabbing the entry from the cds-view, so that the mail adress can be looked up per customer. That's the situation described in my initial post.