• No results found

Receiving E-Mails in the SAP System

Receiving E-Mails in an SAP System

Task 5: Receiving E-Mails in the SAP System

Setting up the SAP system for receiving e-mails.

Figure 46: Overall Scenario of the Training Landscape for Inbound Mail 1. In your SAP system, create a user, MAILDISP, to distribute e-mails in the

current client. This user should be of the type System. The user should have the initial password chosen by you and it should have the authorization profile S_A.SCON provided by SAP.

2. Enter the user that you have just created in the virtual host for SAPconnect (transaction SICF). Remember to activate the virtual host after changing it.

3. Using the AS Java application running on the instructor's system, send an e-mail to “your” AS ABAP system, either as a “reply” to an e-mail received previously or as a “new message”.

4. Check your inbox in the SAP system.

Result

You are now able to connect SMTP for an SAP system in both directions.

We wish you every success in implementing this in your company.

Solution 5: Sending and Receiving E-Mails by SMTP with AS ABAP

Task 1: Access to the External Mail Inbox

Figure 47: Overall Scenario of the Training Landscape for the Outbound Mail

Access to your external mail Inbox.

Note: For the purposes of this training course, we will use the JAMES mail server that is running on the instructor's host. Access is via a prepared application that is running on AS Java (usually the DEV system) of the instructor's host.

1. Call the URL to access “your” mail inbox <course

ID>-##@training.sap.comon the JAMES mail server.

In standard ADM102 courses, the ADM102-## users have a prepared menu entry in the role-based SAP Easy Access user menu (in the folder that corresponds to this unit of the course). Double-click this menu item.

Continued on next page

In installation courses such as TADM12_1, you must enter the following URL manually: http://<instructor's

host>.wdf.sap.corp:50000/webdynpro/dis-patcher/local/JamesMail/ReadMail?foruser=<course ID>-##&canCreate

Note: Note that this URL is case-sensitive. When the course materials are published, a hyphen “-” may be displayed at the end of the line. This hyphen is not part of the URL.

a) See the task description. /JamesMail/ReadMail is a Web Dynpro for Java application that has been created especially for this course and does not require an authentication.

Result

You can see the incoming mails for your e-mail recipients on the shared mail server.

Task 2: Check the SMTP Configuration of Your SAP System

Check whether your SAP system has been configured for SMTP. If this is not the case, configure your SAP system accordingly.

1. For each of your application servers, determine the port at which requests in the SMTP protocol are processed.

a) There are a number of ways to determine the port responsible for SMTP.

The simplest method is to call transaction SMICM and choose Services.

You can see the number under which the SMTP service is running in the system in the first column (it is represented here by xx). The associated profile parameter is called icm/server_port_<xx>. You can also find the value of this parameter, for example:

In transaction SMICM, by choosing Goto → Parameters → Display

By calling report RSPFPAR

• In Profile Maintenance (transaction RZ10)

b) Note that the port determined in this way (such as 3411) applies only for the application server to which you are currently logged on. Log on to the other instance of your SAP system (for example using transaction SM51), to determine the port that is set there.

2. If your SAP system has not yet been configured for SMTP, use transaction RZ10 to add the parameter icm/server_port_1 for your default profile and assign it the value PROT=SMTP,PORT=34$$. Save and activate the profile and then restart all the ICM processes of your system in transaction SMICM. Then repeat the first step of the task.

a) If, during the previous step of this exercise, you discovered in transaction SMICM that SMTP is not configured, switch to transaction RZ10 and open the extended maintenance of the DEFAULT profile in change mode.

Hint: You may have to load the profiles by choosing Utilities

→ Import profiles → Of active servers.

b) Choose Create Parameter. Enter icm/server_port_1 as the parameter name and PROT=SMTP,PORT=34$$ as the parameter value.

c) Save your changes by choosing Copy → Back → Copy → Back → Save.

If a dialog box appears with information about an incorrect parameter value, choose Yes and ensure that your parameter is displayed correctly.

If you are prompted to do so, activate the profile at operating system level. Confirm the following dialog boxes by choosing Continue.

d) Instead of now starting the entire SAP system, you can just start the ICM processes. To do so, call transaction SMICM and choose Administration → ICM → Restart → Yes and then Administration → ICM → Exit Hard → Global. Confirm the query by choosing Yes. Then choose Services again and check whether your changes have been made.

Task 3: Setting Up the Sending of E-Mails in the SAP System

Generate Internet addresses, set the default domain and receipt confirmation, and configure the SMTP node.

1. Assign all users in your client the Internet address <UserID>@do-main##.sap.com, where ## is your (two-digit) group number.

Continued on next page

Then check the changes using your user (for example, ADM102-##).

a) Start the report RSADRCK7 (using transaction SA38, for example).

b) In the Domain field, enter domain##.sap.com (where ## is your group number). Deselect the Keep existing addresses and Test mode checkboxes and set the Use user names checkbox.

Once you have chosen Execute, the system displays a log of all the changes made.

