These are the requirements that I was given:
- You may not use distribution lists, neither internal nor external. This requirement extends from not wanting common users to have access to these functions. How ever the user defines the multiple email addresses, then must be able to do so without significantly extending their roles. A Z table and interface screens are acceptable but not preferred. We would prefer to take advantage of the existing Vender Master address functionality.
- If the email addresses are in SAP already (Vendor addresses already allow multiple email addresses to be entered, however only one can be printed in standard functionality), why do we have to have new configuration to have access to them?
- Emails must be monitored through through standard SAP functionality, such as SOST or similar functions and therefore must be issued through SCOT configuration.
- Less is more. The less effort this takes, the better.
Knowns about our system (the preconditions for certainty that the described process will work):
- SAP Version - ECC6 Support Stack 22
- Also still working after Loading EHP6 on top of ECC6
- IBM i-series DB2 Database
- Invoices are created through a SmartForm
- We have used note 718017 to get the invoice number into the Subject line of our invoice
Observations:
- In the customer master, multiple emails addresses may be recorded for a single customer.
- Only one can be the default address. This one is the only address that un-augmented SAP allows the invoice to be sent to.
- As addresses are no longer needed, they can be marked for deletion. All others are available for use but not currently used.
- These characteristics are easily found in table ADR6.
- In debugging, we see that the following portion of the call stack is accessed:
SAPLSBCOMSUT FUNCTION SBCOMS_SEND_REQUEST_CREATE
SAPLSOA2 FUNCTION SO_OBJECT_SEND
SAPLSTXBW FUNCTION SSFCONVERT_OTF_AND_MAIL
SAPLSTXBC FORM OTF_MAIL
SAPLSTXBC FORM OTF_RESOLVE
SAPLSTXBC FORM OTF_FINISH
SAPLSTXBC FUNCTION SSFCOMP_CLOSE
/1BCDWB/SAPLSF00000001 FUNCTION /1BCDWB/SF00000001
RLB_INVOICE FORM PROCESSING
RLB_INVOICE FORM ENTRY
RSNAST00 FORM PROGRAMM_AUFRUFEN
- receivers is built in SBCOMS_SEND_REQUEST_CREATE
- By nature it contains only the default address
Solving the problem:
- Place an implicit enhancement at the beginning of FM sbcoms_send_request_create.
- In this read the email title from objhead where objhead-line(12) = 'TDTITLE=Inv:'.
- objhead-line+13(9) is the invoice number in our case
- In VBRK, the invoice number is connected to the Customer number
- In KNA1, the customer number is connected to the address number
- The sought addresses are in ADR6 and can therefore be appended to receivers
Things that you might want to think about further:
- In another exit, you might export the address number, then import it in this exit. The method I'm using is pretty hokey...
I will be glad to talk further to anyone about this solution.
Neal Wilhite