c) In transaction SU01, enter the user <course ID>-## (for example, ADM102-##) and choose Display. On the Address tab page, the E-Mail field should contain the value <course ID>-##@domain##.sap.com (where ## is your group number).

2. In your SAP system, enter domain##.sap.com as the default domain.

a) Start SAPconnect Administration (transaction SCOT) and under Settings → Default Domain, enter the value domain##.sap.com (where ## is your group number).

3. Configure SAPconnect so that no confirmation of receipt is expected for Internet mails.

a) In transaction SCOT choose Settings → Confirmation of receipt and define that SAPconnect does not expect receipt confirmation for Internet mail.

Hint: This setting means that sent messages of the type Internet mail are immediately assigned the status “Completed”

(otherwise, they remain in the status “In transit” until a confirmation of receipt is received).

In the SAP system, the sending application determines whether a confirmation of receipt is actually requested.

4. Set up the SMTP node in your SAP system so that e-mails addressed to recipients in the domain training.sap.com can be sent to the external mail server (running on the instructor's host).

Hint: If the external mail server also operates as a Mail Transfer Agent (MTA), you could also use enter * as the SAPconnect domain.

However, in the training landscape, the mail server does not forward any e-mails, but rather processes only the specified domain.

a) If you have not already done so, switch to View → Node.

Hint: You should see a “-” icon next to the SMTP node, as this node is not yet operational.

b) Double-click the SMTP node and enter the following information:

Description <enter a self explaining text>

Maximum waiting time... 30minutes

Node in use Check

Mail Host The host name on which your instructor set up the external mail server (for example, twdf0042.wdf.sap.corp) Mail Port The port entered for the external mail

server (typically 25)

Code page 4110 Unicode UTF-8

For Supported address types, choose Internet → Set → Address area, enter *training.sap.com, and choose Continue.

Choose Continue to save your settings.

c) In the node display in transaction SCOT, check that the SMTP node no longer contains any “-” characters and that it appears*TRAINING.SAP.COM when you expand the address range . Result

Your SMTP node is now ready for use and is responsible for all e-mails sent to the specified address range. It is this easy to connect to an SMTP-compatible mail server.

Task 4: Sending an E-Mail from an SAP System

Create an e-mail and start the send process.

1. In the SAP system, create an e-mail to the recipient <course ID>-##@training.sap.com.

a) Call the SAP Business Workplace (transaction SBWP) and choose New Message.

Continued on next page

b) In the new window, create a message (using any title and content).

When you press ENTER to transfer the address <course

ID>-##@training.sap.comfor the Recipient (in ADM102 this would be ADM102-##@training.sap.com), the SAP system identifies from the structure of the address that it is an Internet address.

Messages can be sent to different types of address (see the F4 help for the Recip. Type field).

c) Finally, choose Send...

2. Start the send process manually.

a) View the information in SAPconnect Administration (transaction SCOT) under View → System Status. There should be a message with status “Waiting”.

b) Now choose the Start Send Process function for the Address Type INT (for Internet mail).

Use the default values under No. Work Processes and Server group and choose Start.

c) View the status once the send process is completed. If an error occurs, you can choose Utilities → Overview of send orders to analyze the cause of the error.

3. Check the external mail server to see whether your mail has arrived.

a) If the browser window is still open from the first task of this exercise, simply choose Refresh. If it is not, repeat the first task.

4. Optional: Schedule the send process for Internet mails periodically (every five minutes). Then send a list output (such as report SHOWCOLO) to recipient <course ID>-##@training.sap.com and observe how the output is sent during the next send process.

a) In transaction SCOT, choose View → Jobs. The system displays the number of times the send process has already run in your client (you can change the evaluation period).

b) Choose Create and enter a job name (such as Send Internet e-mails).

SAP delivers a variant, SAP&CONNECTINT, for this address type. On the next screen, select this entry and choose Schedule.

On the next screen, adjust the time if required (you can view the system time by choosing System → Status) and then choose Schedule Periodically. As the period, enter 5 minutes and choose Create.

The job that you have just created now appears in the job overview (transaction SM37).

c) Call any list display in the SAP system (suggestion: use transaction SA38 to execute report SHOWCOLO).

Choose System → List → Send and enter <course

ID>-##@training.sap.comas the Recipient. The system proposes the report title as the default Title of the message. If desired, enter some text as the Document contents. Choose Send... to transfer your message to SAPconnect.

d) The message is processed by the send process during the following five minutes. If the e-mail finally is displayed in the browser, the attachment is displayed in the bottom area of the browser screen.

Note: By default, ABAP lists are converted to HTML format.

As you can see from the selection options for Output Formats for SAP Documents, other formats are supported in the definition of theSAPconnect node.

Result

Congratulations on successfully connecting your SAP system to a mail server.

Continued on next page

Task 5: Receiving E-Mails in the SAP System

Setting up the SAP system for receiving e-mails.

Figure 48: Overall Scenario of the Training Landscape for Inbound Mail 1. In your SAP system, create a user, MAILDISP, to distribute e-mails in the

current client. This user should be of the type System. The user should have the initial password chosen by you and it should have the authorization profile S_A.SCON provided by SAP.

a) In User Maintenance (transaction SU01), create the user MAILDISP as described in the task. On the Logon Data tab page, set the user type System. Choose Save to save your entries.

Hint: Users of the type System are intended for dialog-free communication between different systems and are excluded from the checks for expired passwords. For more information, see SAP Note 622464 – Change: Password change req. entry for “SYSTEM” user type.

2. Enter the user that you have just created in the virtual host for SAPconnect (transaction SICF). Remember to activate the virtual host after changing it.

a) On the initial screen of transaction SICF, select the hierarchy type SERVICEand choose Execute. On the following screen, double-click the SAPconnect entry. On the Logon Data tab page, switch to change mode. Enter the data for user MAILDISP (client, user, password, and language). Leave all other fields unchanged and save your changes.

Create a local transport request at this point, if needed.

Hint: If you receive an error message when you select the language for the user because a code page is not supported, you have to activate your language using report RSCPINST. To do so, add your language on the left-hand side of the initial screen of this report and then choose Activate.

b) In transaction SICF, click the SAPconnect entry with the right mouse button, choose Activate SMTP Host and confirm the subsequent dialog box by choosing Yes.

Hint: An SMTP server is required for each client of an SAP system in which e-mails can be received. You have now created the connection to a virtual mail host. If e-mails were also to be delivered to other clients in your SAP system, you would have to create additional virtual mail hosts for these clients in transaction SICF.

Continued on next page

3. Using the AS Java application running on the instructor's system, send an e-mail to “your” AS ABAP system, either as a “reply” to an e-mail received previously or as a “new message”.

a) Call the URL of the AS Java application, as described in the first task of this exercise.

b) Choose one of the following two functions:

Reply to message, after selecting a message received previously, or

Create a message in the upper area of your inbox.

c) Under Mail server to use, choose an instance of your SAP system.

d) Ensure that the Port to use field contains a valid SMTP port of your SAP system.

e) Ensure that the To field contains a valid mail address of a user in your ABAP clients (structure: <course ID>-##@domain##.sap.com).

f) Enter a text of your choice under Mail text.

g) Choose Send the message.

4. Check your inbox in the SAP system.

a) As user <course ID>-## in the SAP system, call the SAP Business Workplace (transaction SBWP). You will find your e-mail in the Inbox.

Result

You are now able to connect SMTP for an SAP system in both directions.

We wish you every success in implementing this in your company.

Lesson Summary

You should now be able to:

• List the steps required to connect the SAP system to a mail server

• Configure the SAP system for the connection to a mail server Related Information

For more information about configuring the mail connection, see

SAP NetWeaver 7.01 online documentation, area SAPconnect

(BC-SRV-COM) (find, for example, by searching online documentation).

In the Administration → Inbound Distribution area, you can also find information about distributing incoming mails.

For more information about the procedures for configuring an e-mail connection in the SAP system, see the following SAP Notes:

• SAP Note 455140: Configuration of e-mail, fax, paging or SMS using SMTP

• SAP Note 455127: E-mail (SMTP) in different SAP releases

• SAP Note 312690: SAPconnect: Collective note

• SAP Note 546147: SMTP plug-in: MS Exchange sends only to port 25

• SAP Note 104263: Generating Internet addresses for users

• SAP Note 690020: SAPconnect send process hangs with large mails

• SAP Note 607108: Problem analysis when you send or receive e-mails

• SAP Note 633265, 664833, 694151 and 883840: SMTP PlugIn:

Multi-codepage ability

Unit Summary

You should now be able to:

• Outline the function of SAPconnect

• Create a node for sending a remote mail to a different SAP system

• List the steps required to connect the SAP system to a mail server

• Configure the SAP system for the connection to a mail server

Test Your Knowledge

1. Which of the following statements regarding SAPconnect are correct?

Choose the correct answer(s).

□ A As of SAP Web AS 6.10, a Microsoft Exchange Infrastructure must be set up outside the SAP system to be able to send mail from SAP systems.

□ B It is not possible to connect the UNIX-based sendmail to SAP systems.

□ C SAPconnect allows you to send mail both by RFC and the SMTP plug-in of the SAP AS ABAP.

□ D SAPconnect is configured cross-client.

□ E A send process automatically runs periodically in every SAP system after the system installation.

2. The connection of a mail server to an SAP system to send e-mails using SMTP from the SAP system runs through an SAPconnect node.

Determine whether this statement is true or false.

□ True

□ False

Answers

1. Which of the following statements regarding SAPconnect are correct?

Answer: C

SAPconnect contains two methods for sending mails: using an RFC connection or directly using a plug-in of the AS ABAP. The other statements are incorrect.

2. The connection of a mail server to an SAP system to send e-mails using SMTP from the SAP system runs through an SAPconnect node.

Answer: True

To configure a send process for SMTP in the SAP system, you must, among other things, also have configured and activated an SMTP node in transaction SCOT (SAPconnect).

Unit 3

Extended Computer Aided Test Tool